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

lemmih/lhc: The LLVM LHC Haskell Optimization System

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

开源软件名称(OpenSource Name):

lemmih/lhc

开源软件地址(OpenSource Url):

https://github.com/lemmih/lhc

开源编程语言(OpenSource Language):

Haskell 80.9%

开源软件介绍(OpenSource Introduction):

Build Status

About LHC

The LHC Haskell Compiler aims at compiling Haskell2010 to LLVM IR using the HaskellSuite of libraries.

Getting started

LHC is built by stack:

stack setup
stack build
stack exec lhc

Installing the lhc-prim library is required before the example programs can be compiled.

stack install cabal-install
stack exec -- cabal update
(cd packages/lhc-prim/ && stack exec -- cabal install --haskell-suite -w `stack exec -- which lhc`)

After lhc-prim has been installed, all the programs in examples/ will be compilable:

stack exec -- lhc build examples/HelloWorld.hs
lli examples/HelloWorld.ll

You can run lhc with the --keep-intermediate-files flag to inspect the various stages of the transformation from bedrock to llvm.

stack exec -- lhc build --verbose --keep-intermediate-files examples/HelloWorld.hs

Testing

Running the test suite is done via stack:

stack test && cat .stack-work/logs/lhc-*-test.log

Status (updated 2018-05-26)

LHC is comprised of separate libraries which are developed independenly and are in various states of completion.

haskell-scope

Haskell-scope implements name resolution for a sizable subset of Haskell2010 but it's far from complete. So far it hasn't proved a bottleneck.

haskell-tc

Haskell-tc implements type-checking and type-inference for a small subset of Haskell2010. Only the constructs used in the example programs are supported.

haskell-crux

Haskell-crux is responsible for desugaring and, like haskell-tc, has only been defined for exactly those language constructs which are currently used by the example programs.

base library

The base is extremely minimal and functions are implemented on a by-need basis.

Integer support

None. Will eventually write a minimal implementation in either Haskell or C.

Exceptions

Not implemented yet but the RTS has been designed with exceptions in mind.

Garbage collection

LHC has a simple but accurate semispace garbage collector.

Threading

Not supported. Will eventually use libuv.

Unicode support

Not supported. Will eventually use libicu.

Compilation pipeline and the relevant libraries:

┌──────────────────┐
│     Parsing      │
│ haskell-src-exts │
└────────┬─────────┘
┌────────┴────────┐
│ Name resolution │
│  haskell-scope  │
└────────┬────────┘
 ┌───────┴───────┐
 │ Type-checking │
 │  haskell-tc   │
 └───────┬───────┘
  ┌──────┴───────┐
  │  Desugaring  │
  │ haskell-crux │
  └──────┬───────┘
┌────────┴────────┐
│ Optimizing Core │
│       LHC       │
└────────┬────────┘
    ┌────┴────┐
    │ Bedrock │
    │ bedrock │
    └────┬────┘
 ┌───────┴───────┐
 │ Generate LLVM │
 │    bedrock    │
 └───────────────┘



鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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