Ugly prototype language for strongly typed, lazy, purely functional client side web scripting
Haskell JavaScript Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



Lambdascript is, as you've probably figured out by looking at commit
statistics, no longer active. It's been superceeded by Haste
( - a compiler that does actual Haskell.

** About

Lambdascript is a prototype language for strongly typed, lazy, purely
functional client side web scripting. It provides a basic subset of
Haskell's functionality, compiled into Javascript.

Due to its clumsy parser and fugly syntax, the plan is to scrap the thing
after it's more or less done (hence, prototype) and rewrite the project using
saner tools (BNFC is somewhat suboptimal for anything that's supposed to
actually be of any use) to enable some essential features (read: polymorphism)
and nicer syntax.

** Building & dependencies

To build the Lambdascript compiler (lsc,) simply run 'make' in the project's
root directory; to run the test suite, 'make test' and to build the
documentation 'make doc'.

In order to compile LS, you need GHC, BNFC Happy and Alex; the Haskell
compiler, parser generator generator, parser generator and lexer generator

GHC, Happy and Alex are all included in the Haskell platform, available from and BNFC can be found at

In order to run the test suite, you need spidermonkey installed. That's also
handily available from your package manager if you're on Debian with
derivatives, and you might also want to install Haddock (which is also
included in the Haskell platform) so you can build the documentation.

On Debian with derivatives, you can install everything you need by issuing:
# apt-get install haskell-platform bnfc spidermonkey-bin

** Compiling & running programs

To compile a Lambdascript program into Javascript, run the compiler (lsc) in
the root directory of the project with the input file as its only argument:
$ ./lsc some/lambdascript/input/
The output file, a.out.js if nothing else is specified, will be created in
your working directory.

If you want to run lsc from another directory, you need to specify the path
where runtime.js can be found using the -L switch:
$ ./some/dir/lsc -Lsome/dir/lib

To run your newly compiled program, include it in an HTML document using the
<script> tag and call its functions from another <script> tag. The functions
are members of an object with the same name as the file you compiled.
If you compile containing the function bar :: Int -> Int -> Int, you
would call it from JS as, 2).

See docs/tutorial.html for more information about using LambdaSript.