Hacker News new | ask | show | jobs
by dustedcodes 617 days ago
Why does it matter if it’s written in Rust?
5 comments

Rust gives you the performance of C++ if not better sometimes, with code that won't go haywire at the 11th hour. There is value in that, particularly in an application that's sole purpose is to load arbitrary stuff from the internet.

Also if it was written in anything else, it probably wouldn't get the coverage it gets ;)

Rust was invented to make it easier to write a secure, performant browser engine
It's funny; I wish Rust was better suited for bare metal than it is now. But no matter how much people perceive Rust as a bare metal language like C, it was quite literally made for a level or two above that, in browser engines.

(Here's to hoping Rust for Linux continues to drive progress for bare metal Rust!)

Projects written in Rust tend to be very fast - as fast as C++ or C code - but without the endless security issues.

You may as well ask "why does it matter if this bridge is made of iron".

There are long lasting bridges made of stone, concrete and in the right climates, even wood. Not to mention rope when it suits the purpose.

Each material has its own qualities, which means its own pros and cons in a given context.

This naive belief that there will be one language to rule them all (and is name is <fill-in-the-blank> ignores history and the world outside of programming in a rather silly way.

> There are long lasting bridges made of stone, concrete and in the right climates, even wood. Not to mention rope when it suits the purpose.

I'd be fine with someone building a new browser out of stone, concrete, wood, or even rope.

Just don't build it out of C/C++ because those languages aren't memory safe.

Rust is a risk-reduction strategy. It is not a risk-elimination strategy.

There are risk-reduction strategies one can follow with C++, which offer some fraction of the reduction that Rust does (opinions vary on the value of the fraction). Rust enforces risk-reduction strategies, which in some contexts may be of value all by itself.

Language choice does not eliminate risks in software.

> opinions vary on the value of the fraction

They don't really. It's been shown by many studies that 2/3 of security bugs are memory safety errors. That's the minimum that Rust can eliminate.

It actually should eliminate more because it also has the strong type system and tree-ownership style that help reduce the chance of logic bugs unrelated to memory safety too (similar to Haskell and other very strongly typed languages).

This is probably the biggest data set:

https://security.googleblog.com/2024/09/eliminating-memory-s...

Unfortunately they don't break out non-memory safety vulnerabilities, but they've almost eliminated memory safety vulnerabilities by writing new code in Rust.

Nobody is saying that. But to continue your analogy, do you not think that in a world where all the bridges are made of wood it would be notable to say that a new bridge is made of steel?

Of course there are impressive projects made with C. But we generally don't build large bridges out of wood anymore do we.

> do you not think that in a world where all the bridges are made of wood it would be notable to say that a new bridge is made of steel?

Notable, sure. But it could turn out to be Tacoma Narrows bridge.

We never did build large bridges out of wood, I think. For the right context, wood is still a preferred material for some bridges.

> We never did build large bridges out of wood, I think.

Yes we did. They just haven't survived. For example London Bridge was "various wooden bridges, AD 50 – 1176".

I guess "large" has a bit of wiggle room built in.
Try your best to ignore the rewrite-it-in-Rust people. They're just plain wrong for that. But yes, for a niche like browser engines, Rust is pretty darn well suited.
1) I suspect that it's important for potential contributors to know what language it's written in.

2) It mattered enough for you to complain about it for some reason, so look at that reason, then look at its reflection.

Huh, Complain??
A few thing from the top of my head:

- Might be interesting to integretors (FFI, dylib, Rust projects)

- Signals some characters: that it's probably safer than alternatives written in non memory safe languages in same class, has good performance

- Might attract contributors (ie I'm sure there's an intersection of people passionate abou the web and Rust)

- This is hacker news, so it might earn a few extra +1s :P

Edit: formatting