No description
Find a file
2025-03-28 17:53:10 +01:00
doc Re-add JSValueConst 2025-03-12 18:20:21 +01:00
monoucha Monoucha version 0.10.0 2025-03-28 17:53:10 +01:00
test Re-add JSValueConst 2025-03-12 18:20:21 +01:00
.gitignore fromjs: re-design API 2024-08-09 00:02:07 +02:00
Makefile javascript: fix refc deinitialization bugs 2024-11-25 23:12:07 +01:00
monoucha.nimble Monoucha version 0.10.0 2025-03-28 17:53:10 +01:00
NEWS Monoucha version 0.10.0 2025-03-28 17:53:10 +01:00
nim.cfg Import Monoucha 2024-06-03 20:27:22 +02:00
README.md Switch to QuickJS-NG 0.6.1 2024-09-29 18:57:47 +02:00
todo javascript: replace old jsgetprop with new one 2025-01-13 19:09:17 +01:00
UNLICENSE Import Monoucha 2024-06-03 20:27:22 +02:00

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,

  • There is a manual. Please read the manual.
  • Examples from the manual, organized as unit tests.

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.