项目作者: talyian

项目描述 :
LLVM toy language
高级语言: C++
项目地址: git://github.com/talyian/c_coral.git
创建时间: 2017-09-20T06:35:15Z
项目社区:https://github.com/talyian/c_coral

开源协议:MIT License

下载


[Development Suspended]

I’m porting this to a new compiler framework in either Ocaml or F#, as iterating on the C++ was taking a bit too long per iteration. Stay tuned!

Coral Language

A toy LLVM-based language.
A Kaleidoscope tutorial project that gained sentience.
A Playground to experiment with language features.
This is not https://corallanguage.org/ ! — I need a new name

Show me some Code!

  1. printf "Hello, World!\n"
  2. func factorial(n):
  3. if n < 2:
  4. 1
  5. else:
  6. n * factorial(n - 1)

Getting Started

Easiest way is to build the docker container that has the dependencies (llvm/clang/flex/bison) installed.

  1. $ docker build -t coral -f dockerenv/Dockerfile .
  2. $ docker run --rm coral bash
  3. [coral]/work/src$ coral-test
  4. ... Runs tests ...
  5. [coral]/work/src$ coral-jit tests/cases/simple/hello_world.coral
  6. Hello, World!

Dependencies

If you’d prefer to build Coral without using docker, make sure you have make, llvm 5, clang 5, flex, bison installed at a minimum. Additional libraries such as libpcre2 or libuv may be required to build.