Live data from Hacker News

Fabrice Bellard Releases MicroQuickJS

github.com

491–500 of 594 posts

Re: Fabrice Bellard Releases MicroQuickJS

#491

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.

IIRC, ES6+ includes TCO, but no actual implementation/engine has implemented it.

Re: Fabrice Bellard Releases MicroQuickJS

#492
post #393

Earlier quoted context omitted.

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.

> 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. Let's talk specifics. As it seems you have strong opinions, in your opinion what is the single worst aspect of JavaScript that justifies the use of the word "ugly"?

https://dorey.github.io/JavaScript-Equality-Table/

https://www.reddit.com/r/learnjavascript/comments/qdmzio/dif...

or anything that touches array ops (concatenating, map, etc…). I mean, better and more knowledgeable people than me have written thousands of articles about those footguns and many more.

I am not a webdev, I don't want to remember those things, but more often than I would wish, I have to interop with JS, and then I'd rather use a better behaved language that compiles down to JS (there are many very good ones, nowadays) than deal with JS directly, and pray for the best.

Re: Fabrice Bellard Releases MicroQuickJS

#493
post #384

Earlier quoted context omitted.

>Lua is the only lightweight language that I am aware of with TCO. Scheme is pretty lightweight.

Tcl too, fwiw[0]. [0] https://wiki.tcl-lang.org/page/NRE

Tcl needs a special command for tail calls though, instead of it Just Working (tm). It's kind of awkward.

Re: Fabrice Bellard Releases MicroQuickJS

#494

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…

I for one would be would be very interested in a Redbean[0] implementation with MicroQuickJS instead of Lua, though I lack the resources to create it myself.

[0] https://redbean.dev/ - the single-file distributable web server built with Cosmopolitan as an αcτµαlly pδrταblε εxεcµταblε

Re: Fabrice Bellard Releases MicroQuickJS

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

Yeah, you can usually write a TCO based algorithm differently without recursion though it's often more messy of an implementation... In practice, with JS, I find that if I know I'm going to wind up more/less than 3-4 calls deep I'll optimize or not to avoid the stack overflow.

Also worth noting that some features in JS may rely on application/environment support and may raise errors that you cannot catch in JS code. This is often fun to discover and painful to try to work around.

Re: Fabrice Bellard Releases MicroQuickJS

#496
Sound like this would have been a good option for PLJS in PostgreSQL (currently using QuickJS), not sure if it'd be appropriate to consider a switch or if that would/could improve availability... IMO interaction with JSON(B) and other json and objects being the biggest usefulness.

Re: Fabrice Bellard Releases MicroQuickJS

#497
post #450

Earlier quoted context omitted.

C++ is a katamari ball of programming trends and half baked ideas. I get why google built golang, as they were already pretty strict about what parts of the c++ sediments you were allowed to use.

Not Google actually, but the same people from C, AWK and Unix (and 9front, which is "Unix 2.0" and it has a simpler C (no POSIX bloat there) and the compilers are basically the philosophy of Golang (cross compile from any to any arch, CSP concurrency...) Also, the Limbo language it's basically pre-Go.

https://en.wikipedia.org/wiki/Go_(programming_language)#Hist... : "Go was designed at Google in 2007"

Re: Fabrice Bellard Releases MicroQuickJS

#498

Earlier quoted context omitted.

Always interesting when people as talented as Bellard manage to (apparently) never write a "full-on" GUI-fronted application, or more specifically, a program that sits between a user with constantly shifting goals and workflows and a "core" that can get the job done. I would not want to dismiss or diminish by any amount the incredible work he has done. It's just interesting to me that the problems he appears to pick…

Reading some of these comments, it's clear very few in here have ever written a productive customer facing full stack app "javascript is really good for a single file app!!!" ok, maybe if you're rendering static HTML... -> these are not serious people

FWIW, most of my shell scripting these days is Deno+TS...

Re: Fabrice Bellard Releases MicroQuickJS

#499
post #178

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…

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…

> In my programs, I have banned the use of loops.

Rather, you no longer see what they're doing clearly.

Post reply on HN