Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@ written in Bend, with a VS Code extension.

## Install

bolt needs a Bend 2, and any Bend 2 will do: the one
bolt needs Bend 2.0.32 or later; it is built and checked on Bend 2.0.34, the
version `flake.lock` pins. Any install of it will do: the one
`curl -fsSL https://bend-lang.com/install.sh | sh` installs, one from nix, or
one built from source. You do not need ez or nix. Building bolt needs clang
14+ as well, since bolt is one native binary.
14+ as well, since bolt is one native binary. `bolt check` and `bolt lsp` run
the `bend` on your PATH, so that `bend` is the one to keep at the tested
version.

**Bend version.** bolt is built and tested with Bend 2.0.34, the version
`flake.lock` pins. `bolt check` and `bolt lsp` run the `bend` on your PATH,
so that `bend` is the one to keep at the tested version.
With an installed `bend` and nothing else, build bolt v1.12.0 from the Bend
hub, where it is published as `bolt@1.12.0.0`. Put this in `t.bend`:

With an installed `bend` and nothing else, build bolt v1.9.0 from the Bend
hub, where it is `0xd96f2ab40f5df4925c42e96d0ba857ff`. Put this in `bolt.bend`:

```
import 0xd96f2ab40f5df4925c42e96d0ba857ff/main.bend as Bolt
```bend
import bolt@1.12.0.0/main.bend as Bolt

def main() -> IO(Unit):
Bolt.main()
Expand All @@ -39,10 +38,14 @@ def main() -> IO(Unit):
and build it:

```
bend bolt.bend -o bolt.bin # fetches bolt and its libraries from the hub
./bolt.bin --version # bolt 1.9.0
bend t.bend -o bolt # fetches bolt and its libraries from the hub
./bolt --version # bolt 1.12.0
```

There is no install step: `bend` fetches the package on the first build.
`bolt@1.12.0.0` resolves to `0x582b4b0fdf3dafdeecc8c3bfddc5e4db`, and
`import 0x582b4b0fdf3dafdeecc8c3bfddc5e4db/main.bend` pins it by content.

Or from a clone, at the head of `main`:

```
Expand Down Expand Up @@ -160,11 +163,13 @@ The gate is [ez](https://github.com/Emerging-Patterns/ez), a separate binary
from a separate repo:

```
ez test every */tests/*.bend on both lanes, every PROOF.bend
ez prove every PROOF.bend: the proof gate
ez test every */tests/*.bend on both lanes
ez build bin/bolt.bin the binary people run
```

`ez test` checks every `PROOF.bend`, then runs each stay-list
`ez prove` passes when every `PROOF.bend` prints `ALL PROOFS CHECK`. `ez test`
runs each stay-list
host/integration test on the JS lane and the native lane against the `#|`
trailer the file ends in, caps each `bend` at `EZ_CAP` gigabytes, and caches
a lane on the content of everything it reads, so a second run over an
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 3 additions & 15 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,9 @@
${old.buildPhase}
'';
});
# the proof gate: every PROOF.bend on this flake's bend, its first line
# ALL PROOFS CHECK. ez.mkProofs comes back when ez runs on 2.0.34.
proofs = pkgs.runCommand "bolt-proofs" {
nativeBuildInputs = [ bend ];
BEND_LIB = ez.bendLib ./ez.lock.toml;
} ''
export HOME=$TMPDIR
cp -r ${self} src && chmod -R u+w src && cd src
for p in $(find . -name PROOF.bend -not -path './.ez/*' | sort); do
first=$(cd "$(dirname "$p")" && bend "$(basename "$p")" | head -n 1)
echo "$p: $first"
[ "$first" = "ALL PROOFS CHECK" ] || exit 1
done
touch $out
'';
# the proof gate: `ez prove`, every PROOF.bend on this flake's bend,
# each passing only on a first line of ALL PROOFS CHECK
proofs = ez.mkProofs { ez = inputs.ez.packages.${system}.default; src = self; };
# bolt, built from this tree, over this tree: exit 1 on any error
lint = ez.mkLint { inherit bolt; src = self; };
in {
Expand Down
Loading