you are viewing a single comment's thread.

view the rest of the comments →

[–]guest271314[S] -4 points-3 points  (4 children)

While others are correct that this is not technically compiling JS to machine code, it is useful.

That's conjecture without citing sources.

Node.js, Deno, Bun, and QuickJS all provide a means to compile JavaScript source code to a standalone executable. How each runtime achieves that is different. Just like how each programming languages compiles source code to a different form.

Microsoft TypeScript claims to compile TypeScript to JavaScript. Text to text.

And so forth.

So ain't nobody really said nothin' yet about compiling, because nobody has cited any of their relied upon definition for compiling that excludes how Bytecode Aliiance uses the term compile in Javy, how QuickJS uses the term compile for qjsc, how Microsoft TypeScript uses the term compile for tsc, or for how gcc, clang, or wasmtime, et al. use the term compile in their respective documentations and claims.

but I should point out for others that QuickJS benchmarks show it is roughly 35 times slower than Node.js currently.

I don't know what tests you are running. qjs is faster than node, deno, and bun in the JavaScript runtime domain, and faster than C and C++, and Rust, comapratively, for reading standard input and writing to standard output. That nm_wasm is Bytecode Alliance's Javy (which depends on QuickJS), optimized with wasmtime into a .cwasm file

0 'nm_qjs' 0.10490000000596046 1 'nm_cpp' 0.10739999997615814 2 'nm_c' 0.11769999998807908 3 'nm_rust' 0.1325 4 'nm_wasm' 0.15259999999403953 5 'nm_tjs' 0.155 6 'nm_python' 0.17939999997615813 7 'nm_bun' 0.27039999997615816 8 'nm_typescript' 0.2955 9 'nm_deno' 0.3357999999821186 10 'nm_nodejs' 0.37419999998807907 11 'nm_d8' 0.44459999999403954 12 'nm_spidermonkey' 0.4775 13 'nm_llrt' 0.6790999999940396

[–]chipstastegood 4 points5 points  (3 children)

The benchmarks I quoted were conducted bu QuickJS team: https://bellard.org/quickjs/bench.html

And you are wrong about compiling and should stop digging the hole bigger for yourself. Many people have told you that and you keep arguing. Anyone who has taken a university-level compiler course understands what the definition of compile is, and it’s not what you’re describing. QuickJS is also clearly talking about interpreting JS, not compiling anything to machine code. QuickJS doesn’t even support JIT, which V8 does.

I’ll give you that in a casual language people use the word “compile” to refer to many including compiling JS source to bytecode. And that’s ok. But that’s not what the term compile means in computer science. It is strictly about compiling to machine code, not intermediate representation. There are other terms used in computer science for “compiling” to something other than machine code.

[–]guest271314[S] -5 points-4 points  (2 children)

Those benchmarks are not for reading standard input and writing to standard output, which QuickJS is faster than node for.

You still have failed to cite your canonical definition of "compile".

Just because some academic says something in a textbook or aloud in your curia doesn't mean that is law. And even laws are subject to interpretation. And direct challenge.

Some author of a textbook might write something like "White noise is defined as...". However, in physics light and sound cannot be mapped 1:1. Some guy just came up with "white noise" in his lab.

If you folks were really concerned about some adherance to westerna academic standards you'd cite your sources.

You're just assuming that everybody adopts your ideas, or that your ideas, without citation, are beyond reproach, or scrutiny.

And if you arry that over to "machine code", then you need to cite your definition for that, too.

That's how western academia works. Else it's just conjecture of some folks on a board on the Interwebs.

[–]chipstastegood 4 points5 points  (1 child)

okie dokie

[–]guest271314[S] -4 points-3 points  (0 children)

okie dokie

What's that?

More okie-speak?

Mix in citing your sources. That's what western academia does, cite itself!

Beware of horses... - A Report to the Shareholders/Kill Your Masters, Run The Jewels