/toy

A compiler based on llvm and go binding

Primary LanguageGoMIT LicenseMIT

My Toy Lang

Go port of LLVM's Kaleidoscope Tutorial using the tinygo llvm bindings. doc

Compile and Run

# Ubuntu 20.04 Golang 16.0+
LLVM_SOURCE="deb https://mirrors.tuna.tsinghua.edu.cn/llvm-apt/focal/ llvm-toolchain-focal-14 main"
sudo echo "$LLVM_SOURCE" > /etc/apt/sources.list.d/llvm.list
sudo apt update
sudo apt install llvm-14-dev

go build -ldflags "-s -w"
./toy fib.k && ./fib

Other Resources