Skip to content

Flag 0.6 - #4

Merged
FramaLuna merged 58 commits into
mainfrom
release-0.6
Nov 20, 2026
Merged

FramaLuna merged 58 commits into
mainfrom
release-0.6

Conversation

@FramaLuna

Copy link
Copy Markdown
Owner

Flag 0.6: the 149 decisions of the language's design, applied in one release, and -memory keeping its promise.

The plan, with the decisions and how they fit together, is in flag-design (plan/plan-0.6.md). It ran in 14 phases, one commit or more each:

  • lengths and numbers: lengths, indexes and counts are i64, usize is gone, integers mix when one holds the other, comparisons take any two integers, overloads are chosen argument by argument.
  • memory: an owner starts without memory and takes it from heap or arena, no literal asks for memory, a list doesn't take a *array, text literals are read only on every system.
  • state and threads: no file variables, only constants and contexts (shared for all threads, inherited for a new one), Lock[T] wraps what it guards, atomic[T] in line in QBE on amd64, arm64 and rv64, wait is a function.
  • the language: tuples and return a, b, a if c else b, ..=, assert, type $T parameters, where blocks, default values of fields and parameters, ..items, protocol operators (operator [], for, next, with, hash...), noinline, @ builtins.
  • C and systems: cstr and wstr types, a simd of 32 bytes, variables of C in extern, libraries that refuse a type of another shape, use "path", listen on a host, run in a folder.
  • -memory: follows paths past three pointers and says when it gives up, finds races between threads, follows calls through function values, knows which words of a struct of any size hold a pointer, and is checked against the compiler and every example (no warnings).

Phase 14 closed it: the docs pass (Reference, Overview and Library checked against 0.6 with every example compiled), the sentences the decisions "as today" asked for, and every bug that the closing pass, the reviews of the old notes and the ports of flag-lsp and flag-design found, each with its test.

The changelog section is 0.6.0 (not released yet) in CHANGELOG.md. The version in build.sh is still 0.5.0 and will be bumped when the release is ready.

Testing done locally

  • Linux x86_64: ./build.sh (stage 2 and stage 3 agree, built from the new seeds), ./test.sh build/flagc: 1602 passed, 0 failed. ./build.sh sanitize is clean, ./build.sh package builds the archive.
  • ./build.sh cross passes linux-arm64; linux-riscv64 stops on lga, which the clang 14 of this machine doesn't know (the same with the compiler of main); CI has a newer clang.
  • flagc src/*.flg -memory -check and every example: no warnings.
  • flag-lsp builds with 0.6 and passes its LSP test and -memory without @trust; flag-design builds and runs with 0.6.
  • macOS and Windows: CI runs them.

🤖 Generated with Claude Code

FramaLuna and others added 30 commits November 18, 2026 14:21
…of the second class, and tests pin the order of evaluation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n error, a test is a func test_name() with no parameters and no result, and colors only on a terminal

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ror, text literals cross lines, and the token ..=

Also two messages without an article before a type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…perator not, comparisons do not chain, and a if c else b

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…of iferror and ifnull, == null narrows, and clearer messages for bits next to a bool and for try on a chain

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the summaries of -memory, and assert is a statement that narrows and shows the sides of a comparison

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, the counter of reverse is the index, a..=b in for and case, and the space before a parenthesis

Also a fix in the rv64 backend of QBE for a spilled condition far down the stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…int cannot be declared, a parameter kind: type $T takes a type, and a $T bound by no parameter is an error where it is declared

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…declarations and statements, a name cannot shadow a constant or another local, inf and nan are keywords, and every diagnostic follows the wording rules

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt types mix and compare when one holds the other, an integer widens in a call and a $T takes the widest, and a shift has the type of its left side

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…float, goes as i32 to the extra arguments of C, and the two sides of a conditional or a range take the wider integer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o untagged types of the same size

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, only a negative index the compiler knows counts from the end, and a literal before as takes the size of the target

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…*bytes, handles and bit patterns u64, and usize is gone from the language

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fts in QBE, out_of_memory flushes first, a count past i64 is an error, and a if c else b with a known condition is the chosen side

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ey work on, min, max, abs, clamp and lerp are in core, open_file and create_file in fs, cores in os, and a name of an unused module says which module

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t with and hash, and hash belongs to the language

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a, noinline, a default reads the parameters before it and is checked where it is declared, a generic call sees the functions of the types inside its arguments, and a type larger than 2^61 bytes is an error

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…[]) heap("") and heap({}) are empty owners that allocate nothing, and Lock[T] keeps the value it guards

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ery thread and a typed constant is checked like a declaration, inherited context is copied into a new thread, and on_panic runs before a panic ends the program while the checks of the compiler always call the panic of core

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ew copies into an owner that has it, maps keep their own text keys, ptr of a map element points inside it, returning a pointer to the stack is an error, and [] {} and fixmaps are values with heap and arena as overloads of core

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… only after a path gives it one, fields and contexts give it with a default, and growing an owner without memory stops the program

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le is read in its turn so z += f() and z = z + f() differ, and tuples are built with return a, b, destructured and read with t.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st three pointers, the contexts a thread copies, memory C gives and far offsets, warns on growing an owner that is not on the heap and on a function it gives up on, and names the variable of a leak again

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the element in place, -memory follows elements one by one and the walks that free them all, warns on a narrowed element whose list changed and on a pointer to a temporary whose block ended

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… follows indexed offsets of big contexts so the compiler checks again in 45 s without @Trust, and the Reference has one section for the checker with its promise and its border

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ive atomic instructions in QBE for amd64, arm64 and rv64, Lock.owner atomic, and random on one shared atomic generator

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…with locks and atomics apart and each element of a walk its own, checks the value of a Lock[T] is touched under it, and the Reference says what makes one thread see another's writes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…iteral goes to a cstr by itself, a *u8 goes with as cstr and takes no text, print shows the text of a cstr, and writing through one is an error; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…C, read through a word of data that a library links too, and its text says the form of its library, a framework of macOS, a file or -lname; raylib links what it needs on macOS and Windows; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FramaLuna and others added 28 commits November 19, 2026 17:45
…say the width of their lanes, bool8 to bool64, conversions between 16 and 32 bytes with the same lanes, and a simd that reads a slice of its length with an operator = of core and goes back into one; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s it made with a hash of their shapes, and load_library refuses a library that made a type of the program with other fields or variants; diagnostics say expects; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r names the module, before the library, a module of the library gives way to one of the program with its name and is lib$name inside the library, two folders of uses with one module are an error, an ambiguous call between modules says to name one, and -L goes with the folder of every file of the program

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… output and start in a folder, output gives the errors of the child too, print empties before the program waits, and hex pads to its digits

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…is an argument and (a, b) as a value says how to write it, a channel that waits inside a with lock of its queue stops the program, and -memory ends the temporaries of a block that reused a slot of an outer one and counts as a read what a function returns by value and what a walk passes to a call; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… against 0.6 with every example compiled, and the sentences that the decisions as today ask for

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ngth, a float literal next to an integer gives the error of mixing numbers, an operation of an atomic behind a pointer says to reach it with .*, messages write \t and \e, @embed shows its path without ./, and -memory names a thread never waited; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a pointer, a call that moves or allocates memory more than three pointers away says it is not checked, a free that far no longer blames the variable of the caller, and (i32, bool){1, true} is a literal; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… different parameters are an error, and when the C library aborts what was printed goes out and then flag: aborted; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… i) gives, and a map has only that form; an operator []= of two parameters gives a pointer; -memory knows that +=, append and = of a view copy it first, and starts the context of a thread with its defaults; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… also one of a context; a field of a context with an owner through a type parameter needs a default; a call -memory gives up on says only that; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…it, which macOS showed, and the test of @compile_error in a where holds on every system

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, return of a tuple beside an error, fields of copies passed by pointer, literals into a bound $T?, places that give their type to their values, Box[i64](b), clearer messages, interior frees through a call, walks over freed memory, and the library: fixed ties, files of other threads' programs, udp errors, close of a socket a thread reads, spawn on macOS with closed files; the limits that remain are in the Reference; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nce read them before any place changes, also through a pointer, a tuple type with a number inside, a pointer field of a copy given to a call, defaults that name or call a generic function, @compile_error in main or an export, export of a name of the library, the caret of +, clearer messages for &str parameters, callbacks, unions with null or an error, numbers and list literals, -memory on a channel copied after send and on a thread per round, and the library: heap(m) copies a map, timeout(s, inf), exit codes after a failed standard output, read of size 0, json nodes outside the document, make_dir names the first folder that failed, spawn on macOS with closed files, executable() on macOS; SIGPIPE and a closed File in the docs; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st, with the type of a place that is a variable or a field; an error given again before it is read, or last with nothing reading it, is an error; a place parameter takes a value only by its name; export is checked against the symbols of C of the library; a default that reads a later parameter, also when a call uses it; -memory: a pointer into a struct parameter taken by value is of the stack, and a big struct by value with an Arena, a Lock or a Channel warns; clearer messages; the library: the code of main after a failed standard output, read of huge sizes, pad and wstr scratch, floats at powers of two, add_char of non characters, fixed of many places, and on Windows ready of nothing, run in a missing folder and make_dir; the limits that remain are in the Reference; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eads follow the branches, the loops and the defers; several places take the type that every kind of place declares; a value given in order goes past a place parameter, also before ..items; -memory sees two threads in one Arena, free or clear of an arena under a thread, an inherited Arena copied, and send gives away what the value owns; the library: a -shared library no longer decides the exit code of the program, close of a library writes what it printed, a map update keeps the table, lerp, the temporaries of printed errors, and on Windows a batch name with a trailing dot, args in a library and short sleeps; clearer messages; the seeds count as generated for git; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d as before, by whether something reads the variable, and the docs say so; -memory touches only the words of an Arena, so the fields beside it don't race, and send gives away only what the value points to; the exit code: ending of core gives what main and exit end with, flag_exit only says what failed and lets the lock go, a library that never wrote does nothing at its close, and core of a library is stamped in the thread that closes it; lerp keeps a when b is a; on Windows tool. runs tool.exe; clearer messages and the borders of -memory agree; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… parameter and its type, so calls that bind them in swapped order get their own; exit from a thread that never ran the program's code, core's exports stamped in every program; an end with 0 that a later failure of the standard output turns into 1, said once; -memory touches each word of an Arena; an untagged union prints with an operator += of yours; ptr of a name takes its export; lerp at the ends; the note of a return after a defer; truer hints; the limits that remain are in the Reference; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t, a typed constant or a default are zeros, where they read the code after them; an integer constant with a type, an i64 too, keeps its type and the compiler knows it, so it sizes an array and decides a where or an a if c else b, since an instruction on numbers the compiler knows is the number QBE would compute; {} and a if c else b with a c it knows go in a default and a typed constant, and heap([]) in a typed constant of a union is the empty list, where it was null; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…every element only of the list it walks, a block that several elements point to is no round's own, a walk that grows or frees elements kills the views taken before it, the temporaries a thread without a pointer in its result leaves go when it ends and a wait takes all of a thread's scratch, an atomic races with a free, a move or a plain write; no false warnings on lists filled again in a loop or after clear, on threads that each grow their own element, on an array of structs with owner defaults, or on the keys and values of a map of a context; the limits that remain are in the Reference; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tagram of 65507 bytes, and four texts of the docs, the empty owners and views, [] to an array, a conditional size through a constant, and the count of changes to QBE

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y outside a function, where the code that read it went into the next function, which starts with nothing now; the right side of an assignment to a narrowed variable reads for its declared type, and a if c else b to a union is the members its sides take; a constant through a shared field keeps the default of the field it shares; a number the compiler knows is the value of its type, so 0xffff_ffff as i32 is -1; a float constant with a type keeps it and the compiler knows it, since an instruction on floats it knows, a conversion too, is the float QBE would compute; a text literal is a cstr the compiler knows, in a constant or a default; a lane of a simd is chosen with any number the compiler knows; assert leaves out the sides the compiler knows; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…read that holds it by its number of the system, pthread_self or GetCurrentThreadId, so the thread that holds it in the program takes it again in a library and the other way, and so does a Channel they share; what core gives a thread, its scratch and the line of print, goes when the thread ends through a key of pthread on Linux, _tlv_atexit on macOS and FLS on Windows, so a thread of C that calls an export or a thread of the program that calls a library no longer leaves it behind, and the thread that closes a library frees what the library gave it; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lements of a list frees only maybe a block allocated once that the list may not hold and one that the walk puts in the list past the elements it visits; one block put at two indexes it knows, in a map twice or inserted twice is in two elements, and freeing it in a walk frees it again; a walk keeps up to date the lists and arrays it walks, also nested ones, and putting an element back adds no block to them, so elements swapped or given one by one and grown in a walk, and nested arrays of owners, give no false warnings; an optional owner field freed in a walk and a tree whose nodes hold a &str neither; the limits that remain are in the Reference; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…de a walk over views of a text that the function frees, like defer free(text) with for line in split(text, "\n"), no longer says the text may never be freed; an export no longer follows the defaults of every context field, so the trusted check of the compiler is silent again and a program with big contexts no longer makes it give up on the exports of core; refresh seeds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@FramaLuna
FramaLuna merged commit 19a9adc into main Nov 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant