valderman/lambdascript
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
** NOTE Lambdascript is, as you've probably figured out by looking at commit statistics, no longer active. It's been superceeded by Haste (https://haste-lang.org) - 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.
About
Ugly prototype language for strongly typed, lazy, purely functional client side web scripting
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published