Live data from Hacker News

Fabrice Bellard Releases MicroQuickJS

github.com

391–400 of 594 posts

Re: Fabrice Bellard Releases MicroQuickJS

#391
post #315

Earlier quoted context omitted.

I also strongly disliked luas syntax at first but now I feel like the meta tables and what not and pcall and all that stuff is kinda worth it. I like everything about Lua except some of the awkward syntax but I find it so much better then JS, but I haven't been a web dev in over a decade

The only thing I dislike about Lua is the 1-indexing. I know they had reasons for it but it always caused issues.

I'm torn on this.

Initially I agreed, just because so many other languages do it that way.

But if you ignore that and clean slate it, IMO, 1 based makes more sense. I feel like 0 based mainly gained foothold because of C's bastardization of arrays vs pointers and associated tricks. But most other languages don't even support that.

You can only see :len(x)-1 so many times before you realize how ridiculous it is.

Re: Fabrice Bellard Releases MicroQuickJS

#392

Earlier quoted context omitted.

Lua has been a wild success considering it was born in Brazil, and not some high wealth, network-effected country with all its consequent influential muscle (Ruby? Python? C? Rust? Prolog? Pascal? APL? Ocaml? Show me which one broke out that wasn't "born in the G7"). We should celebrate its plucky success which punches waaay above its adoption weight. It didn't blindly lockstep ALGOL citing "adooooption!!", but didn'…

I appreciate your point, but Python was invented in .nl which wouldn't be G7 strictly speaking.

In the same vein Pascal was invented by Niklaus Wirth in Switzerland.

Re: Fabrice Bellard Releases MicroQuickJS

#393

Earlier quoted context omitted.

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

I think he’s saying it’s a fundamentally improved language at this point?

Not OP, but the case can be made that it's still the same very ugly language of 10 years ago, with few layers of sugar coating on top. The ugly hasn't gone anywhere. You still have to deal with it and suffer the cognitive burden.

Re: Fabrice Bellard Releases MicroQuickJS

#394
post #310
post #289

Earlier quoted context omitted.

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

Nice. Got it down from 229KB to 148KB! Thanks for the tips. https://github.com/simonw/research/pull/5 Thats now live on https://tools.simonwillison.net/microquickjs

Thanks for sharing! The link to the PR looks like a wrong paste. I found https://github.com/simonw/tools/pull/181 which seems to be what was intended to be shared instead.

Re: Fabrice Bellard Releases MicroQuickJS

#395
post #67
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…

Down to -4. Is this generic LLM-dislike, or a reaction to perceived over-self-promotion, or something else? No matter how much you hate LLM stuff I think it's useful to know that there's a working proof of concept of this library compiled to WASM and working as a Python library. I didn't plan to share this on HN but then MicroQuickJS showed up on the homepage so I figured people might find it useful. (If I hadn't dis…

Because it adds nothing to the conversation. Im

Re: Fabrice Bellard Releases MicroQuickJS

#396

Earlier quoted context omitted.

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…

I sort of see what you are getting at but I am still a bit confused: If I have a program that based on the input given to it runs some number of recursions of a function and two compilers of the language, can I compile the program using both of them if compiler A has PTC and compiler B does not no matter what the actual program is? As in, is the only difference that you won’t get a runtime error if you exceed the max…

I think features of the language can make it much easier (read: possible) for the compiler to recognize when a function is tail call optimizable. Not every recursion will be, so it matters greatly what the actual program is.

Re: Fabrice Bellard Releases MicroQuickJS

#397

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.

IDK about C11; but C99 doesn't change a lot compared to ANSI C. You can read The C Programming Language 2nd edition and pick up C99 in a week. It adds boleans, some float/complex math ops, an optional floating point definition and a few more goodies:

https://en.wikipedia.org/wiki/C99

C++ by comparison it's a behemoth. If C++ died and, for instance, the FLTK guys rebased their libraries into C (and Boost for instance) it would be a big loss at first but Chromium and the like rewritten in C would slim down a bit, the complexity would plummet down and similar projects would use far less CPU and RAM.

It's not just about the binary size; C++ today makes even the Common Lisp standard (even with UIOP and some de facto standard libraries from QuickLisp) pretty much human-manageable, and CL always has been a one-thousand pages thick standard with tons of bloat compared to Scheme or it's sibling Emacs Lisp. Go figure.

Re: Fabrice Bellard Releases MicroQuickJS

#398
post #245

Earlier quoted context omitted.

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!

And people think is not interesting enoug and downvote you.

Re: Fabrice Bellard Releases MicroQuickJS

#400
post #81

Well, as Jeff Atwood famously said [0], "any application that can be written in JavaScript, will eventually be written in JavaScript". I guess that applies to embedded systems too [0] https://en.wikipedia.org/wiki/Jeff_Atwood

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

And FFMPEG, the standard codec suite for Unix today. And Qemu, the core of KVM. Plus TCC, a great small compiler compared to C/Clang altough cparser has better C99 coverage. Oh, and some DVB transmitter reusing the MHZ radiation from a computer screen by tweaking the Vidtune values from X. It's similar to what Tempest for Eliza does.
Post reply on HN