Skip to content

Releases: dfinity/motoko

0.6.21

31 Jan 17:41
198d617
Compare
Choose a tag to compare
  • motoko (moc)

    • Emit new ICP metadata custom section 'motoko:compiler' with compiler release or revision in UTF8 (e.g. "0.6.21"). Default is icp:private (#3091).
    • Generalized import supporting pattern matching and selective field imports (#3076).
    • Fix: insert critical overflow checks preventing rare heap corruptions
      in out-of-memory allocation and stable variable serialization (#3077).
    • Implement support for 128-bit Cycles-API (#3042).
  • motoko-base

0.6.20

11 Jan 11:43
6a6cb0f
Compare
Choose a tag to compare
  • motoko

    • Implement support for heartbeat system methods (thanks to ninegua) (#2971)
  • motoko-base

0.6.19

05 Jan 16:42
37e179d
Compare
Choose a tag to compare
  • motoko-base

    • Fixed a bug in the RBTree.size() method.

0.6.18

20 Dec 09:56
adeaef1
Compare
Choose a tag to compare
  • moc

    • Add runtime support for low-level, direct access to 64-bit IC stable memory, including documentation.
    • Add compiler flag --max-stable-pages <n> to cap any use of ExperimentalStableMemory.mo (see below), while reserving space for stable variables.
      Defaults to 65536 (4GiB).
  • motoko-base

    • (Officially) add ExperimentalStableMemory.mo library, exposing 64-bit IC stable memory
  • BREAKING CHANGE (Minor):
    The previously available (but unadvertised) ExperimentalStableMemory.mo used
    Nat32 offsets. This one uses Nat64 offsets to (eventually) provide access to more address space.

0.6.17

10 Dec 13:23
ee30fbc
Compare
Choose a tag to compare
  • Improved handling of one-shot messages facilitating zero-downtime
    upgrades (#2938).
  • Further performance improvements to the mark-compact garbage
    collector (#2952, #2973).
  • Stable variable checking for moc.js (#2969).
  • A bug was fixed in the scoping checker (#2977).

0.6.16

03 Dec 13:41
47d18eb
Compare
Choose a tag to compare
  • Minor performance improvement to the mark-compact garbage collector

0.6.15

26 Nov 20:59
0ac042a
Compare
Choose a tag to compare
  • Fixes crash when (ill-typed) switch expression on non-variant
    value has variant alternatives (#2934)

0.6.14

19 Nov 17:31
8459514
Compare
Choose a tag to compare
  • The compiler now embeds the existing Candid interface and new
    stable signature of a canister in additional Wasm custom sections,
    to be selectively exposed by the IC, and to be used by tools such as dfx
    to verify upgrade compatibility (see extended documentation).

    New compiler options:

    • --public-metadata <name>: emit ICP custom section <name> (candid:args or candid:service or motoko:stable-types) as public (default is private)
    • --stable-types: emit signature of stable types to .most file
    • --stable-compatible <pre> <post>: test upgrade compatibility between stable-type signatures <pre> and <post>

    A Motoko canister upgrade is safe provided:

    • the canister's Candid interface evolves to a Candid subtype; and
    • the canister's Motoko stable signature evolves to a stable-compatible one.

    (Candid subtyping can be verified using tool didc available at:
    https://github.com/dfinity/candid.)

  • BREAKING CHANGE (Minor):
    Tightened typing for type-annotated patterns (including function parameters)
    to prevent some cases of unintended and counter-intuitive type propagation.

    This may break some rare programs that were accidentally relying on that
    propagation. For example, the indexing xs[i] in the following snippet
    happend to type-check before, because i was given the more precise
    type Nat (inferred from run's parameter type), regardless of the
    overly liberal declaration as an Int:

    func run(f : Nat -> Text) {...};
    let xs = ["a", "b", "c"];
    run(func(i : Int) { xs[i] });

    This no longer works, i has to be declared as Nat (or the type omitted).

    If you encounter such cases, please adjust the type annotation.

  • Improved garbage collection scheduling

  • Miscellaneous performance improvements

    • code generation for for-loops over arrays has improved
    • slightly sped up Int equality comparisons

0.6.12

22 Oct 15:03
7fe19ef
Compare
Choose a tag to compare
  • for loops over arrays are now converted to more efficient
    index-based iteration (#2831). This can result in significant cycle
    savings for tight loops, as well as slightly less memory usage.

  • Add type union and intersection. The type expression

    T and U

    produces the greatest lower bound of types T and U, that is,
    the greatest type that is a subtype of both. Dually,

    T or U

    produces the least upper bound of types T and U, that is,
    the smallest type that is a supertype of both.

    One use case of the former is "extending" an existing object type:

    type Person = {name : Text; address : Text};
    type Manager = Person and {underlings : [Person]};

    Similarly, the latter can be used to "extend" a variant type:

    type Workday = {#mon; #tue; #wed; #thu; #fri};
    type Weekday = Workday or {#sat; #sun};

0.6.11

08 Oct 12:35
5632654
Compare
Choose a tag to compare
  • Assertion error messages are now reproducible (#2821)