A systems programming language that wears its love for C on its shoulder.
C is by no means perfect, nor is Laye trying to be perfect in its stead. Rather, Laye understands that C is here to stay for the foreseeable future, and wants to peacefully co-exist with established C code while supporting modern and (hopefully) sensible language features to the table. To achieve this, Laye allows seamless importing of C source files, most commonly the public headers, into any Laye source file. In addition, Laye provides lightweight FFI to expose its own functions and data types to C.
- Any standard compliant C17 compiler (we like Clang)
- If your compiler does not support an address sanitizer with the
-fsanitize=address
option or you don't have one installed, see the build configuration options for the option to disable it.
- If your compiler does not support an address sanitizer with the
Clang 18
specifically to compile the IR generated by the LLVM backendCMake
for running fchk tests (see testing)
NOTE: The build system currently inherits whatever compiler you use to build it. All of the examples here use Clang, so the the project will also be built with clang. If you want to build Laye with GCC instead, replace instances of clang
with gcc
and that will propogate.
-
Build Nob
This project uses a version of the Nob build system by Tsoding included with this repository.
$ clang -o nob nob.c
-
Run Nob Nob will automatically rebuild itself if any changes are made to the build script.
$ ./nob
You can run
./nob --help
to see all of the commands and configuration available to you, and./nob <command> --help
for help filtered specifically to that command. By default, thebuild
subcommand is assumed.
$ ./out/laye1 [options...] files...
Run ./out/laye1 --help
for a list of avaliable options.
The test suite is written for the fchk
tool, which has a few additional dependencies as listed in requirements.
$ ./nob test
Tests are located in the ./test
directory. Each test file is a source file which defines the test inline, as well as how it should be invoked by the tooling. Read the fchk
documentation to understand how it works.
Laye has a Visual Studio Code extension for syntax hilighting. Find it here.
The source code of this repository is dual-licensed: either the MIT license or in the public domain. You can choose whichever suits you best. See the license file for the high level details on each. The license applies only to source files which contain a copy the license information within them; this means, for example, that the "Laye" name is not in the public domain, only the source files of this implementation of its compiler.
See the documentation on contributing in the GitHub project wiki.