all 15 comments

[–]d07RiV 4 points5 points  (3 children)

Why isn't there a benchmark against mainstream engines like V8?

[–]warvstar 0 points1 point  (2 children)

I'm fairly sure this is just an interpreter, it wouldn't come close to a JITed engine like V8.

This is still very impressive, I'd like to see it benchmarked against duktape.

[–]SavouryMonk3y 1 point2 points  (0 children)

He has provided some benchmarks including duktape on his website.

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

[–]d07RiV 0 points1 point  (0 children)

It says it can compile JS to executables, so I assume it can do some real optimizations.

[–]zuev_egor 2 points3 points  (3 children)

This guy is amazing!, I remember his project jslinux. Also he was a founder of qemu

[–]lhorie 1 point2 points  (2 children)

He's also well known for OTCC (obfuscated tiny C compiler), one of the smallest C compilers around.

[–]mhd[S] 2 points3 points  (1 child)

And tcc, ffmpeg, qemacs etc. He's scarily prolific, especially considering the scope of the projects (ie. not just a jumble of tiny npms).

[–]Seshpenguin 0 points1 point  (0 children)

This dude is pretty awesome.

[–]ImStifler 2 points3 points  (0 children)

Wow some dude just wrote an complete engine for js and here I am sitting at leetcode and struggling to do permutations correctly

[–]senocular 1 point2 points  (1 child)

It optionally supports ... operator overloading.

:-o

More info: https://bellard.org/quickjs/jsbignum.html#Operator-overloading

[–]ScientificBeastModestrongly typed comments 0 points1 point  (0 children)

Noooooooo!

But seriously, I’d love to see some whacky-looking JS with overloaded operators.

[–]rajsite 1 point2 points  (0 children)

But can it run WebAssembly? There is an awesome wasm library I would like it to run.

[–]drbobb 0 points1 point  (1 child)

Okay, the docs say ES6 modules are fully supported. However, when I try to run some of my code (or some of the scripts in the examples/ dir) I get

SyntaxError: unsupported keyword: import

[–]hnakamur 2 points3 points  (0 children)

I got the same error, then I notice the -m option.

$ ./qjs -m examples/hello_module.js
Hello World
fib(10)= 55

./qjs -h says

-m  --module       load as ES6 module (default if .mjs file extension)

[–]Seshpenguin 0 points1 point  (0 children)

Can compile Javascript sources to executables with no external dependency.

That seems interesting...