Live data from Hacker News

Fabrice Bellard Releases MicroQuickJS

github.com

401–410 of 594 posts

Re: Fabrice Bellard Releases MicroQuickJS

#401

Earlier quoted context omitted.

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 mor…

C11 adds a couple of nice things like static asserts which I use sometimes to document assumptions I make.

They did add some optional sections like bounds checking that seem to have flopped, partly for being optional, partly for being half-baked. Having optional sections in general seems like a bad idea.

Re: Fabrice Bellard Releases MicroQuickJS

#402
post #171
post #157

Earlier quoted context omitted.

> it feels like it departs from what people know without good reasons. Lua was first released in 1993. I think that it's pretty conventional for the time, though yeah it did not follow Algol syntax but Pascal's and Ada's (which were more popular in Brazil at the time than C, which is why that is the case)! Ruby, which appeared just 2 years later, departs a lot more, arguably without good reasons either? Perl, which i…

We had a lot problems embedding Ruby in a multithreaded C program as the garbage collector tries to scan memory between the threads (more details here: https://gitlab.com/nbdkit/nbdkit/-/commit/7364cbaae809b5ffb6... ) Perl, Python, OCaml, Lua and Rust were all fine (Rust wasn't around in 2010 of course).

I'm reving _why's syck right now. Turns out my fork from 2013 was still the most advanced. It doesn't implement the latest YAML specs, and all of it's new insecurities, which is a good thing. And it's much, much faster than the sax-like libyaml.

But since syck uses the ruby hashtable internally, I got stuck in the gem for a while. It fell out of their stdlib, and is not really maintained neither. PHP had the latest updates for it. And perl (me) extended it to be more recursion safe, and added more policies (what to do on duplicate keys: skip or overwrite).

So the ruby bindings are troublesome because of its GC, which with threading requires now7 a global vm instance. And using the ruby alloc/free pairs.

PHP, perl, python, Lua, IO, cocoa, all no problem. Just ruby, because of its too tight coupling. Looks I have to decouple it finally from ruby.

Re: Fabrice Bellard Releases MicroQuickJS

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

I do not think your compiler argument in support of TCO is very convincing.

Do you really need to write compilers with limitless nesting? Or is nesting, say, 100.000 deep enough, perhaps?

Also, you'll usually want to allocate some data structure to create an AST for each level. So that means you'll have some finite limit anyway. And that limit is a lot easier to hit in the real world, as it applies not just to nesting depth, but to the entire size of your compilation unit.

Re: Fabrice Bellard Releases MicroQuickJS

#404

Earlier quoted context omitted.

Maybe claude code uses bellard as agent

Claude is really Bellard sitting in his kitchen, sipping coffee, casually replying to code requests while getting ready for his day.

Is Bellard the “Chuck Norris” of Programming?

Re: Fabrice Bellard Releases MicroQuickJS

#405

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…

Lua - an entire language off by one.

Sure, because the first element is at index 1, not zero. Ha

Re: Fabrice Bellard Releases MicroQuickJS

#406
post #397

Earlier quoted context omitted.

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)…

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.

Re: Fabrice Bellard Releases MicroQuickJS

#407
post #399

Very excited about this. I was programming an ESP32 for a project recently and was like, computer chips are fast enough, why can't I just write TypeScript?

There is already Espruino[0], it’s more free in terms of syntactic support but it’s also bigger.

0: https://www.espruino.com/ESP32

Re: Fabrice Bellard Releases MicroQuickJS

#408
post #67

Earlier quoted context omitted.

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…

Thank you for sharing. A lot of HN people got cut by AI in one way or another, so they seem to have personal beefs with AI. I am talking about not only job shortages but also general humbling of the bloated egos.

I'm constanly encountering this "bloated ego" argument every time the narrative is being steered away to prevent monetary losses for AI companies.

Especially so when it concerns AI theft of human music and visual art.

"Those pompous artists, who do they think they are? We'll rob them of their egos".

The problem is that these ego-accusations don't quite come from egoless entities.

Re: Fabrice Bellard Releases MicroQuickJS

#409

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…

Python’s dicts for many years did not return keys in insertion order (since Tim Peters improved the hash in iirc 1.5 until Raymond Hettinger improved it further in iirc 3.6).

After the 3.6 changed, they were returned in order. And people started relying on that - so at a later stage, this became part of the spec.

Re: Fabrice Bellard Releases MicroQuickJS

#410
post #315

Earlier quoted context omitted.

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.

I could live with 1-indexing but a closed range array unpack (slices) is quite big toll and breaks nice intuitive invariant.
Post reply on HN