Tech/LxEngine/Features & Tasks/Scripting Language Plug-ins
From Athile
< Tech | LxEngine | Features & Tasks
Status
Unstarted.
Overview
Add an abstraction layer between the LxEngine core and the scripting language implementation so that scripting languages can be supported via a plug-in per language. Classes, methods, properties, and free functions would be exposed to the abstract script management via generic interfaces: the plug-ins would then map these to implementation specific wrappers.
- Javascript
- Python
- .NET
Design Notes
- Create a language-neutral description of the classes and functions (effectively an internal virtual machine run-time environment)
- Add them to a stack of contexts
- Run a script at any time with a given active context stack
class ScriptClass { name; methods[]; properties[]; slotInvokeMethod(name, args); slotInvokeProperty(name); } class ScriptContext { addFunction(name, std::function<T>); addClass(ScriptClass); };