4 ms·
this is exactly how I feel! in school, the idea of pool/arena allocators wasn't touched upon at all—the options, as I was presented them, were either "manual me
by adamrezich 3y ago
this is exactly how I feel! in school, the idea of pool/arena allocators wasn't touched upon at all—the options, as I was presented them, were either "manual memory management" (malloc/free/new/delete), "RAII" (smart pointers), or "garbage collection". I had not heard of the concept of "lifetimes", outside of scopes when using RAII, until later, and even then probably only after Rust made that be like it's whole thing.
nobody ever told me, check it out, it's not hard to make like the dumbest possible "bump allocator", where you allocate a hunk of memory and dole it out bit by bit as the application requests it, and then later you can just free the whole hunk at once… or even just move the bump pointer back to the start, and reuse it next frame/request/etc.! that's like 95+% of the reason why people reach for things like garbage collection to begin with, and it seems so obvious in hindsight!
actually, it was this top-shelf HN comment that really spelled it all out for me, and again, it all seems so obvious in hindsight: https://news.ycombinator.com/item?id=26443768&p=2#26451692 https://news.ycombinator.com/item?id=26443768&p=2#26451692
- notacoward 3y agoPretty awesome to see Andy Kelley, Steve Klabnik, and Joe Blow all writing at length about this stuff in one thread, isn't it? In a way, that was my original point. I didn't come here to say it's wrong for Cakelisp to forego tracing GC in favor of nothing at all, but just that the rationale - and maybe compatible solutions to common issues with that approach - should be explained better. I hope the author takes that to heart, because (as plenty of other comments here indicate) without explanation it's a blocker for many people.