Re:Two years of Rust
by int_19h on Tuesday May 16, 2017 @11:00PM
(#14355291)
Yes, a lot of C++ code out there can be rewritten with GC. But for a language to replace C++, it has to cover the full spectrum, and that includes GC-less operation for low-level components. Providing primitives to manually allocate memory on unmanaged heap is not sufficient - the language must allow running without GC at all.
[ Parent
| on HN ]
Re:Two years of Rust
by nickpsecurity on Wednesday May 17, 2017 @12:46PM
(#14360231)
It does. It just isn't safe. The extra primitives for safer handling of pointers are main advantage of C++, D, Rust, etc. A worthwhile re-incarnagion of Modula-3 should have something similar.
So the standard library doesn't rely on GC semantics anywhere?
As I recall, that's the main problem with D: the standard library basically requires GC. Your code might not require it, but the library is always there. On top of that, it's just too easy to accidentally involve GC by using reference types.
Re:Two years of Rust
by nickpsecurity on Wednesday May 17, 2017 @11:02PM
(#14364548)
Actually, I dont know. Good question. I tried to quickly get the info but all I found was about I/O. It's done UNSAFE to use platform-specific ways of reducing overhead. Probably no GC semantics there. Anyone curious who can get some Modula-3 source for stdlib might just look to see if UNSAFE is at the top of the routines. Also, if that turns off the GC, Id reason that just putting it in front of a stdlib function that was GC'd might make it work without it unless they screwed up memory management in the code itself.