Re:Bun v0.8.0
by geodel on Thursday August 24, 2023 @01:39AM
(#37245401)
That will be your opportunity to open issue on project about RIIR (Rewrite It In Rust).
[ Parent
| on HN ]
Re:Bun v0.8.0
by satvikpendem on Thursday August 24, 2023 @01:44AM
(#37245432)
There's Deno already if someone really wants their JS runtime in Rust. Personally, since everything just runs on a JIT JS runtime anyway, I don't really see to much of a difference between Node, Deno, and Bun, it's not like the JS is being AOT compiled via Zig or Rust, which would be very interesting, you could basically treat JS as a compiled language rather than an interpreted one, even if the JIT is already fast.
> it's not like the JS is being AOT compiled via Zig or Rust
That would actually be slower than what you get from a JIT compiler.
Re:Bun v0.8.0
by satvikpendem on Thursday August 24, 2023 @06:28AM
(#37247186)
I meant the compiler written in a lower level language that then binds to LLVM, as Rust is currently. Why would AOT be slower than JIT?
In theory it could be: compiling for the specific latency profile and instruction-set of each individual machine. In practice that has never been done.
Why would the implementation language matter for the compiler? It is a traditional input-output algorithm, it is either good and does many fancy optimizations for good output, or it isn’t. Sure, the speed of compilation may vary, but that’s a different question.
Also, JS being such a dynamic language, it will likely perform better with a speculative JIT compiler, e.g. a shape can be assumed for a frequently used object. This is only possible with PGO to a degree.