Add preprocessor features to make scripting much more efficient
Woolfyy Resident
Use cases :
- make debugging easier for scripters structuring correctly their code with flags to enable / disable testing portions of code in spite of doing it manually with comments or copy / paste
- configure scripts to be dynamically optimized for a build configuration, though relying on one main script that scripters can upgrade with time and as they get better skilled
etc.
It is basically a free and open source feature from the C/C++ boost library https://www.boost.org/doc/libs/1_59_0/libs/preprocessor/doc/index.html (already existing into the Firestorm viewer).
Anyway it is a feature needed by any serious scripter who wants to maintain code efficiently in the long term BTW making more efficient code also means using less cpu on LL servers.
Log In
Cheshyr Pontchartrain
You can get preprocessing services from any number of tools, including the Firestorm client. I would prefer that Linden Lab update LSL to modern coding standards. Why are there no ternary operators or break/continue to streamline loops control? Even simple features like declaring multiple variables on one line (integer i, j, k;) are lacking in LSL.
Woolfyy Resident
Cheshyr Pontchartrain I already intensively use preprocessor features in Firestorm, knowing that there are optimizations that you can do with a preprocessor that you can't without ...
Moreover a thing that i would also like is to be able to include parts of code from within an object (to share it in between scripts) and not outside of SL and this can only be done by LL ... knowing that all my code is in-world and that i don't forecast for example to use external editors etc. though the feature also exists in Firestorm (no idea as for SL viewer as i am under Linux and for now LL is not even capable of having a viewer working under Linux).
PS: Your other requests have nothing to do with preprocessor ... so open another feedback feed if you want to add some more, knowing that at the end LL decide what / when they want to add features. On my side i already did many other posts about lacking features.
Bavid Dailey
it's a very useful Firestorm feature; but the way it works when compiling and looking for and fixing syntax errors is a real pain. I wouldhope that can be substantially improved.
VriSeriphim Resident
Bavid Dailey "but the way it works when compiling and looking for and fixing syntax errors is a real pain"
This is because the LSL compiler (on the sim server) doesn't support the compiler directives that, for example, the C preprocessor inserts into its output. These directives where the lines of source following the directive come from. Therefore, the compiler knows only the count of source lines it has read.
Of course, this issue could be resolved by enhancing the compiler to support those directives. Then, the preprocessor would have to be enhanced to produce those directives.
While that would be good, server side preprocessing would be better because all assets involved would be in-world.
Bavid Dailey
VriSeriphim ResidentI'm well aware of that the firestorm preprocessor is at best, a useful hack, and the why of it. The limitations of the compiler could be addressed by the Lindens, were they so inclined. I hope the forthcoming LUA compiler is a lot more up to date in these types of fetaures