Devine Lu Ator on Nostr: Today in chaotic batshit crazy computing: A stack-machine can be implemented in ...
Today in chaotic batshit crazy computing: A stack-machine can be implemented in #Fractran, but it's not for the faint of heart.
The theory is that we can keep a stack of zeros and ones in a single register using binary encoding for that number, a little like Church encoding but with bit-shifting.
- Pushing a 0 onto the stack is equivalent to doubling the number.
- Pushing a 1 is equivalent to doubling and adding 1.
- Popping is equivalent to dividing by 2, where the remainder is the value
The theory is that we can keep a stack of zeros and ones in a single register using binary encoding for that number, a little like Church encoding but with bit-shifting.
- Pushing a 0 onto the stack is equivalent to doubling the number.
- Pushing a 1 is equivalent to doubling and adding 1.
- Popping is equivalent to dividing by 2, where the remainder is the value