2 ms·
Memory allocation management should not be a big deal, and it is not the kind of problem that can easily be solved at the language level. Correct memory manage
by stephc_int13 7y ago
Memory allocation management should not be a big deal, and it is not the kind of problem that can easily be solved at the language level.
Correct memory management needs information on the allocation context, in some cases, it can be handled automatically by a framework (like a game engine) or manually by the coder, but it is really cumbersome to force this into the language...
In my opinion, garbage collection is a bane.
- mruts 7y agoFunctional 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).