raz / commit 88dd58b5

commit
88dd58b51bf1666da9d1e426b55c734d109dbc9c
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
7624e35d
Build and publish the source browser and release archives under /source/

patch · log

58 files changed, +891 -113

.gitignore (history) modified +3 -0

@@ -1,4 +1,7 @@
11 build/
2+.wrangler/
3+/site/public/source/
4+/site/__pycache__/
25 /raz
36 # Programs make check builds next to their sources
47 /examples/*

CLAUDE.md modified +8 -0

@@ -80,6 +80,14 @@
8080
8181 ## Where things stand
8282
83+The website's `/source/` browser and releases are built by ladle,
84+pinned with its checksum under `site/tools/`. `make site` builds the
85+main pages and then the source site. Wrangler runs `make site-source`
86+before uploading, so the generated Git store stays out of this
87+repository. `site/README.md` gives the build, release records and
88+checks. `site/releases` preserves the existing untagged website
89+distributions; it does not create their tags.
90+
8391 v0.20.0, report 2026-10.34, is made and not yet tagged: v0.19.0 builds
8492 `src/` (`BOOT`) and the Pascal seed is gone; `Buf.bytes`,
8593 `Sys.entryKind` and `src/`'s `Item`s only read take `const`; and the

HANDOVER.md modified +34 -1

@@ -1,4 +1,37 @@
1-# Handover, 2026-10-17
1+# Handover
2+
3+## Website source integration, 2026-10-19
4+
5+`make site` now adds ladle's source browser, history, release pages
6+and a dumb-HTTP clone store under `/source/`. The existing Cloudflare
7+deploy command stays `npx wrangler deploy`; its custom build hook runs
8+`make site-source` before uploading. The source output is ignored,
9+avoiding a Git store that contains copies of its own earlier builds.
10+The compressed static ladle executable is pinned at 509b9d3 with its
11+checksum and build instructions in `site/tools/`.
12+
13+`site/releases` records the existing v0.18.1, v0.19.0 and v0.20.0
14+website distributions at the commits below. Both site builders read
15+it, so a plain build keeps v0.20.0 as the latest download. All
16+original compiler archives and their published checksums keep their
17+bytes. Each supported version also has a source archive; the three
18+untagged versions have notes under `site/release-notes/` explaining
19+their status. No compiler release or tag was created here.
20+
21+The root `_headers` carries scoped `/source/` rules, including the
22+canonical release-page URLs Cloudflare serves. Other pages keep their
23+existing policy; `/download/latest` keeps its redirect. `site/README.md`
24+gives the full build and verification procedure. The bundled builder
25+needs only Python 3 and git on x86-64 Linux. A shallow deployment
26+checkout fetches the full history and tags from its own origin.
27+
28+Checks before pushing: `make check` (1,012 checks), `make site`, six
29+Git and checksum checks in `site/check.py`, and Wrangler's actual
30+custom build in a deploy dry run. The existing report PDFs were
31+reused; Pandoc 3.8 rebuilds the HTML report as before. Live deployment
32+and HTTP download/clone verification follow the push to main.
33+
34+## Compiler handover, 2026-10-17
235
336 v0.20.0 is done on `main`; nothing is tagged. This says what to tag
437 where, how, and what to check. Delete this file once the three tags

Makefile (history) modified +13 -2

@@ -175,8 +175,19 @@
175175 # "Raz, Set, Go" (whose programs are run here, so the output shown is
176176 # real), the report and the latest release's tarball. site/build.py
177177 # says how; it needs ./raz and pandoc. RELEASES, "vX.Y.Z=COMMIT ...",
178-# names releases whose tags aren't pushed yet.
178+# adds release records to those kept in site/releases. site-source runs
179+# ladle after the pages: its Git store and releases live under /source/,
180+# with their headers merged at the upload's root. The pinned ladle is
181+# bundled for Cloudflare; LADLE may name a locally built one instead.
182+LADLE ?=
179183 site: raz pdf
180184 python3 site/build.py $(RELEASES)
185+ $(MAKE) site-source
181186
182-.PHONY: prev-bench fixpoint check gdb bench kernels stress alpine fmt loc man pdf dist site clean install uninstall
187+# Wrangler runs this before deploying the committed pages. The generated
188+# Git store must never be committed: otherwise later stores contain copies
189+# of earlier ones. See site/README.md for the release and upload procedure.
190+site-source:
191+ python3 site/source.py $(if $(LADLE),--ladle $(LADLE)) $(RELEASES)
192+
193+.PHONY: prev-bench fixpoint check gdb bench kernels stress alpine fmt loc man pdf dist site site-source clean install uninstall

README.md (history) modified +19 -0

@@ -86,6 +86,7 @@
8686 make pdf # build/raz.pdf and build/raz-lib.pdf, the two volumes, by pandoc and Chromium
8787 make dist # build/raz-V-linux-x86_64.tar.gz, the release's tarball
8888 make site # site/public/, the website, by pandoc and python3
89+ make site-source # /source/, its releases and HTTP clone store, by git and Python 3
8990
9091 ## Using it
9192
@@ -237,6 +238,24 @@
237238 wherever it runs, so GitHub's and the website's agree. Once a release
238239 is out, `BOOT` may name it, and the next one is built by it: then
239240 `src/` may use what it brought.
241+
242+The website's [source browser](https://raz.lucelad.workers.dev/source/)
243+has the files, history and [release pages](https://raz.lucelad.workers.dev/source/releases/).
244+Each supported version has its compiler archive, a separate source
245+archive and SHA-256s. The same address is a git remote:
246+
247+ git clone https://raz.lucelad.workers.dev/source/
248+
249+`site/releases` records existing website distributions whose tags
250+are not pushed yet, so a plain `make site` keeps offering them. Both
251+the home page and ladle's release pages use this list. Existing
252+`download/` URLs and compiler archives keep their exact bytes.
253+[Building the site](site/README.md) gives the complete procedure.
254+`make site` runs ladle after building the normal pages and merges its
255+headers under `/source/`. The source output stays ignored; Wrangler's
256+build hook regenerates it before `npx wrangler deploy` uploads the
257+site. Commit the main pages, scripts and pinned builder, then push
258+`main` for the existing Cloudflare deployment.
240259
241260 A version of the report is named by its month and a count; the report's
242261 last section says what each version changed.

site/README.md (history) added +109 -0

@@ -0,0 +1,109 @@
1+# Building raz's website
2+
3+`make site` builds the pages, tours, reports and downloads with
4+`build.py`, then the source browser and release pages with `source.py`.
5+The latter needs git and Python 3 on x86-64 Linux. Its pinned static
6+ladle executable is kept compressed under `tools/`, with a checksum
7+and build instructions. The helper verifies the compressed bytes,
8+unpacks it into `build/site/ladle` and runs it. No compiler or network
9+connection is needed with a full checkout. If a deployment service
10+clones shallowly, the helper first fetches the full history and tags
11+from that checkout's origin, using its existing repository access.
12+
13+The existing `/download/` URLs and archives stay as they are. Before
14+attaching an archive to a release, `source.py` checks its bytes against
15+the published checksum beside it. It fails if either is missing or
16+the sum differs; it never replaces that checksum to fit new bytes.
17+
18+## The source browser
19+
20+`source.py` makes a fresh bare clone of `main`, with its reachable
21+tags, using `--single-branch --no-local`. Other branches, reflogs and
22+unreachable tags are not published. The store is repacked with a
23+20 MiB target, and `git update-server-info` prepares it for cloning
24+over plain HTTP. The exported files are only `HEAD`, `info/refs`,
25+`objects/info/packs` and `objects/pack/`: no git configuration, hooks
26+or local paths. ladle writes the pages beside these files.
27+
28+The clone's committed tree is the source of every page. A detached
29+deployment checkout is supported too: the publishing service chooses
30+main, and the helper names its commit `main` only in the temporary
31+store. Uncommitted
32+files and the generated source site do not enter it. In particular,
33+`public/source/` must stay ignored: committing a source browser's own
34+output would publish a copy of the previous output on the next build.
35+
36+The result lives at `public/source/`, browsed and cloned at
37+<https://raz.lucelad.workers.dev/source/>. To build just this part,
38+after the normal downloads exist:
39+
40+```sh
41+make site-source
42+```
43+
44+Or run `python3 site/source.py` directly. `--ladle /path/to/ladle`
45+overrides the bundled executable for development. `--url` may give
46+another absolute address ending in `/source/`, for
47+previewing the feeds and clone line. `source.theme` starts from
48+ladle's paper theme, with raz's page and link colours; ladle checks
49+its light and dark contrast when it runs.
50+
51+## Releases and downloads
52+
53+Each supported tag from `v0.7.1` onward gets its existing Linux
54+x86-64 compiler archive and a separate source archive of the tagged
55+commit. Source archives use `git archive` and gzip without a timestamp;
56+their names include the version, and they do not include submodules.
57+ladle writes each artifact's size and SHA-256 on its release page,
58+with a downloadable `.sha256` beside it.
59+
60+`releases` lists distributions whose tags have not yet been pushed:
61+one `vX.Y.Z FULL_COMMIT_HASH` per line, with `#` comments. The commit
62+must be on `main`'s first-parent line. A tag added later must name the
63+same commit; otherwise the build fails. Remove a manifest row only
64+after that tag exists. This records existing distributions; the site
65+build never creates tags or compiler releases.
66+
67+`release-notes/vX.Y.Z.md`, when present, supplies that version's notes.
68+Otherwise an annotated tag supplies them. The three untagged website
69+distributions have notes here that identify their pending tags.
70+
71+Both builders read this list through `releases.py`, so the home page
72+and source browser offer the same versions. An existing distribution
73+can also be given as `vX.Y.Z=COMMIT` on either helper's command line;
74+`make site RELEASES='vX.Y.Z=COMMIT'` passes it to both. Permanent
75+distributions belong in the manifest rather than a remembered command.
76+
77+## Headers and hosting
78+
79+ladle's header rules are prefixed with `/source` and merged into the
80+root `public/_headers` between marked comments. Rebuilding replaces
81+that block, preserving other root rules. Its general security policy
82+therefore applies only to `/source/*`, including raw files and git
83+objects. `source.py` never changes `_redirects`, so `/download/latest`
84+continues to work. Cloudflare reads the root header file; the nested
85+one is not enough.
86+
87+The new source tree is built in a temporary directory before replacing
88+the old one. The complete output is counted before it is installed:
89+at most 20,000 files, each at most 25 MiB. A 20 MiB pack target is not
90+a guarantee, since git may place a larger object in its own pack.
91+The final file check catches that too. No total-byte limit is assumed;
92+the build prints total bytes for review against the hosting plan.
93+
94+Before deploying, serve `public/` locally, clone `/source/` and run
95+`git fsck` in the clone. Download a compiler and its checksum from a
96+release page, check it, then unpack it and compile Hello. Repeat the
97+clone and download checks against the live address after deployment;
98+a local file server does not test Cloudflare's headers.
99+
100+`python3 site/check.py` checks release identity and ordering against
101+small real Git repositories, including shallow deployment checkouts,
102+and rejects a damaged bundled builder. `make check` remains the
103+compiler's required check before committing.
104+
105+The Wrangler configuration runs `make site-source` before deployment.
106+The usual `npx wrangler deploy` therefore generates the ignored source
107+browser from the committed repository before uploading the assets.
108+It uses the already generated main pages and distributions; it does
109+not run the compiler, pandoc or the tours on the deployment machine.

site/build.py modified +18 -18

@@ -3,7 +3,8 @@
33
44 python3 site/build.py [vX.Y.Z=COMMIT ...]
55
6-Each vX.Y.Z=COMMIT is a release whose tag isn't pushed yet: it is
6+site/releases records website distributions whose tags are not pushed
7+yet. Each additional vX.Y.Z=COMMIT is another such distribution: it is
78 offered as if the tag were at COMMIT, its tarball made by make dist
89 with VERSION, the same tarball the tag will give.
910
@@ -37,6 +38,7 @@
3738 with raz on the path, and shown with what it printed.
3839 """
3940 import hashlib, html, os, re, shutil, subprocess, sys, tempfile
41+from releases import refs
4042
4143 HERE = os.path.dirname(os.path.abspath(__file__))
4244 ROOT = os.path.dirname(HERE)
@@ -237,6 +239,7 @@
237239 ("tour", "tour/index.html", "Raz, Set, Go"),
238240 ("advanced", "advanced/index.html", "More Raz"),
239241 ("spec", "spec.html", "Report"),
242+ ("source", "source/index.html", "Source"),
240243 ("get", "index.html#download", "Download")])
241244 return """<!doctype html>
242245 <html lang="en">
@@ -260,10 +263,10 @@
260263 <main>
261264 %s
262265 </main>
263-<footer>raz is under the ISC license.</footer>
266+<footer>raz is under the ISC license. <a href="%ssource/index.html">Source</a></footer>
264267 </body>
265268 </html>
266-""" % (html.escape(title), html.escape(title), SITE, up, up, up, up, up, up, nav, body)
269+""" % (html.escape(title), html.escape(title), SITE, up, up, up, up, up, up, nav, body, up)
267270
268271 def write(path, text):
269272 path = os.path.join(OUT, path)
@@ -335,12 +338,8 @@
335338 body = '<div class="spec">%s</div>' % p.stdout
336339 write("spec.html", page("The raz report", body, 0, "spec"))
337340
338-# The first release whose tarball the site offers: the first with the
339-# manual, which make dist packs
340-FIRST_RELEASE = "v0.7.1"
341-
342341 def build_download(untagged):
343- """Every release's tarball from FIRST_RELEASE on, in public/download/
342+ """Every release's tarball from v0.7.1 on, in public/download/
344343 with its SHA-256, and /download/latest leading to the newest; a list
345344 of (version, file name, SHA-256), oldest first. A program's CI can
346345 fetch the version it was written for by its name, so none is ever
@@ -349,20 +348,20 @@
349348 made again: those before 0.14.0 were made before make dist made the
350349 same tarball each time, so a new one would differ, and so its
351350 SHA-256, which a program's CI may check."""
352- git = lambda *a: subprocess.run(("git", "-C", ROOT) + a, capture_output=True,
353- text=True, check=True).stdout.strip()
354351 releases = []
355- tags = git("tag", "-l", "v*", "--sort=v:refname", "--contains", FIRST_RELEASE).split()
356- revs = [(tag, tag, []) for tag in tags]
357- revs += [(tag, rev, ["VERSION=" + tag[1:]]) for tag, rev in untagged if tag not in tags]
358- for tag, rev, version in revs:
352+ for tag, rev in refs(ROOT, untagged):
359353 name = "raz-%s-linux-x86_64.tar.gz" % tag[1:]
360354 made = os.path.join(OUT, "download", name)
361355 if not os.path.exists(made):
362- subprocess.run(["make", "-s", "-C", ROOT, "dist", "REV=" + rev] + version,
356+ subprocess.run(["make", "-s", "-C", ROOT, "dist", "REV=" + rev, "VERSION=" + tag[1:]],
363357 stdout=subprocess.DEVNULL, check=True)
364358 shutil.copy(os.path.join(ROOT, "build", name), made)
365359 digest = hashlib.sha256(open(made, "rb").read()).hexdigest()
360+ checksum = made + ".sha256"
361+ if os.path.exists(checksum):
362+ expected = open(checksum, encoding="utf-8").read().split()
363+ if not expected or expected[0] != digest:
364+ sys.exit("release archive does not match its published checksum: " + made)
366365 write("download/%s.sha256" % name, "%s %s\n" % (digest, name))
367366 releases.append((tag[1:], name, digest))
368367 # Cloudflare reads _redirects from the root of what it serves
@@ -397,6 +396,10 @@
397396 def main():
398397 if not os.path.exists(RAZ):
399398 sys.exit("make raz first")
399+ untagged = [a.split("=", 1) for a in sys.argv[1:]]
400+ if not all(len(u) == 2 and re.fullmatch(r"v\d+\.\d+\.\d+", u[0]) for u in untagged):
401+ sys.exit("usage: build.py [vX.Y.Z=COMMIT ...]")
402+ refs(ROOT, untagged) # validate the release records before removing old pages
400403 # everything is made again but the tarballs (see build_download)
401404 for f in os.listdir(OUT) if os.path.exists(OUT) else []:
402405 path = os.path.join(OUT, f)
@@ -427,9 +430,6 @@
427430 build_spec()
428431 for pdf in ("raz.pdf", "raz-lib.pdf"): # made by make pdf
429432 shutil.copy(os.path.join(ROOT, "build", pdf), OUT)
430- untagged = [a.split("=", 1) for a in sys.argv[1:]]
431- if not all(len(u) == 2 and re.match(r"v\d+\.\d+\.\d+$", u[0]) for u in untagged):
432- sys.exit("usage: build.py [vX.Y.Z=COMMIT ...]")
433433 build_home(build_download(untagged))
434434 print("site/public: %s lessons" % " + ".join(map(str, counts)))
435435

site/check.py added +108 -0

@@ -0,0 +1,108 @@
1+#!/usr/bin/env python3
2+"""Check release selection with real git histories: python3 site/check.py.
3+
4+Uses Python's standard library and git. All repositories and downloads
5+are temporary; no release, working checkout or published file is changed.
6+"""
7+
8+from pathlib import Path
9+import subprocess
10+import tempfile
11+import unittest
12+
13+from releases import refs
14+import source
15+
16+
17+class Releases(unittest.TestCase):
18+ def setUp(self):
19+ self.temporary = tempfile.TemporaryDirectory()
20+ self.addCleanup(self.temporary.cleanup)
21+ self.directory = Path(self.temporary.name)
22+ self.repo = self.directory / "repo"
23+ self.repo.mkdir()
24+ self.git("init", "--quiet", "--initial-branch=main")
25+ (self.repo / "site").mkdir()
26+ self.manifest = self.repo / "site/releases"
27+ self.manifest.write_text("# distributions\n")
28+ self.commits = []
29+ for number, version in enumerate(("v0.7.1", "v0.9.0", "v0.10.0")):
30+ (self.repo / "file").write_text(str(number))
31+ self.git("add", ".")
32+ self.git("commit", "--quiet", "-m", version)
33+ self.commits.append(self.git("rev-parse", "HEAD"))
34+ self.git("tag", version)
35+ self.manifest.write_text(f"# not tagged yet\nv0.20.0 {self.commits[-1]}\n")
36+ self.git("add", "site/releases")
37+ self.git("commit", "--quiet", "-m", "record distribution")
38+
39+ def git(self, *args, repo=None):
40+ return subprocess.check_output([
41+ "git", "-C", str(repo or self.repo), "-c", "user.name=Test",
42+ "-c", "user.email=test@example.org", "-c", "commit.gpgSign=false", *args,
43+ ], text=True).strip()
44+
45+ def test_numeric_tags_and_manifest(self):
46+ self.assertEqual(refs(self.repo), list(zip(
47+ ("v0.7.1", "v0.9.0", "v0.10.0", "v0.20.0"),
48+ self.commits + [self.commits[-1]],
49+ )))
50+
51+ def test_manifest_cannot_move_a_tag(self):
52+ self.manifest.write_text(f"v0.9.0 {self.commits[0]}\n")
53+ with self.assertRaisesRegex(ValueError, "disagree"):
54+ refs(self.repo)
55+
56+ def test_manifest_cannot_publish_another_line(self):
57+ self.git("checkout", "--quiet", "-b", "side", self.commits[0])
58+ (self.repo / "side").write_text("a development branch\n")
59+ self.git("add", "side")
60+ self.git("commit", "--quiet", "-m", "side")
61+ side = self.git("rev-parse", "HEAD")
62+ self.git("checkout", "--quiet", "main")
63+ self.manifest.write_text(f"v0.20.0 {side}\n")
64+ with self.assertRaisesRegex(ValueError, "first-parent"):
65+ refs(self.repo)
66+ # A new tag must not override the recorded distribution, even
67+ # when that tag would otherwise be skipped as off the main line.
68+ self.manifest.write_text(f"v0.20.0 {self.commits[-1]}\n")
69+ self.git("tag", "v0.20.0", side)
70+ with self.assertRaisesRegex(ValueError, "disagree"):
71+ refs(self.repo)
72+
73+ def test_shallow_deploy_recovers_history_and_tags(self):
74+ # A file URL uses git's transport, so --depth really is shallow.
75+ clone = self.directory / "deploy"
76+ self.git("clone", "--quiet", "--depth=1", "--branch=main", self.repo.as_uri(), str(clone))
77+ self.assertEqual(self.git("rev-parse", "--is-shallow-repository", repo=clone), "true")
78+ self.assertEqual(refs(clone), refs(self.repo))
79+ self.assertEqual(self.git("rev-parse", "--is-shallow-repository", repo=clone), "false")
80+
81+ def test_detached_shallow_deploy_needs_no_local_main(self):
82+ clone = self.directory / "deploy"
83+ self.git("clone", "--quiet", "--depth=1", "--branch=main", self.repo.as_uri(), str(clone))
84+ self.git("checkout", "--quiet", "--detach", repo=clone)
85+ self.git("branch", "-D", "main", repo=clone)
86+ self.assertEqual(refs(clone), refs(self.repo))
87+ original = source.ROOT
88+ self.addCleanup(setattr, source, "ROOT", original)
89+ source.ROOT = clone
90+ store = source.prepare_store(self.directory)
91+ self.assertEqual(self.git("rev-parse", "HEAD", repo=store), self.git("rev-parse", "HEAD", repo=clone))
92+ self.assertEqual(self.git("symbolic-ref", "HEAD", repo=store), "refs/heads/main")
93+ self.git("fsck", "--strict", repo=store)
94+ self.assertEqual(self.git("rev-parse", "--abbrev-ref", "HEAD", repo=clone), "HEAD")
95+
96+ def test_modified_builder_is_rejected_before_unpacking(self):
97+ packed = self.directory / "ladle.gz"
98+ packed.write_bytes(b"not the published executable")
99+ packed.with_name("ladle.gz.sha256").write_text("0" * 64 + " ladle.gz\n")
100+ original = source.LADLE
101+ self.addCleanup(setattr, source, "LADLE", original)
102+ source.LADLE = packed
103+ with self.assertRaisesRegex(ValueError, "recorded SHA-256"):
104+ source.pinned_ladle()
105+
106+
107+if __name__ == "__main__":
108+ unittest.main()

site/content/home.html (history) modified +5 -0

@@ -7,6 +7,7 @@
77 <a class="btn" href="advanced/index.html">More Raz</a>
88 <a class="btn" href="#download">Download</a>
99 <a class="btn" href="spec.html">Read the report</a>
10+ <a class="btn" href="source/index.html">Browse the source</a>
1011 </div>
1112 </section>
1213
@@ -85,3 +86,7 @@
8586 good. Earlier releases: @EARLIER@; each has its SHA-256 beside it, with
8687 <code>.sha256</code> added to its name.</p>
8788 <p class="sha">SHA-256 <code>@SHA256@</code></p>
89+<p><a href="source/releases/index.html">Release pages</a> give each
90+version's commit, notes, compiler and source archives, with checksums.
91+Browse the <a href="source/index.html">source and history</a>, or clone:
92+<code>git clone https://raz.lucelad.workers.dev/source/</code>.</p>

site/public/_headers (history) added +78 -0

@@ -0,0 +1,78 @@
1+
2+
3+# BEGIN ladle source
4+/source/*
5+ X-Content-Type-Options: nosniff
6+ Content-Security-Policy: default-src 'none'; style-src 'self'; img-src 'self' https:; base-uri 'none'; form-action 'none'; frame-ancestors 'none'
7+/source/raw/*
8+ Content-Type: text/plain; charset=utf-8
9+/source/commit/*.patch
10+ Content-Type: text/plain; charset=utf-8
11+/source/feed.xml
12+ Content-Type: application/atom+xml; charset=utf-8
13+/source/releases.xml
14+ Content-Type: application/atom+xml; charset=utf-8
15+/source/objects/*
16+ Content-Type: application/octet-stream
17+ Cache-Control: public, max-age=31536000, immutable
18+/source/HEAD
19+ Content-Type: text/plain; charset=utf-8
20+ Cache-Control: no-cache
21+/source/line
22+ Content-Type: text/plain; charset=utf-8
23+ Cache-Control: no-cache
24+/source/info/refs
25+ Content-Type: text/plain; charset=utf-8
26+ Cache-Control: no-cache
27+/source/objects/info/packs
28+ ! Content-Type
29+ ! Cache-Control
30+ Content-Type: text/plain; charset=utf-8
31+ Cache-Control: no-cache
32+/source/releases/*
33+ Content-Type: application/octet-stream
34+/source/releases/*.sha256
35+ ! Content-Type
36+ Content-Type: text/plain; charset=utf-8
37+/source/releases/index.html
38+ ! Content-Type
39+ Content-Type: text/html; charset=utf-8
40+/source/releases/:version/index.html
41+ ! Content-Type
42+ Content-Type: text/html; charset=utf-8
43+/source/releases/
44+ ! Content-Type
45+ Content-Type: text/html; charset=utf-8
46+/source/releases/:version/
47+ ! Content-Type
48+ Content-Type: text/html; charset=utf-8
49+/source/raw/*.png
50+ ! Content-Type
51+ Content-Type: image/png
52+/source/raw/*.jpg
53+ ! Content-Type
54+ Content-Type: image/jpeg
55+/source/raw/*.jpeg
56+ ! Content-Type
57+ Content-Type: image/jpeg
58+/source/raw/*.gif
59+ ! Content-Type
60+ Content-Type: image/gif
61+/source/raw/*.webp
62+ ! Content-Type
63+ Content-Type: image/webp
64+/source/raw/*.avif
65+ ! Content-Type
66+ Content-Type: image/avif
67+/source/raw/*.ico
68+ ! Content-Type
69+ Content-Type: image/x-icon
70+/source/raw/*.bmp
71+ ! Content-Type
72+ Content-Type: image/bmp
73+/source/raw/*.svg
74+ ! Content-Type
75+ Content-Type: image/svg+xml
76+ ! Content-Security-Policy
77+ Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; img-src data:; font-src data:; sandbox; frame-ancestors 'none'
78+# END ladle source

site/public/advanced/allocators.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -197,6 +197,6 @@
197197 <h2>What to take from this</h2>
198198 <ul><li>An allocator is a value, so it is passed, wrapped, swapped in a test and replaced by a bump allocator in a program with no heap.</li><li>A library function that needs memory takes the allocator as a parameter, so its caller owns the policy.</li><li>An allocator can use the record-first trick to carry any state it needs, because converting a pointer to a record's first field and back is the same address.</li></ul><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="processes.html">&larr; Time, randomness and other programs</a><a href="index.html">Contents</a><a class="next" href="static.html">A program with no run time &rarr;</a></div></article></div>
199199 </main>
200-<footer>raz is under the ISC license.</footer>
200+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
201201 </body>
202202 </html>

site/public/advanced/asm.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -254,6 +254,6 @@
254254 <h2>What goes wrong</h2>
255255 <p>A code procedure that breaks its rules breaks the program, and what follows isn't defined. Writing through a wrong pointer, a changed <code>rbx</code>, a missing <code>ret</code>, a stack left unbalanced: the language can't help, because it doesn't see inside. Keep them short, give each a comment that says what it expects in which register, test each against a raz twin, and use them for what only the machine can do.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="targets.html">&larr; One module, one file per target</a><a href="index.html">Contents</a><a class="next" href="syscalls.html">System calls &rarr;</a></div></article></div>
256256 </main>
257-<footer>raz is under the ISC license.</footer>
257+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
258258 </body>
259259 </html>

site/public/advanced/atomics.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -199,6 +199,6 @@
199199 <ul><li>A counter, a ticket, a flag: <code>XADD</code> or <code>XCHG</code>.</li><li>A value computed from the old one: a <code>CAS</code> loop.</li><li>Several variables that must change together: a <code>Lock</code> or a <code>Mutex</code>. Don't try to be clever with several atomics; the one invariant spanning them is the thing that breaks.</li></ul>
200200 <p>All three act on a word. For anything bigger, the thing you swap is a pointer to the bigger thing: the next lessons do exactly that.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="volatile.html">&larr; Volatile</a><a href="index.html">Contents</a><a class="next" href="ordering.html">Ordering and publication &rarr;</a></div></article></div>
201201 </main>
202-<footer>raz is under the ISC license.</footer>
202+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
203203 </body>
204204 </html>

site/public/advanced/bytes.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -242,6 +242,6 @@
242242 -9223372036854775808
243243 </code></pre><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="fmt.html">&larr; Output and formatting</a><a href="index.html">Contents</a><a class="next" href="collections.html">Lists, arrays, maps and sorting &rarr;</a></div></article></div>
244244 </main>
245-<footer>raz is under the ISC license.</footer>
245+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
246246 </body>
247247 </html>

site/public/advanced/collections.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -187,6 +187,6 @@
187187 <h2>Choosing</h2>
188188 <p>Use a <code>List</code> when you push and pop at one end and walk it in order. Use a <code>Vec</code> when you add at the end and index, and don't know how many will come; an array when you do. Use a <code>Map</code> when you look things up by key. Use <code>Sort</code> on either's slice when you want an order. When none of them fits, they are each under a hundred lines of raz in <code>lib/</code>, and the advanced tour's allocator lesson shows what is underneath.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="bytes.html">&larr; Strings and bytes</a><a href="index.html">Contents</a><a class="next" href="files.html">Files and the command line &rarr;</a></div></article></div>
189189 </main>
190-<footer>raz is under the ISC license.</footer>
190+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
191191 </body>
192192 </html>

site/public/advanced/files.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -272,6 +272,6 @@
272272 <p><code>-h</code> and <code>--help</code> are <code>Opt</code>'s: the program never sees them. A mistake on the command line is a sentence on standard error with the program's name first, then the synopsis, and status 2. Nothing in <code>Tool</code> wrote any of that.</p>
273273 <p>A mistake in the table itself, such as an option given twice, is the program's, and <code>init</code> says so and ends with status 1 before it reads a word.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="collections.html">&larr; Lists, arrays, maps and sorting</a><a href="index.html">Contents</a><a class="next" href="processes.html">Time, randomness and other programs &rarr;</a></div></article></div>
274274 </main>
275-<footer>raz is under the ISC license.</footer>
275+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
276276 </body>
277277 </html>

site/public/advanced/fmt.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html" aria-current="page">Output and formatting</a></li>
@@ -193,6 +193,6 @@
193193 CE BB
194194 </code></pre><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="index.html">Contents</a><a class="next" href="bytes.html">Strings and bytes &rarr;</a></div></article></div>
195195 </main>
196-<footer>raz is under the ISC license.</footer>
196+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
197197 </body>
198198 </html>

site/public/advanced/index.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="contents"><h1>More Raz</h1>
2222 <p>The second tour, for the part of raz that sits close to the machine. It
@@ -55,6 +55,6 @@
5555 <li><a href="ring.html">A ring buffer between threads</a> <span>A single-producer, single-consumer queue, put together from what the tour has covered.</span></li>
5656 </ol></div>
5757 </main>
58-<footer>raz is under the ISC license.</footer>
58+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
5959 </body>
6060 </html>

site/public/advanced/lifecycle.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -159,6 +159,6 @@
159159 </code></pre>
160160 <p><code>Sys.ready(fd, ms)</code> waits up to <code>ms</code> milliseconds for something to read; with <code>Sys.readyOf</code> it waits on several descriptors, so one loop serves a socket, a terminal and a stop signal together. <code>Sys.ignore(sig, true)</code> makes a signal do nothing, as a shell ignores <code>SIGTTOU</code>.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="linkstatic.html">&larr; Threads without C, and keeping the two apart</a><a href="index.html">Contents</a><a class="next" href="targets.html">One module, one file per target &rarr;</a></div></article></div>
161161 </main>
162-<footer>raz is under the ISC license.</footer>
162+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
163163 </body>
164164 </html>

site/public/advanced/linkstatic.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -117,6 +117,6 @@
117117 <h2>The same promise for your own modules</h2>
118118 <p>The rule isn't special to <code>Thread</code>. A module of yours that makes <code>SYSCALL</code>s directly, or relies on being the only owner of signal handlers, or sets up its own stacks, says <code>link static;</code> too, and then the compiler keeps C away from it for you. The module is documenting a fact about itself, and the compiler checks it where the program is assembled.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="static.html">&larr; A program with no run time</a><a href="index.html">Contents</a><a class="next" href="lifecycle.html">Starting, ending, and signals &rarr;</a></div></article></div>
119119 </main>
120-<footer>raz is under the ISC license.</footer>
120+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
121121 </body>
122122 </html>

site/public/advanced/listing.html (history) modified +14 -14

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -258,20 +258,20 @@
258258 <ul><li><code>gdb</code> finds procedures by name and lines by number, since the executable carries them: <code>break Dot.dot</code> and <code>list</code> work, and so does stepping a line at a time.</li><li><code>RAZ_PROFILE=1</code> samples the program every millisecond and says which procedures and lines took the time.</li><li><code>objdump -d</code> disassembles what is really in the file, if you want to see the bytes behind a listing.</li></ul>
259259 <pre class="output term"><code><span class="cmd">$ raz -o Dot Dot.raz</span>
260260 <span class="cmd">$ objdump -d -M intel --no-show-raw-insn Dot | sed -n &#x27;/&lt;Dot.dot&gt;:/,/ret/p&#x27; | head -12</span>
261-0000000000403b00 &lt;Dot.dot&gt;:
262- 403b00: push rbp
263- 403b01: mov rbp,rsp
264- 403b04: sub rsp,0x40
265- 403b0b: mov QWORD PTR [rbp-0x38],rbx
266- 403b0f: xor ebx,ebx
267- 403b11: mov QWORD PTR [rbp-0x30],r12
268- 403b15: xor r12d,r12d
269- 403b18: mov QWORD PTR [rbp-0x28],r13
270- 403b1c: xor r13d,r13d
271- 403b1f: mov QWORD PTR [rbp-0x20],rdx
272- 403b23: mov QWORD PTR [rbp-0x18],rcx</code></pre>
261+0000000000403b20 &lt;Dot.dot&gt;:
262+ 403b20: push rbp
263+ 403b21: mov rbp,rsp
264+ 403b24: sub rsp,0x40
265+ 403b2b: mov QWORD PTR [rbp-0x38],rbx
266+ 403b2f: xor ebx,ebx
267+ 403b31: mov QWORD PTR [rbp-0x30],r12
268+ 403b35: xor r12d,r12d
269+ 403b38: mov QWORD PTR [rbp-0x28],r13
270+ 403b3c: xor r13d,r13d
271+ 403b3f: mov QWORD PTR [rbp-0x20],rdx
272+ 403b43: mov QWORD PTR [rbp-0x18],rcx</code></pre>
273273 <p>The listing is what the encoder meant; <code>objdump</code> is what the processor will read. They tell the same story.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="syscalls.html">&larr; System calls</a><a href="index.html">Contents</a><a class="next" href="volatile.html">Volatile &rarr;</a></div></article></div>
274274 </main>
275-<footer>raz is under the ISC license.</footer>
275+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
276276 </body>
277277 </html>

site/public/advanced/lockfree.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -162,6 +162,6 @@
162162 <h2>When to use it</h2>
163163 <p>A lock-free structure is worth it when a lock would be held by a thread that can be descheduled, when the critical section is a single pointer, or when a signal handler or an interrupt must share data with the code it interrupts. Everywhere else a <code>Mutex</code> is shorter, easier to check, and fast enough. The advantage of knowing how to write the other kind is that you understand what the lock is doing for you.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="ordering.html">&larr; Ordering and publication</a><a href="index.html">Contents</a><a class="next" href="ring.html">A ring buffer between threads &rarr;</a></div></article></div>
164164 </main>
165-<footer>raz is under the ISC license.</footer>
165+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
166166 </body>
167167 </html>

site/public/advanced/ordering.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -126,6 +126,6 @@
126126 <h2>The lesson of the three versions</h2>
127127 <ul><li>Shared and written by someone: reach it through an atomic, a volatile pointer or a fence, every time, on both sides.</li><li>To hand over a bundle, publish a single atomic word *after* writing the bundle, and read the bundle only *after* seeing the word.</li><li>Everything under a <code>Lock</code> or a <code>Mutex</code> is ordered by the lock itself, so the data it guards can be ordinary variables. That is the simplest discipline, and the one to prefer until it is measured to be too slow.</li></ul><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="atomics.html">&larr; Atomics</a><a href="index.html">Contents</a><a class="next" href="lockfree.html">A lock-free stack &rarr;</a></div></article></div>
128128 </main>
129-<footer>raz is under the ISC license.</footer>
129+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
130130 </body>
131131 </html>

site/public/advanced/processes.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -208,6 +208,6 @@
208208 and was seen once
209209 </code></pre><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="files.html">&larr; Files and the command line</a><a href="index.html">Contents</a><a class="next" href="allocators.html">Writing an allocator &rarr;</a></div></article></div>
210210 </main>
211-<footer>raz is under the ISC license.</footer>
211+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
212212 </body>
213213 </html>

site/public/advanced/ring.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -134,6 +134,6 @@
134134 <p>That is the end of the tour. A few places to continue:</p>
135135 <ul><li><strong><a href="../spec.html">The report</a></strong> defines the language, and is short enough to read through.</li><li><strong><code>doc/compiler.md</code></strong> in the sources is a guide to reading the compiler, file by file; it is a model of the style the project is written in.</li><li><strong><code>lib/</code></strong> is the library, in raz. Each module's own <code>main</code> is its test. Reading <code>Heap</code>, <code>Map</code>, <code>Opt</code> and <code>Thread</code> is the best remaining education.</li><li><strong><code>tools/Doc.raz</code></strong> prints what a module exports with its comments: <code>raz -o Doc tools/Doc.raz &amp;&amp; ./Doc lib/Str.raz</code>.</li><li><strong><code>examples/</code></strong> holds small programs with the output each should give, and <code>conform/</code> holds what any implementation must do.</li></ul><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="lockfree.html">&larr; A lock-free stack</a><a href="index.html">Contents</a><a class="next" href="../spec.html">The report &rarr;</a></div></article></div>
136136 </main>
137-<footer>raz is under the ISC license.</footer>
137+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
138138 </body>
139139 </html>

site/public/advanced/static.html (history) modified +6 -6

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -65,7 +65,7 @@
6565 <span class="cmd">$ ldd Bare</span>
6666 not a dynamic executable
6767 <span class="cmd">$ ls -l Bare | awk &#x27;{print $5, &quot;bytes&quot;}&#x27;</span>
68-26296 bytes</code></pre>
68+26336 bytes</code></pre>
6969 <p>It is statically linked: no interpreter, no shared libraries, no <code>libc</code>. <code>ldd</code> says so.</p>
7070 <h2>What it does when it runs</h2>
7171 <p><code>strace</code> lists every system call a program makes. This is the whole of it:</p>
@@ -134,19 +134,19 @@
134134 <pre class="output term"><code><span class="cmd">$ raz Lean.raz</span>
135135 <span class="cmd">$ raz Heavy.raz</span>
136136 <span class="cmd">$ ls -l Lean Heavy | awk &#x27;{print $9, $5}&#x27;</span>
137-Heavy 28440
138-Lean 28440</code></pre>
137+Heavy 28480
138+Lean 28472</code></pre>
139139 <p>The sizes differ by a few bytes, not by the hundreds of kilobytes that the table and the procedure would take: they are not in the executable at all. You can link in a library module without worrying what else it offers.</p>
140140 <h2>Stripping</h2>
141141 <p><code>-s</code> leaves out what is there for finding faults: the symbols and line numbers, the places a failure is told by, and the profiler. It is for the final build of a size-conscious program; the default keeps them so that gdb and failure messages work.</p>
142142 <pre class="output term"><code><span class="cmd">$ raz -s -o Lean-stripped Lean.raz</span>
143143 <span class="cmd">$ ls -l Lean Lean-stripped | awk &#x27;{print $9, $5}&#x27;</span>
144-Lean 28440
144+Lean 28472
145145 Lean-stripped 6856
146146 <span class="cmd">$ ./Lean-stripped</span>
147147 same program</code></pre>
148148 <p><code>raz -S Lean.raz</code> is the other direction: it prints the machine code the compiler made, one source line at a time. The next two parts of the tour use it.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="allocators.html">&larr; Writing an allocator</a><a href="index.html">Contents</a><a class="next" href="linkstatic.html">Threads without C, and keeping the two apart &rarr;</a></div></article></div>
149149 </main>
150-<footer>raz is under the ISC license.</footer>
150+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
151151 </body>
152152 </html>

site/public/advanced/syscalls.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -194,6 +194,6 @@
194194 </code></pre>
195195 <p><code>SYSCALL</code> is the right tool nearly always: the compiler puts the arguments where they belong, and the result is checked in the open. A code procedure is for the rare call you want to make from inside another piece of assembly.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="asm.html">&larr; Procedures in assembly</a><a href="index.html">Contents</a><a class="next" href="listing.html">What the compiler makes &rarr;</a></div></article></div>
196196 </main>
197-<footer>raz is under the ISC license.</footer>
197+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
198198 </body>
199199 </html>

site/public/advanced/targets.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -107,6 +107,6 @@
107107 <h2>What stays the same everywhere</h2>
108108 <p>The core of the library is what every target must have: <code>Rt</code>, <code>Out</code>, <code>Mem</code>, <code>Arena</code>, <code>Lock</code>, <code>Str</code> and <code>Buf</code>, and of <code>Sys</code> what they need. A program that keeps to the core runs on every target. <code>Thread</code>, <code>link</code> and <code>extern</code>, and most of <code>Sys</code>, are what a target may leave out when its system can't give them.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="lifecycle.html">&larr; Starting, ending, and signals</a><a href="index.html">Contents</a><a class="next" href="asm.html">Procedures in assembly &rarr;</a></div></article></div>
109109 </main>
110-<footer>raz is under the ISC license.</footer>
110+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
111111 </body>
112112 </html>

site/public/advanced/volatile.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html">Raz, Set, Go</a><a href="../advanced/index.html" aria-current="page">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>More Raz</h2><h3>The library</h3><ol start='1'>
2222 <li><a href="fmt.html">Output and formatting</a></li>
@@ -149,6 +149,6 @@
149149 | ^^
150150 raz: 2 errors</code></pre><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="listing.html">&larr; What the compiler makes</a><a href="index.html">Contents</a><a class="next" href="atomics.html">Atomics &rarr;</a></div></article></div>
151151 </main>
152-<footer>raz is under the ISC license.</footer>
152+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
153153 </body>
154154 </html>

site/public/index.html (history) modified +7 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="index.html"><img src="logo.svg" width="26" height="26" alt="">raz</a><a href="tour/index.html">Raz, Set, Go</a><a href="advanced/index.html">More Raz</a><a href="spec.html">Report</a><a href="index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="index.html"><img src="logo.svg" width="26" height="26" alt="">raz</a><a href="tour/index.html">Raz, Set, Go</a><a href="advanced/index.html">More Raz</a><a href="spec.html">Report</a><a href="source/index.html">Source</a><a href="index.html#download">Download</a></nav></header>
2020 <main>
2121 <section class="hero">
2222 <h1>raz</h1>
@@ -27,6 +27,7 @@
2727 <a class="btn" href="advanced/index.html">More Raz</a>
2828 <a class="btn" href="#download">Download</a>
2929 <a class="btn" href="spec.html">Read the report</a>
30+ <a class="btn" href="source/index.html">Browse the source</a>
3031 </div>
3132 </section>
3233
@@ -131,8 +132,12 @@
131132 good. Earlier releases: <a href="download/raz-0.19.0-linux-x86_64.tar.gz">0.19.0</a>, <a href="download/raz-0.18.1-linux-x86_64.tar.gz">0.18.1</a>, <a href="download/raz-0.18.0-linux-x86_64.tar.gz">0.18.0</a>, <a href="download/raz-0.17.2-linux-x86_64.tar.gz">0.17.2</a>, <a href="download/raz-0.17.1-linux-x86_64.tar.gz">0.17.1</a>, <a href="download/raz-0.17.0-linux-x86_64.tar.gz">0.17.0</a>, <a href="download/raz-0.16.0-linux-x86_64.tar.gz">0.16.0</a>, <a href="download/raz-0.15.0-linux-x86_64.tar.gz">0.15.0</a>, <a href="download/raz-0.14.0-linux-x86_64.tar.gz">0.14.0</a>, <a href="download/raz-0.13.0-linux-x86_64.tar.gz">0.13.0</a>, <a href="download/raz-0.12.0-linux-x86_64.tar.gz">0.12.0</a>, <a href="download/raz-0.11.1-linux-x86_64.tar.gz">0.11.1</a>, <a href="download/raz-0.11.0-linux-x86_64.tar.gz">0.11.0</a>, <a href="download/raz-0.10.1-linux-x86_64.tar.gz">0.10.1</a>, <a href="download/raz-0.10.0-linux-x86_64.tar.gz">0.10.0</a>, <a href="download/raz-0.9.1-linux-x86_64.tar.gz">0.9.1</a>, <a href="download/raz-0.9.0-linux-x86_64.tar.gz">0.9.0</a>, <a href="download/raz-0.8.0-linux-x86_64.tar.gz">0.8.0</a>, <a href="download/raz-0.7.1-linux-x86_64.tar.gz">0.7.1</a>; each has its SHA-256 beside it, with
132133 <code>.sha256</code> added to its name.</p>
133134 <p class="sha">SHA-256 <code>bfa954d27d759e4ca7f7f33debb4705f25d5c05a097d86aa28b3260048b5d9cc</code></p>
135+<p><a href="source/releases/index.html">Release pages</a> give each
136+version's commit, notes, compiler and source archives, with checksums.
137+Browse the <a href="source/index.html">source and history</a>, or clone:
138+<code>git clone https://raz.lucelad.workers.dev/source/</code>.</p>
134139
135140 </main>
136-<footer>raz is under the ISC license.</footer>
141+<footer>raz is under the ISC license. <a href="source/index.html">Source</a></footer>
137142 </body>
138143 </html>

site/public/spec.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="index.html"><img src="logo.svg" width="26" height="26" alt="">raz</a><a href="tour/index.html">Raz, Set, Go</a><a href="advanced/index.html">More Raz</a><a href="spec.html" aria-current="page">Report</a><a href="index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="index.html"><img src="logo.svg" width="26" height="26" alt="">raz</a><a href="tour/index.html">Raz, Set, Go</a><a href="advanced/index.html">More Raz</a><a href="spec.html" aria-current="page">Report</a><a href="source/index.html">Source</a><a href="index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="spec"><p><a href="raz.pdf">Volume 1 as a PDF</a> &middot; <a href="raz-lib.pdf">Volume 2 as a PDF</a></p>
2222 <ul>
@@ -1465,6 +1465,6 @@
14651465 <p>A combining mark, a format character, a control and Hangul’s medial and final jamo take 0 columns; an ideograph, a kana, most emoji and the rest that Unicode calls East Asian Wide or Fullwidth take 2; every other character takes 1, the ambiguous ones among them, as most terminals draw them. These are the C library’s <code>wcwidth</code>’s answers, but for a control, which is -1 there. <code>Width</code> knows characters, not clusters: an emoji joined to another by a zero width joiner, or a flag, counts as its parts. Its tables, about 4 KB, come from Unicode’s data, made again by <code>tools/Widths.raz</code> for a new version of Unicode; a program that imports <code>Width</code> and calls neither procedure carries none of them.</p>
14661466 </div>
14671467 </main>
1468-<footer>raz is under the ISC license.</footer>
1468+<footer>raz is under the ISC license. <a href="source/index.html">Source</a></footer>
14691469 </body>
14701470 </html>

site/public/tour/c.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>Raz, Set, Go</h2><h3>Raz</h3><ol start='1'>
2222 <li><a href="hello.html">Hello, world</a></li>
@@ -148,6 +148,6 @@
148148 <pre class="output"><code>3.000 5.000
149149 </code></pre><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="generics.html">&larr; Generic modules</a><a href="index.html">Contents</a><a class="next" href="threads.html">Threads &rarr;</a></div></article></div>
150150 </main>
151-<footer>raz is under the ISC license.</footer>
151+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
152152 </body>
153153 </html>

site/public/tour/checks.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>Raz, Set, Go</h2><h3>Raz</h3><ol start='1'>
2222 <li><a href="hello.html">Hello, world</a></li>
@@ -183,6 +183,6 @@
183183 <h2>For gdb and the profiler</h2>
184184 <p>The program carries names and line numbers, so <code>gdb</code> can break at <code>Fail.raz:6</code> and show raz source. <code>RAZ_PROFILE=1</code> in the environment makes a program sample itself every millisecond and say at the end where its time went, by procedure and by line.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="defer.html">&larr; Defer</a><a href="index.html">Contents</a><a class="next" href="generics.html">Generic modules &rarr;</a></div></article></div>
185185 </main>
186-<footer>raz is under the ISC license.</footer>
186+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
187187 </body>
188188 </html>

site/public/tour/defer.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>Raz, Set, Go</h2><h3>Raz</h3><ol start='1'>
2222 <li><a href="hello.html">Hello, world</a></li>
@@ -182,6 +182,6 @@
182182 <h2>What defer does not do</h2>
183183 <p>A deferred statement can't contain a <code>return</code>, <code>break</code> or <code>defer</code> that would leave it. A failed check, <code>Rt.exit</code> and <code>Sys.exit</code> end the program without running the deferred statements still pending, so deferred cleanup is for the program's resources, not for what must happen at exit; that is what <code>Rt.atExit</code> is for.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="errors.html">&larr; Errors</a><a href="index.html">Contents</a><a class="next" href="checks.html">When it goes wrong &rarr;</a></div></article></div>
184184 </main>
185-<footer>raz is under the ISC license.</footer>
185+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
186186 </body>
187187 </html>

site/public/tour/errors.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>Raz, Set, Go</h2><h3>Raz</h3><ol start='1'>
2222 <li><a href="hello.html">Hello, world</a></li>
@@ -212,6 +212,6 @@
212212 the table is corrupt
213213 status 2</code></pre><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="memory.html">&larr; Memory and allocators</a><a href="index.html">Contents</a><a class="next" href="defer.html">Defer &rarr;</a></div></article></div>
214214 </main>
215-<footer>raz is under the ISC license.</footer>
215+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
216216 </body>
217217 </html>

site/public/tour/generics.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>Raz, Set, Go</h2><h3>Raz</h3><ol start='1'>
2222 <li><a href="hello.html">Hello, world</a></li>
@@ -169,6 +169,6 @@
169169 <h2>The library's generics</h2>
170170 <p>The library's <code>List</code>, <code>Map</code> and <code>Sort</code> are generic modules. A <code>Map</code> takes its key hash and equality as procedure arguments: <code>import Count := Map([]U8, INT, Str.hash, Str.eq);</code>. The advanced tour uses each of them in a real program.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="checks.html">&larr; When it goes wrong</a><a href="index.html">Contents</a><a class="next" href="c.html">Talking to C &rarr;</a></div></article></div>
171171 </main>
172-<footer>raz is under the ISC license.</footer>
172+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
173173 </body>
174174 </html>

site/public/tour/hello.html (history) modified +3 -3

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>Raz, Set, Go</h2><h3>Raz</h3><ol start='1'>
2222 <li><a href="hello.html" aria-current="page">Hello, world</a></li>
@@ -70,7 +70,7 @@
7070 <span class="cmd">$ raz run Quiet.raz</span>
7171 hello, again
7272 <span class="cmd">$ ls -l Quiet | awk &#x27;{print $5, &quot;bytes&quot;}&#x27;</span>
73-28440 bytes</code></pre>
73+28472 bytes</code></pre>
7474 <p>The program is a static executable with no run time besides the code it uses, so it is a few kilobytes, and runs without any library installed.</p>
7575 <h2>What <code>Out</code> can write</h2>
7676 <p><code>Out</code> is the library's buffered output. It writes strings, single characters, numbers in decimal or hexadecimal, and a line feed. A string is written as it is, with <code>\n</code> for a line feed, <code>\t</code> for a tab, <code>\"</code> and <code>\\</code>; or between backquotes, as a raw string with no escapes at all, which may run over lines (lesson 6).</p>
@@ -140,6 +140,6 @@
140140 two words
141141 status 2</code></pre><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="index.html">Contents</a><a class="next" href="modules.html">Modules &rarr;</a></div></article></div>
142142 </main>
143-<footer>raz is under the ISC license.</footer>
143+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
144144 </body>
145145 </html>

site/public/tour/index.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="contents"><h1>Raz, Set, Go</h1>
2222 <p>A tour of raz, in the spirit of <em>A Tour of Go</em>. Each lesson is one
@@ -49,6 +49,6 @@
4949 <li><a href="threads.html">Threads</a> <span>Native threads without C, atomics, a mutex, and why the counter needs both.</span></li>
5050 </ol></div>
5151 </main>
52-<footer>raz is under the ISC license.</footer>
52+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
5353 </body>
5454 </html>

site/public/tour/integers.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>Raz, Set, Go</h2><h3>Raz</h3><ol start='1'>
2222 <li><a href="hello.html">Hello, world</a></li>
@@ -281,6 +281,6 @@
281281 <h2>Which one to use</h2>
282282 <ul><li><strong><code>INT</code></strong> for lengths, indexes, counts, loop variables, and anything you'd write <code>int</code> for in C.</li><li><strong><code>U8</code></strong> for bytes, and for a string's elements (<code>[]U8</code>). <strong><code>I32</code></strong> for a character, a code point.</li><li><strong><code>U32</code>, <code>U64</code></strong> for hashes, bit sets, masks and addresses you do arithmetic on.</li><li><strong><code>I64</code></strong> for what must not shrink on a smaller target: a file's size or position, a time in nanoseconds, a number read from text.</li><li><strong><code>I8</code>, <code>I16</code>, <code>U16</code></strong> when a format or a layout says so, in a record or an array, to save space or match a protocol. Convert at the edge and compute in <code>INT</code>.</li><li><strong><code>UINT</code></strong> rarely: for a count that must use the whole address range, or an address.</li></ul><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="modules.html">&larr; Modules</a><a href="index.html">Contents</a><a class="next" href="values.html">Values and conversions &rarr;</a></div></article></div>
283283 </main>
284-<footer>raz is under the ISC license.</footer>
284+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
285285 </body>
286286 </html>

site/public/tour/memory.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>Raz, Set, Go</h2><h3>Raz</h3><ol start='1'>
2222 <li><a href="hello.html">Hello, world</a></li>
@@ -191,6 +191,6 @@
191191 <h2>Pages</h2>
192192 <p>Under the allocators are pages from the system: <code>Mem.pages(size)</code> gives zeroed memory in whole pages, or <code>nil</code>, and <code>Mem.unmap</code> gives it back. Most programs never need to call it directly.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="variants.html">&larr; Enumerations, sets, variants and match</a><a href="index.html">Contents</a><a class="next" href="errors.html">Errors &rarr;</a></div></article></div>
193193 </main>
194-<footer>raz is under the ISC license.</footer>
194+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
195195 </body>
196196 </html>

site/public/tour/modules.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>Raz, Set, Go</h2><h3>Raz</h3><ol start='1'>
2222 <li><a href="hello.html">Hello, world</a></li>
@@ -194,6 +194,6 @@
194194 raz: 2 errors</code></pre>
195195 <p>The compiler goes on to find the others, up to 20, and says what it can: where a name was declared, or a name spelled almost alike. A module with errors writes no executable.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="hello.html">&larr; Hello, world</a><a href="index.html">Contents</a><a class="next" href="integers.html">Integers &rarr;</a></div></article></div>
196196 </main>
197-<footer>raz is under the ISC license.</footer>
197+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
198198 </body>
199199 </html>

site/public/tour/procedures.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>Raz, Set, Go</h2><h3>Raz</h3><ol start='1'>
2222 <li><a href="hello.html">Hello, world</a></li>
@@ -232,6 +232,6 @@
232232 <h2>Dropped results</h2>
233233 <p>A call that drops a result, as <code>Sys.write(fd, s);</code> does, is warned of; <code>_ := Sys.write(fd, s);</code> says it is meant. The compiler also warns of a variable that is assigned and never read, and of a name declared and never used, unless it starts with <code>_</code>.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="values.html">&larr; Values and conversions</a><a href="index.html">Contents</a><a class="next" href="slices.html">Arrays, slices and strings &rarr;</a></div></article></div>
234234 </main>
235-<footer>raz is under the ISC license.</footer>
235+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
236236 </body>
237237 </html>

site/public/tour/records.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>Raz, Set, Go</h2><h3>Raz</h3><ol start='1'>
2222 <li><a href="hello.html">Hello, world</a></li>
@@ -345,6 +345,6 @@
345345 </code></pre>
346346 <p>Of an array, <code>PTR(a)</code> is the address of its first element, a <code>^T</code> where <code>ADR(a)</code> is a <code>^[n]T</code>. Reading through the pointer is as unchecked as through any pointer: the length is yours to keep with it. The compiler says so when the two are mixed up: a slice given where a pointer is wanted is an error whose help says to write <code>PTR(s)</code> and <code>LEN(s)</code>, and a pointer given where a slice is, <code>p[0..n]</code>.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="slices.html">&larr; Arrays, slices and strings</a><a href="index.html">Contents</a><a class="next" href="variants.html">Enumerations, sets, variants and match &rarr;</a></div></article></div>
347347 </main>
348-<footer>raz is under the ISC license.</footer>
348+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
349349 </body>
350350 </html>

site/public/tour/slices.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>Raz, Set, Go</h2><h3>Raz</h3><ol start='1'>
2222 <li><a href="hello.html">Hello, world</a></li>
@@ -345,6 +345,6 @@
345345 1 2 4 5 7 8 10
346346 </code></pre><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="procedures.html">&larr; Procedures and several results</a><a href="index.html">Contents</a><a class="next" href="records.html">Records and pointers &rarr;</a></div></article></div>
347347 </main>
348-<footer>raz is under the ISC license.</footer>
348+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
349349 </body>
350350 </html>

site/public/tour/threads.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>Raz, Set, Go</h2><h3>Raz</h3><ol start='1'>
2222 <li><a href="hello.html">Hello, world</a></li>
@@ -180,6 +180,6 @@
180180 </code></pre>
181181 <p><code>Thread</code> makes its own threads, without C, so a program that uses it can't use C; one that does makes its threads with C's <code>pthread_create</code> instead. The advanced tour goes further into atomics, memory ordering and lock-free code.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="c.html">&larr; Talking to C</a><a href="index.html">Contents</a><a class="next" href="../advanced/index.html">More Raz &rarr;</a></div></article></div>
182182 </main>
183-<footer>raz is under the ISC license.</footer>
183+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
184184 </body>
185185 </html>

site/public/tour/values.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>Raz, Set, Go</h2><h3>Raz</h3><ol start='1'>
2222 <li><a href="hello.html">Hello, world</a></li>
@@ -141,6 +141,6 @@
141141 </code></pre>
142142 <p>A real converts to an integer by rounding toward zero. Every variable starts at zero, a real's <code>0.0</code> and a <code>BOOL</code>'s <code>false</code> included, so there is no uninitialised value to be surprised by.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="integers.html">&larr; Integers</a><a href="index.html">Contents</a><a class="next" href="procedures.html">Procedures and several results &rarr;</a></div></article></div>
143143 </main>
144-<footer>raz is under the ISC license.</footer>
144+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
145145 </body>
146146 </html>

site/public/tour/variants.html (history) modified +2 -2

@@ -16,7 +16,7 @@
1616 <link rel="stylesheet" href="../style.css">
1717 </head>
1818 <body>
19-<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../index.html#download">Download</a></nav></header>
19+<header><nav><a class="mark" href="../index.html"><img src="../logo.svg" width="26" height="26" alt="">raz</a><a href="../tour/index.html" aria-current="page">Raz, Set, Go</a><a href="../advanced/index.html">More Raz</a><a href="../spec.html">Report</a><a href="../source/index.html">Source</a><a href="../index.html#download">Download</a></nav></header>
2020 <main>
2121 <div class="tour"><aside><h2>Raz, Set, Go</h2><h3>Raz</h3><ol start='1'>
2222 <li><a href="hello.html">Hello, world</a></li>
@@ -313,6 +313,6 @@
313313 </code></pre>
314314 <p>Two labels that are the same string are an error, as two arms for one case are.</p><p class="tryit">Save a program under its module&rsquo;s name and run it with <code>raz run Name.raz</code>.</p><div class="pager"><a href="records.html">&larr; Records and pointers</a><a href="index.html">Contents</a><a class="next" href="memory.html">Memory and allocators &rarr;</a></div></article></div>
315315 </main>
316-<footer>raz is under the ISC license.</footer>
316+<footer>raz is under the ISC license. <a href="../source/index.html">Source</a></footer>
317317 </body>
318318 </html>

site/release-notes/v0.18.1.md (history) added +8 -0

@@ -0,0 +1,8 @@
1+# raz 0.18.1
2+
3+Report 2026-10.32. A constant's slice part may name another module's
4+array constant. The library adds `Buf.cut`, `Out.lines`, `Vec.pop`,
5+`Sys.Info.links`, `Thread.signal` and more command-line option helpers.
6+
7+This is the existing website distribution. Its annotated Git tag is
8+pending; the commit and compiler archive are unchanged.

site/release-notes/v0.19.0.md (history) added +9 -0

@@ -0,0 +1,9 @@
1+# raz 0.19.0
2+
3+Report 2026-10.33. Adds `const` parameters and variants in constants.
4+The library takes `var`, `const` or a value where it previously took
5+a pointer; calls written with `ADR` need updating. The compiler's
6+message points to the required change.
7+
8+This is the existing website distribution. Its annotated Git tag is
9+pending; the commit and compiler archive are unchanged.

site/release-notes/v0.20.0.md (history) added +9 -0

@@ -0,0 +1,9 @@
1+# raz 0.20.0
2+
3+Report 2026-10.34. Adds `PTR(s)`, the unchecked address of a slice's
4+first element, including an empty slice. The compiler is built by raz
5+0.19.0, and the Pascal seed leaves the current tree. `Buf.bytes` and
6+`Sys.entryKind` take `const` parameters.
7+
8+This is the existing website distribution. Its annotated Git tag is
9+pending; the commit and compiler archive are unchanged.

site/releases (history) added +5 -0

@@ -0,0 +1,5 @@
1+# Existing distributions whose tags have not yet been pushed.
2+# Keep these identities when their tags are added.
3+v0.18.1 88b18ba640f341da2f4d7c6a6941b2e13cb29190
4+v0.19.0 51a90a630cbd3b2e3b4634d72b3568edcc476dc4
5+v0.20.0 086e55c439e4b2e38e8b3f062da8f9d5703054ce

site/releases.py added +80 -0

@@ -0,0 +1,80 @@
1+"""Release commits shared by the home page and ladle's download pages.
2+
3+Tags supply released versions. site/releases records existing website
4+distributions whose tags have not been pushed. Both must name commits
5+on main's first-parent line, and a later tag must agree with the record.
6+No tags or archives are created here.
7+"""
8+from pathlib import Path
9+import re
10+import subprocess
11+
12+
13+def main_ref(root):
14+ """Use main locally, or the detached commit supplied to a deployment.
15+
16+ A build never silently publishes a different local working branch.
17+ The publishing service selects main before checking out its commit.
18+ """
19+ command = ['git', '-C', str(root)]
20+ if subprocess.run(command + ['show-ref', '--verify', '--quiet', 'refs/heads/main']).returncode == 0:
21+ return 'refs/heads/main'
22+ if subprocess.run(command + ['symbolic-ref', '--quiet', 'HEAD'], stdout=subprocess.DEVNULL).returncode:
23+ return 'HEAD'
24+ raise ValueError('site build needs main or a detached deployment checkout')
25+
26+
27+def refs(root, extra=()):
28+ """Return (version tag, full commit) pairs, oldest first.
29+
30+ extra holds the optional vX.Y.Z=COMMIT arguments to make site,
31+ already split into pairs. Conflicting records are errors, so a
32+ build cannot quietly move an existing version to another commit.
33+ """
34+ root = Path(root)
35+
36+ def git(*args):
37+ return subprocess.check_output(['git', '-C', str(root), *args], text=True).strip()
38+
39+ # Deployment services may give the build only one commit. The source
40+ # browser needs the history, and the same origin supplies its tags.
41+ if git('rev-parse', '--is-shallow-repository') == 'true':
42+ print('site: fetching full history and tags from origin')
43+ subprocess.run(['git', '-C', str(root), 'fetch', '--unshallow', '--tags', 'origin'], check=True)
44+ line = set(git('rev-list', '--first-parent', main_ref(root)).splitlines())
45+ selected = {}
46+ tagged = {}
47+
48+ def add(tag, rev):
49+ if not re.fullmatch(r'v\d+\.\d+\.\d+', tag):
50+ raise ValueError('release version must be vX.Y.Z: ' + tag)
51+ if tuple(map(int, tag[1:].split('.'))) < (0, 7, 1):
52+ return
53+ commit = git('rev-parse', '--verify', '--end-of-options', rev + '^{commit}')
54+ if commit not in line:
55+ raise ValueError(f'release {tag}: {commit} is not on main\'s first-parent line')
56+ if tag in tagged and tagged[tag] != commit:
57+ raise ValueError(f'release {tag}: tag and recorded commits disagree')
58+ if tag in selected and selected[tag] != commit:
59+ raise ValueError(f'release {tag}: tag and recorded commits disagree')
60+ selected[tag] = commit
61+
62+ for tag in git('tag', '-l', 'v*').splitlines():
63+ if re.fullmatch(r'v\d+\.\d+\.\d+', tag):
64+ # Tags on another development line are not this site's releases.
65+ commit = git('rev-parse', '--verify', tag + '^{commit}')
66+ tagged[tag] = commit
67+ if commit in line:
68+ add(tag, commit)
69+ manifest = root / 'site' / 'releases'
70+ for number, text in enumerate(manifest.read_text().splitlines(), 1):
71+ text = text.partition('#')[0].strip()
72+ if not text:
73+ continue
74+ words = text.split()
75+ if len(words) != 2 or not re.fullmatch(r'[0-9a-f]{40}', words[1]):
76+ raise ValueError(f'{manifest}:{number}: expected vX.Y.Z and full commit hash')
77+ add(*words)
78+ for tag, rev in extra:
79+ add(tag, rev)
80+ return sorted(selected.items(), key=lambda item: tuple(map(int, item[0][1:].split('.'))))

site/source.py added +238 -0

@@ -0,0 +1,238 @@
1+#!/usr/bin/env python3
2+"""Build the static source browser and releases after site/build.py.
3+
4+Uses git, ladle and Python's standard library. Reads committed main and
5+the existing, checksummed compiler distributions; writes only the website.
6+It does not build compilers, create tags, upload files or deploy the site.
7+The layout and publishing rules are in site/README.md.
8+"""
9+
10+import argparse
11+import gzip
12+import hashlib
13+from pathlib import Path
14+import re
15+import shutil
16+import subprocess
17+import tempfile
18+from urllib.parse import urlsplit
19+
20+from releases import main_ref, refs
21+
22+
23+ROOT = Path(__file__).resolve().parent.parent
24+PUBLIC = ROOT / "site/public"
25+URL = "https://raz.lucelad.workers.dev/source/"
26+LADLE = ROOT / "site/tools/ladle.gz"
27+BEGIN_HEADERS = "# BEGIN ladle source\n"
28+END_HEADERS = "# END ladle source\n"
29+MAX_FILES = 20000
30+MAX_FILE_BYTES = 25 * 1024 * 1024
31+
32+
33+def git(repo, *args):
34+ """Read git's text output, failing at the command that went wrong."""
35+ return subprocess.check_output(
36+ ["git", "-C", str(repo), *args], text=True
37+ ).strip()
38+
39+
40+def prepare_store(directory):
41+ """Clone main independently, keeping only tags whose commits it reaches."""
42+ store = directory / "raz.git"
43+ branch = ["--branch", "main"] if main_ref(ROOT) != "HEAD" else []
44+ subprocess.run([
45+ "git", "clone", "--quiet", "--bare", "--single-branch",
46+ "--no-local", *branch, str(ROOT), str(store),
47+ ], check=True)
48+ # Deployment checkouts can be detached and have no local branch.
49+ # Name their commit only inside this temporary published store.
50+ if not branch:
51+ git(store, "update-ref", "refs/heads/main", git(store, "rev-parse", "HEAD"))
52+ git(store, "symbolic-ref", "HEAD", "refs/heads/main")
53+ reachable = set(git(store, "rev-list", "main").splitlines())
54+ for tag in git(store, "tag", "--list").splitlines():
55+ # Tags of trees or blobs are not cloneable releases. Ask quietly:
56+ # such a tag is valid git, simply outside the published history.
57+ result = subprocess.run(
58+ ["git", "-C", str(store), "rev-parse", "--verify", f"refs/tags/{tag}^{{commit}}"],
59+ capture_output=True, text=True,
60+ )
61+ if result.returncode or result.stdout.strip() not in reachable:
62+ git(store, "update-ref", "-d", f"refs/tags/{tag}")
63+ git(store, "repack", "-a", "-d", "--max-pack-size=20m")
64+ git(store, "update-server-info")
65+ return store
66+
67+
68+def digest(path):
69+ checksum = hashlib.sha256()
70+ with path.open("rb") as stream:
71+ for chunk in iter(lambda: stream.read(1024 * 1024), b""):
72+ checksum.update(chunk)
73+ return checksum.hexdigest()
74+
75+
76+def published_sum(path):
77+ """Read the original checksum; never replace it to fit different bytes."""
78+ checksum = path.with_name(path.name + ".sha256")
79+ words = checksum.read_text().split()
80+ if len(words) != 2 or not re.fullmatch(r"[0-9a-f]{64}", words[0]) or words[1] != path.name:
81+ raise ValueError(f"{checksum}: expected SHA-256 and {path.name}")
82+ return words[0]
83+
84+
85+def pinned_ladle():
86+ """Unpack the checked-in static builder, needing no compiler or network."""
87+ packed = LADLE.read_bytes()
88+ if hashlib.sha256(packed).hexdigest() != published_sum(LADLE):
89+ raise ValueError(f"{LADLE}: differs from its recorded SHA-256")
90+ executable = ROOT / "build/site/ladle"
91+ executable.parent.mkdir(parents=True, exist_ok=True)
92+ # Rename a new inode into place: another build may still be running
93+ # the previous executable, which cannot be overwritten on Linux.
94+ with tempfile.NamedTemporaryFile(dir=executable.parent, delete=False) as output:
95+ temporary = Path(output.name)
96+ output.write(gzip.decompress(packed))
97+ temporary.chmod(0o755)
98+ temporary.replace(executable)
99+ return executable
100+
101+
102+def compiler_archive(version, directory):
103+ """Copy the distribution, checking its existing published checksum."""
104+ name = f"raz-{version[1:]}-linux-x86_64.tar.gz"
105+ original = PUBLIC / "download" / name
106+ expected = published_sum(original)
107+ copied = directory / name
108+ shutil.copyfile(original, copied)
109+ if digest(copied) != expected:
110+ raise ValueError(f"{original}: differs from its published SHA-256")
111+
112+
113+def source_archive(store, version, commit, directory):
114+ """Archive the exact commit, with no wall-clock time or filename in gzip."""
115+ name = f"raz-{version[1:]}-source.tar.gz"
116+ with (directory / name).open("wb") as output:
117+ with gzip.GzipFile(filename="", mode="wb", fileobj=output, mtime=0) as compressed:
118+ with subprocess.Popen([
119+ "git", "-C", str(store), "archive", "--format=tar",
120+ f"--prefix=raz-{version[1:]}/", commit,
121+ ], stdout=subprocess.PIPE) as process:
122+ shutil.copyfileobj(process.stdout, compressed)
123+ if process.wait():
124+ raise ValueError(f"release {version}: git archive failed")
125+
126+
127+def stage_releases(store, directory, selected):
128+ line = set(git(store, "rev-list", "--first-parent", "main").splitlines())
129+ for version, commit in selected:
130+ # Ref resolution is shared with build.py. Check against our snapshot
131+ # too, so a commit made during the build cannot split their histories.
132+ if commit not in line:
133+ raise ValueError(f"release {version}: {commit} is not in the cloned main history")
134+ release = directory / version
135+ release.mkdir(parents=True)
136+ (release / "commit").write_text(commit + "\n")
137+ notes = ROOT / "site/release-notes" / (version + ".md")
138+ if notes.exists():
139+ shutil.copyfile(notes, release / "notes.md")
140+ compiler_archive(version, release)
141+ source_archive(store, version, commit, release)
142+
143+
144+def export_store(store, output):
145+ """Export only the dumb-HTTP store, never configuration or local paths."""
146+ for name in ("HEAD", "info/refs", "objects/info/packs"):
147+ destination = output / name
148+ destination.parent.mkdir(parents=True, exist_ok=True)
149+ shutil.copyfile(store / name, destination)
150+ shutil.copytree(store / "objects/pack", output / "objects/pack")
151+
152+
153+def merged_headers(generated):
154+ """Replace our scoped block while keeping the host's other header rules."""
155+ path = PUBLIC / "_headers"
156+ existing = path.read_text() if path.exists() else ""
157+ if BEGIN_HEADERS in existing:
158+ before, _, rest = existing.partition(BEGIN_HEADERS)
159+ _, found, after = rest.partition(END_HEADERS)
160+ if not found:
161+ raise ValueError(f"{path}: source header block has no closing marker")
162+ existing = before + after
163+ scoped = "\n".join(
164+ "/source" + line if line.startswith("/") else line
165+ for line in generated.splitlines()
166+ ) + "\n"
167+ return existing.rstrip() + "\n\n" + BEGIN_HEADERS + scoped + END_HEADERS
168+
169+
170+def check_limits(source, headers):
171+ """Measure the proposed complete output, counting the new source tree once."""
172+ paths = [path for path in PUBLIC.rglob("*")
173+ if path.is_file() and "source" != path.relative_to(PUBLIC).parts[0]
174+ and path != PUBLIC / "_headers"]
175+ paths.extend(path for path in source.rglob("*") if path.is_file())
176+ sizes = [(str(path), path.stat().st_size) for path in paths]
177+ sizes.append((str(PUBLIC / "_headers"), len(headers.encode())))
178+ for name, size in sizes:
179+ if size > MAX_FILE_BYTES:
180+ raise ValueError(f"{name}: {size} bytes exceeds the 25 MiB file limit")
181+ if len(sizes) > MAX_FILES:
182+ raise ValueError(f"site: {len(sizes)} files exceeds the {MAX_FILES} file limit")
183+ print(f"site/public: {len(sizes)} files, {sum(size for _, size in sizes)} bytes; "
184+ f"largest file {max(size for _, size in sizes)} bytes")
185+
186+
187+def build(ladle=None, url=URL, extra=()):
188+ address = urlsplit(url)
189+ if address.scheme not in ("http", "https") or not address.netloc or address.path != "/source/" or address.query or address.fragment:
190+ raise ValueError("--url must be an HTTP(S) address ending in /source/")
191+ if not PUBLIC.is_dir():
192+ raise ValueError("site/public is missing; run site/build.py first")
193+ selected = refs(ROOT, extra) # complete a shallow deployment checkout before cloning
194+ if ladle is None:
195+ ladle = pinned_ladle()
196+ # Build separately: a failed checksum, ladle run or host-limit check
197+ # leaves the previous source browser in place. Nothing reads that output.
198+ with tempfile.TemporaryDirectory(prefix="raz-source-") as temporary:
199+ directory = Path(temporary)
200+ store = prepare_store(directory)
201+ releases = directory / "releases"
202+ stage_releases(store, releases, selected)
203+ output = directory / "source"
204+ output.mkdir()
205+ export_store(store, output)
206+ subprocess.run([
207+ str(ladle), "-u", url, "-r", str(releases),
208+ "-t", str(ROOT / "site/source.theme"), "-o", str(output), str(store),
209+ ], check=True)
210+ headers = merged_headers((output / "_headers").read_text())
211+ check_limits(output, headers)
212+ destination = PUBLIC / "source"
213+ if destination.exists():
214+ shutil.rmtree(destination)
215+ shutil.move(str(output), destination)
216+ (PUBLIC / "_headers").write_text(headers)
217+
218+
219+def main():
220+ parser = argparse.ArgumentParser(description=__doc__)
221+ parser.add_argument("--ladle", type=Path, help="override the checked-in static ladle executable")
222+ parser.add_argument("--url", default=URL, help="the site's absolute /source/ address")
223+ parser.add_argument("releases", nargs="*", metavar="vX.Y.Z=COMMIT", help="additional existing distributions")
224+ args = parser.parse_args()
225+ try:
226+ extra = []
227+ for release in args.releases:
228+ version, separator, commit = release.partition("=")
229+ if not separator or not commit:
230+ raise ValueError(f"{release}: expected vX.Y.Z=COMMIT")
231+ extra.append((version, commit))
232+ build(args.ladle.resolve() if args.ladle else None, args.url, extra)
233+ except (OSError, ValueError, subprocess.CalledProcessError) as error:
234+ parser.exit(1, f"source: {error}\n")
235+
236+
237+if __name__ == "__main__":
238+ main()

site/source.theme (history) added +13 -0

@@ -0,0 +1,13 @@
1+base paper
2+light
3+bg #fbfaf7
4+fg #1b1b1a
5+muted #6b6a66
6+accent #b4401f
7+link #b4401f
8+dark
9+bg #17181a
10+fg #e6e4de
11+muted #9a988f
12+accent #ee8a63
13+link #ee8a63

site/tools/README.md (history) added +34 -0

@@ -0,0 +1,34 @@
1+# The website's ladle
2+
3+`ladle.gz` is the static x86-64 Linux executable built from
4+`ldiaz94/ladle` at `509b9d314f6161a7430b8dc1354ba4ebe203ddb8`.
5+Its pinned dependencies are sauce `35e0c186db6b8861745c25925ca5b2489219e48d`
6+and rflate `c55b37888b071e98f57dcf18b97ab31f85595e76`.
7+`ladle.gz.sha256` checks the compressed file; `source.py` verifies it
8+before unpacking the executable into `build/site/`.
9+
10+Keeping this small build tool with the site lets Cloudflare run the
11+existing `npx wrangler deploy` without a compiler or access to another
12+private repository. It is a deployment dependency, not a raz release.
13+Its source and tests remain in ladle's repository.
14+
15+To replace it, clone ladle with its submodules and check out the
16+chosen commit. Unpack raz's checked v0.20.0 distribution, keeping its
17+`lib/` and `tools/` beside `raz`. From ladle's checkout:
18+
19+```sh
20+make RAZ=/absolute/path/to/raz test fmt
21+```
22+
23+From raz's checkout, pack that tested executable:
24+
25+```sh
26+gzip -9n -c ../ladle/build/ladle > site/tools/ladle.gz
27+(cd site/tools && sha256sum ladle.gz > ladle.gz.sha256)
28+make site-source
29+```
30+
31+Record the new commit and dependency pins here in the same change.
32+The executable includes debugging paths from its build directory;
33+another build may have a different checksum. The checksum pins this
34+tested artifact. Gzip adds neither a filename nor a wall-clock time.

site/tools/ladle.gz (history) added

Binary file; the patch has it.

site/tools/ladle.gz.sha256 (history) added +1 -0

@@ -0,0 +1 @@
1+c7827e119e82bcc2facb8bcef555556351a84b43b4cc9c466df09ebfa8af92ef ladle.gz

wrangler.jsonc (history) modified +3 -1

@@ -1,7 +1,9 @@
11 {
22 // Cloudflare: serves site/public/ (made by make site) as static files.
3- // The dashboard's deploy command is "npx wrangler deploy"; no build.
3+ // The dashboard's deploy command stays "npx wrangler deploy". This
4+ // hook generates /source/ from main before assets are uploaded.
45 "name": "raz",
56 "compatibility_date": "2026-10-01",
7+ "build": { "command": "make site-source" },
68 "assets": { "directory": "./site/public" }
79 }