Skip to content

tychy/hooligan

Repository files navigation

hooligan

hooligan is yet another tiny self-hosted C compiler by @tychy and @yokonao.

Get Started

Shell script for developers(hcli) and shared object file(libhooligan.so) are placed in bin directory. You have to add bin directory to PATH and LD_LIBRARY_PATH.

We recommend you use direnv. You can use .envrc.sample. Plese run cp .envrc.sample .envrc.

install shellspec

It is require to install shellspec for testing

curl -fsSL https://git.io/shellspec | sh

Or, refer to the link

Run simply shellspec command for testing

shellspec

Command

// display help
hcli -h

// compile specified files and output assembly code
hcli src a.c

// compile and assembly specified files and execute
hcli exec a.c

// generate 2nd gen compiler
make selfhost

// run tests using 2nd gen compiler
hcli test -g 2

References

低レイヤを知りたい人のためのCコンパイラ作成入門

アセンブリ命令

文字列操作

Linux x86アセンブラ

代表的な命令

x86_64 プログラミング入門

Intel Instruction Set pages

さくっとアセンブリ入門 hello,world編

C11の最終ドラフト

x86-64のABI

About

yet another tiny self-hosted C compiler

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages