2 ms·
Functional programming can’t really exist in any meaningful way without GC. If you’re not a FP developer, it’s easy to think that memory allocation falls into t
by mruts 7y ago
Functional programming can’t really exist in any meaningful way without GC. If you’re not a FP developer, it’s easy to think that memory allocation falls into two categories: a) short-term objects that can be allocated on the stack, or b) long-term objects that the lifetime of can be tracked easily. But with FP a lot of short-term garbage is created that isn’t known at runtime, thus necessitating GC.
I program professionally in Scala and without GC, the paradigm of strong FP would be (almost) impossible. Fortunately, the JVM handles this pretty exceptionally.
I think a GC in hardware is a fantastic idea and hope Intel and others incorporate it into x86-64. I don’t know how practical this is as I’m not a hardware guy, but a hyper-efficient pauseless concurrent GC that could keep garbage out of the cache sounds like a massive win in my book.
- weberc2 7y ago> that isn’t known at runtime Typo: s/runtime/compile time Also, this isn't particular to FP; every style of programming requires dynamic memory management for real-world programs (modulo pedantry about embedded programming).