Skip to content

nlsandler/c-compiler-implementations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

c-compiler-implementations

This is a list of reader implementations of the project from Writing a C Compiler, shamelessly ripped off from lovingly inspired by the list of implementations of Lox from Crafting Interpreters. I hope this will be a useful resource for readers planning to complete the project in a lots of different languages.

See the contributing section for details on how to add your implementation to the list. Incomplete, unpolished, and hacky implementations are welcome!

Disclaimer: I haven't code reviewed these implementations. As with any untrusted code, please be cautious about running these on your own computer.

Contents

Contributing

Please add your C compiler to this page if:

  1. It's basically following the design in Writing a C Compiler (the book, not the blog posts, which are quite different).
  2. You've finished at least chapter 1.

Your compiler does not need to be complete, polished, or production-ready, and it does not need to follow the book exactly. Compilers that implement extra language features, target different processors or are organized into different passes are totally welcome.

Open a pull request to add your compiler to the list for the appropriate implementation language, in alphabetical order. If there isn't already a subheading for your implementation language, please go ahead and add one (make sure to add it to the the table of contents too!) If you don't have a Github account, you can email me and ask me to add it for you.

For projects hosted on Github, please use the following format:

  • USERNAME/REPO - A few optional sentences about your project. E.g. if you've made different design decisions than the book suggests or implemented extra features, you can mention it here.

For projects hosted elsewhere, use this format:

  • name of project - A few optional sentences about your project. E.g. if you've made different design decisions than the book suggests or implemented extra features, you can mention it here.

Implementations

C

C++

  • romainducrocq/wheelcc - C++ (>=17) implementation for Linux: with some builtin preprocessing, comprehensive error messages with source locations and more features to come! (Part 1, 2 and extra-credits done. Part 3 in progress.)

OCaml

  • nlsandler/nqcc2 - This is the official reference implementation for the book!

Rust

About

Reader Implementations of "Writing a C Compiler"

Topics

Resources

Stars

Watchers

Forks