@neauoire I see, thank you so much :) i'm not in the two-stack mindset yet, if I had to do something like this I think I would try to juggle the values with swaps and rots
@bellinitte If it's not something that's called thousands of times per frame, it's probably fine. But even before learning to juggle two stacks, the truly best way to handle deep stacks and variables is to get comfy with self-modification, and caching the variables in the future of the runtime.
,&sel STR is writing the variable directly in the program memory where it will be needed, from outside of the loop, so I don't need to unstash it each run.
@bellinitte If it's not something that's called thousands of times per frame, it's probably fine. But even before learning to juggle two stacks, the truly best way to handle deep stacks and variables is to get comfy with self-modification, and caching the variables in the future of the runtime.
@tty@neauoire love it too, it feels so alien after writing code in "modern" languages for so long, in a good way. like i'm discovering some ancient knowledge hah
@bellinitte If it's not something that's called thousands of times per frame, it's probably fine. But even before learning to juggle two stacks, the truly best way to handle deep stacks and variables is to get comfy with self-modification, and caching the variables in the future of the runtime.
For example:
https://git.sr.ht/~rabbits/left/tree/main/item/src/left.tal#L1427
,&sel STR is writing the variable directly in the program memory where it will be needed, from outside of the loop, so I don't need to unstash it each run.
@bellinitte If it's not something that's called thousands of times per frame, it's probably fine. But even before learning to juggle two stacks, the truly best way to handle deep stacks and variables is to get comfy with self-modification, and caching the variables in the future of the runtime.
For example: