Skip to content

fursich/alloycc

Repository files navigation

Alloycc

A self-hosting C compiler that operates on x86-64 linux.

Setting up

For macOS:

  1. clone this repository.

  2. run make to build alloycc

(for macOS)

$ docker build -t compilerbook https://www.sigbus.info/compilerbook/Dockerfile
$ docker run --rm -it -v $PWD:/home/user compilerbook

:~$ make # rebuild alloycc on self-hosted basis

Miscellaneous

  • run make test to see alloycc passes all (simple but comprehensive) unit tests described in test/test.c
  • make test-all will double-check this test with self-hosted compiler, as well as ensuring self-hosted binaries does not differ from first build to second.
  • make clean will clean up binaries and tmp files.

Acknowledgement

Original ideas and design of this compiler are introduced by Rui Ueyama in compilerbook, a fantastic in-depth tutorial document to implement C compiler in "incremental" approach.

You could also refer to some of his open repositories, such as 9cc or chibicc for actual implementations.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages