Repository navigation
Wolang 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,yamlandtomlreport
Malformed(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;keep
anywhere 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_setand
wolang_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, builds
Quatasx, 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: write
as 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.Malformedand
yaml.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 linkwolang_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;ParallelFor
narrows 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.
Install
macOS and Linux:
curl -fsSL https://raw.githubusercontent.com/MowoGames/Wolang/alpha/install.sh | sh -s -- --version 1.2.0Windows: run wolang-1.2.0-x86_64.msi from the assets below, or
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/MowoGames/Wolang/alpha/install.ps1))) -Version 1.2.0Every archive is listed in SHA256SUMS; the installers check it.
What's Changed
Full Changelog: v1.1.0...v1.2.0