Repository navigation
Windows Release
Release v0.1 – Basic Compiler
Highlights:
- Emit x86-64 (MASM (windows), GAS (linux), LLVM IR (linux)) Windows code from AST
- Assemble with Microsoft’s ML64
- Link with GCC (MinGW-w64)
- Includes “Hello, World!” sample
Language Support
- Support a variety of data types (builtins)
- Supports various unary and binary operations
- Supports various conditional operations
- Supports user-defined functions
- Supports linking to extern functions
- Supports variadic extern functions
- Functions implement canaries to detect stack corruption
Prerequisites
- Windows 10+ with:
- Visual Studio Build Tools (for
ml64.exe) - MinGW-w64 GCC on PATH
- Visual Studio Build Tools (for
- A working C++17 toolchain
Usage
-
Code
extern fn printf(fmt: string, ...) -> int32_t; fn main() { printf("Hello Z!!\n"); } -
Compile
bash zpiler --format x86_64-mswin -o output.asm <path_to_source> -
Assemble
bash ml64 /nologo /c <path_to_asm> -
Link
bash gcc <path_to_object> -o temp.exe -
Run
bash <path_to_exe>
Warning
By no means is this language perfect, it's just a toy project, use it at your own risk