GRP is a simple, stack-based language currently written in Python, that transpiles to Lua.
Note that because GRP is a stack-based language, it is read left-to-right, so all functions are used in postfix form.
To print an expression, you can either use Print
, or you can type its operator form |<
.
4 Print
7 |<
Output:
4
7
Remembering that all functions/operators are used in postfix form, it is sometimes harder to understand an arithmetic expression, so you can use parenthesis to group parts of the operation together to make it clearer, also, there is no operator precedence, every function has the same left-precedence in GRP
1 2 + 4 * 3 / Print
1 (2+) (4*) (3/) Print
Output:
4
4
If that is still weird to you, just try thinking of a program as a list of instructions, as a pipeline, and it should start making sense.