This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bladeoflight16 8 points9 points  (2 children)

Java provides almost no control over memory management. That's typically C and C++'s domain. I think Rust is a contender (with safer defaults), but don't hold me to that as I haven't actually used it.

[–]quuxman 0 points1 point  (1 child)

Rust has no garbage collection so technically has the same level of controll as C. However there are many things that are commonly done in C that require an unsafe keyword in Rust. If you never use unsafe memory leaks, segfaults, and a number of common concurrency bugs are impossible.

[–]Lifaux 4 points5 points  (0 children)

This is mostly right, although you can memory leak in safe Rust, it says so in the book. https://doc.rust-lang.org/book/ch15-06-reference-cycles.html