Toolkit for the Grass programming language.
git clone https://github.com/susisu/Grassy.git cd Grassy stack install
grass is a Grass interpreter (not so fast).
grass -e <program>
See the original website of Grass for detailed information about the language.
plant is a transpiler from untyped lambda calculus (written in ML-like syntax) to Grass.
plant <input> -o <output>
plant -h shows help about the avaiable options.
The syntax of the source language is briefly described by the following BNF:
<prog> ::= <def>+ <def> ::= "let" <pattern>+ "=" <term> <term> ::= <ident> -- variable | <term> <term> -- application | "fun" <pattern>+ "->" <term> -- lambda abstraction | "let" <pattern>+ "=" <term> "in" <term> -- local binding <ident> ::= <letter> (<letter> | <digit> | "_" | "'")* <pattern> ::= <ident> | "_"
_ pattern does not bind any variable.
Succ (the primitives of Grass) are exposed to the global environment.
The last value defined in the source will be called with itself as an argument (as the definition of the Grass language).