LSO

From Second Life Wiki
Revision as of 11:39, 19 October 2007 by Strife Onizuka (talk | contribs) (LSL Bytecode moved to LSO)
Jump to navigation Jump to search

The compiled form of LSL scripts - a mostly stack-based language with a reference-counted heap and a very odd function calling convention in which the caller allocates storage for the callee's local variables. All the gory details can be found at http://www.libsecondlife.org/wiki/LSO, including some opcodes that are implemented in the interpreter but never outputted by the compiler (such as the handy DUP family of instructions for Forth-style programming, and PUSHIP/POPIP for implementing custom function calls/function pointers, jumptable-based switch statements and the like).

It's actually a reasonably powerful instruction set in some ways, but the compiler doesn't make use of it very well. Of course, with the planned switch to Mono, it's probably really not sensible to do anything with it. Besides, rumor has it that script compilation will move server-side in the near future.