Live data from Hacker News

Fabrice Bellard Releases MicroQuickJS

github.com

241–250 of 594 posts

Re: Fabrice Bellard Releases MicroQuickJS

#241

this would be a killer replacement for micro/circuitpython for embedded devices, assuming there's an elegant TS->MQJS transpile

It’s not even the languages or runtimes that inhibit embedded adoption but the software to hardware tooling. Loader scripts, HAL/LL/CMSIS, flashing, etc. They all suck.

Re: Fabrice Bellard Releases MicroQuickJS

#242
post #178

Earlier quoted context omitted.

I don't love a good deal of Lua's syntax, but I do think the authors had good reasons for their choices and have generally explained them. Even if you disagree, I think "without good reasons" is overly dismissive. Personally though, I think the distinctive choices are a boon. You are never confused about what language you are writing because Lua code is so obviously Lua. There is value in this. Once you have written…

> as my primary language I'd love to hear more how it is, the state of the library ecosystem, language evolution (wasn't there a new major version recently?), pros/cons, reasons to use it compared to other languages. About tail-calls, in other languages I've found sometimes a conversion of recursive algorithm to a flat iterative loop with stack/queue to be effective. But it can be a pain, less elegant or intuitive th…

Lua isn't my primary programming language now, but it was for a while. My personal experience on the library ecosystem was:

It's definitely smaller than many languages, and this is something to consider before selecting Lua for a project. But, on the positive side: With some 'other' languages I might find 5 or 10 libraries all doing more or less the same thing, many of them bloated and over-engineered. But with Lua I would often find just one library available, and it would be small and clean enough that I could easily read through its source code and know exactly how it worked.

Another nice thing about Lua when run on LuaJIT: extremely high CPU performance for a scripting language.

In summary: A better choice than it might appear at first, but with trade-offs which need serious consideration.

Re: Fabrice Bellard Releases MicroQuickJS

#243

Earlier quoted context omitted.

> consistent and predictable That's what matters to me, not how similar Lua is to other languages, but that the language is well-designed in its own system of rules and conventions. It makes sense, every part of it contributes to a harmonious whole. JavaScript on the other hand. When speaking of Algol or C-style syntax, it makes me imagine a "Common C" syntax, like taking the best, or the least common denominator, of…

Is modern C really much more complicated than old C? C++ is a mess of course.

I don't write modern C for daily use, so I can't really say. But I've been re-learning and writing C99 more these days, not professionally but personal use - and I appreciate the smallness of the language. Might even say C peaked at C99. I mean, I'd be crazy to say that C-like languages after C99, like Java, PHP, etc., are all misguided for how unnecessarily big and complex they are. It might be that I'm becoming more like a caveman programmer as I get older, I prefer dumb primitive tools.

Re: Fabrice Bellard Releases MicroQuickJS

#244
post #208
post #178

Earlier quoted context omitted.

I don't love a good deal of Lua's syntax, but I do think the authors had good reasons for their choices and have generally explained them. Even if you disagree, I think "without good reasons" is overly dismissive. Personally though, I think the distinctive choices are a boon. You are never confused about what language you are writing because Lua code is so obviously Lua. There is value in this. Once you have written…

Re: TCO Does the language give any guarantee that TCO was applied? In other words can it give you an error that the recursion is not of tail call form? Because I imagine a probability of writing a recursion and relying on it being TCO-optimized, where it's not. I would prefer if a language had some form of explicit TCO modifier for a function. Is there any language that has this?

Although it’s a bit weird, Able Forth has the explicit word ~

https://github.com/ablevm/able-forth/blob/current/forth.scr

I do prefer this as it keeps the language more regular (fewer surprises)

Re: Fabrice Bellard Releases MicroQuickJS

#245
post #167

Earlier quoted context omitted.

Here you go: https://simonwillison.net/2025/Dec/23/microquickjs/

No I mean post it as an HN post and if anybody cares to see it, they'll upvote that and comment in there. That, instead of pigging backing on other posts to get visibility.

I genuinely don't think it's interesting enough to warrant a top level post. It's interesting enough to be in a comment though!

Re: Fabrice Bellard Releases MicroQuickJS

#246
post #173

Earlier quoted context omitted.

I want to build features - both client- and server-side - where users can provide JavaScript code that I then execute safely. Just having a WebAssembly engine available isn't enough for this - something has to take that user-provided string of JavaScript and execute it within a safe sandbox. Generally that means you need a JavaScript interpreter that has itself been compiled to WebAssembly. I've experimented with Qui…

This is generally the purpose of JavaScript execution environments like v8 or jsc (or quickjs although I understand not trusting that as a sandbox to the same degree). They are specifically intended for executing untrusted scripts (eg web browsers). Web assembly’s sandboxing comes from js sandboxing, since it was originally a feature of the same programs for the same reasons. Wrapping one sandbox in another is what I…

Running v8 itself as a sandbox is non-trivial, at least embedded in a Python or Node.js or similar application.

The web is littered with libraries that half do that and then have a note in the README that says "do not rely on this as a secure sandbox".

Re: Fabrice Bellard Releases MicroQuickJS

#247
post #197

Earlier quoted context omitted.

Not to mention the 1-based indexing sin. JavaScript has a lot of WTFs but they got that right at least.

This indeed is not Algol (or rather C) heritage, but Fortran heritage, not memory offsets but indices in mathematical formulae. This is why R and Julia also have 1-based indexing.

And MATLAB. Doesn't make it any better that other languages have the same mistake.

Re: Fabrice Bellard Releases MicroQuickJS

#248
post #103

Earlier quoted context omitted.

Yeah, I failed completely to explain the context here. I'm currently on a multi-year side-quest to find safe ways to execute untrusted user-provided code in my Python and web applications. As such, I pay very close attention to any new language or library that looks like it might be able to provide a robust sandbox. MicroQuickJS instantly struck me as a strong candidate for that, and initial protoyping has backed tha…

It is depressing the age of llm coding power came during python and JavaScript. Unfortunately it means those languages will be the permanent coding platforms.

> Unfortunately it means those languages will be the permanent coding platforms.

not really,

I suspect training volume has a role in debugging a certain class of errors, so there is an advantage to python/ts/sql in those circumstances: if, as an old boss once told me, you code by the bug method :)

The real problems I've had that hint at training data vs logic have been with poorly documented old versions of current languages.

To me, the most amazing capability is not the code they generate but the facility for natural language analysis.

my experience is that agent tools enable polyglot systems because we can now use the right tool for the job, not just the most familiar.

Re: Fabrice Bellard Releases MicroQuickJS

#249
post #168

If this had been available in 2010, Redis scripting would have been JavaScript and not Lua. Lua was chosen based on the implementation requirements, not on the language ones... (small, fast, ANSI-C). I appreciate certain ideas in Lua, and people love it, but I was never able to like Lua, because it departs from a more Algol-like syntax and semantics without good reasons, for my taste. This creates friction for newcom…

Out of interest, was Tcl considered? It's the original embeddable language.

In 1994 at the second WWW conference we presented "An API to Mosaic". It was TCL embedded inside the (only![1]) browser at the time - Mosaic. The functionality available was substantially similar to what Javascript ended up providing. We used it in our products especially for integrating help and preferences - for example HTML text could be describing color settings, you could click on one, select a colour from the chooser and the page and setting in our products would immediately update. In another demo we were able to print multiple pages of content from the start page, and got a standing ovation! There is an alternate universe where TCL could have become the browser language.

For those not familiar with TCL, the C API is flavoured like main. Callbacks take a list of strings argv style and an argc count. TCL is stringly typed which sounds bad, but the data comes from strings in the HTML and script blocks, and the page HTML is also text, so it fits nicely and the C callbacks are easy to write.

[1] Mosaic Netscape 0.9 was released the week before

Re: Fabrice Bellard Releases MicroQuickJS

#250

Earlier quoted context omitted.

Perhaps closer to 100x actually.

You can call 1000 averaged programmers and see if they can write MicroQuickJS using the same amount of time, or call one averaged programmer and see if he/she can write MicroQuickJS to the same quality in his/her life time. 10X, 100X or 1000X measures the productivity of us mortals, not someone like Fabrice Bellard.

If you're in a room with 100 physicists and Feynman, the accumulated wisdom of Feynman is your best bet.
Post reply on HN