1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! What:
//! Small shared building blocks:
//! private files,
//! scratch locations,
//! JSON,
//! time,
//! random ids,
//! paths and bounded parallelism.
//! Why:
//! Subsystems depend on these and they depend on no subsystem.
//!
//! In TS you'd write (pseudocode):
//! ```ts
//! // foundation/index.ts: one `export * from './file'` per module below.
//! ```
/// Private,
/// crash-safe file primitives shared by every durable record.
/// Where short-lived private files live:
/// the per-user scratch directory and the repository scratch directory,
/// never the system temporary directory.
/// Compact JSON records read and written with the incumbent's `JSON` semantics.
/// Random identifiers in the layout of the incumbent's `randomUUID`.
/// Text operations with the exact semantics of JavaScript's built-ins.
/// Line-oriented debug and warning diagnostics on standard error.
/// UTC timestamps in the exact form of JavaScript's `toISOString`.
/// Lexical path normalization.
/// How many workers independent items may use together, from the CPUs allowed, the memory free and a measured ceiling.
/// Where one line of progress goes, as a trait a struct can implement.
/// Independent items on a bounded number of threads, reported in input order with no lock.
/// A call turned into a value when it panics, for the places that guard a function and its state.
/// A scoped thread, or the work done in turn where the system cannot start one.
/// Jobs on scoped threads beside each other or beside the calling thread, each a function and the state it reads.
/// The names this program answers to and keeps on disk,
/// each as the current spelling and the one an earlier release used.
/// The rename that never replaces an existing name,
/// and the test for a filesystem that cannot do it.
/// Where a kept file or folder is,
/// moved in place from its earlier name on the first need.
/// Every kept name in a repository's Git directories settled to its current spelling,
/// and the finder for a reader that moves nothing.