use std::io::io;
pub func main() -> i32 {
io::stdout().out("hello world!").endln();
return 0;
}
See simple language guide in:
See compiler library reference in:
Use this command to show help:
<colgm compiler path> -h
If you want to compile test.colgm
with debug mode,
and output the executable file to test.out
,
use this command:
<colgm compiler path> test.colgm -g -o test.out
Colgm accepts -O
option to enable optimization.
-O0
: disable optimization-O1
: enable basic optimization-O2
: enable advanced optimization-O3
: enable maximum optimization-Oz
: enable speed optimization-Os
: enable size optimization
Also you could use -O[x] -g
for release with debug info.
Before building the project, here's the requirements:
- python >= 3.8
- llvm >= 13.0
- clang >= 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 bootstrap compiler, you can use this:
python3 misc/build.py -boot
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
Use this script to test tcp/udp utils:
python3 misc/test_tcp_udp.py
To check if any memory leakage, use this script:
python3 misc/memleak_check.py
And for development, you should follow the code style.
- feature: fuzzy match when variable is not found
- feature: reference type
- feature: to_string method for struct/enum/tagged union
- 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 (socket, TCP/UDP Server and Client)
- HTTP Utilities
- OS Utils (exec, env, args, etc)
- Assert and Bench
- Deprecation Marker
- Regex
- Package manager
- Docs generator
- SIR refactor
- constant fold
- DCE opt
- CSE opt