From 403e5981453b6772ed140e27cb34c2f0992d3491 Mon Sep 17 00:00:00 2001
From: Joseph Ferano
@@ -528,10 +528,13 @@ a body that changes it cannot change the trip count, and the loop variable is no
assignable.$ 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]
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.
match and somei32swap-i32!, reverse-i32!, sort-i32!, index-of-i32, min-i32, max-i32, sum-i32bytes=?, starts-with?, ends-with?, index-of-byte, index-of-bytes, trim, digit?, space?parse-i64, parse-f64split-on-byte, split-next!, lower-ascii, upper-ascii, bytes-ci=?decode-rune, rune-at, rune-count, rune-size, rune-start?, valid-utf8?, encode-rune!sign-f32, lerp, floor-f32, ceil-f32, round-f32, and sqrt-f32, which is the one declare in the filerand-seed, rand-u32, rand-f32, rand-i32-range, rand-f32-range$ 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: