Llvm Hs Examples Save

Examples for Haskell bindings to LLVM

Project README

LLVM Haskell Examples

Build Status

Simple examples demonstrating the usage of the llvm-hs for generating and manipulating LLVM from Haskell.

  • basic - Generating LLVM AST and rendering Textual IR
  • orc - JIT Compiling IR on the Eager and Lazy ORC Jit using Compile-On-Demand
  • arith - a minimal JIT compiler for functions of one (real) variable using recursion schemes
  • irbuilder - Basic usage of the LLVM IRBuilder for constructing modules

These examples require LLVM 9.0. Check that your installed LLVM version is precisely 9.0. If not then follow the install directions in the llvm-hs repository.

$ llvm-config --version
9.0

To run the examples with Stack:

$ stack exec basic
$ stack exec orc
$ stack exec arith
$ stack exec irbuilder

To load the examples in GHCI:

$ stack repl examples:basic
$ stack repl examples:orc
$ stack repl examples:arith
$ stack repl examples:irbuilder

To run the examples with Cabal:

$ cabal run basic
$ cabal run orc
$ cabal run arith
$ cabal run irbuilder

License

MIT License Copyright (c) 2017-2020, Stephen Diehl

Open Source Agenda is not affiliated with "Llvm Hs Examples" Project. README Source: llvm-hs/llvm-hs-examples
Stars
68
Open Issues
5
Last Commit
3 years ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating