talyian / c_coral

LLVM toy language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[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!

printf "Hello, World!\n"

func factorial(n):
   if n < 2:
      1
   else:
      n * factorial(n - 1)

Getting Started

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

$ docker build -t coral -f dockerenv/Dockerfile .
$ docker run --rm coral bash
[coral]/work/src$ coral-test
... Runs tests ...
[coral]/work/src$ coral-jit tests/cases/simple/hello_world.coral
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.

About

LLVM toy language

License:MIT License


Languages

Language:C++ 98.6%Language:Yacc 0.5%Language:Lex 0.4%Language:CMake 0.3%Language:Emacs Lisp 0.2%Language:Dockerfile 0.1%