Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Rust’s scoping rules prevent most double free errors. You can get them with certain techniques but it’s also possible, say, use JNI to shoot yourself in the foot, too.

Basically, I’d say that at fond point this gets to be a lot more complicated because you’re talking about which sets of features & cultural practices make you more or less likely to make exploitable errors. Does using a GC buy you enough to balance out the complexity fetish common in the open source Java world? Which is safer probably depends on what type of projects you work on.



It’s just a weird argument to hear someone argue “does GC buy you enough to balance out the complexity…”

Isn’t the whole argument rust vs C++ that rust gives you memory safety even though it’s more complex?

Like if you can tolerate memory issues all of the sudden to avoid complexity then there was no argument against C++ in the first place.


Note that the sentence continued to describe common open source libraries. Rust code may or may not be more complicated than the core Java language but Java as practiced by many people has lots of heavyweight dependencies with various patterns and conventions you have to understand to use them correctly. It's not a linear relationship but the more code you're running the more likely it is that you have something unsafe.

That's also why I mentioned culture: for various reasons, a lot of Java programmers sought ways to make tons of behaviour configurable which also means that there's both plenty of scope for log4j-style mistakes and lots of optional behaviours which might be exploitable even if few people use them. Rust's culture tends not to encourage that kind of thing as much so even though certain types of errors are possible in any language they're not equally common.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: