3 ms·
There are very few mainstream languages without GC. Really, I’m thinking C, C++ and Rust, plus no doubt other interesting but less popular ones. C++ is immense
by rich_sasha 5y ago
There are very few mainstream languages without GC. Really, I’m thinking C, C++ and Rust, plus no doubt other interesting but less popular ones.
C++ is immensely complex. The amount you need to grok is very significant.
I wonder if that is somehow a necessary feature of a performant, GC-free, optionally low level language.
Could you, for example, create something with the simplicity of Go, (most of) the speed of C/C++, and no GC? What would it look like?
I’ve never written a line of Rust so no idea there.
- jimbob45 5y agohttps://nim-lang.org/ https://nim-lang.org/ The C++ language designers have made a terrific language with the ergonomics of a four-fingered glove. Nim fits your criteria but doesn’t have the popularity of C++.
- rich_sasha 5y agoI like the look of Nim, but it is GC based so not quite what I’m musing about here.
- jimbob45 5y agoI’m sorry, I thought Nim didn’t have a GC. Now that I’m doing a bit of research, I’m wondering what ever gave me that thought.
- cb321 5y agoNim has a variety of automated memory management strategies (more or less optional depending upon how much the stdlib and other libs matter to you). It has even recently renamed its --gc compile option to --mm to try to reduce confusion.
- zozbot234 5y agoC++ and Rust are not so much "without GC" as "with optional, limited GC". Reference counting is a kind of GC, and is available out of the box in both C++ and Rust.
- rich_sasha 5y agoMy point is, their are both so complicated because they are built around the idea of routine use without GC. Yes you can optionally have GC but it’s like saying you can tow a car. Yes you can, but the whole point of a car is to be self-propelled.
- kjeetgill 5y agoSimilarly to how C++ and Rust fill an overlapping space I think Zig has shown tremendous promise developing a similar relationship with C in the GC-less language space. If you're looking for a modern, GC-less go I think it'd be your best bet unlike, say Nim, which tries to be it's own language on the syntax side too much. Zig just feels like C, but with the semantics firmed up a bit.