Live data from Hacker News

Fabrice Bellard Releases MicroQuickJS

github.com

331–340 of 594 posts

Re: Fabrice Bellard Releases MicroQuickJS

#331
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?

C, with [[clang::musttail]]

Re: Fabrice Bellard Releases MicroQuickJS

#332

I wonder if this could become the most lightweight way for yt-dlp to solve YouTube Javascript challenges. https://github.com/yt-dlp/yt-dlp/wiki/EJS (Note that Bellard's QuickJS is already a supported option.)

That's a great idea, but if they did, then YouTube could retaliate by specifically using features that MicroQuickJS does not support.

Re: Fabrice Bellard Releases MicroQuickJS

#333
post #17

Clarification added later : One of my key interests at the moment is finding ways to run untrusted code from users (or generated by LLMs) in a robust sandbox from a Python application. MicroQuickJS looked like a very strong contender on that front, so I fired up Claude Code to try that out and build some prototypes. I had Claude Code for web figure out how to run this in a bunch of different ways this morning - I hav…

What is the purpose of compiling this to web assembly? What web assembly runtimes are there where there is not already an easily accessible (substantially faster) js execution environment? I know wasmtime exists and is not tied to a js execution engine like basically every other web assembly implementation, but the uses of wasmtime are not restricted from dependencies like v8 or jsc. Usually web assembly is used for…

As I noted in another comment Figma has used QuickJS to run JS inside Wasm ever since a security vulnerability was discovered in their previous implementation.

In a browser environment it's much easier to sandbox Wasm successfully than to sandbox JS.

Re: Fabrice Bellard Releases MicroQuickJS

#334
post #306

Earlier quoted context omitted.

I think you're misreading what the "normalization" problem actually is and why my comment got a lot of upvotes. You're not pushing against an arbitrary taboo where people dislike self links in principle. People already accept self links on HN when they're occasional and clearly relevant. What people are reacting to is the pattern when "my answer is a link to my site" becomes your default state, it stops reading like…

No, I'm determined to normalize it. I would like a LOT more people to have personal websites where they write at length about things, and then share links to what they have already written where it is relevant to the conversation. I'm actively pushing back against the "don't promote your site, don't link to it, restate your content in the comments instead" thing. I am willing to take on risk to my personal reputation…

Well, that's your choice. You can do whatever you want with your reputation, but you can't change human nature and that's essentially what you're trying to do. People don't want HN to turn into another LinkedIn style feed full of AI slop, spam and self promotion. That's exactly what your attempt to "normalize" this behavior would encourage (and I'm confident it won't catch on, sorry).

If everyone starts dropping their "relevant content" in the comments, most of it won't be relevant, and a lot of it will be spam. People don't have time to sift through hundreds of links in the comments and tens of thousands of words when the whole point of HN is that discussion and curation work in the opposite direction.

If your content is good, someone else will submit it as a story. Your blog is probably already read by thousands of people from HN, if they think a particular post belongs in the discussion in some comment, they'll link it. That's why other popular HN users who blog don't constantly promote or link their own content here, unlike you. They know that you don't need to do it yourself, and doing it repeatedly sends the wrong signal (which is obvious and plenty of socially aware people have already pointed out to you in multiple threads).

Trying to normalize that kind of self promoting is like normalizing an annoying mosquito buzz, most people simply don't want it and no amount of "normalizing" will change that.

Re: Fabrice Bellard Releases MicroQuickJS

#335

Earlier quoted context omitted.

> Lua has a crucial feature that Javascript lacks: tail call optimization. I'm not familiar with Lua, but I expect tco to be a feature of the compiler, not of the language. Am I wrong?

I don't think you're wrong per se. This is a "correct" way of thinking of the situation, but it's not the only correct way and it's arguably not the most useful. A more useful way to understand the situation is that a language's major implementations are more important than the language itself. If the spec of the language says something, but nobody implements it, you can't write code against the spec. And on the flip…

Are you saying that Lua's TCO is an accidental feature due to the first implementation having it? How accurate is that?

Re: Fabrice Bellard Releases MicroQuickJS

#336

Earlier quoted context omitted.

Actually in JS array indexing is same as property indexing right? So it's actually looking up the string '0', as in arr['0']

Huh. I always thought that JS objects supported string and number keys separately, like lua. Nope! [Documents]$ cat test.js let testArray = []; testArray[0] = "foo"; testArray["0"] = "bar"; console.log(testArray[0]); console.log(testArray["0"]); [Documents]$ jsc test.js bar bar [Documents]$

Lua supports even functions and objects as keys:

  function f1() end
  function f2() end
  local m1 = {}
  local m2 = {}
  local obj = {
      [f1] = 1,
      [f2] = 2,
      [m1] = 3,
      [m2] = 4,
  }
  print(obj[f1], obj[f2], obj[m1], obj[m2], obj[{}])
Functions as keys is handy when implementing a quick pub/sub.

Re: Fabrice Bellard Releases MicroQuickJS

#337
post #205

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 It's a variant of my QuickJS playground here: https://tools.simonwillison.net/quickjs The QuickJS page loads 2.28 MB (675 KB transferred). The MicroQuickJS one loads 303 KB (120 KB transferred).

The most important thing about any new JS runtime in 2025, how do I use it from JS? /s

Re: Fabrice Bellard Releases MicroQuickJS

#338

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…

My hunch is that the same is true of Wikipedia's choice of Lua for template scripting, made back in 2012.

https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists...

Re: Fabrice Bellard Releases MicroQuickJS

#339

Earlier quoted context omitted.

Lua only departs from norms if you’ve had a very narrow experience with other programming languages. Frankly, I welcome the fact that Redis doesn’t use JavaScript. It’s an abomination of a language. The fewer times I need to use it the better.

I think criticizing JavaScript has become a way of signaling "I'm a good programmer." Yes, good programmers ten years ago had valid reasons to criticize it. But today, attacking the efforts of skilled engineers who have improved the language (given the constraints and without breaking half of the web) seems unfair. They’ve achieved a Herculean task compared to the Python dev team, which has broken backward compatibil…

> But today, attacking the efforts of skilled engineers who have improved the language (given the constraints and without breaking half of the web) seems unfair.

I was criticising a thing not a person.

Also your comment implies it was ok to be critical of a language 10 years ago but not ok today because a few more language designers might get offended. Which is a weird argument to make.

Re: Fabrice Bellard Releases MicroQuickJS

#340

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…

What are the chances of switching to MQJS or something like it in the future?
Post reply on HN