function tostack 'b' asoc stack 'a' asoc 0 'v' asoc b pop byte 'o' asoc b len while [ v o b pop byte ] 'o' asoc - + 'v' asoc b len end [ v end
このチャレンジの発見後に「tostack」コマンドが追加されたため、競合していません(バイト数がひどい場合でも)
テストケース
Hello, World!
-39
Cool, huh?
-4
説明
function                        # Push the function between this and end to the stack
    tostack 'b' asoc            # Convert the implicit input to a stack, associate it with 'b'
    0 'v' asoc                  # Push 0 to the stack, associate it with 'v'
    b pop byte 'o' asoc         # Pop the top value of b (The end of the input), get the byte value, associate it with 'o'.
    b len                       # Push the size of b to the stack
    while [                     # While the top of the stack is truthy, pop the top of the stack
        v                       # Push v to the stack
            o                   # Push o to the stack
            b pop byte          # Pop the top value of b, push the byte value of that to the stack
            ] 'o' asoc          # Push a copy of the top of the stack, associate it with 'o'
            -                   # Subtract the top of the stack from one underneith that, In this case, the old value of o and the byte.
        +                       # Sum the top of the stack and underneith that, that is, the difference of the old value and new, and the total value
        'v' asoc                # Associate it with 'v'
        b len                   # Push the size of b to the stack (which acts as the conditional for the next itteration)
    end [                       # Pop the top of the stack, which will likely be the left over size of b
    v                           # Push the value of v to the top of the stack
end                             # Implicitely returned / printed
RProgNは、逆ポーランド記法を念頭に置いて取り組んでいる難解な言語です。現在は非常に冗長で、変数の割り当ては4文字であるため、将来的には少しのシンタックスシュガーを追加する予定です。
また、RProgNはスタックの引数に暗黙的にアクセスし、同じ方法でそれらを返します。プログラムの終了後にスタックに残っている文字列データは、暗黙的に出力されます。