All Projects → Lemmih → Lhc

Lemmih / Lhc

Licence: unlicense
The LLVM LHC Haskell Optimization System

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to Lhc

Llvm Guide Zh
User Guides For those new to the LLVM system.(LLVM系统的新用户指南,中文翻译版)
Stars: ✭ 180 (-4.26%)
Mutual labels:  compiler, llvm
Brain
An esoteric programming language compiler on top of LLVM based on Brainfuck
Stars: ✭ 112 (-40.43%)
Mutual labels:  compiler, llvm
Numba Scipy
numba_scipy extends Numba to make it aware of SciPy
Stars: ✭ 98 (-47.87%)
Mutual labels:  compiler, llvm
Akilang
A compiler for a simple language, built with Python and LLVM
Stars: ✭ 71 (-62.23%)
Mutual labels:  compiler, llvm
Rhine
🔬 a C++ compiler middle-end, using an LLVM backend
Stars: ✭ 157 (-16.49%)
Mutual labels:  compiler, llvm
Ghdl
VHDL 2008/93/87 simulator
Stars: ✭ 1,285 (+583.51%)
Mutual labels:  compiler, llvm
Fanx
A portable programming language
Stars: ✭ 101 (-46.28%)
Mutual labels:  compiler, llvm
Llvm Tutorial Standalone
DEPRECATED (Use: https://github.com/llvm-hs/llvm-hs-kaleidoscope )
Stars: ✭ 38 (-79.79%)
Mutual labels:  compiler, llvm
Ispc
Intel SPMD Program Compiler
Stars: ✭ 1,924 (+923.4%)
Mutual labels:  compiler, llvm
Hikari
LLVM Obfuscator
Stars: ✭ 1,585 (+743.09%)
Mutual labels:  compiler, llvm
Seeless
C IDE for iOS
Stars: ✭ 71 (-62.23%)
Mutual labels:  compiler, llvm
Compile To Web
Discover what languages can be compiled to Web Assembly
Stars: ✭ 164 (-12.77%)
Mutual labels:  compiler, llvm
Kai
An expressive low level programming language
Stars: ✭ 68 (-63.83%)
Mutual labels:  compiler, llvm
Enzyme.jl
Julia bindings for the Enzyme automatic differentiator
Stars: ✭ 90 (-52.13%)
Mutual labels:  compiler, llvm
Leekscript V2
A dynamically typed, compiled just-in-time programming language used in Leek Wars' AIs
Stars: ✭ 46 (-75.53%)
Mutual labels:  compiler, llvm
Faust
Functional programming language for signal processing and sound synthesis
Stars: ✭ 1,360 (+623.4%)
Mutual labels:  compiler, llvm
Zion
A statically-typed strictly-evaluated garbage-collected readable programming language.
Stars: ✭ 33 (-82.45%)
Mutual labels:  compiler, llvm
Unlisp Llvm
Compiler for a toy Lisp language
Stars: ✭ 33 (-82.45%)
Mutual labels:  compiler, llvm
Flax
general purpose programming language, in the vein of C++
Stars: ✭ 111 (-40.96%)
Mutual labels:  compiler, llvm
Jitfromscratch
Example project from my talks in the LLVM Social Berlin and C++ User Group
Stars: ✭ 158 (-15.96%)
Mutual labels:  compiler, llvm

Build Status

About LHC

The LHC Haskell Compiler aims at compiling Haskell2010 to LLVM IR using the HaskellSuite of libraries.

Getting started

LHC is built by stack:

stack setup
stack build
stack exec lhc

Installing the lhc-prim library is required before the example programs can be compiled.

stack install cabal-install
stack exec -- cabal update
(cd packages/lhc-prim/ && stack exec -- cabal install --haskell-suite -w `stack exec -- which lhc`)

After lhc-prim has been installed, all the programs in examples/ will be compilable:

stack exec -- lhc build examples/HelloWorld.hs
lli examples/HelloWorld.ll

You can run lhc with the --keep-intermediate-files flag to inspect the various stages of the transformation from bedrock to llvm.

stack exec -- lhc build --verbose --keep-intermediate-files examples/HelloWorld.hs

Testing

Running the test suite is done via stack:

stack test && cat .stack-work/logs/lhc-*-test.log

Status (updated 2018-05-26)

LHC is comprised of separate libraries which are developed independenly and are in various states of completion.

haskell-scope

Haskell-scope implements name resolution for a sizable subset of Haskell2010 but it's far from complete. So far it hasn't proved a bottleneck.

haskell-tc

Haskell-tc implements type-checking and type-inference for a small subset of Haskell2010. Only the constructs used in the example programs are supported.

haskell-crux

Haskell-crux is responsible for desugaring and, like haskell-tc, has only been defined for exactly those language constructs which are currently used by the example programs.

base library

The base is extremely minimal and functions are implemented on a by-need basis.

Integer support

None. Will eventually write a minimal implementation in either Haskell or C.

Exceptions

Not implemented yet but the RTS has been designed with exceptions in mind.

Garbage collection

LHC has a simple but accurate semispace garbage collector.

Threading

Not supported. Will eventually use libuv.

Unicode support

Not supported. Will eventually use libicu.

Compilation pipeline and the relevant libraries:

┌──────────────────┐
│     Parsing      │
│ haskell-src-exts │
└────────┬─────────┘
┌────────┴────────┐
│ Name resolution │
│  haskell-scope  │
└────────┬────────┘
 ┌───────┴───────┐
 │ Type-checking │
 │  haskell-tc   │
 └───────┬───────┘
  ┌──────┴───────┐
  │  Desugaring  │
  │ haskell-crux │
  └──────┬───────┘
┌────────┴────────┐
│ Optimizing Core │
│       LHC       │
└────────┬────────┘
    ┌────┴────┐
    │ Bedrock │
    │ bedrock │
    └────┬────┘
 ┌───────┴───────┐
 │ Generate LLVM │
 │    bedrock    │
 └───────────────┘
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].