Live data from Hacker News

Fabrice Bellard Releases MicroQuickJS

github.com

321–330 of 594 posts

Re: Fabrice Bellard Releases MicroQuickJS

#321

Fabrice Bellard is widely considered one of the most productive and versatile programmers alive: - FFmpeg: https://bellard.org - QEMU: https://bellard.org/qemu/ - JSLinux: https://bellard.org/jslinux/ - TCC: https://bellard.org/tcc/ - QuickJS: https://bellard.org/quickjs/ Legendary.

Wikipedia doesn't list any honours awarded by the French Government. Nor do I see anything from ACM. Definitely overdue some official recognition.

Re: Fabrice Bellard Releases MicroQuickJS

#322

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?

If the language spec requires TCO, I think you can reasonably call it part of the language.

It wouldn't be the first time the specs have gone too far and beyond their perimeter.

C's "register" variables used to have the same issue, and even "inline" has been downgraded to a mere hint for the compiler (which can ignore it and still be a C compiler).

Re: Fabrice Bellard Releases MicroQuickJS

#323
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).

I 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.

Re: Fabrice Bellard Releases MicroQuickJS

#324
post #49

Earlier quoted context omitted.

And, I don't have to run a binary to try your product. The web has a lot of flaws, but it's a good way to deliver properly sandboxed applications with low hassle on the part of the user. I've built my fair share of native vs web apps, and I vastly prefer working on web apps. As a user, I vastly prefer web apps for most things. Not all things, but most. No, I don't want to install your crappy app on my computer and ri…

I can't think of a single thing where I prefer a web app over a native alternative, unless it's for one-off use.

I will pick a web app over a proprietary "native" app every time. That way, it can stay in a sandbox where it belongs. Discord, Zoom, Meet, Trello, YouTube, and various others, all stay in sandboxed browser tabs.

Re: Fabrice Bellard Releases MicroQuickJS

#325

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?

You’re wrong in the way in which many people are wrong when they hear about a thing called “tail-call optimization ”, which is why some people have been trying to get away from the term in favour of “proper tail calls” or something similar, at least as far as R5RS[1]: > A Scheme implementation is properly tail-recursive if it supports an unbounded number of active tail calls. The issue here is that, in every language…

Thank you for the precise answer.

I still think that the language property (or requirement, or behavior as seen by within the language itself) that we're talking about in this case is "unbounded nested calls" and that the language specs doesn't (shouldn't) assume that such property will be satisfied in a specific way, e.g. switching the call to a branch, as TCO usually means.

Re: Fabrice Bellard Releases MicroQuickJS

#326
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…

There might be a bit of growth-hacking resistance here, and maybe some StackOverflow culture as well. Neither should be leveled at you, IMHO. I've followed and admired your work since Datasette launched, and I think you're exhibiting remarkably good judgment in how you discuss topics with links to deeper discussion, and it's in keeping with a long tradition of good practices for the web. Thanks for working to normalize the practice.

Re: Fabrice Bellard Releases MicroQuickJS

#327
post #317

Earlier quoted context omitted.

It sounds like you're trying to articulate why you don't like Lua, but it seems to just boil down to syntax and semantics unfamiliarity? I see this argument a lot with Lua. People simply don't like its syntax because we live in a world where C style syntax is more common, and the departure from that seem unnecessary. So going "well actually, in 1992 when Lua was made, C style syntax was more unfamiliar" won't help, b…

GP is the creator of Redis. I would imagine he knows Lua well given that Redis has embedded it for around a decade.

In that case, my point about Garry not liking Lua despite choosing it for Garrysmod, for seemingly the same reason as antirez is very appropriate.

I haven't read antirez'/redis' opinions about Lua, so I'm just going off of his post.

In contrast I do know more about what Garry's opinion on Lua is as I've read his thoughts on it over many years. It ultimately boils down to what antirez said. He just doesn't like it, it's too unfamiliar for seemingly no intentional reason.

But Lua is very much an intentionally designed language, driven in cathedral-style development by a bunch of professors who seem to obsess about language design. Some people like it, some people don't, but over 15 years of talking about Lua to other developers, "I don't like the syntax" is ultimately the fundamental reason I hear from developers.

So my main point is that it just feels arbitrary. I'm confident the main reason I like Lua is because garry's mod chose to implement it. Had it been "MicroQuickJS", Lua would likely feel unfamiliar to me as well.

Re: Fabrice Bellard Releases MicroQuickJS

#328

Earlier quoted context omitted.

I honestly think the single file thing is best reserved for C, given how bad the language support for modularity is. I've had the inverse experience dealing with a many thousand line "core.php" file way back in the day helping debug an expressionengine site (back in the php 5.2ish days) and it was awful . Unless you have an editor which can create short links in a hierarchical tree from semantic comments to let you o…

C has no problems splitting programs in N files, to be honest. The reason FB (and myself, for what it is worth) often write single file large programs (Redis was split after N years of being a single file) is because with enough programming experience you know one very simple thing: complexity is not about how many files you have, but about the internal structure and conceptually separated modules boundaries. At some…

The file granularity you chose was at the perfect level for somebody to approach the source code and understand how Redis worked. It was my favorite codebases to peruse and hack. It’s been a decade and my memory palace there is still strong.

It reminded me how important organization is to a project and certainly influenced me, especially applied in areas like Golang package design. Deeply appreciate it all, thank you.

Re: Fabrice Bellard Releases MicroQuickJS

#329

Earlier quoted context omitted.

Well, wasn't Fabrice Bellard the guy who built a virtual machine with JS so that you could run Linux within the browser? https://bellard.org/jslinux/vm.html?cpu=riscv64&url=fedora33...

Fabrice is an absolute legend. Most people would be content with just making QEMU, but this guy makes TinyC and FFmpeg and QuickJS and MicroQuickJS and a bunch of other huge projects. I am envious that I will never anywhere near his level of productivity.

Not just programming either; he invented a mathematical technique for calculating the nth hex digit of pi

Re: Fabrice Bellard Releases MicroQuickJS

#330
post #2

I easily managed to build quickJS to WebAssembly for running in https://exaequOS.com . So I need to do the same for MicroQuickJS !

I'm curious what practical purpose you could have for running a js execution engine in an environment that already contains a (substantially faster) js execution engine? Is it just for the joy of doing it (if so good for you, absolutely nothing wrong with that).

Sandboxing.

Figma for example used QuickJS, the prior version of the library this post is about, to sandbox user authored Javascript plugins: https://www.figma.com/blog/an-update-on-plugin-security/

It's pretty handy for things like untrusted user authored JS scripts that run on a user's client.

Post reply on HN