Live data from Hacker News

QuickJS JavaScript Engine

bellard.org

61–70 of 279 posts

Re: QuickJS JavaScript Engine

#62
post #52

Earlier quoted context omitted.

Yeah... his current employer already does.

Do you know who his current employer is (if any)?

He has his own company now with another partner (https://www.amarisoft.com/) where they work on and distribute the LTE software he wrote.

Re: QuickJS JavaScript Engine

#64
post #40

Earlier quoted context omitted.

Apparently the garbage collection algorithm is reference counting with cycle removal: https://bellard.org/quickjs/quickjs.html#Garbage-collection . Swift does pure reference counting, relying on the programmer to annotate references so that there are no cycles (which is untenable in JavaScript, due to the way the language is designed).

Curious what ”The cycle removal algorithm only uses the reference counts and the object content” means in practice. Is it based on some well known algorithm?

From the description it's probably a Bacon cycle collector. The basic idea is that it checks to see whether reference counts for all objects in a subgraph of the heap are fully accounted for by other objects in that subgraph. If so, then it's a cycle, and you can delete one of the edges to destroy the cycle. Otherwise, one of the references must be coming from "outside" (typically, the stack) and so the objects cannot be safely destroyed. It's a neat algorithm because you don't have to write a stack scanner, which is one of the most annoying parts of a tracing GC to write.

Re: QuickJS JavaScript Engine

#65

This man is a wizard. You can also thank him for ffmpeg and qemu. A company I worked for once tried to hire him as a consultant because he had implemented an LTE BTS in software. Is there anything he hasn't done? EDIT: tombert beat me to it[0] by a couple minutes. [0] https://news.ycombinator.com/item?id=20413498

He's probably worth $300-$500/hr if not $1k...

Any FAANG would happily pay him a 7 figure salary if he was interested.

Re: QuickJS JavaScript Engine

#67

quickjs.c is a 47,842 line C file. I think that sets the record for the largest handwritten file I've seen.

Is it hand-written as a single file, though? I'm assuming the release is the output of some script that does concatenation.

Some editors, like Emacs, make it very easy to work with one huge file, because you can have multiple independent views ("windows" in Emacs parlance) into the same file. It is - or maybe has been - quite common to work like this in LISP communities.
Post reply on HN