3 ms·
You could write everything if you refactor to continuation passing style
by skew-aberration 18d ago
You could write everything if you refactor to continuation passing style
- eyegor 18d agoMight as well go back to ye olden days and put 100% of your memory in a giant preallocated block and instead of stack locals you just use the block. No allocation cost at runtime, cheese benchmarks by making the super arena.
- omoikane 18d ago> Might as well go back to ye olden days and put 100% of your memory in a giant preallocated block I do that for the Playdate: statically allocate most of the large structures and tables in global variables, and don't call malloc or free after initialization is done. I also put some things on the stack, not so much because I need to dynamically allocate or free something, often it's because I get lower access latency to the stack compared to main memory (because stack lives inside ARM's tightly coupled memory).
- cmrx64 18d agoCPS is an intermediate representation, humans shouldn’t have to tolerate it.
- skew-aberration 18d agoThere are languages with first class continuations, is if every function is async and every call is await. In that context, everything can be stack allocated and every reference to stack memory stays valid always. The cost is that stack is now non-linear / not a contiguous array.