entaloneralie
Joined 5 years ago
Karma
606
Submissions
149
Member since
Feb 9
Joined 5 years ago
(co-author of 100r.ca)
https://paste.sr.ht/~rabbits/cd2369cc7c72bfad0fcd83e27682095...
A stack of zeros and ones can be encoded in a single number by keeping with bit-shifting and incrementing.
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 number.
I use something not too far off for my daily a programming based on a similar idea:Rejoice is a concatenative programming language in which data is encoded as multisets that compose by multiplication. Think Fractran, without the rule-searching, or Forth without a stack.
Yeah, okay you have 10 years of dogfooding ahead of me X)
Sorry. Still, goals.