• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

sdiehl/kaleidoscope: Haskell LLVM JIT Compiler Tutorial

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

sdiehl/kaleidoscope

开源软件地址(OpenSource Url):

https://github.com/sdiehl/kaleidoscope

开源编程语言(OpenSource Language):

Haskell 94.1%

开源软件介绍(OpenSource Introduction):

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




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
moocfi/haskell-mooc: Haskell MOOC University of Helsinki发布时间:2022-06-18
下一篇:
ghcjs/ghcjs: Haskell to JavaScript compiler, based on GHC发布时间:2022-06-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap