π Blaise v0.12.0 β native by default, zero external tools, and a real standard library #139
graemeg
announced in
Announcements
Replies: 1 comment 3 replies
-
|
Congratulations Graeme. Very impressive work! Can't wait to test the new version of the compiler. Is there a reason for QBE imminent retirement? I used to like that feature. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is a big one.
As of v0.12.0 the native x86-64 backend is the default,
and Blaise now ships its own internal assembler and internal linker β so a
plain build needs no external tools at all:
That single command parses, generates native code, assembles it, and links a
working executable β no
qbe, noas, nogcc(only the system C runtimeobjects the linker needs). QBE is still there if you want it (
--backend qbe),but it is now opt-in and on a path to retirement.
βοΈ Incremental by default
Compilation is now incremental, per unit β each unit becomes its own object
file and the internal linker joins them, just like Free Pascal. Rebuilds are
faster, and the old whole-program path is one flag away (
--no-incremental) ifyou ever want it. A lot of careful work went into making warm-cache rebuilds
lossless β and the test suite now has a dedicated warm-cache fixpoint guard
so that stays true.
π First-class debugging across units
If you have used the OPDF debugger (pdr), here is the headline: it now works
through every unit of an incrementally-built program, not just the main
file. Set a breakpoint inside a dependency unit, walk a cross-unit callstack,
inspect parameters, locals, and object fields β all of it. Each object file
carries its own debug section and the linker merges them, mirroring how FPC
lays out multi-unit debug info, so pdr reads it without any changes.
π A standard library worth the name
v0.12.0 turns the stdlib from a handful of helpers into something you can build
real programs on β all opt-in via
uses:What landed this cycle:
Net.Sockets(IPv4 TCP),Net.WebSockets(RFC 6455), anda minimal
Net.Http.Serverwith WebSocket upgrade. πTDecimal(precise decimal arithmetic) andTMoney(currency-aware, configurable rounding) β no binary-float surprises. π·
SplitChar,SplitLines,JoinList, and a UTF-8CodePointToString.blaise.testingunit-test framework now lives in the stdlib where itbelongs, with its own test suite.
ποΈ Showcase: Luhmann, a Zettelkasten built in Blaise
The best way to judge a standard library is to build something real on it β so
I did. Luhmann (also released today)
turns a directory of AsciiDoc notes into a personal
Zettelkasten: a local-first web
app that renders your notes, computes backlinks, draws an interactive note
graph, indexes everything for full-text search, and live-reloads your browser
as you edit. It started life as a Clojure/Java program and was reimplemented in
Blaise β and the port gained features along the way (automatic backlinks,
tags, the graph, a broken-links report, a JSON API).
It leans directly on what v0.12.0 shipped:
Net.Http.Server+Net.Socketsserve the site and the REST API.Net.WebSocketsdrives the live-reload channel β save a note, the browserrefreshes itself.
Json.Writerbuilds the/api/backlinks,/api/graphand/api/tagsresponses.
Generics.Collectionsunderpins the in-memory link graph and tag index.It is also a genuine application, not a demo: a framework-free hexagonal
(ports-and-adapters) core with swappable adapters, built with PasBuild. And it
leans on the native backend's concurrency β at start-up it renders notes in
parallel, taking an 86-note corpus from ~13 s serial to ~2 s on 16 cores (6.3Γ).
That a third-party app of this size compiles, links (zero external tools) and
runs on Blaise is the clearest signal yet that the language and stdlib are ready
for real work. π
β¨ Language niceties
A few conservative, FPC/Delphi-friendly additions:
SysUtils.TFormatSettings, dotted qualifiers andall.
Self.FStack[0].Count := valuejust works.{$IFDEF}/{$DEFINE}with a predefinedBLAISEsymbol plus CPU/OS symbols, and-don the command line.set of 0..255), named subrange types, and ahandful of parser corners that used to reject perfectly ordinary code.
π‘οΈ Hardening
This release also fixed a meaningful batch of native-backend codegen bugs that
varied real-world programs (the new JSON library, especially) flushed out:
floating-point arguments now follow the System V ABI correctly through methods,
constructors, inherited calls and the register-overflow path; implicit-
Selfvirtual calls dispatch through the vtable;
HasClassAttributeworks on native;and several record/interface argument-passing edges were closed. Dogfooding
varied code is the best bug-finder we have. π
β Verified
Blaise still bootstraps itself to a byte-for-byte fixpoint β 410,477 lines
of IR, with all four fixpoint guards green (QBE, native, internal-assembler,
and the warm-cache rebuild β the warm-cache guard now also exercises an
edit-then-rebuild). 3,745 compiler tests and 57 stdlib tests pass, and
the whole test suite compiles under Blaise itself.
Grab the v0.12.0 binary from the
GitHub release page β it is a
self-contained native compiler that needs nothing but a C runtime to link
against. See
changelog-v0.12.0.mdfor the full technical detail. And as a bonus,I've also included a pre-built
pdrdebugger binary as part of the release archive.Onwards to v0.13.0! π
Built with β€ for the Pascal community.
Beta Was this translation helpful? Give feedback.
All reactions