3 ms·
If anyone wants to try out MicroQuickJS in a browser here's a simple playground interface for executing a WebAssembly compiled version of it: https://tools.simo
by simonw 11mo ago
If anyone wants to try out MicroQuickJS in a browser here's a simple playground interface for executing a WebAssembly compiled version of it: https://tools.simonwillison.net/microquickjs https://tools.simonwillison.net/microquickjs
It's a variant of my QuickJS playground here: https://tools.simonwillison.net/quickjs https://tools.simonwillison.net/quickjs
The QuickJS page loads 2.28 MB (675 KB transferred). The MicroQuickJS one loads 303 KB (120 KB transferred).
- azakai 11mo agoLooks like those sizes could be improved significantly, as the builds include names etc. I would suggest linking with emcc -O3 (and maybe even adding --closure 1 ) edit: actually the QuickJS playground looks already optimized - just the MicroQuickJS one could be improved.
- simonw 11mo agoNice. Got it down from 229KB to 148KB! Thanks for the tips. https://github.com/simonw/research/pull/5 https://github.com/simonw/research/pull/5 Thats now live on https://tools.simonwillison.net/microquickjs https://tools.simonwillison.net/microquickjs
- julenx 11mo agoThanks for sharing! The link to the PR looks like a wrong paste. I found https://github.com/simonw/tools/pull/181 https://github.com/simonw/tools/pull/181 which seems to be what was intended to be shared instead.
- kamranjon 11mo agoI was interested to try Date.now() since this is mentioned as being the only part of the Date implementation that is supported but was surprised to find it always returns 0 for your microquickjs version - your quickjs variant appears to return the current unix time.
- simonw 11mo agoGood catch. WebAssembly doesn't have access to the current time unless the JavaScript host provides it through injecting a function, so the WASM build would need to be hooked up specially to support that.
- throwaway290 11mo agoThe most important thing about any new JS runtime in 2025, how do I use it from JS? /s
- xigoi 11mo agoAt last, I can run JavaScript in my browser. The world is now complete.