Skip to content

Releases: dfinity/motoko

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)

0.6.10

23 Sep 20:48
412dce6
Compare
Choose a tag to compare
  • moc

    • documentation changes
  • motoko-base

    • documentation changes

0.6.9

15 Sep 17:51
e1569d7
Compare
Choose a tag to compare

0.6.8

07 Sep 08:31
cce95e0
Compare
Choose a tag to compare
  • Introduce primitives for IntFloat conversions (#2733)
  • Bump LLVM toolchain to version 12 (#2542)
  • Support extended name linker sections (#2760)
  • Fix crashing bug for formatting huge floats (#2737)

0.6.7

16 Aug 21:32
43da0ac
Compare
Choose a tag to compare
  • moc

    • Optimize field access by exploiting field ordering (#2708)
    • Fix handling of self references in mark-compact GC (#2721)
    • Restore CI reporting of perf-regressions (#2643)
  • motoko-base:

    • Fix bug in AssocList.diff (#277)
    • Deprecate unsafe or redundant functions in library Option ( unwrap, assertSome, assertNull) (dfinity/motoko-base#275)

0.6.6

30 Jul 09:43
Compare
Choose a tag to compare
  • Vastly improved garbage collection scheduling: previously Motoko runtime would do GC
    after every update message. We now schedule a GC when

    1. Heap grows more than 50% and 10 MiB since the last GC, or
    2. Heap size is more than 3 GiB

    (1) is to make sure we don't do GC on tiny heaps or after only small amounts of allocation.
    (2) is to make sure that on large heaps we will have enough allocation space during the next message.

    This scheduling reduces cycles substantially, but may moderately increase memory usage.

    New flag --force-gc restores the old behavior.

  • Fix bug in compacting gc causing unnecessary memory growth (#2673)

  • Trap on attempt to upgrade when canister not stopped and there are outstanding callbacks.
    (This failure mode can be avoided by stopping the canister before upgrade.)

  • Fix issue #2640 (leaked ClosureTable entry when awaiting futures fails).

0.6.5

08 Jul 10:42
bd98d37
Compare
Choose a tag to compare
  • Add alternative, compacting gc, enabled with new moc flag --compacting-gc.
    The compacting gc supports larger heap sizes than the default, 2-space copying collector.

    NOTE: Dfx 0.7.6 adds optional field "args" to dfx.json files,
    so Motoko canisters can specify moc command-line arguments. E.g.,

    ...
       "type" : "motoko"
       ...
       "args" : "--compacting-gc"
    ...
  • Documentation fixes.

  • Command line tools: --help option provides better documentation of command line
    options that have arguments.

  • Fix issue #2319 (crash on import of Candid class).