Coal is a statically typed, purely functional programming language with Hindley–Milner type system, algebraic data types, extensible records, traits, and codata. The Coal compiler is implemented in Haskell.
See the official website for a language manual and getting started instructions:
Website: coal-lang.org
| Name | Description |
|---|---|
| 📦 coal-containers | A collection of functional data structures for the Coal programming language, providing efficient implementations of common container types. |
| 📦 coal-json | A JSON library for the Coal programming language, providing encoding, decoding, and pretty-printing of JSON values with composable decoder combinators and typeclass-based serialization. |
| 📦 coal-monads | A collection of common monad implementations for the Coal programming language. |
A Haskell library for constructing LLVM IR programmatically. It provides a monadic DSL for building modules, functions, blocks, and instructions, along with a pure renderer that serializes the result to LLVM assembly
You describe an IR module using the IRBuilder monad. When you run
compileModule, the builder produces an IRModule value. renderModule
then converts that value to the textual LLVM IR format that can be passed
to llc, clang, or lli. For example:
import LLVM.IR
example :: IRBuilder ()
example = do
define i32 "add_one" [(i32, "x")] LExternal [] $ do
beginBlock "entry"
r <- add i32 (OLocal i32 "x") (OConstant (CInt 32 1))
ret rRunning compileModule "example" example produces:
define i32 @add_one(i32 %x) {
entry:
%1 = add i32 %x, 1
ret i32 %1
}




