tricu

An interpreted language for exploring Tree Calculus
Log | Files | Refs | README | LICENSE

README.md (2951B)


Linked-source text summary

Run from the repository root after nix build .#:

result/bin/tricu arboricx import --store /tmp/scp-linked-demo \
  --file test/fixtures/support-library.arboricx --indexed
result/bin/tricu arboricx run --store /tmp/scp-linked-demo --module support-library \
  --name demos_consumers_source_linked_summary_main.main --unsafe-io --io --format tree

The old cold-source consumer_source_link_demo.sh is historical, not current validation of the native module. The runner has portable build coverage; its full linked-source execution is not part of the focused integration gate.

The first command prints imports=<64 hex digits>, sidecars=<64 hex digits>, and lines: 4, followed by t (the IO runner's return value). sample.txt has three LF-terminated lines and an unterminated fourth. Hash values are content identifiers, not fixed lesson answers. The historical harness repeats the normal run in a fresh store and then uses the same pinned source with an absent input file. It prints a read failed: … line and checks that the imports/sidecars identifiers do not change. It edits only the runner's inputFile for that check, not the .scp sources.

Read the sources in dependency order:

  1. succ.scp consumes a compact natural; it is copied from the base library. Preparation compiles it first.
  2. countLines.scp takes bytes as input and initial state (0, (leaf, successor)), where successor is that compiled descriptor. A final unterminated line increments the compact count; an empty file produces 0.
  3. entry.scp receives a path and counter worker, and requests the named ReadText effect. The retained environment carries the counter to the receiver; the entry does not read the file itself.
  4. receiver.scp matches successful reads and calls the counter, or returns the read error as application data. The tricu-owned effect driver performs actual file IO, and T.render prints either lines: N or read failed: ….

main.tri is intentionally explicit about staging four source files, pinning their digests in one import descriptor, resolving verified source, publishing IR sidecars, and preparing the dependent workers. The --store flag configures the bootstrap import store; sourceStore in the runner configures a separate source CAS under /tmp. The command uses --unsafe-io for this local preparation and file-read demonstration. The printed identifiers attest neither the compiler configuration nor the worker payload. At runtime, a separately prepared native CAS application can load compiled trees without re-reading .tri/.scp source; see the SCP build/run guide for that distinct path. The commands above do compile and link source on launch: do not treat their time as a native-load measurement.