The INSERTIONSORT crash, all three rulings (FIX.org 2026-09-20): - (bytes s) allocates a writable copy through the allocator surface — context or (bytes s a), StorageExhausted with retry, a registry note in dev builds (flan_bytes_dup, lowered like vec-new). (bytes-view s) is the old zero-cost reinterpret, renamed, read-only by convention; every in-repo reader swept over to it. (string b) unchanged. - String constants were already read-only on both backends at -O0; now pinned — bytes-copy.flan rows on LLVM/-O0/--x86, and dies_segv rows asserting the write-through-view trap on both backends. - A dev build installs a SIGSEGV/SIGBUS handler by the same dev-only constructor slot that arms the registry: one line naming the address and the innermost frame, then the trap-hook park — stopped, not dead, the daemon serving. No agent: message and re-raise. Release builds untouched. Pinned by trap_park over dev-segv.flan.
36 lines
1.6 KiB
Plaintext
36 lines
1.6 KiB
Plaintext
;;;; The same source on both targets, which is the whole of decision 2.
|
|
;;;;
|
|
;;;; Flan has NO conditional compilation — nothing in parse.ml or check.ml
|
|
;;;; reads the target — so "isolate this to desktop" is not expressible here,
|
|
;;;; and a build-time refusal would therefore be unusable. A silent no-op is
|
|
;;;; worse than either, because that is how a save file disappears with nothing
|
|
;;;; said. So `barf` on the web signals a condition and the program decides,
|
|
;;;; which is the language having something Odin does not: Odin stubs its whole
|
|
;;;; file API on js/wasm to .Unsupported so that importing core:os "panics
|
|
;;;; cleanly", and a panic is not a decision.
|
|
;;;;
|
|
;;;; Built for the desktop this prints that the write worked. Built for the
|
|
;;;; browser it prints that it was refused, and says which file and why. One
|
|
;;;; source, two outcomes, no flag anywhere.
|
|
|
|
(defn main [] i32
|
|
;; Embedding needs no filesystem and no host ABI, so this line is identical
|
|
;; on both targets and is why decision 1 came first.
|
|
(print (embed "assets/a.txt" string))
|
|
|
|
(handler-bind
|
|
[(FileError [c]
|
|
(print "refused: ")
|
|
(print (.path c))
|
|
(print " reason ")
|
|
(println (.reason c))
|
|
(println (= (.reason c) file-unsupported))
|
|
;; There is no restart that means "give up and carry on" — spec-
|
|
;; conditions.md §2 makes `error` diverging, and a handler that returns
|
|
;; normally has not answered it. Leaving is the honest way out of a
|
|
;; save that cannot happen.
|
|
(exit 0))]
|
|
(barf "web-files-out.txt" (bytes-view "state\n")))
|
|
(println "wrote it")
|
|
0)
|