A Lisp-like programming language that is typed and compiled. It aims to support multiple processor architectures by being built upon LLVM. It takes inspiration from programming languages like Rust, Lisp and Elixir.
A program to compute first 5 fibonacci numbers:
(let first 0)
(let second 1)
(let fib)
(let n 0)
(while (< n 5)
(let fib (+ first second))
(let second first)
(let first fib)
(let n (+ n 1))
(print fib)
)
- Convert raw code into token stream
- Convert token stream into Expression tree
- Handle multiple levels of nested expressions
- Have multiple (independent) expressions per file
- Generate LLVM IR for the currently supported features
- add CLI flag to emit llvm
- add while loop
- Declare variables
- add nested while loops
- Add types for function and variable declaration
- Define functions
- Support types in code
This project uses the following requirements:
- LLVM version 10.0 (https://llvm.org)
- Latest stable version Rust (https://www.rust-lang.org/tools/install)
- Download and install all dependencies.
- Clone the repo and
cd
into it - Run
cargo build
to build it from source - Then you execute the compiled binary using the command below:
target/debug/tispc -h
Write some valid Tisp code like the following:
(let x 300)
(print "Hello world" (+ 2 (- 1 x)))
and save it in a file somewhere, for eg. ~/test.tp
. Now compile it using
target/debug/tispc -i ~/test.tp
Then you can run the output generated using lli
command, like so:
lli ~/output.ll
NOTE: Tisp doesn't generate executable binaries yet, it generates LLVM IR
in a file called output.ll
in the same folder as the source file that you
can run with the lli
command that comes with your LLVM installation.