~cypheon/rapid

LLVM Backend and Native Runtime for Idris2
bca992ed — Johann Rudloff 3 days ago
Update code for current version of upstream Idris 2
899fb668 — Johann Rudloff 12 days ago
Implement more primitives
8f92c6f4 — Johann Rudloff 12 days ago
Make sure foreign calls return a real "Unit" value when specified

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~cypheon/rapid
read/write
git@git.sr.ht:~cypheon/rapid

You can also use your local clone with git send-email.

#LLVM codegen and native runtime for Idris 2

This is a (work in progress) backend to generate native executables from Idris code, using the LLVM compiler infrastructure. Code is generated via LLVM IR (i.e. not via generated C source code).

The source folder rts/ contains a primitive runtime system with a relocating semi-space garbage collector.

#Prerequisites

LLVM 10 needs to be installed and the binaries available in your $PATH. To check if that is the case, try the following command:

$ opt --version
LLVM (http://llvm.org/):
  LLVM version 10.0.1

  Optimized build.
  Default target: x86_64-pc-linux-gnu
  Host CPU: skylake

#Compiling

$ make
$ make test

#Using

# compile the included "Hello world" example
./build/exec/rapidc --cg llvm -o hello samples/Hello.idr
# run the compiled binary
./build/exec/hello