wejournal / lamb

A statically typed and lazy evaluated implementation of Lambda Calculus.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lamb

A statically typed and lazy evaluated implementation of Lambda Calculus.

SYNOPSIS

lamb [--target {linux|windows}] [-i|-S|-c|--link] [--inline] [-o FILE] [FILE...] FILE

ENVIRONMENT

LAMB_HOME

The directory where lamb is being installed. default: ~/.lamb

PREREQUISITES

  • mlton
  • mlyacc
  • mllex
  • gcc
  • x86_64-w64-mingw32-gcc (optional)

INSTALLATION

$ make -j8
$ make install # to install ~/.lamb
$ export PATH="$HOME/.lamb/bin:$PATH"

LANGUAGE SPECIFICATION

Lexicon

  • lexeme ::= ' | ( | ) | -> | . | : | := | ^ | def | in | let | type | val | NAT | CHAR | STRING | ID

Where NAT, CHAR, STRING and ID are classes of lexemes. The classes are defined by regular expressions.

  • SPACE: /[\t\n\r ]+/
  • COMMENT: /--[^\n]*\n/
  • NAT: /[0-9]+/
  • CHAR: /'([^\\']|\\.)'/
  • STRING: /"([^\\"]|\\.)*"/
  • ID: /[A-Z_a-z][A-Z_a-z0-9]*/

SPACE and COMMENT are ignored by lexers.

Grammar

  • program ::= decls
  • decls ::= ε | decl decls
  • decl ::= type ID | val ID : ty | def ID asc := exp
  • ty ::= atty | atty -> ty
  • atty ::= ' ID | ID | ( ty )
  • asc ::= ε | : ty
  • exp ::= appexp | ^ ID asc . exp | let ID asc := exp in exp
  • appexp ::= atexp | appexp atexp
  • atexp ::= NAT | CHAR | STRING | ID | ( exp )

LICENSE

GPLv3.

SEE ALSO

About

A statically typed and lazy evaluated implementation of Lambda Calculus.

License:GNU General Public License v3.0


Languages

Language:Standard ML 54.5%Language:C 30.1%Language:Makefile 6.0%Language:C++ 5.6%Language:Lex 3.8%