Repository navigation
v3.6.0
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_addressandsanitize_thread
(ADR-0358).AFTERSCHOOL_PASCAL_CFLAGS=-fsanitize=addressnow 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=threadsees a race between two tasks. The attributes are inert
without the flag. Thesanitizersandthread-sanitizergates 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-symbolsreports a task astask(ADR-0357), where it reported
procedure— a task is started byspawnand cannot be called, so an outline
naming it a procedure sent a reader to the wrong construct. The language
server maps the new word besidefunction, the protocol having no nearer
kind, and the MCPoutlinetool 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 withtrait Key—Hash(k: Self): integerandSame(a: Self; b: Self): boolean— declared in the module's interface.MapPut,MapGet,
MapHasandMapDeleteno longer take a hash and an equality; the client
writes oneimpl Key forits key type, before the map type is produced, and
StrHash/StrEqstay 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 ownMapKey(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 oneMapInit, 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 byunknown functionnaming 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), aliasnew, with
build,runandtestreading what it wrote. The skeleton issrc/,
test/,build/, a.gitignore, a README andafterschool-pascal.toml;
pascalcc runin the new directory printsHello, world!without anything
else being done first.afterschool-pascal.tomlcarries 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 bindingPasTlsotherwise 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;findssrc/greet.pasby 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.passtill compiles a file of that name.