| ▲ | skew-aberration 11 hours ago |
| You could write everything if you refactor to continuation passing style |
|
| ▲ | eyegor 11 hours ago | parent | next [-] |
| Might 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 10 hours ago | parent [-] | | > 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 11 hours ago | parent | prev [-] |
| CPS is an intermediate representation, humans shouldn’t have to tolerate it. |
| |
| ▲ | skew-aberration 5 hours ago | parent [-] | | There 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. |
|