ScriptEngines
From OpenSimulator
Script Engines
OpenSim supports scripting via script engines.
Script engines are special region modules, which cannot be shared modules.
A script engine defines a way to load and run a script. It uses compilers and runtimes to accomplish this.
Compilers take script text and convert it to a .NET assembly. Such an assembly needs to reference a runtime, which provides API stubs.
This calls out of the appdomain to the API implementation.
Currently, a compiler exists for lsl, c#, j# and vb.
A runtime exists for the LSL API.
The runtime and compiler are not dependent on each other, and also not dependent on the script engine.
A proposed structure coudl be like this:
ScriptEngines/DotNetEngine/ The engine itself. Methods to manage threads, AppDomains, etc ScriptEngines/Compilers/DotNet/ The currrent compiler ScriptEngines/API/LSL/ The current LSL API ScriptEngines/API/LSL/Runtime The stub runtime ScriptEngines/API/LSL/Implementation The acutual LSL API implementation
The script engine would load the compiler, telling to to compile the given text from the source languages into a .NET assembly. referencing a certain API. The resulting assembly would be Script_compiled_<GUID>.dll. It would reference the API requested during compile, e.g. OpenSim.ScriptEngines.API.LSL.Runtime.dll. The scripot engine would load this assembly into an appdomain. The script engine loads OpenSim.ScriptEngines.API.LSL.Implementation.dll to execute the function calls from the script.
Alternative script engines, like the XEngine, would be in
ScriptEngines/XEngine/
They would share the compiler collection, API runtimes and API implementations.