Skip to content

v3.6.0

Choose a tag to compare

@github-actions github-actions released this 06 Sep 22:46
· 186 commits to main since this release

The library asked the language for something, and got it. Traits landed in
3.5.0 with one client; this release is the one where PasContainer's map keys
itself with a trait and every map call loses two arguments — the payoff the
feature was measured against, and a break for every existing map client, said
below in as many words. Around it: the sanitizers see compiled Pascal for the
first time, an outline calls a task a task, a refused generic instantiation is
reported once instead of a hundred times, and pascalcc new-project writes a
project a program can be started in. The number is minor because the accepted
language and the command line grew and nothing they accept changed meaning; a
library interface changed, and the entry says which.

Changed

  • Every emitted function carries sanitize_address and sanitize_thread
    (ADR-0358). AFTERSCHOOL_PASCAL_CFLAGS=-fsanitize=address now instruments
    the program and not only the runtime — a use-after-free written in Pascal
    is reported with a stack trace where it printed a value — and
    -fsanitize=thread sees a race between two tasks. The attributes are inert
    without the flag. The sanitizers and thread-sanitizer gates refuse to
    sweep until a probe the sanitizer must report is reported, and the corpus
    was clean under both with compiled Pascal instrumented on the day.
  • --dump-symbols reports a task as task (ADR-0357), where it reported
    procedure — a task is started by spawn and cannot be called, so an outline
    naming it a procedure sent a reader to the wrong construct. The language
    server maps the new word beside function, the protocol having no nearer
    kind, and the MCP outline tool writes the word itself. A client written
    against the previous list reports a task as a variable until it learns the
    word.
  • PasContainer's map key implements a trait, and every map call loses two
    arguments
    (ADR-0355). Map(K: Key; V: type; cap: integer) binds the key
    discriminant with trait Key — Hash(k: Self): integer and Same(a: Self; b: Self): boolean — declared in the module's interface. MapPut, MapGet,
    MapHas and MapDelete no longer take a hash and an equality; the client
    writes one impl Key for its key type, before the map type is produced, and
    StrHash/StrEq stay exported as what a string key's implementation calls.
    This breaks every existing map client: the four in this tree lost 34
    argument pairs and gained one implementation block each (three for
    lib_container_key, one per key capacity), with every golden unchanged. The
    module cannot supply an implementation for its own MapKey (ADR-0341), so
    even the ready-made key type takes two lines in each client.

Fixed

  • A refused generic instantiation is reported once (ADR-0356). A schema
    whose type-valued discriminant failed its bound used to produce ^integer,
    and every generic body instantiated against it then reported faults located
    in the library — seven lines for one MapInit, a hundred for a client that
    also put and got — after the one line that was the diagnostic; and a call
    whose instantiation was refused for a category, a bound or an undetermined
    type was followed by unknown function naming the function just refused.
    The type now carries the refusal, no body is checked against it, and the
    second message is gone. Five goldens lost fifteen lines and gained none.

Added

  • A project: pascalcc new-project <name> (ADR-0348), alias new, with
    build, run and test reading what it wrote. The skeleton is src/,
    test/, build/, a .gitignore, a README and afterschool-pascal.toml;
    pascalcc run in the new directory prints Hello, world! without anything
    else being done first.

    afterschool-pascal.toml carries what the compiler cannot infer — which
    source is the program, where the executable goes, the optimisation level, the
    target, extra import paths and the link flags, the last being what a
    program binding PasTls otherwise has to know to pass by hand. It is looked
    for in the current directory and each enclosing one. It lists no modules and
    never will
    : import greet; finds src/greet.pas by name, so adding a
    module is adding a file and there is no build order anywhere. The reader is a
    strict TOML subset — [section], key = "string", key = ["a", "b"],
    comments — and refuses an unknown key or section by line number rather than
    ignoring it.

    A subcommand is recognised as the first argument and nowhere else, so
    pascalcc build.pas still compiles a file of that name.