Live data from Hacker News

Brimstone: ES2025 JavaScript engine written in Rust

github.com

41–50 of 125 posts

Re: Brimstone: ES2025 JavaScript engine written in Rust

#41

Why is stuff written in rust always promoted as "written in rust" like its some magic thing?

In the case of libraries, this distinction is important; we've set up our computing infrastructure in a way replete with barriers which and drive repeated efforts in isolation. Therefore, if a library is written in Rust, it suggests that I can use it in my Rust program clear of a conspicuous barrier type.

For an application, service, etc like this... it is not relevant.

Re: Brimstone: ES2025 JavaScript engine written in Rust

#42

Why is stuff written in rust always promoted as "written in rust" like its some magic thing?

I think the idea is like: it took extra work 'cause Rust makes you be so explicit about allocations and types, but it's also probably faster/more reliable because that work was done.

Of course at the end of the day it's just marketing and doesn't necessarily mean anything. In my experience the average piece of Rust software does seem to be of higher quality though..

Re: Brimstone: ES2025 JavaScript engine written in Rust

#44

Why is stuff written in rust always promoted as "written in rust" like its some magic thing?

It carries some weight, very roughly in the direction of formal verification. Since (assuming there isn't any unsafe), a specific class of bugs are guaranteed to not happen.

However, this repo seems like it uses quite a bit of unsafe, by their own admission.

Re: Brimstone: ES2025 JavaScript engine written in Rust

#45

Why is stuff written in rust always promoted as "written in rust" like its some magic thing?

[flagged]

The virtue of being memory safe is probably more a value than a virtue.

Also, without associated social virtue signaling, what do you think is wrong with signaling?

Re: Brimstone: ES2025 JavaScript engine written in Rust

#46
post #13
post #8

[flagged]

> who in the fuck would write a garbage collector using garbage collected Rust? Rust is not garbage collected unless you explicitly opt into using Rc/Arc

If you count Rc/Arc as garbage collection you should count RAII + The Borrow Checker (i.e. all safe rust) as garbage collection too IMHO. It collects garbage just as automatically - it just does so extremely efficiently.

That said I tend to count neither. Garbage collection to me suggests you have something going around collecting it, not just you detect you're done with something when you're done with it and deal with it yourself.

Re: Brimstone: ES2025 JavaScript engine written in Rust

#47
post #25

Just a small comparison, compiled for release: Boa: 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.

It looks like Boa has Unicode tables compiled inside of itself: https://github.com/boa-dev/boa/tree/main/core/icu_provider Brimstone does not appear to. That covers the vast bulk of the difference. The ICU data is about 10.7MB in the source (boa/core/icu_provider) and may grow or shrink by some amount in the compiling. I'm not saying it's all the difference, just the bulk. There's a few reasons why svelte little exec…

Unicode is everywhere though. You'd think there'd be much greater availability of those tables and data and that people wouldn't need to bundle it in their executables.

Re: Brimstone: ES2025 JavaScript engine written in Rust

#48

how does this compare to existing JS engines?

You can embed this one in your Rust programs. No linking to C/C++. All native Rust.

That little 40 mb single binary server you wrote can now be scripted in JavaScript.

This is frankly awesome, and now there are multiple Rust-native JavaScript engines. And they both look super ergonomic.

Re: Brimstone: ES2025 JavaScript engine written in Rust

#49

Earlier quoted context omitted.

IMO the memory safety aspect is overblown by enthusiasts and purists. Rust is an overall nice fast imperative language.

Rust WAS really nice before it got mangled with syntax like we never seen before. Graydon did not imagine rust as what it is today. Rust core wo. async is ok, but in practice rust projects tend to have hundreds of deps and really slow compiles. Its just like javascript with npm.

> in practice rust projects tend to have hundreds of deps

That's really just any language with a built-in package manager. Go somewhat sidesteps this by making you vendor your dependencies, but very few other languages escape the ballooning dependency graph.

Re: Brimstone: ES2025 JavaScript engine written in Rust

#50

Why is stuff written in rust always promoted as "written in rust" like its some magic thing?

I think the idea is like: it took extra work 'cause Rust makes you be so explicit about allocations and types, but it's also probably faster/more reliable because that work was done. Of course at the end of the day it's just marketing and doesn't necessarily mean anything. In my experience the average piece of Rust software does seem to be of higher quality though..

Even forgetting the memory safety and async safety guarantees, the language design produces lower defect code by a wide margin. Google and other orgs have written papers about this.

There are no exceptions. There are no nulls. You're encouraged to return explicit errors. No weird error flags or booleans or unexpected ways of handling abnormal behaviors. It's all standardized. Then the language syntax makes it easy to handle and super ergonomic and pleasurable. It's nice to handle errors in Rust. Fully first class.

Result, Option, match, if let, if let Ok, if let Some, while let, `?`, map, map_err, ok_or, ok_or_else, etc. etc. It's all super ergonomic. The language makes this one of its chief concerns, and writing idiomatic Rust encourages you to handle errors smartly.

Because errors were so well thought out, you write fewer bugs.

Finally, the way the language makes you manage scope, it's almost impossible to write complicated nesting or difficult to follow logic. Hard to describe this one unless you have experience writing Rust, but it's a big contributor to high quality code.

Rust code is highly readable and easy to reason about (once you learn the syntax). There are no surprises with Rust. It's written simply and straightforwardly and does what it says on the tin.

Post reply on HN