Skip to content

sidi762/colgm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Colgm Compiler Project

bootstrap nightly-build

use std::io::io;

pub func main() -> i32 {
    io::stdout().out("hello world!").endln();
    return 0;
}

Repo Content

Language Guide

See simple language guide in doc/guide/tutorial.md.

Build and Development

Requirements

Before building the project, here's the requirements:

  • python >= 3.8
  • llvm >= 13.0
  • cmake >= 3.21
  • zip

Build

We suggest you to just follow the build script at misc/build.py.

Use this command in top level directory:

python3 misc/build.py

The build script will generate 3 executables in the build directory:

  1. build/colgm: bootstrap compiler (compiled by gcc/clang)
  2. build/colgm_lifted: lifted compiler (compiled by build/colgm)
  3. build/colgm_selfhost: self-host compiler (compiled by build/colgm_lifted)

If only want to build the self-host compiler after running the build script once, you can use this to just build the self-host compiler:

python3 misc/build.py -self

Test

And use another script to test:

python3 misc/test.py

Code Style

And for development, you should follow the code style.

Features and Roadmap

  1. feature: array type [<base-type>; 128]
    • syntax like var a: [i32; 128] = [1, 2, 3];
    • syntax like var a: [i8*; 128] = ["foo", "bar", tmp];
  2. feature: Tagged Union
  3. feature: Tuple
  4. feature: RAII
  5. feature: reference type
  6. feature: smart pointer
  7. feature: std
    • Filesystem API (read, write, join, exists, etc)
    • Datetime utils
    • String and Unicode Helpers
    • Math Utils
    • map, filter, reduce, sort, reverse, etc
    • JSON, TOML, YAML and other formats parsing
    • networking (TCP Server and Client, HTTP Server on top of the TCP server)
    • HTTP Utilities
    • OS Utils (exec, env, args, etc)
    • Typeof, is_type, etc
    • Assert and Bench
    • Logging
    • Deprecation Marker
    • Regex
    • Package manager
    • Docs generator

About

self-host llvm compiler project for fun

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 62.5%
  • C++ 36.9%
  • Other 0.6%