use std::io::io;
pub func main() -> i32 {
io::stdout().out("hello world!").endln();
return 0;
}
See simple language guide in doc/guide/tutorial.md.
Before building the project, here's the requirements:
- python >= 3.8
- llvm >= 13.0
- cmake >= 3.21
- zip
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:
build/colgm
: bootstrap compiler (compiled by gcc/clang)build/colgm_lifted
: lifted compiler (compiled bybuild/colgm
)build/colgm_selfhost
: self-host compiler (compiled bybuild/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
And use another script to test:
python3 misc/test.py
And for development, you should follow the code style.
- feature: array type
[<base-type>; 128]
- syntax like
var a: [i32; 128] = [1, 2, 3];
- syntax like
var a: [i8*; 128] = ["foo", "bar", tmp];
- syntax like
- feature: Tagged Union
- feature: Tuple
- feature: RAII
- feature: reference type
- feature: smart pointer
- 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