4 ms·
Many languages provide memory safety. None of them--none in popular use, anyway--have manual memory management. Granted, most applications that are written in C
by thirsteh 14y ago
Many languages provide memory safety. None of them--none in popular use, anyway--have manual memory management. Granted, most applications that are written in C today don't actually need manual memory management.
- pcwalton 14y agoRust provides safe manual memory management.
- thirsteh 14y agoFair enough. Can you turn off the gc/explicitly free everything? If not, then e.g. Go provides the same kind of memory management, i.e. controlling the layout of objects in memory. It would probably be helpful to define what I mean by memory management: controlling allocs and frees. If Rust provides this, great. (Sorry, I don't know Rust very well.) Then your plug is certainly warranted.
- pcwalton 14y agoYes, you can write code without ever using the GC. You have to opt-in to use the GC by using the GC'd types, which are not the default. Rust never implicitly promotes anything to the garbage collected heap. There's a compiler lint mode you can turn on that verifies that you don't ever use the GC. Allocation and freeing can be done manually, using unique pointer types (like std::unique_ptr in C++, except the compiler verifies that it's safe).
- thirsteh 14y agoVery cool. Thanks.