Now written in C++, LCC started as a compiler written in C for just one hobby language, Intercept
. Over the course of a few years, it has grown into a compiler collection, with a whole host of frontends created and maintained by the growing and thriving community.
- Intercept (WIP)
- Laye (WIP)
In the future, we hope to support
- some of C
- YOUR language :)
For convenience purposes, there is a single executable, lcc
, that can delegate between all of the different compilers in the collection. This is called the compiler driver, often shortened to just driver.
Running the driver executable with no arguments will display a usage message that contains compiler flags and options as well as command layout.
The driver uses file extension to determine which compiler to pass the source code to. lcc ./tst/intercept/byte.int
will invoke the Intercept
compiler, while lcc ./tst/laye/exit_code.laye
will invoke the Laye
compiler, for example.
Dependencies:
- CMake >= 3.20
- Any C++ Compiler (We like GCC)
NOTE: If on Windows and using Visual Studio, see this document instead.
First, generate a build tree using CMake.
cmake -B bld
Finally, build an executable from the build tree.
cmake --build bld
To use external calls, link with appropriate libraries!
GNU Binutils:
as code.S -o code.o
ld code.o -o code
GNU Compiler Collection
gcc code.S -o code
LLVM/Clang
clang code.S -o code --target=x86_64
Use LLVM’s clang
to compile the generated LLVM output into a library or executable.
clang code.ll -o code