Skip to content

ebb/lumgua

Repository files navigation

Lumgua is a simple programming language.  Sample code:

(define (foldl f z x)
   (cond
      (case (nilp x) z)
      (else
         (goto (foldl f (f z (car x)) (cdr x))))))


Getting Started

Try the following:

  (Note: The server must be running before you try running lumgua code. The
  REPL is designed to receive code over HTTP via the server.)

  term1
    $ export GOPATH=$GOPATH:$PWD/go
    $ bash refresh.bash
    <go to term3 and start lumgua>
    $ echo '(+ 1 1)' | ./lispin
    $ ./lispin
    (log "hello")
    (log "world")
    ^D
    <and so on>

  term2
    $ ./server
    <restart as necessary>

  term3
    $ ./lumgua lumgua
    <edit lumgua.lisp and try again>


The Language

Lumgua is a very simple Scheme/ML hybrid.

Scheme similarities:

  * S-expression syntax and data.
  * No type system.

ML similarities:

  * No macros.
  * No variable mutation.
  * Lists are immutable and never "dotted".

Some important similarities shared with both Scheme and ML:

  * Tail-calls.
  * Continuations.
  * Pattern matching.
  * Call-by-value evaluation.

Lumgua is also significantly different from both Scheme and ML.  For
example:

  * The set of data constructors is fixed.
  * There is no language definition.
  * Tail-call compilation is subject to programmer control.


The Implementation

The implementation has a few useful features beyond mere evaluation:

  * Reasonably useful stack traces.
  * Disassembly of functions.

The following publications have been used extensively for inspiration:

  * Paradigms of Artificial Intelligence Programming by Peter Norvig.
  * Three Implementation Models for Scheme by R. Kent Dybvig.

About

Simple functional language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published