For contributors
This page is for changing flang itself rather than writing in it. If you came to write in it: Install → Your first program → Tutorial.
The tree is written in Russian: identifiers, commit messages and most of the prose. An English surface of the language exists and lexes to the same identifiers; a patch written in English is accepted — nobody will ask you to write Russian.
Build it
There is one compiler here, written in flang itself, and it builds without Node. The tree carries a bootstrap point — that same compiler printed to C99. The whole dependency list is a C compiler and make:
git clone https://github.com/digitable-lol/flang && cd flang
make -C bootstrap
bootstrap/flang --version
flang 0.7.29
The built binary is what you run from then on:
bootstrap/flang check docs/examples/rosetta/towers-of-hanoi.flang
Nothing here runs on Node: the language server ships inside the same binary — flang lsp --stdio (see the editor page).
Run the checks
Three checks run on the built binary and need no Node:
sh flang/test/обход.sh
sh flang/test/обход-примеров.sh
sh scripts/bootstrap-reprint.sh --check
The first walks the tree with the compiler, the second runs the examples of every program in the tree, the third compares the printed C against what sits in bootstrap/: a change in flang/self/ must produce the byte-identical bootstrap file.
If you touched the site pages, add:
node docs/site/build.mjs --check
It turns red on a link to nowhere, a page without its English pair, and a substitution with no value.
Code, output of the binary, error codes and the help of the commands stand on the pages as inserts from the tree, not typed by hand: the word insert in the first line of a fenced block or in an HTML remark above a table names the source. After changing an example or the compiler, rebuild the inserts and check that the pages agree with the code:
bootstrap/flang run-script docs:build
bootstrap/flang run-script docs:check
docs:check compares every page. The hook before a push runs docs:changed: it compares only the pages whose text or sources the branch changed against the dev of its remote — an inserted file, a file named in an inserted run, the binary under bootstrap/, the compiler sources for the table of codes, flang/stdlib for the library tables — and every page when the insert plan itself changed. CI runs the full docs:check.
How inserts work: ADR-0151.
Send a change
- Branch off the trunk:
git switch -c my-change. - Write it. Put examples inside the function — they run with the same
flang testcommand as everything else. - Run the checks above. A red check is not something to explain away: the change is not ready.
- Commit message: one line saying what changed and why.
- Open a pull request at github.com/digitable-lol/flang.
For a bug without a fix, open an issue in the same repository. Attach the program text and the verbatim command output with its exit code: that is enough to reproduce it.
Read this before changing the language
- Language specification — forms, values, types, diagnostic codes.
- Categories and functors — what the binary judges and what it does not.
- Processes and fault tolerance — the whole process model.
- Kernel specification — what the proof kernel accepts.
- Repository layout — what lives where.
- Developing the language — how something new gets added.
- Known limitations — what the language cannot do and knows it.