Skip to content

v3.9.0

Choose a tag to compare

@github-actions github-actions released this 10 Sep 14:53
· 77 commits to main since this release

Two more targets and a program that runs on one of them, and an editor
you can install and use
. The compiler's --target= now admits seven
triples, two of which are not machines: wasm32-wasi, where 560 of the 598
programs in this corpus compile, link and print what they print everywhere
else
under a WASI engine, and wasm64-wasi, admitted on the layout claim
alone because no sysroot for memory64 exists yet. And tui/ — withdrawn by
decision nine days ago and un-withdrawn for reasons that decision could not
weigh — is now afterschool, a CMake target installed beside pascalc, with
undo, search, go-to-line, save-as, colour and a hint bar.

Nothing an already-valid program does has changed. The runtime stopped
calling tmpfile and builds §6.7.5.5's auxiliary file out of two other ISO C
functions instead, which is a portability improvement on every target and no
change to behaviour; the runtime still holds zero preprocessor
conditionals.

Added

  • The editor has colour and a hint bar (ADR-0389). A cell carries a
    role — document text, status, hint, message, prompt — and the shell maps a
    role to a colour, so ApEdit still names no terminal capability and a
    palette change touches no recorded screen. The bottom row now lists the
    bindings, which were discoverable only by reading the README. PasTerm had
    gained colour for the editor with ADR-0381 and the editor had no way to
    express it; this is what connects them.

  • A document with no name asks for one (ADR-0388). Ctrl-S on a new
    document opens a Save as: prompt instead of advising a restart, which is
    what the fileless start needed to be usable: run afterschool, type, save.
    The decision is the model's and the write is the shell's, so a session
    drives the prompt and a golden holds it — ADR-0387's division of labour, and
    the third prompt cost almost nothing because the first was built there. It
    also removed a second copy of the document's name that the shell had been
    keeping since milestone one.

  • The editor is afterschool, and it starts with no argument. It is a
    CMake target and an installed program now — cmake --build produces
    build/bin/afterschool and cmake --install puts it in <prefix>/bin
    beside pascalc — where launching it used to mean tui/build.py with three
    arguments and an output path a person had to invent and then remember. With
    no file it opens a new unnamed document rather than printing what looked
    like a usage line, and a document with no name says so instead of failing at
    the first Ctrl-S. tui/build.py is still what builds it, and every one of
    its arguments now has a default.

  • The editor gains undo, find and go-to-line (ADR-0387), milestone two of
    tui/. Ctrl-Z and Ctrl-Y over a journal in which every edit is one of four
    named operations — insert, remove, split, join — so one entry both reverses
    an edit and performs it again; a typed run is one undo and not one per
    character. Ctrl-F and Ctrl-L search, case-insensitively because this is an
    editor for a language whose identifiers are, wrapping round the end and
    saying so. Ctrl-G goes to a line. A prompt is a mode of the model rather
    than a loop in the shell
    , which is what lets a session drive one and a
    golden hold it; Ctrl-C closes it, because a decoder handed one byte at a
    time cannot tell a bare Escape from the start of an arrow.

  • Programs run as WebAssembly (ADR-0385, ADR-0390). 560 of the 598 programs in this
    repository's corpus compile for wasm32-wasi, link, and print what they
    print everywhere else under a WASI runtime. tools/pascalcc knows what the
    target needs — the SjLj lowering the non-local goto compiles through,
    libsetjmp, no -pthread, and a stack of a megabyte rather than wasm's
    64 KB default. It was 519 until the runtime stopped calling tmpfile, which
    is ISO C and which wasi declares and does not define: an exclusive fopen
    and a remove are both ISO C and do the same job, so 39 more programs run
    with no preprocessor conditional added anywhere (ADR-0390). What is not
    there yet is still the runtime -- channels, tasks, processes and sockets are
    30 of the 38 that do not run.

  • A seventh target: --target=wasm64-wasi (ADR-0386), WebAssembly's
    memory64. It is admitted on the layout claim alone — the emitted module
    states the target's layout and clang assembles it — because no sysroot for
    it exists to link against. It cost nothing in the compiler's layout rules:
    every one already had the arm an LP64 target needs.

  • A sixth target: --target=wasm32-wasi (ADR-0383), also spelled
    wasm32-unknown-wasi and wasm32-wasip1. The emitted module states
    WebAssembly's layout and triple, and clang assembles it into a .wasm
    object. What this does not yet do is link a program: the runtime does
    not build for the target, and runtime-nonposix says how far away that is —
    two of its four translation units compile, one wants five headers wasi has
    not got, and one wants threads the target does not have.

  • A text-mode editor, tui/apide.pas, in Turbo Pascal's mould and written
    in this language: open, edit, save, and Ctrl-B to compile with the cursor
    landing on the first diagnostic. Build it with
    tui/build.py tools/pascalcc apide.pas ~/bin/apide. A first milestone, and
    it says what it is not — no horizontal scrolling, no mouse, no undo, and a
    column is a byte.

  • PasTerm gained the alternate screen, colour and a reset:
    EnterScreen, LeaveScreen, SetColour and ResetColour, each a string
    the caller writes where it likes, as the five sequences before them are.

Removed

  • --target=x86_64-w64-windows-gnu, and every other spelling of it. The
    compiler emits for five machines and every one of them is POSIX. Windows was
    measured rather than assumed — a program was built and run under wine — and
    then dropped: what remained was a frame-layout change compared across every
    target and seven headers of winsock, for a platform this project does not
    run. The measurements are kept in doc/history.md for anyone who wants to
    take it up, and practical compatibility work is still welcome.