Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Haskell LLVM JIT Compiler Tutorial

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-LLVM
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

sdiehl/kaleidoscope

Repository files navigation

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

Stephen Diehl

Haskell LLVM Tutorial

Build StatusMIT 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 theinstructions posted by the llvm-hs maintainers.

With Haskell and LLVM in place, you can use either Stack or Cabal to install the necessary Haskellbindings 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:

$ stackexec chapter2

Building with Cabal

Ensure thatllvm-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 dependenciesinstalled 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 thellvm-tutorial-standalonerepository. 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 theLLVM license.

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

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp