Skip to content

Wolang 1.2.0

Choose a tag to compare

@github-actions github-actions released this 02 Nov 08:02
· 88 commits to alpha since this release
e4fec00

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). Self in an ability is the type that
    implements it, and an ability marked @Operator lends its one method to
    an operator: a + b on a Vec3 is a.Plus(b), a += b, -a, ==,
    != and < <= > >= likewise. std.ops has Add, Sub, Mul, Div,
    Neg, Eq, Ord, Hash, Max and Min; numbers meet every bound
    and keep their instructions. New diagnostics E0156, 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, and T! still means any. An offered function must state its set
    (E0150); a return or ? outside the set is E0151; a payload error
    where a T! is not wanted is E0152; a match on a T! must cover its
    errors or end with _ (E0201). json, yaml and toml report
    Malformed(line, column).
  • unsafe fun (D236): the caller pays for unsafe, the body need not
    state it. A bodiless uses unsafe function is E0153; an unsafe override
    of a safe method is E0154.
  • @Hot checks what a body allocates, across modules (D237, E0155). An
    unknown name in uses is E0158.
  • keep on a function-typed parameter (D240). A closure that outlives its
    call owns a counted environment: it retains what it captures, copies an
    owned text and moves a value with a deinit (E0161, E0162; keep
    anywhere else is E0046).
  • []mut T is a writable slice and []T is read-only (D251). Writing
    through a []T is E0165. Bytes is no longer unsafe.
  • after in a machine through a generated Tick(dt) (D260). Self is
    bound in enter and exit.
  • Module-level weak var of a C? holds its object weakly (D253). A script
    class cannot derive from an extern 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).
  • E0147 follows a thread body into other modules and into methods (D252).
  • math: Vec2, Vec3, Vec4, Mat3, Mat4, Quat with operators
    through abilities (D263).
  • std.sort.SortBy, std.map.IntMapNew and TextMapNew,
    Builder.AppendLine; ServeWith closes a connection that stays silent
    past head_timeout.
  • Embedding, C ABI 1.1 to 1.3: functions named by module and
    wolang_vm_function_module (D259); a lone .wo can need (D259);
    Print goes through the host writer; a VM keeps its own bindings, classes
    and writers (D257); wolang_vm_object_new, object_set and
    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::string results and
    properties, numeric structs, TObjectPtr and object properties, builds
    Quat as x, y, z, w, and checks MowoWolangAlive before it touches an
    object (D262).
  • wolang ir --typed prints the IR in a form ir::Reader reads back
    (D264). tools/selfhost/lexer is 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

  • int is s64 on every target and in every tier; float stays f32.
    A length, an index and a hash are int, so .len no longer stops at
    2^31 (D238). C's int is still s32 in extern signatures: write
    as s32 where an int reaches one. An integer literal with no type
    now settles on s64, so E0109 fires from 2^63.
  • An error's tag is the hash of its qualified name, so json.Malformed and
    yaml.Malformed are different errors.
  • std.hash.TextHash keeps 63 bits of the hash now instead of 31, so a
    text key lands in a different slot than before; std.map.IntHash keeps
    its 31-bit value for every key that fit 32 bits and no longer traps for
    a larger one.
  • The alloc effect is gone (D237). E0136 and E0159 are retired.
  • A failed wolang_vm_reload keeps 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 int and s32 as 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 = -128 no longer traps, and var a: s8 = 128 is E0109.
  • "{t}" of an owned Text in a loop is no longer E0122.
  • An alias from another package is its target; extend of a foreign class
    sees its fields; a used base class no longer gives an unused-import
    warning; a bodiless extern class method 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_destroy releases the globals a VM holds.

Breaking

  • int is 64 bits. Source that relied on 32-bit wrap-around, and C
    signatures that take an int, need as 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.
  • []T is read-only. Code that writes through a slice parameter writes
    []mut T.
  • A bodiless uses unsafe function is unsafe fun now (E0153).
  • alloc is not an effect; capabilities = "alloc" is E0053.
  • A T! returned from an offered function states its errors (E0150),
    and a match on a T! that does not cover them is E0201.

Install

macOS and Linux:

curl -fsSL https://raw.githubusercontent.com/MowoGames/Wolang/alpha/install.sh | sh -s -- --version 1.2.0

Windows: 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.0

Every archive is listed in SHA256SUMS; the installers check it.

What's Changed

Full Changelog: v1.1.0...v1.2.0