Skip to content

Blaise v0.16.0

Latest

Choose a tag to compare

@graemeg graemeg released this 28 Nov 21:02
· 6 commits to master since this release

Blaise v0.16.0 — Changelog

Changes since v0.15.0 (396 commits, 2026-10-23 to 2026-11-28).

Breaking changes

  • Int is the width of lengths, indices and literals (type standardisation). An unhinted integer literal is Int; built-in lengths, positions and ordinals are Int; string and dynamic-array lengths are 64-bit; collection counts and indices are Int; MaxInt is High(Int). Integer arithmetic narrower than 64 bits is promoted to Int64.
  • The classic type names are no longer built-ins. Integer, Cardinal, SmallInt, Word, QWord, PtrUInt, Single and Double (and their P-prefixed pointer types) come from uses ClassicPascalTypes; an unknown classic name gets an error naming its replacement, and BlaiseGuard BL-2006 suggests each one.
  • cdecl is the only calling-convention directive. register, pascal, stdcall and the others are rejected; a routine without a directive uses the Blaise convention. cp-migrate reports them in ported code (rule MIG-CALLCONV). The calling convention is now part of a procedural type.
  • WriteFile and AppendFile fail loudly. A failed write raises EInOutError (with the OS error code) when SysUtils is used, and stops the program with runtime error 101 otherwise. Previously the failure was silent.
  • OPDF format version 2. The header names the format version; use the pdr shipped with this release (or opdebugger master).
  • A parameterless interface method, and a chained call statement, need () like any other call.

Platforms

  • Windows x86-64 is a shipped target. --target windows-x86_64 produces PE32+ executables with no external toolchain: a PE32+ image writer and linker over ELF objects, unwind data, the PE TLS model for threadvars, Win64 calls at the foreign boundary, stack probes, and an export check against the real DLLs.
  • The Windows runtime: files, directories, time, processes, the command line, random bytes (bcrypt, loaded on first use), BSD sockets over Winsock, fibres and the scheduler, IO.Files, IO.Process and IO.Watch, all through the platform port. A program imports only kernel32 unless it uses more.
  • Windows paths: drives, UNC paths and ExpandFileName; ParamStr(0) is the program's full path.
  • TLS on Windows uses OpenSSL 3's DLL names, and a verifying client trusts the system's root and CA certificate stores.
  • The Windows compiler self-hosts: blaise.exe rebuilds itself byte-identical in a Windows 11 guest and on CI's windows-latest runner.
  • TargetOS and TargetCPU constants name the build target; Platform.Info gives display names.

Exceptions and ARC

  • An exception releases what it unwinds past. Unwind tables and a frame-pointer walk now release a frame's scalar and aggregate slots, a function's managed Result, owned call-argument and string-operand temporaries, deferred-release bases, values parked by built-ins, record-call arguments, and the main program's temporaries. Code that raises no longer leaks.
  • A [Weak] or [Unretained] record field takes no reference; weak references register and release in constant time.
  • A discarded result of a receiver or interface method call is released; a receiver the caller does not own is kept alive for the call.
  • TObject.AfterConstruction runs once construction has finished; TThread.Create(False) starts the thread after construction, releasing a running TThread terminates it, and FreeOnTerminate is supported.
  • The program's globals are released before its units are finalised.

Language

  • Generic type arguments are inferred from a call's arguments: Max(3, 7).
  • Copy, +, Concat, Delete and Insert on dynamic arrays (FPC semantics); Concat on strings.
  • mod accepts floating-point operands.
  • Typed-pointer arithmetic counts in elements.
  • Static vars of generic types, with one slot per instance; overloaded methods in generic classes and records; member constants of generic classes and records.
  • A set parameter may default to a set constant.
  • A nested anonymous method shares its enclosing one's environment, and a closure whose literals never use Self holds it unretained.
  • Dynamic-array indices are bounds-checked at run time, and an element write evaluates array, index and value left to right.
  • Warnings: a closure made in a loop that captures a variable the iterations share; downto 0 over an unsigned loop variable; opt-in --warn-narrowing for implicit integer narrowing.

Semantic

  • Overload resolution never narrows an argument a candidate can hold; an integer argument prefers a Float64 overload; an enum ranks as a 4-byte ordinal.
  • A generic constraint error is reported at the instantiating use, naming its unit; an interface constraint accepts every type that converts to it.
  • SizeOf, High and Low of a type fold in constant expressions; constant expressions over UInt64 and Boolean operands, and integer casts in constants, keep their type.
  • '->' lambdas work as arguments to constructors, static, interface and indirect calls, and in generic bodies.
  • A routine, variable or type may shadow a System constant; a property hides a same-named inherited method for a bare read.
  • An implementation-use unit cycle is analysed in interleaved phases.

Codegen

  • A method named like a built-in (Write, WriteLn and others) is that method, on both ISAs.
  • A method call through an interface Result on x86-64 reads the caller's buffer.
  • A failed as calls the RTL with an aligned stack on x86-64.
  • Record results from foreign routines, foreign entries that return records, and calls through cdecl procedural values on x86-64.
  • for..in over closures keeps each closure's environment; a for..in loop's enumerator is not held again for MoveNext and Current.
  • WriteLn of a Float32 prints 7 significant digits on arm64, as on x86-64.

stdlib

  • IO.Process: child processes with stdin, separate stdout and stderr pipes, their own environment, and RunProcess for the common case.
  • IO.Watch: notification when files and directories change.
  • IO.Files.FindFiles, a recursive file finder.
  • JSON: typed accessors on objects and arrays (Strings[], Integers[], Booleans[], Objects[], Arrays[]) and FindPath for a dotted path.
  • Math: Random and TRandom (auto-seeded, reproducible from a seed, unbiased), Frac, DegToRad, RadToDeg, Exp and Expm1.
  • ReadLn reads a line from standard input; IsTerminal and GetUserDir.
  • TList.Insert and AddRange; TDictionary.Keys and Values; TDictionary.Remove is O(1) amortised.
  • TDecimal and TMoney gain arithmetic and comparison operators.
  • THttpResponse.AddHeader; TStringList.Text ends a line at LF, CR LF or a lone CR.
  • Format supports %u.

Toolchain and CLI

  • --check analyses without generating code, and --diagnostics=json writes one JSON object per problem, for IDEs.
  • --emit-xref writes each identifier use and its declaration; --emit-tokens writes the lexer's tokens; --print-unit-paths prints the unit search order.
  • Every target's objects carry .blaise.imports link metadata, and a warm build binds the libraries of units reached only through a cached unit's implementation.
  • A uniquely owned dynamic array grows in place.

Debugging

  • The release archives include the pdr debugger. The macOS arm64, Linux x86-64 and FreeBSD x86-64 archives carry pdr and pdr-dap (its Debug Adapter Protocol server for IDEs; Hexagram uses it). pdr is Free Pascal-built, BSD-3-Clause (LICENSE-pdr). Build with --debug-opdf, then run pdr <program>.
  • pdr now debugs macOS arm64 programs, including breakpoints hit on any thread.
  • On Linux, pdr and pdr-dap need glibc 2.34 or later, and do not yet stop at breakpoints in threads other than the main one. The Windows archive has no pdr yet.
  • OPDF records arm64 debug facts, links a nested routine's scope to its parent, and names its format version.

Tooling and CI

  • blaise.testing gains --format=json, one result per test.
  • BlaiseGuard: opt-in BL-1007 DeclarationParentheses.
  • cp-migrate, the migration analyser, has its first rule (MIG-CALLCONV).
  • bindgen marks synthesised callback types cdecl.
  • CI cross-builds the Windows binaries and runs the fixtures and the self-hosting gate on windows-latest.
  • scripts/windows-vm.sh runs programs, and the self-hosting gate, in a local Windows 11 guest.

Release artefacts

Archive Built Verified
blaise-v0.16.0-macos-arm64.tar.gz native stage-2 on macOS every fixpoint and the full suites on macOS; pdr's suites on macOS
blaise-v0.16.0-linux-x86_64.tar.gz cross-compiled on macOS byte-identical to its own Linux self-build, and the full suites on Linux x86-64; pdr's suites on Debian 12
blaise-v0.16.0-freebsd-x86_64.tar.gz cross-compiled on macOS ELF shape and version string, the archive used in a FreeBSD 14.3 VM; pdr's suites there; the master CI freebsd-crosscheck job runs the self-host fixpoint and full suite
blaise-v0.16.0-windows-x86_64.zip cross-compiled on macOS byte-identical self-build in a Windows 11 guest, and the zip unpacked and used there

Each archive is self-contained: the binary, blaise.cfg, the RTL and stdlib source and a hello.pas; the macOS, Linux and FreeBSD archives also carry pdr, pdr-dap and LICENSE-pdr.

Fixpoint: 1,467,903 lines of stage-2 arm64 assembly. Tests: 6,022 compiler tests and 689 stdlib tests.