Live data from Hacker News

QuickJS JavaScript Engine

bellard.org

41–50 of 279 posts

Re: QuickJS JavaScript Engine

#41
post #15

Would it be possible to compile a nodejs app to a binary with this? If so, would performance be any better?

It would have a much lower memory and binary size impact. If your program is short-running, it could also be faster.

Re: QuickJS JavaScript Engine

#42
post #37
post #25

Is there anything that Fabrice can't do? I mean, FFMpeg is almost a PhD thesis in and of itself, and he still manages to find time to make TinyC, QEMU, and now this. To say I'm jealous of his skills would be an understatement.

Also the x86 emulator in JS that can run windows 2000 on a browser canvas.

Before that, there even was a third party demo of QEMU running in the browser using PNaCl. Right after PNaCl died, jslinux popped up to continue the legacy, but with even more awesomeness.

Re: QuickJS JavaScript Engine

#43

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

Can you really put a number on this level of skill and productivity?

Re: QuickJS JavaScript Engine

#44
I like that Bellard released the source code in old school tar format rather than on github. The world's code collaboration platform is of little use to the world's best programmer.

Hopefully QuickJS won't discourage the author of Duktape from making future releases of his incredible small low-memory JS engine.

Re: QuickJS JavaScript Engine

#46

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

That's a pretty standard range for high level consultants. Bellard can definitely bill well above that, if there are tasks that require his talent.

Re: QuickJS JavaScript Engine

#47

I'm curious as to how the reference counting works in this. Is it comparable to what's used in Swift? How is it compared to the methods typically used in V8 and Spider Monkey?

This is a very broad question. Garbage collection is a large topic. The general consensus is that reference counting methods give typically lower throughput than heap scanning methods but (I think) lower total memory usage and more predictable performance. They do bookkeeping on every free whereas a heap scanning gc will typically do bookkeeping in small incremental bits on alloc and mainly on gc cycle (when space ru…

Would also be interesting to see how this GC runs in threaded or multi-instance environment. For example, Nim (the language) can produce libs by having them link to one dynamic lib containing the RT. Other compilers, like Crystal, don't support this outright.

Re: QuickJS JavaScript Engine

#48

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

There's at least two years of work in there as Fabrice Bellard's side project. This would mean about ~10-15 man-years of full-time work for a small team of experienced engineers, which is about what it took for jerryscript:

https://github.com/jerryscript-project/jerryscript

Granted, the targets aren't exactly the same (micro-controllers vs very small lib), but benchmark differences are impressive:

https://bellard.org/quickjs/bench.html

Re: QuickJS JavaScript Engine

#49
post #30

Earlier quoted context omitted.

Couldn't you replace v8 with this and recompile the node binary? If it passes 100% ECMAScript tests, that should mean it's a drop-in replacement for v8. Correct me if I'm wrong.

fs/net and some other important pieces of Node.js are written as C++ addons for v8, hooking them would be very difficult I guess. Though Microsoft have been working on this for their ChakraCore engine. There was a conflict if I recall correctly, Microsoft suggested to add another abstraction layer to make hooking other JS engines easier but Node.js team refused it. I might not know that situation very well. But I hav…

How could we easily expose syscalls to `qjs`? Deno is just a Rust IPC/syscall layer glued to V8 really...

Re: QuickJS JavaScript Engine

#50
post #23
post #20

I just tried building this on my Mac and it looked initially like it all was building fine, but it eventually failed when building qjs32. Thinking this probably didn't matter much I went ahead and ran `./qjs examples/hello.js` which worked as advertised – cool! Tried `./qjsbn examples/pi.js 5` and it worked as well – very cool! Then I tried `./qjs examples/hello_module.js` and got this: SyntaxError: unsupported keywo…

Try adding the `--module` flag [1]. JS now has two different grammars, script and module, and the `import` keyword is only allowed in module code. [1] https://bellard.org/quickjs/quickjs.html#qjs-interpreter

Ah yes of course – thanks, works as advertised now! :o)

Really cool stuff!

Post reply on HN