Forþ
Jump to navigation
Jump to search
| Paradigm(s) | Imperative, Functional |
|---|---|
| Designed by | User:jan Gamecuber |
| Appeared in | 2022 |
| Memory system | Stack |
| Computational class | Unknown |
| Reference implementation | C++ interpreter |
| Influenced by | Forth |
Forþ is a stack based language.
Commands
| Name | Function |
|---|---|
| 0-F | Add that number to stack. |
| : | Duplicate top. |
| +-*/% | Do the obvious operation (top goes on right). |
| ~ | Bitwise not the top |
| . | Output the top as unicode. |
| , | Take string input and store it's unicode values in the top (right goes on top). |
| () | If the top is not 0 |
| [] | While the top is not 0 |
| {} | Store a function in the number atop the stack. |
| ; | Call the function stored by the stack. |
| o | Reverse the stack. |
| c | Rotate the top 3 elements. |
| v | Swap the top 2 elements. |
Examples
Cat program
1{,0o[.]1+}[;]
Hello, world!
0F2*3+F6*A+F7*3+F7*9+F7*6+F7*E+F2*2+F2*E+F7*6+F7*3+F7*3+F6*B+F4*C+[.]
Implementations
A C++ interpreter by User:Bangyen.