Go to file
ValKmjolnir 0b85f5ca51 🎨 fix complext generic type generation 2024-11-20 00:41:08 +08:00
.github/workflows 🎨 [WIP] try support complex generic syntax 2024-11-17 01:20:11 +08:00
bootstrap 🎨 fix complext generic type generation 2024-11-20 00:41:08 +08:00
doc 🎨 upload new colgm logo 2024-08-22 23:12:33 +08:00
src 🎨 fix complext generic type generation 2024-11-20 00:41:08 +08:00
test 🎨 fix complext generic type generation 2024-11-20 00:41:08 +08:00
.gitattributes 📝 add logs 2024-10-28 00:51:56 +08:00
.gitignore 🐛 bug fixes 2024-11-13 00:42:24 +08:00
LICENSE 📝 change license to apache 2.0 2024-03-25 22:40:10 +08:00
README.md 🎨 [WIP] try support complex generic syntax 2024-11-17 01:20:11 +08:00
makefile 🎨 fix complext generic type generation 2024-11-20 00:41:08 +08:00

README.md

Colgm Compiler Project

bootstrap

Repo Content

  • bootstrap : available now, features not stable these days, but welcome to try.
  • src : bootstrapped compiler, not available now (lexer and parser is ready).
  • test: test cases.

Bootstrap Compiler

Bootstrap compiler locates at {repo_path}/bootstrap, written by C++(-std=c++17):

Use these commands to build the bootstrap compiler, use -DCMAKE_BUILD_TYPE=Debug if want debug version:

mkdir build && cd build
cmake ../bootstrap -DCMAKE_BUILD_TYPE=Release && make -j

The executable is located as build/colgm.

Then use this command to build bootstrapped compiler:

make colgm.ll

The bootstrapped compiler should be {repo_path}/colgm.ll. If having lli(llvm jit interpreter), you could try this to execute bootstrapped new compiler:

lli colgm.ll main.colgm --library .

LLVM jit interpreter maybe unstable on some platforms, if lli crashed, try using clang to build out.ll to executable:

clang colgm.ll -o colgm

Hello World

Hello world example is available in bootstrap:

use libc::puts;

pub func main() -> i64 {
    puts("hello world!");
    return 0;
}

Tutorial

See simple tutorial in bootstrap/README.md.

TODO

  1. support foreach/forindex, may not support in bootstrap compiler:
    • forindex loop, container should have size() method
    • foreach loop, container should have iterator-like stuff
  2. llvm debug info, may not support in bootstrap compiler
  3. develop bootstrapped compiler
  4. array type like [i32; 128]
  5. support generic type like A<i32*> or A<B<C, D>> [WIP]