I've seen several times freelist management packages in projects I've worked on or looked at or used. You can turn off GC with Go, but at that point nothing will get deallocated, so everything has to be reused.

As such, it's not as well suited to embedded or kernel development.

There is an embedded version, "tinygo", that uses other memory management strategies in its much smaller runtime.

I really don't see there being that many cases that can't be faster built and easier to maintain with the help of GC though. Kernels, and minimalistic, embedded apps (think arduino).

The guys who invented Go were 30 year+ veterans of C and C++ programming, one of them even was the co-inventor of C, Ken Thompson. IMO, if they said use GC, then a lot of other people don't know what they are talking about.

Go, like Rust, it is practically impossible to have a stack smashing or other memory allocation error vulnerability. One you can pick up and run with, build something useful in your first weekend with it, the other, you will still be scratching your head 3 months down the track trying to remember everything you have to memorise to use Rust's memory allocation system.

Reply to this note

Please Login to reply.

Discussion

GC vs Borrow checker is down to trade-offs. The former is a well proven strategy, probably easier to implement and less verification work for the compiler. For the time Go was released, it's understandable they went with GC.

Agree on the learning curve.

Would be interesting to see a third language, striving for simplicity and fast compilation but with borrow-checking.

Indeed.