Mquickjs-hs - Haskell wrapper for the Micro QuickJS JavaScript Engine

Fabrice Bellard recently released a new JavaScript engine called Micro QuickJS. It is targeted at embedded systems and can compile and run JavaScript programs using as little as 10 kB of RAM. However, it only supports a subset of JavaScript close to ES5.

It’s a follow up to his previous QuickJS engine, which supports the ES2023 specification, including modules, asynchronous generators, proxies, and BigInt.

I am excited about MQuickJS, as it could be a great way to add safe scripting support to Haskell programs in a more beginner-friendly way than HsLua (assuming that more developers will learn JS before they learn Lua).

To implement a wrapper, I modified the existing quickjs-hs package by Samuel Balco. Claude Code was a great help here in doing all the grunt work.

The first thing I want to try is executing TaskLite hooks with it. Since their main purpose is to transform tasks, it should be the perfect use case. TaskLite already includes support for HsLua, so this will be a good opportunity to compare the two.

Do you have any other use cases where this could come in handy?

4 Likes