All Projects → lemmih → lhc

lemmih / lhc

Licence: Unlicense license
The LLVM LHC Haskell Optimization System

Programming Languages

haskell
3896 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to lhc

heyoka.py
Python library for ODE integration via Taylor's method and LLVM
Stars: ✭ 45 (-76.8%)
Mutual labels:  llvm
rain
A programming language.
Stars: ✭ 20 (-89.69%)
Mutual labels:  llvm
evm llvm
Official repo of the EVM LLVM project
Stars: ✭ 72 (-62.89%)
Mutual labels:  llvm
dumb-obfuscator
Tutorial on how to write the dumbest obfuscator I could think of.
Stars: ✭ 147 (-24.23%)
Mutual labels:  llvm
U-00DC-Sprache
"Ü" programming language development
Stars: ✭ 43 (-77.84%)
Mutual labels:  llvm
juce faustllvm
JUCE Module for the libfaust JIT compiler
Stars: ✭ 32 (-83.51%)
Mutual labels:  llvm
llvm2cpg
LLVM meets Code Property Graphs
Stars: ✭ 62 (-68.04%)
Mutual labels:  llvm
kotlin-native
Kotlin/Native infrastructure
Stars: ✭ 7,066 (+3542.27%)
Mutual labels:  llvm
sycl
SYCL for Vitis: Experimental fusion of triSYCL with Intel SYCL oneAPI DPC++ up-streaming effort into Clang/LLVM
Stars: ✭ 80 (-58.76%)
Mutual labels:  llvm
pa.llvm
Program Analysis for LLVM
Stars: ✭ 37 (-80.93%)
Mutual labels:  llvm
docker-opengl
Multi-Arch Docker - Mesa 3D OpenGL Software Rendering (Gallium) - LLVMpipe, and OpenSWR Drivers
Stars: ✭ 68 (-64.95%)
Mutual labels:  llvm
flextool
C++ compile-time programming (serialization, reflection, code modification, enum to string, better enum, enum to json, extend or parse language, etc.)
Stars: ✭ 32 (-83.51%)
Mutual labels:  llvm
FPChecker
A dynamic analysis tool to detect floating-point errors in HPC applications.
Stars: ✭ 26 (-86.6%)
Mutual labels:  llvm
MetaCG
MetaCG offers an annotated whole program call-graph tool for Clang/LLVM.
Stars: ✭ 21 (-89.18%)
Mutual labels:  llvm
ebpfault
A BPF-based syscall fault injector
Stars: ✭ 65 (-66.49%)
Mutual labels:  llvm
mars
Minimal language with type inference, structures, control flow, and more.
Stars: ✭ 19 (-90.21%)
Mutual labels:  llvm
LLVMTemplate
LLVM + Swift template Xcode project
Stars: ✭ 12 (-93.81%)
Mutual labels:  llvm
clad
clad -- automatic differentiation for C/C++
Stars: ✭ 161 (-17.01%)
Mutual labels:  llvm
pacxx-llvm
Programming Accelerators with C++ (PACXX)
Stars: ✭ 57 (-70.62%)
Mutual labels:  llvm
adorad
Fast, Expressive, & High-Performance Programming Language for those who dare
Stars: ✭ 54 (-72.16%)
Mutual labels:  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].