All Projects → sdiehl → Kaleidoscope

sdiehl / Kaleidoscope

Licence: other
Haskell LLVM JIT Compiler Tutorial

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to Kaleidoscope

Flingos
An educational operating system written in C#. A great stepping stone from high to low level development.
Stars: ✭ 451 (-48.16%)
Mutual labels:  compiler, tutorial
Numpile
A tiny 1000 line LLVM-based numeric specializer for scientific Python code.
Stars: ✭ 341 (-60.8%)
Mutual labels:  compiler, tutorial
Write A Programming Language
How to make a new language(and why we shouldn't?)
Stars: ✭ 29 (-96.67%)
Mutual labels:  compiler, tutorial
Minic Hosting
A simple stack-based virtual machine that runs C in the browser.
Stars: ✭ 628 (-27.82%)
Mutual labels:  compiler, tutorial
Shivyc
C compiler created in Python.
Stars: ✭ 845 (-2.87%)
Mutual labels:  compiler
Ldc
The LLVM-based D Compiler.
Stars: ✭ 937 (+7.7%)
Mutual labels:  compiler
Orcc
Open RVC-CAL Compiler
Stars: ✭ 26 (-97.01%)
Mutual labels:  compiler
Voting Blockchain
A simple blockchain-based voting system application built from scratch by Python. It's available for running with multipeer.
Stars: ✭ 26 (-97.01%)
Mutual labels:  tutorial
Ros Academy For Beginners
中国大学MOOC《机器人操作系统入门》代码示例 ROS tutorial
Stars: ✭ 861 (-1.03%)
Mutual labels:  tutorial
Dugong
Minimal State Store Manager for React Apps using RxJS
Stars: ✭ 10 (-98.85%)
Mutual labels:  compiler
Ios Uiimage Render To Pdf
iOS Render UIImage to PDF and merging PDF files
Stars: ✭ 8 (-99.08%)
Mutual labels:  tutorial
Fly Coffee
☕️ Fly plugin for CoffeeScript
Stars: ✭ 7 (-99.2%)
Mutual labels:  compiler
Sbt Scripting
Getting started tutorial for scripting using sbt.
Stars: ✭ 9 (-98.97%)
Mutual labels:  tutorial
Sign In With Apple Swift Example
iOS + Node.js authentication using Sign in with Apple
Stars: ✭ 27 (-96.9%)
Mutual labels:  tutorial
Awesome Google Colab
Google Colaboratory Notebooks and Repositories (by @firmai)
Stars: ✭ 863 (-0.8%)
Mutual labels:  tutorial
Rmarkdown Website Tutorial
Tutorial for creating websites w/ R Markdown
Stars: ✭ 26 (-97.01%)
Mutual labels:  tutorial
Nginx Tutorial
这是一个 Nginx 极简教程,目的在于帮助新手快速入门 Nginx。
Stars: ✭ 845 (-2.87%)
Mutual labels:  tutorial
Python Django For Php Nerds
A tutorial for PHP people wanting to learn Python/Django
Stars: ✭ 9 (-98.97%)
Mutual labels:  tutorial
Cfl
a Compileable statically typed Functional programming Language
Stars: ✭ 7 (-99.2%)
Mutual labels:  compiler
Hamler
Haskell-style functional programming language running on Erlang VM.
Stars: ✭ 840 (-3.45%)
Mutual labels:  compiler

A short guide to building a tiny programming language in Haskell with LLVM.

Stephen Diehl

Haskell LLVM Tutorial

Build Status MIT License

Read Online:

Setup

You will need GHC 7.8 or newer as well as LLVM 4.0. For information on installing LLVM 4.0 (not 3.9 or earlier) on your platform of choice, take a look at the instructions posted by the llvm-hs maintainers.

With Haskell and LLVM in place, you can use either Stack or Cabal to install the necessary Haskell bindings and compile the source code from each chapter.

Building with Stack (Recommended)

$ stack build

You can then run the source code from each chapter (starting with chapter 2) as follows:

$ stack exec chapter2

Building with Cabal

Ensure that llvm-config is on your $PATH, then run:

$ cabal sandbox init
$ cabal configure
$ cabal install --only-dependencies

Then to run the source code from each chapter (e.g. chapter 2):

$ cabal run chapter2

Building with make

The source code for the example compiler of each chapter is included in the /src folder. With the dependencies installed globally, these can be built using the Makefile at the root level:

$ make chapter2
$ make chapter6

A smaller version of the code without the parser frontend can be found in the llvm-tutorial-standalone repository. The LLVM code generation technique is identical.

Editing

This is an open source project, patches and corrections always welcome.

To generate the HTML page:

$ make tutorial.html

A standalone PDF can also be generated with:

$ make tutorial.pdf

License

Text is adapted from the LLVM tutorial and is subsequently licensed under the LLVM license.

The Haskell source files are released under the MIT license. Copyright (c) 2013-2016, Stephen Diehl

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