interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / tools / trit / build.sh

17 lines · 1000 bytes Raw Blame History
1#!/bin/sh
2# build.sh -- compile tools/trit/trit.om with the seeded omc, after the seeded SHA-256 core.
3# Run from the repo root: sh tools/trit/build.sh (OMC defaults to seed/out/omc)
4# The composition mirrors seed/omega-from-seed.sh step 5 (diaggen): om2 line, the sha256.om core
5# up to "fn sha256", then the program. Prints the sha256 of the composed source and the binary.
6set -eu
7R=$(CDPATH= cd -- "$(dirname "$0")/../.." && pwd)
8cd "$R"
9OMC=${OMC:-seed/out/omc}
10B=${B:-build/trit}
11mkdir -p "$B"
12# omc refuses an `abstract` line after any `fn` (error 9), and the core ends in functions, so the
13# trit type line is lifted ahead of the core.
14{ printf 'om2\n'; grep '^abstract ' tools/codebook/codebook.om; sed '/^fn sha256 /,$d' seed/trace/sha256.om; grep -v '^abstract ' tools/codebook/codebook.om; cat tools/trit/trit.om; } > "$B/trit.full.om"
15"$OMC" < "$B/trit.full.om" > "$B/trit"
16chmod +x "$B/trit"
17sha256sum "$OMC" tools/codebook/codebook.om tools/trit/trit.om "$B/trit.full.om" "$B/trit"