~akkartik/basic-layers

Example repo that can build subsets of features for easier comprehension
324110a5 — Kartik Agaram 9 months ago
license
2ade7f1d — Kartik Agaram 4 years ago
work around sr.ht
e3194bb8 — Kartik Agaram 4 years ago
initial commit

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~akkartik/basic-layers
read/write
git@git.sr.ht:~akkartik/basic-layers

You can also use your local clone with git send-email.

Example project that allows newcomers to gradually learn about its internals. It allows newcomers to build subsets of its features so that they can focus on its core skeleton at first, later adding features at their own pace.

#Try it out

First build the project:

./build

Try running the tests:

$ ./a.out test

Now try building and running tests for subsets of layers:

$ ./build_and_test_until 000*
$ ./build_and_test_until 001*
$ ./build_and_test_until 002*
$ ./build_and_test_until 003*
$ ./build_and_test_until 004*

Each command builds all .cc files that start with a numeric prefix and are lexically less then or equal to its argument. For example, building until 001* includes two layers: 000organization.cc and 001test.cc.

In a well-formed codebase based on layers, all such subsets of layers should pass all their tests.

Later layers override earlier ones using directives of the form :(...). See http://akkartik.name/post/wart-layers for more details, and tangle/Readme.md in this repo for a reference of supported directives.

#Coda

This repo is pulls together several unconventional ideas:

  1. A zero-dependency build system. See https://git.sr.ht/~akkartik/basic-build for details.

  2. A minimal test harness for C. See https://git.sr.ht/~akkartik/basic-test for details.

  3. Primitives for automatic white-box testing, a more comprehensive and flexible way to express automated tests. See https://git.sr.ht/~akkartik/basic-whitebox-test for details.

For a more fully fleshed out codebase using all these ideas, check out https://github.com/akkartik/mu