From 403e5981453b6772ed140e27cb34c2f0992d3491 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sat, 12 Sep 2026 04:11:22 +0700 Subject: [PATCH] Catch up with four facts that moved while this page sat on a branch The quote checker found three of them on the first run against the new tip: the sand hash was changed deliberately by the grid lane, break and continue now refuse by name instead of reading as unknown functions, and the usage text grew --debug. The prelude also grew a string and UTF-8 family the table did not list. --- web/examples/quotes.sh | 3 ++- web/index.html | 25 ++++++++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/web/examples/quotes.sh b/web/examples/quotes.sh index dd447fc..b0f50b3 100644 --- a/web/examples/quotes.sh +++ b/web/examples/quotes.sh @@ -56,7 +56,8 @@ for pair in \ 'fnty:(defn f [g (Fn [i32] i32)] i32 (g 1))' \ 'quoted:(defn f [] i32 (quote a))' \ 'deferblock:(defn f [] i32 (let [x 1] (defer (print-line "a")) x))' \ - 'i64index:(defconst xs [3 i32] [1 2 3]) (defn main [] i32 (let [i (i64 1)] (at xs i)))' + 'i64index:(defconst xs [3 i32] [1 2 3]) (defn main [] i32 (let [i (i64 1)] (at xs i)))' \ + 'break:(defn main [] (let [i 0] (while (< i 3) (break))))' do name=${pair%%:*}; src=${pair#*:} printf '%s\n' "$src" > "$here/.q.flan" diff --git a/web/index.html b/web/index.html index 08b78ce..c042f21 100644 --- a/web/index.html +++ b/web/index.html @@ -217,7 +217,7 @@ $ ./_build/default/bin/main.exe run calc-me.flan "1 + 2 * (3 - 0.5) / 2"
$ flan
 usage: flan (read|parse|check|emit|shim) <file.flan>...
-       flan build <file.flan> [-o out] [--no-bounds-checks] [--dev] [--target=wasm32-wasi]
+       flan build <file.flan> [-o out] [--no-bounds-checks] [--dev] [--debug] [--target=wasm32-wasi]
        flan run <file.flan> [args...]
        flan reload <program.flan> <forms.flan> [-o out.so]
        flan dev <program.flan> [-s socket]
@@ -528,10 +528,13 @@ a body that changes it cannot change the trip count, and the loop variable is no assignable.

Loops are imperative, with while, until and -return. There is no loop/recur, and there is no -break or continue either — both are planned and neither -exists, so today they report as unknown function break. An early exit out -of a loop is return, as first-even does above.

+return. There is no loop/recur. There is no +break or continue yet either; both refuse by name:

+ +
break is not implemented yet (see the build sequence in plan.org)
+ +

An early exit out of a loop is return, as first-even does +above.

Option, match and some

@@ -641,6 +644,8 @@ ordinary Flan.

slices of i32swap-i32!, reverse-i32!, sort-i32!, index-of-i32, min-i32, max-i32, sum-i32 bytesbytes=?, starts-with?, ends-with?, index-of-byte, index-of-bytes, trim, digit?, space? parsingparse-i64, parse-f64 +textsplit-on-byte, split-next!, lower-ascii, upper-ascii, bytes-ci=? +UTF-8decode-rune, rune-at, rune-count, rune-size, rune-start?, valid-utf8?, encode-rune! numberssign-f32, lerp, floor-f32, ceil-f32, round-f32, and sqrt-f32, which is the one declare in the file randomrand-seed, rand-u32, rand-f32, rand-i32-range, rand-f32-range @@ -1189,10 +1194,10 @@ module, and the headless sand acceptance program prints the same 64-bit hash und it does natively:

$ flan run test/programs/sand-headless.flan
-2256461126764447066
+-2851001042534928384
 $ flan build test/programs/sand-headless.flan --target=wasm32-wasi -o sand.wasm
 $ node --no-warnings test/wasm-run.mjs sand.wasm
-2256461126764447066
+-2851001042534928384

That number is the whole point of writing the RNG in Flan rather than calling libc's: a grid hash is only a regression test if the sequence is byte-identical on both targets. @@ -1206,6 +1211,12 @@ module to bind to; release builds call directly, emit constants as constants, an the folding back. Dev builds are not pruned by reachability, because what a REPL may redefine next is not a function of what has been called so far.

+

--debug is a third flag beside --dev and the optimisation +level. --dev asks whether you can redefine the program while it runs; +--debug asks whether you can stop it and read it. It emits DWARF, sets +-O0, and is refused by name for wasm32. lldb needs no plugin to read a +Flan struct: the struct is its C struct.

+

Some things are refused by name rather than half-supported, and both cross-target refusals say why: