62 Commits

Author SHA1 Message Date
6c2f7c34c7 An eval or load reply carries the compiler's warnings, which Emacs marks at their sites and counts in the echo line, and a load says each warning once. 2026-09-26 19:20:40 +07:00
66fce31dbd The prelude is lib/prelude.fln, embedded at build time and read by the indented reader. 2026-09-26 16:37:02 +07:00
2752d57655 A dev daemon started by a test dies with it, a daemon whose socket is gone ends cleanly, the Emacs daemon buffer asks before it is killed and closes the session, and a program's agent socket lives under TMPDIR and goes on a trap or fatal signal. 2026-09-26 13:13:39 +07:00
2135f6d37f Merge branch 'master' into worktree-agent-a46233a32d1912c78 2026-09-25 23:27:55 +07:00
69ac194ba7 An editor socket path too long to connect to is linked at a short path the Emacs client computes the same way 2026-09-25 22:54:44 +07:00
0fc258c434 Merge branch 'master' into worktree-agent-a46233a32d1912c78 2026-09-25 21:11:17 +07:00
4d3688a519 Merge master into the .fln mode lane; a .fln arm sends its match whenever its value uses any name the pattern has, C-c C-s steps a .fln top-level form, and a comment block directly above a form is part of its text objects 2026-09-25 20:53:48 +07:00
ad40123b25 Master's error recovery and return types read off the body live together, and two ways out of an inferred body that cannot share a type are refused with both named 2026-09-25 19:58:31 +07:00
8c814b39c1 .fln files open in flan-fln-mode, which evaluates, moves over, indents and edits statements, clauses and top-level forms, and every Flan mode derives from flan-base-mode 2026-09-25 17:13:12 +07:00
ff88b9dad6 A defn whose return slot is _ (or a .fln fn with no arrow) takes its return type from its own body, recursion through such functions is refused by name, and a stale caller of one is told which line changed its type 2026-09-25 17:09:13 +07:00
37938db7c2 A call through a failed local is not reported and a miscounted call's arguments are, eval-in-frame answers slotless frames and ended stops, flan dev links its own agent, and the daemon buffer colours only file:line:col diagnostics 2026-09-25 16:47:51 +07:00
f32f88413e Merge branch 'master' into worktree-agent-a4f010dac78379ee2 2026-09-25 16:20:22 +07:00
30373ffda5 A converted comment stays with the form it was written beside when the printer reorders or splits bindings, the round trip checks each comment's form, and a snippet's first line sets its left edge 2026-09-25 16:17:12 +07:00
4b64dc5f65 Code-carrying dev requests name their syntax and starting line and column, so a .fln snippet sent from the middle of a buffer reads with the buffer's own locations 2026-09-25 15:57:09 +07:00
9a91440486 C-c C-s installs a defn that stops before each form of its body, and the break buffer steps it with s and runs the rest of the call with c 2026-09-25 15:43:24 +07:00
da9f21ddcd A form sent to the daemon is refused with every error in it, and an expression evaluated from the break buffer sees the stopped frame's locals 2026-09-25 15:33:23 +07:00
8dc90416d4 The daemon's buffer draws errors, warnings and notes in compilation's faces and the program's own output in a face of its own 2026-09-25 15:14:23 +07:00
610e9fcf9d A parent's handler reads a name and message made in context/temp, whole and good until the frame ends, and the handler-case landing no longer holds a buffer of its own 2026-09-25 14:36:46 +07:00
f87d596bdc A file with a broken form still starts a session, a package's macros expand bare from its file, a delivery a running program never polls for says so with a fix that compiles, and aborting an expression stopped in the park abandons it and keeps the session 2026-09-25 13:06:36 +07:00
b74002be02 Merge master 2026-09-25 12:54:55 +07:00
bfd176cce9 Merge master: a handler clause runs without its own handler in force, over the condition descriptor, and StaleCall is an Error 2026-09-25 12:50:01 +07:00
1fb4b37125 A restart that takes values can be taken from the break loop, which asks for one per parameter and stores them into the frame as an invoke-restart would 2026-09-25 12:46:23 +07:00
11e1ff10a7 flan dev starts on a file with no main and links the agent into every program it builds, C-c C-k loads a file keeping what compiles, and an expression sent from a package's file resolves in that package 2026-09-25 12:44:15 +07:00
77497cfc2c A generic's copy made by an evaluated expression is disassembled from that expression's module, and one copy that cannot be shown no longer hides the others 2026-09-25 12:00:50 +07:00
6c8611cece Merge master 2026-09-25 11:53:00 +07:00
20fa04d9df A program never waits on an editor that stops reading its pushes, and the editor keeps a bounded tail of the program's output 2026-09-25 11:42:54 +07:00
b05a97b029 A generic's name disassembles to its copies, each headed by the types it was called at, and is listed among the program's names 2026-09-25 11:41:31 +07:00
c671f23b2c Merge master 2026-09-25 11:36:46 +07:00
14da41e1d9 A changed signature installs, its stale callers are named, and a handler is off while its own clause runs 2026-09-25 11:17:48 +07:00
f4725788c5 The daemon pushes the program's output and the watch table to an editor that asked for them, and every key a Flan buffer's own map binds is that buffer's under Evil 2026-09-25 11:16:49 +07:00
ed8dbbcd62 A handler-bind clause runs with only the handlers outside its own form in force, and a stale call in main's running loop stays listed until the callee changes back or the program re-runs
The first is CLHS 9.1.4.1: a clause that signalled the condition it handles used to re-enter itself until the stack ran out. The stale list now names a lifted clause by the function it is written in, and BUILT.md's cost line is measured against master.
2026-09-25 11:15:52 +07:00
0a6ea7c32b A caller excused for going stale takes back the generic copies its failed check cached, and a package's stale callers are named at their own file and line 2026-09-25 10:51:44 +07:00
39d35f51db A function whose signature changed installs, and a caller compiled against the old one stops on StaleCall at the call
A dev cell carries its body's signature word beside the body, every call through a cell (and every function value taken from one) compares it with the word the site was compiled for, and the session lists the stale callers by file and line on the reply. Both backends, both installers; release builds have neither the word nor the compare.
2026-09-25 10:40:18 +07:00
066fb18940 Every Flan form heads the code it produced in the emitted IR, the x86 listing and both disassembly buffers, and the objects are the same with or without it 2026-09-25 10:34:07 +07:00
11dc230974 A defn- is private to its module, and the module's own macros may call it 2026-09-25 08:57:20 +07:00
ff744120fc A release build's watch is only its value, next-error lets go of a stack that has resumed, and the frame a stop is in is always shown 2026-09-25 08:36:53 +07:00
6fd456c0a2 A function declared with defn- is callable only from the files of its own package 2026-09-25 07:42:40 +07:00
cf028e23ea A class and each case of a data type are names on the definitions list 2026-09-25 07:09:46 +07:00
2e58880160 The break buffer hides the prelude's frames and opens the source behind a frame 2026-09-25 07:04:56 +07:00
9c0e659209 next-error stops on a diagnostic's notes, and CFn is drawn as a type 2026-09-25 07:01:48 +07:00
9d7da2ba7a A stop takes the window, because the next key is aimed at it 2026-09-22 11:12:53 +07:00
57fe91f303 Five records become one, and every citation lands somewhere
FIX.org, NEXT.md, DISCUSS.org, docs/DISCUSS.md and the session handoff at the
root are one TODO.org now: 293 entries under seven subsystem headings, each
carrying an org keyword that says where it stands. A DONE entry is a few lines
saying what was decided and what that rules out; the reasoning that would not
compress — the embedding spike and the four reports the hand-written x86
backend was built from — moved into docs/BUILT.md instead, and its entries
point there in one line.

Every entry was checked against the tree before it got a keyword, and the
prose was wrong in both directions. Things the deleted files called open were
built: the first-evaluation stall, main being redefinable, macro parameter
lists, the type-limit constants, the array constructors, the byte fills,
inc/dec, the discard's fontification, the Emacs buffers, rt_die's _exit, the
backtrace surface, and the acceptance failure that could print and still exit
zero. Things they called done were not: the backend reports' no-plan buckets
had gone stale in the other direction, the value-dependent defvar was
superseded rather than built, and macro-expansion source locations are on an
unmerged lane, so that entry is NEXT and names the branch.

Every comment that cited one of the five by name now cites a heading that
exists, in TODO.org or in docs/BUILT.md. The session reports under
docs/handoffs/ keep naming the files they worked on, because rewriting them
would falsify what those sessions did; each carries a note saying where the
content went.
2026-09-21 21:05:48 +07:00
612411021c The colour goes on the language, and the program is left plain 2026-09-21 19:06:16 +07:00
2d1d88e9d1 A macro has a body, and the entry that said otherwise
Review follow-ups on the mode pass.

The regression first, because it is the one that cost something: giving
macros a kind of their own took them out of three completion tables.
flan-disassemble, flan-disassemble-ir and flan-lowering each filtered
flan--defs on kind "fn", which had been the whole truth right up until
this branch made it half of one. A macro is compiled -- defmacro is a
defn by the time anything emits code -- so all three genuinely work on
one, and only the offer had gone. One flan--compiled-kinds names both
words and the three sites read it.

Then four sentences in the FIX.org entry that were not true, which
matters more than it sounds: that file is the history somebody reads
later to find out what happened.

The corpus claim was the bad one. It said the whole corpus round-trips
with zero differing lines. It does not, and never did -- the script that
measured it bound inhibit-message around its own reporting, which in
batch means the differences were found and then swallowed. Measured
properly: 317 files, 22 files and 389 lines differing before, 20 and 373
after. Sixteen lines fixed in two files, no new difference introduced,
and 373 lines still differing that this pass never looked at.

The other three: the fns/macros dedup is required by the new rows and is
not a fix to a bug that was there before -- a macro used to appear once,
as a fn. handler-case was already a keyword. loops.flan has three
labelled loops and dotimes-range.flan has the other two.

And three gaps the review found while checking: array-fill and array-gen
were never in the keyword list, Unit was in the type rule while the
parser refuses the word, and a prelude macro's row carried a bare name
where a program's carried its parameters. A check that pulls every head
out of parse.ml and diffs it against the three lists now comes back
empty, which is what the docstring had started claiming.
2026-09-21 16:00:49 +07:00
2ba6a6cbf0 One list for the parser, one for the checker, and one the program fills
flan--special was three kinds of name in one list: the forms the parser
dispatches on, the functions the compiler provides, and the words that
stand for themselves. Drawing push like let said they were the same kind
of thing. They are three lists now, each read off the file that decides
it, and the two names in the old one that are not in the language at all
-- cast and none -- are gone with it.

What else had been missed: dyn, Allocator, Vec, Map, Fn, int and float
were not types, $t was not anything, handler-case was not a keyword, a
comma was not whitespace, & was not a name character -- which a macro's
parameter list needs, now that it destructures -- imenu had no heading
for a macro and none for the four dispatch forms, and a labelled loop
indented its body under its own binding vector, which loops.flan has
four of and would have said.

Then the second half. The defs op already told the editor what every
name is, and only completion and eldoc were listening, so a macro you
defined looked exactly like a function you defined. It carried no macro
kind to listen for and could not have: a macro is a defn by the time
there is a program. So the op answers with one -- keeping the location
off the defn it drops, so M-. still goes there -- and with the type
names, read off the checker's environment, since an enum is an i32 and
an alias is gone by then.

The editor draws them by kind, after the static rules and never over
them: a program defining its own length does not get to repaint the
builtin. A hash table and a matcher rather than a regexp of every name,
rebuilt when the cache is and not when a key is pressed. With no session
the rules come off and the buffer is what it always was.
2026-09-21 15:31:32 +07:00
41334b3a8f Review follow-ups: a trap is not an evaluation, and the way out cannot be truncated away
The break buffer captioned every refused restart "below this evaluation", which
is the wrong sentence at a trap: there is no transfer channel, nothing on the
list can be taken, and there is no evaluation to abandon. The terminal listing
had always said the two apart. The wire now does too — a bare ! line ahead of
the entries, because a trap with no restarts at all still has to be able to say
so, and because :abandon being nil means three different things.

The boundary was also the first entry truncation dropped: snap_push walks
innermost first, and the boundary is the outermost frame of the evaluation. A
slot and a name's worth of bytes are kept back for it.

flan_break_resume goes; nothing has called it since choices became positions,
and NEXT.md already said there was no such function. eval_boundary is cleared
between runs beside the two stacks that already were. And the note on a taken
restart stops costing a second round trip: the agent answers ok abandon for the
boundary, which is the end that knows.

Nested boundaries are tested rather than argued: two evaluations, six restarts,
and abandoning the inner leaves the outer with its own still on offer.
2026-09-21 09:04:35 +07:00
fe6744ae41 An evaluation that signals can be abandoned, and the program keeps running
A C-x C-e that blew up took the session with it. The expression's break offered
either nothing at all — a bad index establishes no restart, and the program's
own are below the thunk boundary where a transfer has nowhere to land — or a
list on which every entry was refused. That left abort, and abort is _exit(134)
over a mistyped index.

So the boundary offers a restart of its own. The agent pushes a real frame
around every evaluation, after the floor is read so that it lands above it;
taking it unwinds to the thunk, flan_reload_call drops the channel it holds,
and the poll returns to the game loop. It abandons and does not undo, which is
said in the agent's line, the daemon's note, the buffer's row and the manual.

The other half was a silence. The break buffer drew every restart as takeable
and ignored the :unreachable the wire already carried, so a digit on one went
out to be refused and nothing came back. Those rows now carry the reason and
are refused where they are read, and :abandon names the position that drops the
evaluation — a position, because a program may establish a restart of that name
itself.

Not the threading, which is what the report suspected. The thunk does run on
the game thread; a thunk on a thread of its own would have had the same empty
list and the same abort.
2026-09-21 09:00:26 +07:00
a4c6b996ff def re-runs its initialiser, and defvar is renamed defonce
The trio the author decided on 2026-09-20 is now all built: def is CL's
defparameter — its initialiser runs on every daemon re-run, unguarded, so
an edited initialiser repaints the same storage on C-c C-c plus re-run —
defonce (Clojure's name for CL's defvar, per the author) initialises once
behind the .init~once. flag, and defconst stays the image.

One parse arm reads both forms; the difference is Ast.reinit, carried to
Tast.global's grerun. Emit.startup_plan gives a def no guard flag, and
Check.check_global lifts every def initialiser — zero and literal
included — into global/<n>, so the host's startup reaches it through the
function cell and a re-evaluated def swaps it (Session's def_inits;
Emit.redefinition declares the cell for a non-sibling target). The old
defvar spelling is refused with the rename and both compiling spellings,
and every program, test, doc and editor list is swept — except sand.flan,
the author's live WIP, whose seven defvar lines are flagged in FIX.org
and keep its three dependent tests red on this branch.
2026-09-21 07:12:04 +07:00
e83a50b5c3 Two streams and one list: the buffer story consolidated
*flan-output* is gone. The program's output lands in the daemon's buffer
always — renamed *flan-dev* to *flan* — and at the REPL when one is open,
inserted above the prompt, output first and the value after it. A
rejection puts its message in *flan-diagnostics*, which now pops up, and
leaves one line at the prompt pointing there; the diagnostics buffer got
a major mode of its own, read-only with n/p/RET, and the memory sites
from flan-check-memory render into it as one section below the errors,
replaced whole on every ask. Two clears at the REPL, on CIDER's keys:
C-c C-o for the last send's output, C-c M-o for the transcript.

No daemon changes: output already rides every reply's :output, so both
destinations are editor-side routing.
2026-09-20 21:05:50 +07:00
865c7e0445 C-c C-c on a defclass went to the expression evaluator and was refused
flan--declaration-heads was topped up a name at a time, so it had lost
defdata and all four of the object and dispatch heads. A head missing
from it is not a quiet fallback: the form goes to the expression
evaluator, and the daemon answers "defclass is a top-level declaration,
not an expression" at the line you pressed the key on. Confirmed both
ways against a real daemon on test/programs/dev-class.flan -- the old
list gets that refusal, the new one installs, and defgeneric and
defmethod install through the same path (area@point, area).

Re-derived whole from Parse.decl, which is the honest authority. The
comment said the authority was the declaration arm of Parse.expr, and
that was never quite true: declare and declare-c have been in this list
from the start and Parse.expr has no arm for either. So the rule is the
plain one -- is it a declaration -- and package is a single named
exception, kept because the two keys have always differed there and
nothing about a line written once at the top of a file asks for that to
change. The rationale in test-flan.el's package check said the same
stale thing and says the surviving reason now.

The new check reads the list off Parse.decl and asserts both keys on
every head, so the derivation is the test rather than a claim beside it.
2026-09-20 18:23:33 +07:00