Rust implementation of Abyss programming language
- Download or compile source code.
- Run the program and enter repl automatically (default lazy mode).
quit
: Quit replhelp
: Get helpeager
: Turn on eager mode (where strict evaluation is the default)lazy
: Turn on lazy mode (where lazy evaluation is the default)debug
: Turn on debug mode
- Function application:
(f x)
- Let bindings:
(let ((x value) (y value) ...) expression)
- Lambda abstraction:
(lambda (x y z ...) expression)
- If branches:
(if expression true-branch false-branch)
- Pattern matching:
(case expression ((case1 value) (case2 value) ...))
- Definition:
(define x expression)
|(define (f x y ...) expression)
- Data abstraction:
(data x)
|(data (cons x y ..))
- Integers
- Symbols
- Strings
- Real numbers
::
: List constructor+-*/
: Arithmetic operators
- Typed dynamic programming language
- Highly configurable and scalable
- Experimental for the next generation
- S-Expressions
- Scalable front-end syntax with parser combinator
- Optional evaluation strategy: eager or lazy
- Flexible GC strategy
- Haskell-like
data
declaration - Pattern matching everywhere
- Dependent type system
- Factorial
(let (((fact n) (case n ((0 1) (n (* n (fact (- n 1)))))))) (fact 5))
;==> 120
- Generating list
(let (((gen s n) (case n ((0 ()) (n (:: s (gen s (- n 1)))))))) (gen 'T_T 10))
; strict ==> (T_T T_T T_T T_T T_T T_T T_T T_T T_T T_T)
; lazy ==> (:: T_T <thunk>)