Skip to content

piravelha/GRP-language

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to GRP /grape/

image

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.

Snippets

Printing

To print an expression, you can either use Print, or you can type its operator form |<.

4 Print
7 |<

Output:

4
7

Basic Operations

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published