| doc | ||
| monoucha | ||
| test | ||
| .gitignore | ||
| Makefile | ||
| monoucha.nimble | ||
| NEWS | ||
| nim.cfg | ||
| README.md | ||
| todo | ||
| UNLICENSE | ||
Monoucha: seamless Nim-QuickJS integration
Monoucha is a wrapper library to simplify the process of embedding the QuickJS-NG JavaScript engine into Nim programs.
Quick start
Include Monoucha in your project using either Nimble or as a git submodule.
requires "monoucha"
Then,
Warning
At the time of writing, Monoucha only works with refc. This means you have to put the following in your nim.cfg:
--mm:refc
If you do not do this, you will be rewarded with strange crashes as your program grows.
Dependencies
monoucha depends on the nim-results library.
QuickJS-NG is already included in this repository; you do not need to install it separately.
Q&A
- Cool, so how do I use this thing?
I'm working on a manual. Please read the manual.
- I'm getting weird memory errors?
You did not read the above instructions, you have to set --mm:refc.
Monoucha does not (and never did) work with ORC, or other memory managers for that matter. You must use refc.
(If you are still experiencing issues, please open a ticket here and I'll look into it.)
- I already have QuickJS-NG, why are you not linking to my system library?
Monoucha does not actually use stock QuickJS-NG, but a fork that tracks upstream.
This fork includes some GC modifications necessary for the synchronization of the Nim and QuickJS runtimes.
- Can I compile Nim to JS and execute Nim from Nim?
Possibilities are endless, but this looks like a better solution.
- Can I use Monoucha with
[insert JS engine]instead of QuickJS?
No. Feel free to fork and adapt it to whatever engine you want, but here we only support QuickJS.
- What is a monoucha?
A kind of tea, from the town once called Monou. You pronounce it as mo-no-u-cha.
Yes, it's a pun.
License
QuickJS was written by Fabrice Bellard and Charlie Gordon, and is maintained as QuickJS-NG by Ben Noordhuis and Saúl Ibarra Corretgé.
QuickJS-NG is distributed in this repository under the terms of the MIT license. See the monoucha/qjs/LICENSE file for details.
Monoucha is released into the public domain. See the UNLICENSE file for details.