Changelog
What changed in each release, newest first. The decision behind a change is cited as (D<n>) and written up in docs/decisions.md; how a release is made is in…
What changed in each release, newest first. The decision behind a change
is cited as (D<n>) and written up in docs/decisions.md;
how a release is made is in docs/releasing.md.
1.4.0
1.4.0 is the embedding fixes a game engine found while moving its scripts onto Wolang.
Added
wolang_vm_load_package_source(C API 1.7, D293) loads a package the host holds as data under the name its scriptsneed, so a host can shipmowoandstdinside its program. A reload loads it again.wolang_vm_saveandwolang_vm_load_save(C API 1.6, D292) write and read an object graph with the bytesstd.savewrites.
Fixed
- An effect declared in a sibling file, or imported, can be named in
uses(E0701). - A name the host gives, as in
wolang_vm_expect_struct, finds the program's type and not a dependency's helper of the same name (D291). - The formatter keeps the parentheses of a cast that ends the left side of
<((stop as float) < y1), which it used to drop and so wrote code the parser rejects, and never breaks a line inside the{}of a string (D290).
1.3.0
1.3.0 finishes what an engine needed from the language in 1.2.0, brings back the five libraries 1.2.0 cut, and starts writing the compiler in Wolang. Very little in it breaks a 1.2.0 program.
Added
@Saveandstd.save(D266). A field marked@Saveis written by name and read back, with shared references and cycles kept, tolerant of a field added or removed since the save. (The C API calls for it came in 1.4.0, D292.)- Tasks run on the caller's clock (D267).
Tick(dt)advances every readytask fun,Wait(seconds)finishes after that much ticked time,Eventis a flag a task looks at, andwolang_vm_tickandwolang_vm_tasks_pendingdo the same for a VM. There is noroutinekeyword:task funandwaitwere already the spelling for code that suspends. - Replication attributes (D268):
@Replicatedon a field and@Server,@Client,@Multicaston a method, checked (E0175,E0176,E0178,E0179) and reported through the class reflection of the C API. Wolang sends nothing itself. - Host controls (C API 1.4 and 1.5).
wolang_vm_set_budgetgives a call a tick budget so a runaway script stops with an error (D265).wolang_vm_expect_abiandwolang_vm_expect_structmake a binding state the layouts it was built for, and a mismatch fails the load (D271). A mod is never grantedunsafe(D270). A trap carries its source place and the script's call stack to the reporter (D269).wolang_vm_set_remapcarries the objects a host holds through a hot reload instead of refusing it. - Five libraries.
fontreads TrueType and lays text out (D276).uiis an immediate-mode toolkit with a software renderer (D277).audiomixes and reads and writes WAV, and reads the headers of Ogg files (D279).gpuis a backend-neutral device with a null and an OpenGL 3.3 backend (D280).appis a fixed-timestep shell around them that runs without a window (D281). std.arena, a bump allocator held across calls (D285), and fasterstdcopies, file reads and map slots (D284).tools/selfhost: a lexer and a parser for Wolang written in Wolang, checked token for token and tree for tree against the C++ ones on the repository's own files (D283, D288); a first tool, package fetch and lock, in Wolang (D286);wolang tokens --stablefor the comparison.wl bench, and docs/benchmarks.md with calls per millisecond and objects per call for each tier (D273).- On Linux,
wolang buildcan link with a bundled linker and a musl sysroot when the machine has no C compiler, and the same source makes the same object bytes (D272). - CI rows for macOS and Windows on ARM64, and
AotTestruns under theasanpreset on Windows.
Changed
- The binding generator registers each class with a liveness token and writes
the layouts a binding relies on (
--no-tokenleaves the token out) (D271). - A reload that changes a class the host holds an object of now migrates the object when the host registered a remap, and is refused with a note when it did not.
- The site documentation publishes every package and 18 guides, and CI checks that each page converts before the publish job runs.
Fixed
- A class with an owned
Textfield no longer corrupts the heap when its last handle goes, and gives the bytes back when the field is replaced (D289). - The text an interpolation, a
+or a+=builds is given back, with awolang_texts_livecounter to test it (D275). - An annotated
T!that holds an error with data releases its box, and an annotated local of an ability type keeps the annotation (D275). - An unknown error name in a
matcharm on aT!isE0166, not the misleadingE0201. A function held in a local and handed to a@Threadfunction isE0163unless the caller statesuses unsafe(D275). Aconstarray handed to a[]mut Tparameter isE0105. - An or-pattern trapped in the reference interpreter and not in the compiled
tiers; comparing two enum values sent the whole function to the interpreter
(D287).
wolang fetchnever worked on Windows (quoting forcmd.exe). AotTestfailed to link underasanon Windows.
Breaking
Little, and none of it for a program that does not use these:
- A function held in a local and passed to a
@Threadfunction isE0163. - A
constarray passed to a[]mut Tparameter isE0105. - A mod is never granted
unsafe, even if the host lists it (D270). - A reload that would change a held object's class is refused unless the host registered a remap.
- The C API is at 1.5. A host built against an earlier minor keeps working.
Not done
- Ogg Vorbis audio is not decoded; the headers are read (D279).
- Nothing has run on Linux, macOS or Windows on ARM64. The bundled-linker link and the OpenGL backend have not run at all, and the execution budget is compiled for x64 only.
Class()with no arguments ignores field initializers and leaves class-typed fields null.- Assigning to an owned
Textvariable does not give back the old value.
1.2.0
The breaking language decisions land together, the gaps found since 1.1 are
closed, the embedding API grows what an engine needs, and math arrives.
Added
- Operators are abilities (D239).
Selfin an ability is the type that implements it, and an ability marked@Operatorlends its one method to an operator:a + bon aVec3isa.Plus(b),a += b,-a,==,!=and< <= > >=likewise.std.opshasAdd,Sub,Mul,Div,Neg,Eq,Ord,Hash,MaxandMin; numbers meet every bound and keep their instructions. New diagnosticsE0156,E0157,E0160. - Errors carry data and sets are stated (D235).
error Bad(line: int, why: text)holds values,T!(A, B)names the errors a function can return, andT!still means any. An offered function must state its set (E0150); a return or?outside the set isE0151; a payload error where aT!is not wanted isE0152; amatchon aT!must cover its errors or end with_(E0201).json,yamlandtomlreportMalformed(line, column). unsafe fun(D236): the caller pays forunsafe, the body need not state it. A bodilessuses unsafefunction isE0153; an unsafe override of a safe method isE0154.@Hotchecks what a body allocates, across modules (D237,E0155). An unknown name inusesisE0158.keepon a function-typed parameter (D240). A closure that outlives its call owns a counted environment: it retains what it captures, copies an ownedtextand moves a value with adeinit(E0161,E0162;keepanywhere else isE0046).[]mut Tis a writable slice and[]Tis read-only (D251). Writing through a[]TisE0165.Bytesis no longerunsafe.afterin amachinethrough a generatedTick(dt)(D260).Selfis bound inenterandexit.- Module-level
weak varof aC?holds its object weakly (D253). A script class cannot derive from anextern class(E0164, D256). a?.Method()gives an optional of the method's result.- Qualified names work in patterns, as intrinsic callees and as assignment
targets (D246,
E0105,E0144). E0147follows a thread body into other modules and into methods (D252).math:Vec2,Vec3,Vec4,Mat3,Mat4,Quatwith operators through abilities (D263).std.sort.SortBy,std.map.IntMapNewandTextMapNew,Builder.AppendLine;ServeWithcloses a connection that stays silent pasthead_timeout.- Embedding, C ABI 1.1 to 1.3: functions named by module and
wolang_vm_function_module(D259); a lone.wocanneed(D259);Printgoes through the host writer; a VM keeps its own bindings, classes and writers (D257);wolang_vm_object_new,object_setandwolang_vm_class_*(D258); a host class may register a token callback (wolang_vm_register_class_ex, D254). - The binding generator binds static functions,
std::stringresults and properties, numeric structs,TObjectPtrand object properties, buildsQuatasx, y, z, w, and checksMowoWolangAlivebefore it touches an object (D262). wolang ir --typedprints the IR in a formir::Readerreads back (D264).tools/selfhost/lexeris a throwaway lexer for Wolang in Wolang; the compiler will be self-hosted in stages after 1.2.0, the C++ one kept as the bootstrap (D250,docs/plans/self-hosting.md).
Changed
intiss64on every target and in every tier;floatstaysf32. A length, an index and a hash areint, so.lenno longer stops at 2^31 (D238). C'sintis stills32inexternsignatures: writeas s32where anintreaches one. An integer literal with no type now settles ons64, soE0109fires from 2^63.- An error's tag is the hash of its qualified name, so
json.Malformedandyaml.Malformedare different errors. std.hash.TextHashkeeps 63 bits of the hash now instead of 31, so a text key lands in a different slot than before;std.map.IntHashkeeps its 31-bit value for every key that fit 32 bits and no longer traps for a larger one.- The
alloceffect is gone (D237).E0136andE0159are retired. - A failed
wolang_vm_reloadkeeps the old program, and a reload that would change a class a host holds an object of is refused with a note (D255). - The embedding package no longer names LLVM's libraries; the driver and
the tests link
wolang_aot(D261). - The differential fuzzer writes
intands32as different types, draws values at 2^31, 2^32 and the 64-bit edges, and generates stated error sets, payload errors and kept closures.
Fixed
var a: s8 = -128no longer traps, andvar a: s8 = 128isE0109."{t}"of an ownedTextin a loop is no longerE0122.- An alias from another package is its target;
extendof a foreign class sees its fields; a used base class no longer gives an unused-import warning; a bodilessextern classmethod works across packages. - Dead-code elimination and hoisting no longer drop or move a cast that can
trap; the data of a freed slice is typed as a pointer;
ParallelFornarrows its thread count. wolang_vm_destroyreleases the globals a VM holds.
Breaking
intis 64 bits. Source that relied on 32-bit wrap-around, and C signatures that take anint, needas s32.- AOT objects built with 1.1 do not link with 1.2.
- Text hash values changed, so anything that stored them must rehash.
- Error tags changed; anything that stored a tag must be rebuilt.
[]Tis read-only. Code that writes through a slice parameter writes[]mut T.- A bodiless
uses unsafefunction isunsafe funnow (E0153). allocis not an effect;capabilities = "alloc"isE0053.- A
T!returned from an offered function states its errors (E0150), and amatchon aT!that does not cover them isE0201.
1.1.0
The first public release after an audit of the compiler, the runtime, the sandbox and the libraries that read other people's bytes, and the fixes for what it found.
Upgrading from 0.1
Some programs that compiled before are now refused, because what they did was unsound or silently wrong:
- Code calling
Free,ArrayNew,ViewFromRaw,std.text.Bytesor a thread body that touches module-level vars has to stateuses unsafe. - A dependency written as a bare string in
wolang.tomlhas to become{ path = ... }or{ git = ..., tag = ... }. afteron a machine transition is refused (E0159); it never waited.- An integer literal too wide for
intneeds its type (const e: s64 = ...). x += 1used to store1. Code that relied on that was already broken.- Embedding hosts must be rebuilt:
WolangValueis 32 bytes, calls return aWolangStatus, andWOLANG_ABI_VERSIONsays which shape a header has (D241).
Safety
- A bodiless
uses unsafeprimitive (Free,ArrayNew,ViewFromRaw) no longer absorbsunsafe, which closed a way for a sandboxed mod to reach raw memory (D221). Naming a function as a value costs its effects (D222), and so does calling or naming a method. Callingstd.text.Bytesisunsafe, because its view can write a literal. - A reference cannot leave through a field, an index, a call or a local
array turned into a slice (
E0121), and an object made in anarenacannot leave its block (E0142, D228). - A
deinitthat keepsselftraps in every tier (E0145for the plain case); a move out of amatch, out of a closure's captures or of a by-value parameter is tracked, so a double move isE0122(D229). - Enums and structs that carry a
deinitvalue drop it, and move it, with the whole. - Module-level vars and captures are refused in thread bodies, and a
sandboxed package cannot declare an
externnested in a type. - The HTTP server parses only the bytes that arrived (it used to read the
previous client's), refuses a
Content-Lengththat would overflow and anyTransfer-Encoding, and closes slow and idle connections (D223). A hostile chunk size no longer traps the client. - JSON, YAML, TOML and regex bound their depth, and
InflateLimited/GunzipLimitedbound their output (D227).Normalizerefuses a path with too many parts.
Language
need std.jsonnow also givesjson.Parse,json.Valueand so on: everyneedmakes its last path segment a qualifier. When two modules offer one bare name and a file uses it, that isE0143; an unknown qualified name isE0144(D246).- A literal too wide for
intisE0109instead of wrapping; runaway generic instantiation isE0140; recursive enums and generics held by value areE0117; an expression chain too deep for the later passes isE0041(D225). - Float literal arithmetic is done at the float type the context asks for.
- A transition on a machine cannot carry
after; task cancellation is struck from the spec. - Compound assignment (
+=, ...) is a read-modify-write, and a module-level var of function type is called through its storage.
Libraries
- New package
lib/image: PNG, QOI and BMP codecs, written in Wolang (D245). std.nethas UDP sockets for game networking.- A dependency in
wolang.tomlcan say which versions it accepts, and a bare-string dependency is refused (D242). gfxgains cursor modes (hidden, locked for mouse-look, shapes), fullscreen, window size and position, DPI-change and file-drop events, up to four gamepads, and native message boxes and file dialogs (D247).lib/db,lib/tlsandlib/imageare tested in CI on every system.
Embedding
- The C ABI has the shape it will keep:
WOLANG_ABI_VERSIONandwolang_abi_version(), a 32-byteWolangValue,WolangStatusresults, a sizedWolangVmOptionsforwolang_vm_create_with, and<lib>_abi_versionexported bywolang build --library(D241).
Tiers
- The interpreter, the JIT and LLVM AOT agree on integer edges: labelled
break/continueon range-forandwhile, 64-bit overflow andMIN / -1trap instead of folding,u64interpolates above 2^63, float%isfmod, and sign-changing 64-bit casts trap (D224, D226). - Trap text is identical in every tier, and floats print as the shortest
round-trip text with every NaN as
nan. - The differential fuzzer covers every integer width, casts, shifts and
bitwise operators, labelled loops,
match, enums, optionals,T!, text, classes and live-object counts; it found and closed seven more disagreements in narrow signed arithmetic, payload reads, text copies and unsigned folding. - The interpreter stops before the native stack runs out, so deep compile-time recursion is a diagnostic.
Tooling and CI
wolang --versionreports the version the project was built as: it is written once, inCMakeLists.txt(D248).- Releases come from one tag push: Linux x86-64 and arm64 and Windows
x86-64 archives (macOS builds from source for now), a Windows
installer, the editor extension and a
SHA256SUMS, built with the LLVM back end sowolang buildworks.install.shandinstall.ps1verify the checksum and refuse to install without one (D248). - AOT is built and fuzzed on every system, there is a UBSan job, and
fuzz --aotfails without a back end instead of passing. - Diagnostic messages escape control bytes;
wolang fuzzwrites its output by length. - The specification, diagnostics catalogue and roadmap were corrected against the code.
Older versions
Before 1.1.0 the project was 0.1.x and had no published releases; there
is nothing to upgrade from. The editor extension kept its own history in
editors/vscode/CHANGELOG.md.