当前位置: 首页 > 软件库 > 开发工具 > 编译器 >

lhc

The LLVM LHC Haskell Optimization System
授权协议 Unlicense License
开发语言 C/C++
所属分类 开发工具、 编译器
软件类型 开源软件
地区 不详
投 递 者 沙宣
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

About LHC

The LHC Haskell Compiler aims at compiling Haskell2010 to LLVM IR using theHaskellSuite 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 becompiled.

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 becompilable:

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

You can run lhc with the --keep-intermediate-files flag to inspect thevarious 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 arein various states of completion.

haskell-scope

Haskell-scope implements name resolution for a sizable subset of Haskell2010 butit'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 ofHaskell2010. Only the constructs used in the example programs are supported.

haskell-crux

Haskell-crux is responsible for desugaring and, like haskell-tc, has only beendefined for exactly those language constructs which are currently used by theexample 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    │
 └───────────────┘
  • lhc 关闭 大型强子对撞机(LHC)是一种粒子加速器,旨在彻底改变我们对宇宙的理解。 全球LHC计算网格 (LCG)项目为将使用LHC的整个高能物理社区提供数据存储和分析基础结构。 LCG于2003年推出,旨在将全球数百个数据中心中的数千台计算机集成到全球计算资源中,以存储和分析LHC将收集的大量数据。 据估计,大型强子对撞机每年产生大约15 PB(1500万千兆字节)的数据。 这相当于每年填满

相关阅读

相关文章

相关问答

相关文档