Remix.run Logo
simonw 17 hours ago

Funny to see this show up today since coincidentally I've had Claude code running for the past ~15 hours attempting to port MicroQuickJS to pure dependency-free Python, mainly as an experiment in how far a porting project can go but also because a sandboxed (memory constrained, to us time limits) JavaScript interpreter that runs in Python is something I really want to exist.

I'm currently torn on whether to actually release it - it's in a private GitHub repository at the moment. It's super-interesting and I think complies just fine with the MIT licenses on MicroQuickJS so I'm leaning towards yes.

Its got to 402 tests with 2 failing - the big unlock was the test suite from MicroQuickJS: https://github.com/bellard/mquickjs/tree/main/tests

Its been spitting out lines like this as it works:

  I see the issue - toFixed is using
  Python’s default formatting which uses
  round-half-to-even rounding, but
  JavaScript uses round-half-away-from-zero.
yeasku 17 hours ago | parent | next [-]

I am waiting for a llm entusiast to create something like MicroQuickJS from scratch.

GaryBluto 16 hours ago | parent [-]

Fabrice Bellard, who developed MicroQuickJS, is a user of LLMs.

yeasku 16 hours ago | parent [-]

[flagged]

GaryBluto 16 hours ago | parent [-]

> I think you halucinated this up. (Quote from original comment, pre malicious-edit)

No point in responding to a troll, but for the other people who may be reading this comment chain, he's used LLMs for various tasks. Not to mention that he founded TextSynth, an entire service that revolves around them.

https://textsynth.com/

https://bellard.org/ts_sms/

yeasku 15 hours ago | parent [-]

[flagged]

dwaltrip 15 hours ago | parent | next [-]

> TextSynth provides access to large language, text-to-image, text-to-speech or speech-to-text models such as Mistral, Llama, Stable Diffusion, Whisper thru a REST API and a playground. They can be used for example for text completion, question answering, classification, chat, translation, image generation, speech generation, speech to text transcription, ...

???

simonw 15 hours ago | parent | prev | next [-]

You're confused. The compression algorithm was something different. TextSynth is an LLM inference server, similar to (but older than) llama.cpp.

yeasku 14 hours ago | parent [-]

Creating a llama.cpp like software is not using LLMs to develop software neither.

15 hours ago | parent | prev [-]
[deleted]
cryptonector 4 hours ago | parent | prev | next [-]

But why Python? Why not a JVM like Graal? I would think that would yield faster code.

Or why not run MicroQuickJS under Fil-C? It's ideal since it has not dependencies.

simonw 2 hours ago | parent [-]

I build and distribute software in Python. My ideal solution is something that installs cleanly via pip so I can include it as a regular dependency of my other projects.

benatkin an hour ago | parent [-]

It's analogous to asm.js, the precursor to WebAssembly, which was written in js, in that it ran virtual machines in pure js, which is a huge win in portability. The mquickjs readme explains it in a much lower level way than the quickjs readme. There's also more emphasis on the bytecode. In a way it's like a tiny WebAssembly plus garbage collection extension vm that can run compile to js languages, going beyond that and compiling them to bytecode. The overhead of porting it to a dynamic language wouldn't always be that bad depending on the use case. Its memory savings could be maintained.

llmslave2 4 hours ago | parent | prev | next [-]

How many tests do other JS runtimes like V8 have? ~400 tests sounds reasonable for a single data structure, but orders of magnitude off for a language runtime.

simonw 2 hours ago | parent [-]

MicroQuickJS has 7, kind of: https://github.com/bellard/mquickjs/tree/main/tests

Though if you look in those files some of them run a ton of test functions and assertions.

My new Python library executes copies of the tests from that mquickjs repo - but those only count as 7 of the 400+ other tests.

ruszki 2 minutes ago | parent [-]

Were the tests generated by an AI then. How do you know whether they are really comprehensive?

krackers 13 hours ago | parent | prev | next [-]

You should release it, it'd be quite useful.

simonw 4 hours ago | parent [-]

https://pypi.org/project/micro-javascript/ - https://github.com/simonw/micro-javascript

Here's the transcript showing how I built it: https://static.simonwillison.net/static/2025/claude-code-mic...

rasz 16 hours ago | parent | prev [-]

TI had similar idea with TI-99/4 - running interpreted BASIC programs using BASIC written in special interpreted language (GPL) running in its own virtual machine, with actual CPU machine code executing from ram accessible thru single byte window of Video processor. Really brilliant system, turtles all the way down.