3 ms·
> it's to be as safe as those without GC - primarily for the sake of using it in a Javascript runtime and not having to run two GCs That's not actually the rea
by gsnedders 10y ago
> it's to be as safe as those without GC - primarily for the sake of using it in a Javascript runtime and not having to run two GCs
That's not actually the reason why Rust doesn't have a GC, nor it the reason why Servo doesn't have a GC. (It's worthwhile remembering that Rust predates Servo, and it has always been a goal to not require a GC.)
The reason why there's such a big desire to avoid GC is to have predictable memory layout and to avoid the overhead of the GC. In a browser, having predictable memory layout is important to be able to control memory usage, as well as for performance.
> Personally I think the Internet will become both more vital and more hostile: the security requirements of a web browser are a canary for things that will become requirements for every program in 5 or 10 years' time. Mozilla started Rust because they couldn't write a safe enough browser in C++. That should be a warning to anyone who wants to continue using the language.
With the proviso that Rust predated Mozilla's involvement and any attempt to write a browser in it, I totally agree. The fact that no browser vendor has managed to write a secure piece of software is pretty damning—these aren't small applications written by small teams, these are big applications written by very well funded development organisations which absolutely have the budget to do plenty of work to ensure their products are secure.