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

How is a software written in Java having less assurances in terms of leaks/crashes etc compared to Rust? All Rust gives you is a borrow checker that isn't very smart, but means you don't need GC/VM, so you gain a bit of performance compared to Java.

But if it's not software that needs to go fast, then Rust is not adding anything for you. And if you considered Java to begin with you probably don't need top tier performance.



The parent didn’t suggest Java is less safe; their point is “Java is safe; C++ is fast; Rust is both” and they just phrased it unclearly


The most notable advantage of Rust compared to GC languages is low and stable memory use and predictable performance, that will not generally drop due to some random GC pause. Both of these can be of interest even wrt. software that doesn't "need to go fast" in any absolute sense.


This is a persistent myth that’s only true if your performance model requires persistent latency and, even then, only if you’re careful to pay attention to how much is freed or allocated as you change scopes. The lifetime tracking features of Rust’s type system have non-negligible impacts on the sorts of abstractions you can make.


Sure, there is one abstraction that effectively requires GC, namely a general graph of spaghetti references where you can't possibly predict in advance or "pay attention" to" how much is freed or allocated as you change scopes". Many GOFAI problems look like that which is why GC was initially developed in the context of LISP, the most prominent language for GOFAI. But for most real-world programs you can do vastly better than that.




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

Search: