Email or username:

Password:

Forgot your password?
Top-level
Devine Lu Linvega

@bellinitte I utilize the return mode a lot! It's especially useful to run two operations in parallel: git.sr.ht/~rabbits/left/tree/m

It's often to move two pointers at the same rate, one in the wst and one in the rst.

Another very typical use that I have, is for drawing sprites. I'll often stash the x/y drawing position, do a routine, and then unstash them to restore the drawing position.

I do these 2 things constantly.

3 comments
charlie

@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

Devine Lu Linvega

@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:

git.sr.ht/~rabbits/left/tree/m

,&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:

[DATA EXPUNGED]
charlie

@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

Go Up