Toolkit for the Grass programming language
Haskell
Latest commit 16361e2 Feb 12, 2017 @susisu Fix zigzag
Permalink
Failed to load latest commit information.
grass Embed version number automatically Feb 8, 2017
plant Embed version number automatically Feb 8, 2017
src/Language/Grass Fix zigzag Feb 12, 2017
.gitignore Add temp directory to .gitignore Jan 26, 2017
Grassy.cabal v0.2.0.0 Feb 8, 2017
LICENSE Initial commit Jan 19, 2017
README.md v0.1.0.0 Feb 4, 2017
Setup.hs Initial commit Jan 19, 2017
stack.yaml Initial commit Jan 19, 2017

README.md

Grassy

Toolkit for the Grass programming language.

Installation

git clone https://github.com/susisu/Grassy.git
cd Grassy
stack install

Usage

grass

grass is a Grass interpreter (not so fast).

grass <filename>

or

grass -e <program>

See the original website of Grass for detailed information about the language.

plant

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.

w, Out, In, and 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).

Author

Susisu (GitHub, Twitter)

References