Could you compare it with Boa? It is written in Rust too. https://github.com/boa-dev/boa
I have some benchmark results here: https://ivankra.github.io/javascript-zoo/?v8=true It's impressively compliant, considering it's just a one man project! Almost as fully featured as Boa, plus or minus a few things. And generally faster too, almost double the speed of Boa on some benchmarks.
Brimstone: ES2025 JavaScript engine written in Rust
11–20 of 125 posts
Re: Brimstone: ES2025 JavaScript engine written in Rust
#12[flagged]
Re: Brimstone: ES2025 JavaScript engine written in Rust
#13[flagged]
Rust is not garbage collected unless you explicitly opt into using Rc/Arc
Re: Brimstone: ES2025 JavaScript engine written in Rust
#14Re: Brimstone: ES2025 JavaScript engine written in Rust
#15Boa: 23M Brimstone: 6.3M
I don't know if closing the gap on features with Boa and hardening for production use will also bloat the compilation size. Regardless, for passing 97% of the spec at this size is pretty impressive.
Re: Brimstone: ES2025 JavaScript engine written in Rust
#16Memory safety is one of Rust’s biggest selling points. It’s a bit baffling that this engine would choose to implement unsafe garbage collection.
If I were to write a toy JS runtime in Rust, I'd try to make it as safe as possible and deal with unsafe only when optimization starts to become necessary, but it's not like that's the only way to use Rust.
Re: Brimstone: ES2025 JavaScript engine written in Rust
#17Memory safety is one of Rust’s biggest selling points. It’s a bit baffling that this engine would choose to implement unsafe garbage collection.
The obvious use-case for unsafe is to implement alternative memory regimes that don’t exist in rust already, so you can write safe abstractions over them. Rust doesn’t have the kind of high performance garbage collection you’d want for this, so starting with unsafe makes perfect sense to me. Hopefully they keep the unsafe layer small to minimise mistakes, but it seems reasonable to me.
Re: Brimstone: ES2025 JavaScript engine written in Rust
#18"Compacting garbage collector, written in very unsafe Rust" got me cracking.
Re: Brimstone: ES2025 JavaScript engine written in Rust
#19"Compacting garbage collector, written in very unsafe Rust" got me cracking.
Sorry for the offtop, but I really miss the cracktros. Imagine having Ikari intro before you boot into your OS.
Re: Brimstone: ES2025 JavaScript engine written in Rust
#20Earlier quoted context omitted.
The obvious use-case for unsafe is to implement alternative memory regimes that don’t exist in rust already, so you can write safe abstractions over them. Rust doesn’t have the kind of high performance garbage collection you’d want for this, so starting with unsafe makes perfect sense to me. Hopefully they keep the unsafe layer small to minimise mistakes, but it seems reasonable to me.
I'm curious if it can be done in Rust entirely though. Maybe some assembly instructions are required e.g. for trapping or setting memory fences.