Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

To Kelly: LSL Bytecode

Marshall Laszlo
Registered User
Join date: 27 Dec 2006
Posts: 5
01-08-2007 02:22
Some people have recently created a new script compiler. The amount of work they put in figuring out how the scripts work is actually quite impressive (you can see their notes here:
http://www.libsecondlife.org/wiki/LSO )

Even though enough is known to allow writing pretty much any script with the new compiler, there are still many unknown Op-Codes (which the official compiler never seems to use). Can you tell us what Op-Codes there are so we can know if we got them all?


Also, along the way they have found many things that suggest the official LSL compiler is quite wasteful with memory and even outputs instructions that do nothing. I was wondering if this was just lack of understanding of some details of the compiled script or if there really is a lot of wasted space. In particular:

* Global variables are put in a block structure containing, type, etc. However it appears none of that structure is actually used or is necessary for the interpreter. Only the actual data values are necessary, and removing the extraneous structure seems to have no effect. Is this true?

* The function blocks have headers with a lot of structure that seem unnecessary as well.

* The official compiler often does a PUSH_LOCAL_ALLOC 0 (assembles to $6600000000) even though this doesn't affect the stack and appears to effectively be a large NOP statement. Why does the compiler include these? Does it actually do something that we're not seeing?


This is a neat little language all of you have created and it has been fun playing with the new compiler. Any insights you can provide would be greatly appreciated.
Kelly Linden
Linden Developer
Join date: 29 Mar 2004
Posts: 896
01-08-2007 10:37
I don't have direct answers for you, sorry. At this point though you should be able to see for your self:
http://blog.secondlife.com/2007/01/08/embracing-the-inevitable/

I do believe that the LSL compiler is still included in the viewer source. :)
_____________________
- Kelly Linden