Home

Awesome

langcc: A Next-Generation Compiler Compiler

langcc can serve as a replacement for lex+yacc, but is much more powerful. langcc enables a completely new paradigm for developing programming languages based on iteratively improving the intuitive declarative specification of your language instead of laboriously updating your hand-written compiler frontend for every grammar change.

langcc is self-hosting. The file grammars/meta.lang contains the specification for the "language of languages" in which langcc expects .lang files to be written. In this canonical implementation, the file bootstrap.sh uses langcc to generate its own compiler front-end.

langcc is stable and feature-complete. It is ready to be used as a research prototype to facilitate rapid exploration of new compilers and programming languages. It is free and open-source and available under the Apache 2.0 License.

langcc is also described in the following companion technical reports, which provide the theoretical basis for its functionality.

Build

This build has been verified to work on Ubuntu 22.04 and MacOS 12.5.

Ubuntu CI   macOS CI

For Ubuntu 22.04:

./deps_ubuntu.sh
make -j8
sudo make install

For macOS 12.5 (requires Homebrew):

./deps_macos.sh
make -j8
sudo make install

And, in order to bootstrap the langcc front-end itself, subsequently run:

./bootstrap.sh

Examples

Once langcc (and its companion datacc) have been built, you can run the various provided examples:

Documentation

For full documentation, please see the user manual.