A tutorial/example showing how to extend squirrel lang via windows DLL.
jsonlib is an nlohmann::json to squirrel bridge, it allows you to convert nlohmann::json to SQObjectPtr/HSQOBJECT and the other way around. Simply add the jsonlib.dll, and the automatic conversion will be enabled.
local dumped = jsonlib.dumps({
a = 1
})
// typeof dumped == string
local loaded = jsonlib.loads(dumped)
// typeof loaded == tablesq-repl is an extendable squirrel interpreter, aka repl.
jsonlibis one of the loadable plugins.
The sq-repl will load all *.dll plugins from the current directory. If a plugin provides the function void on_squirrel_vm_init(HSQUIRRELVM), it will be triggerred after the Squirrel VM initialization.