All Projects → jaseemabid → Olifant

jaseemabid / Olifant

Licence: other
A simple programming language targeting LLVM

Programming Languages

haskell
3896 projects
Dockerfile
14818 projects
Makefile
30231 projects
LLVM
166 projects
c
50402 projects - #5 most used programming language
emacs lisp
2029 projects

Projects that are alternatives of or similar to Olifant

CastXMLSuperbuild
Build CastXML and its dependencies (LLVM/Clang)
Stars: ✭ 32 (-44.83%)
Mutual labels:  llvm, clang
lldbg
A lightweight native GUI for LLDB.
Stars: ✭ 83 (+43.1%)
Mutual labels:  llvm, clang
proton-clang-build
A set of scripts to build optimized LLVM and binutils toolchains. See https://github.com/kdrag0n/proton-clang for prebuilts.
Stars: ✭ 30 (-48.28%)
Mutual labels:  llvm, clang
systemc-compiler
This tool translates synthesizable SystemC code to synthesizable SystemVerilog.
Stars: ✭ 128 (+120.69%)
Mutual labels:  llvm, clang
hmg
💝 My personal Gentoo/Linux configuration backup files
Stars: ✭ 16 (-72.41%)
Mutual labels:  llvm, clang
open-ops
Open Optimizing Parallelizing System
Stars: ✭ 21 (-63.79%)
Mutual labels:  llvm, clang
llvm-project-prepo
Fork of LLVM with modifications to support a program repository
Stars: ✭ 27 (-53.45%)
Mutual labels:  llvm, clang
Chromium Clang
Chromium browser compiled with the Clang/LLVM compiler.
Stars: ✭ 77 (+32.76%)
Mutual labels:  llvm, clang
wasm-toolchain
WebAssembly toolchain
Stars: ✭ 34 (-41.38%)
Mutual labels:  llvm, clang
lsif-clang
Language Server Indexing Format (LSIF) generator for C, C++ and Objective C
Stars: ✭ 28 (-51.72%)
Mutual labels:  llvm, clang
llvm-svn
Arch Linux PKGBUILD for LLVM, Clang et al. (latest SVN code)
Stars: ✭ 18 (-68.97%)
Mutual labels:  llvm, clang
SameTypeClangPlugin
自定义检查规范的 Clang 插件
Stars: ✭ 47 (-18.97%)
Mutual labels:  llvm, clang
OS-CFI
Origin-sensitive Control Flow Integrity (OS-CFI) - USENIX Security 2019
Stars: ✭ 27 (-53.45%)
Mutual labels:  llvm, clang
CFI-LB
Adaptive Callsite-sensitive Control Flow Integrity - EuroS&P'19
Stars: ✭ 13 (-77.59%)
Mutual labels:  llvm, clang
CMLFS
Clang-Built Musl Linux From Scratch
Stars: ✭ 51 (-12.07%)
Mutual labels:  llvm, clang
opencilk-project
Monorepo for the OpenCilk compiler, forked from llvm/llvm-project. See the OpenCilk/infrastructure repository for build and installation instructions.
Stars: ✭ 42 (-27.59%)
Mutual labels:  llvm, clang
adorad
Fast, Expressive, & High-Performance Programming Language for those who dare
Stars: ✭ 54 (-6.9%)
Mutual labels:  llvm, clang
los
Los是一个c/c++语言编译型的虚拟机。它使用llvm/clang作为其前端,losld做后端对源代码进行编译,生成los指令文件。Los is a c/c++-compiled virtual machine. It uses llvm/clang as its front end, losld does the backend to compile the source code, and generates the los directive file.
Stars: ✭ 46 (-20.69%)
Mutual labels:  llvm, clang
stack-guard
A toy implementation of 'Stack Guard' on top of the LLVM compiler toolchain
Stars: ✭ 21 (-63.79%)
Mutual labels:  llvm, clang
arch-packages
Arch Linux performance important packages
Stars: ✭ 27 (-53.45%)
Mutual labels:  llvm, clang

Olifant Build Status Docker Repository on Quay

A simple functional language targeting LLVM, WIP

Project is setup with stack

$ git pull https://github.com/jaseemabid/Olifant && cd Olifant
$ stack setup && stack build

See the blog post Lessons learned building a toy compiler for a detailed introduction to the project.

The test coverage isn't great, but has a bunch of good code samples. They run pretty fast 🏎 too.

$ stack test

The README maybe sparse, but there is a lot of inline documentation 📜 in the code; which can be read with Haddock.

$ stack haddock --no-haddock-deps --open

Olifant programs can be compiled to native binaries and executed in one step .

$ stack exec olifant <<< 'sum 4 5'
$ 9

This is NOT an interpreter, a machine native binary is produced and executed in one step 🎩.

$ file /tmp/cmd.exe
$ /tmp/cmd.exe: Mach-O 64-bit executable x86_64

There are some samples programs in the examples directory - these are real programs used by the test runner so if the tests are , these are guaranteed to work.

The intermediary forms can be exported with additional flags. For example, the output of the parser can be viewed with -p.

$ stack exec olifant -- -p <<< 'sum 4 5'
[ App (Ref
       {rname = "sum", ri = 0, rty = TInt :> (TInt :> TInt), rscope = Extern})
      [Lit (Number 4), Lit (Number 5)]
]

Similarly, Core is exported with -c and the intermediary LLVM IR is exported with -l.

The compiler accepts programs from stdin or takes a file as argument.

$ olifant -l examples/vars.ol
$ file vars.ll
vars.ll: ASCII text

Docker images are automatically built by quay.io as well as by Travis CI as part of automated testing. If you have trouble building the dependencies/libraries locally, try the container.

$ make container
$ docker run -it olifant/olifant

I would LOVE any code contributions. There is a milestone to track priority bugs and features if you are looking for some inspiration.

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].