Go to file
ValKmjolnir c6e5e2eb29 update old data structures 2024-11-22 00:36:41 +08:00
.github/workflows 📝 update CI 2024-11-21 01:07:52 +08:00
bootstrap 🔥 use list to implement hashmap 2024-11-21 20:32:49 +08:00
doc 🎨 upload new colgm logo 2024-08-22 23:12:33 +08:00
src update old data structures 2024-11-22 00:36:41 +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 📝 update CI 2024-11-21 01:07:52 +08:00
makefile 🎨 fix complext generic type generation 2024-11-20 00:41:08 +08:00

README.md

Colgm Compiler Project

bootstrap nightly-build

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]