3 ms·
Duktape’s host API is pretty much a ripoff of Lua’s, and the latter wasn’t rejected on those grounds, so… QuickJS’s API isn’t particularly well-documented, but
by pwdisswordfish8 5y ago
Duktape’s host API is pretty much a ripoff of Lua’s, and the latter wasn’t rejected on those grounds, so…
QuickJS’s API isn’t particularly well-documented, but it’s not hard to find your way around it either if you dig into the source (the engine is very hackable, too; you might even fix some of the language’s design flaws – obligatory wat talk reference – if you’re so inclined). The host API follows the CPython model, with objects represented by pointers and explicit reference counting on the C side. There are some predefined macros to ease defining built-in classes. Some type-level hackery in C++ might ease things even further. I don’t know how much deader-easier you want it.
- germandiago 5y agoTake a look at how pybind11, wrenbind17, sol2 or Chaiscript do it. That is how easy I want it: I can expose custom types and global state easily. I do not want just ints and const char */double. These bindings do from decent to great.