- bindings for MicroQuickJS
- generated with odin-c-bindgen
- Clone with submodules:
git clone --recursive https://github.com/xraxra/odin-mquickjs.git - Linux: build.sh
- Windows: build.bat
- (may need to edit path in bat, uses build tools for VS 2022 "Desktop development with C++" & "C++ Clang Compiler")
- once built, it's useful to symlink to your
odin/shared/folder, e.g.ln -s ~/dev/odin-mquickjs ~/dev/odin/shared/mquickjsso that it can be used viaimport "shared:mquickjs"
- example usage:
cd example && odin run . - you can also run the mquickjs test scripts, e.g
odin run . -- ../mquickjs/tests/mandelbrot.js
mquickjs expects all callable functions to be defined in C and compiled into the library (see odin_stdlib.c)
- For faster iteration, the bindings provide a dispatcher that routes JS calls to Odin procedures, e.g.
call("player_set_health", player_id, 100);
- The code generator introspects your provided API struct and outputs an odin file with all dispatch handling for each procedure.
- In theory, once your API has stabilized, any performance-critical functions could be moved into
odin_stdlib.cto be called natively instead of usingcall()