Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Ugly prototype language for strongly typed, lazy, purely functional client side web scripting

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 docs
Octocat-spinner-32 examples
Octocat-spinner-32 lib
Octocat-spinner-32 src
Octocat-spinner-32 tests
Octocat-spinner-32 Makefile
Octocat-spinner-32 README
Octocat-spinner-32 runtests.sh
README
** NOTE

Lambdascript is, as you've probably figured out by looking at commit
statistics, no longer active. It's been superceeded by Haste
(http://ekblad.cc/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
respectively.

GHC, Happy and Alex are all included in the Haskell platform, available from
http://hackage.haskell.org/platform/ and BNFC can be found at
http://hackage.haskell.org/package/BNFC.

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/file.ls
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 myfile.ls -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 foo.ls containing the function bar :: Int -> Int -> Int, you
would call it from JS as foo.bar(1, 2).

See docs/tutorial.html for more information about using LambdaSript.
Something went wrong with that request. Please try again.