3 ms·
Would love this. I know it's not "easy" but would love to have a "delete" keyword.
by pcunite 11y ago
Would love this. I know it's not "easy" but would love to have a "delete" keyword.
- MichaelGG 11y agoOffering manual memory management would be a huge win. Even if it's just hints. For instance, if a function was pure, then we know the arguments to it can't escape. So suddenly we can safely allocate many things right on the stack. This can be a huge win in high perf scenarios. I'd also love an arena system, so I could provide a context and allocate objects in it and enforce they never leak. (Say, per request in an HTTP app.) Then the GC could just free that chunk in one go, no matter how much garbage I've loaded in it. I know that generational GC is supposed to handle this in general, but it isn't free, plus fails when some requests take a long time (and thus all their stuff gets promoted).