Simple Programming Language compiler in Haskell
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
midreport
presentation
presentation2
presentation3
presentation4
tests
.gitignore
AST.hs
ASTWalker.hs
ASTtoIR.hs
Builtins.hs
CodeGen.hs
Console.hs
Errors.hs
IR.hs
IRDeadcode.hs
IRtoLLVM.hs
IRtoSSM.hs
LLVM.hs
Lexer.hs
Main.hs
Meta.hs
Options.hs
Output.hs
Parser.hs
ParserLib.hs
PrettyPrinter.hs
README.md
SSM.hs
SemanticAnalysis.hs
Source.hs
Templating.hs
TypeInference.hs
TypePrinter.hs
Typing.hs
Utils.hs
compile_llvm.sh
compile_llvm_linux.sh
parse
presentation.txt
run
run_tests

README.md

splang

Simple Programming Language compiler in Haskell

Example of output Friendly error messages

Dependencies

splang can be compiled using GHC 7.4.2 or higher.

Compilation has been tested with the following setups:

  • Ubuntu 12.10, GHC 7.4.2
  • Mac OSX 10.7.5, GHC 7.4.2

To install the software required to compile splang, use the following commands:

$ cabal update
$ cabal install ansi-terminal
$ cabal install edit-distance
$ cabal install derive

How to use it

For instructions, run:

$ ./run -h

Testing

splang comes with a set of unittests, which can be run using:

./run_tests

Note that the codegen-phase of these tests requires ssm-nogui and LLVM to be installed.

Testing (SSM)

Some tests use the Utrecht Simple Stack Machine without GUI, by Markus Klinik, available from mklinik/ssm-nogui. Please deploy this package in the parent directory of splang, such that the jar-file can be accessed from:

../ssm-nogui/build/ssm-nogui.jar

Testing (LLVM)

Some tests use the LLVM interpreter, compiler or linker. To ensure that you are capable to run all LLVM-related tests, please use the following commands (on Ubuntu 12.10):

$ sudo apt-get install llvm clang 
$ sudo ln -s <path_to_splang>/build/splang /usr/bin/local/splang