3 ms·
I use C for very-soft real-time, and have very little memory management code in practice. I think you're misrepresenting the situation about control. With C, y
by Peaker 15y ago
I use C for very-soft real-time, and have very little memory management code in practice.
I think you're misrepresenting the situation about control. With C, you can (and indeed sometimes do) manage a list of things to "free later". You have full control over when to free things.
I use GC'd languages too, plentifully, and agree that GC beats a lot of the average manual memory managed code. People using C write a lot of unnecessary mallocs/frees. But I don't think GC would work well for the kind of code I work on.
If I wanted a high-performance GC'd language, why would I use Go and not Haskell?
- sambeau 15y agoFair point about Haskell. Horses for courses. I love the simplicity of Go. Haskell's simplicity breaks for me around the point that I have to use a Monad: brain splosions.
- Peaker 15y agoA Monad is pretty simple. class Monad m where return :: a -> m a (>>=) :: m a -> (a -> m b) -> m b and the left-neutral/right-neutral/associativity laws: x >>= return = x return x >>= f = f x x >>= (\v -> y v >>= z) = (x >>= \v -> y v) >>= z Last law can be expressed more easily if you define: (f >=> g) x = f x >>= g Then you can say: (f >=> g) >=> h = f >=> (g >=> h) How complex is that?