Skip to content

Releases: dfinity/motoko

0.9.5

05 Jul 01:59
f7a5923
Compare
Choose a tag to compare
  • motoko (moc)

    • Allow identifiers in or-patterns (#3807).
      Bindings in alternatives must mention the same identifiers and have compatible types:

      let verbose = switch result {
        case (#ok) "All is good!";
        case (#warning why or #error why) "There is some problem: " # why;
      }
    • Performance improvement: improved cycle consumption allocating fixed-size objects (#4064).
      Benchmarks indicate up to 10% less cycles burned for allocation-heavy code,
      and 2.5% savings in realistic applications.

    • Administrative: binary build artefacts are now available according to standard naming
      conventions (thanks to EnzoPlayer0ne) (#3997).
      Please consider transitioning to downloading binaries following the new scheme,
      as legacy naming will be discontinued at some point in the future.

0.9.4

01 Jul 02:13
14a3ad4
Compare
Choose a tag to compare
  • motoko (moc)

    • Allow multiline text literals (#3995).
      For example,

      "A horse walks into a bar.
      The barman says: `Why the long face?`"
      

      parses as:

      "A horse walks into a bar.\nThe barman says: `Why the long face?`"
      
    • Added pipe operator <exp1> |> <exp2> and placeholder expression _ (#3987).
      For example:

      Iter.range(0, 10) |>
        Iter.toList _ |>
          List.filter<Nat>(_, func n { n % 3 == 0 }) |>
            { multiples = _ };

      may, according to taste, be a more readable rendition of:

      { multiples =
         List.filter<Nat>(
           Iter.toList(Iter.range(0, 10)),
             func n { n % 3 == 0 }) };

      However, beware the change of evaluation order for code with side-effects.

    • BREAKING CHANGE (Minor):

      New keyword composite allows one to declare Internet Computer composite queries (#4003).

      For example,

      public shared composite query func sum(counters : [Counter]) : async Nat {
        var sum = 0;
        for (counter in counters.vals())  {
          sum += await counter.peek();
        };
        sum
      }

      has type:

      shared composite query [Counter] -> async Nat

      and can call both query and other composite query functions.

      See the documentation for full details.

    • Allow canister imports of Candid service constructors, ignoring the service arguments to
      import the instantiated service instead (with a warning) (#4041).

    • Allow optional terminal semicolons in Candid imports (#4042).

    • bugfix: allow signed float literals as static expressions in modules (#4063).

    • bugfix: improved reporting of patterns with record types in error messages (#4002).

  • motoko-base

0.9.3

19 Jun 15:55
efec74d
Compare
Choose a tag to compare
  • motoko (moc)

    • Added fields sender_canister_version for actor class version tracking (#4036).

0.9.2

10 Jun 00:45
9ce2e5a
Compare
Choose a tag to compare
  • motoko (moc)

    • BREAKING CHANGE (Minor):

      or-patterns in function definitions cannot be inferred any more. The new error
      message suggests to add a type annotation instead. This became necessary in order
      to avoid potentially unsound types (#4012).

    • Added implementation for ic0.canister_version as a primitive (#4027).

    • Added a more efficient Prim.blobCompare (thanks to nomeata) (#4009).

    • bugfix: minor error in grammar for async* expressions (#4005).

  • motoko-base

0.9.1

15 May 18:11
69fd8c6
Compare
Choose a tag to compare
  • motoko (moc)

    • Added implementation for ic0.is_controller as a primitive (#3935).

    • Added ability to enable the new incremental GC in the Motoko Playground (#3976).

0.9.0

12 May 22:21
fa8c9be
Compare
Choose a tag to compare
  • motoko (moc)

    • For beta testing: Add a new incremental GC, enabled with new moc flag --incremental-gc (#3837).
      The incremental garbage collector is designed to scale for large program heap sizes.

      The GC distributes its workload across multiple steps, called increments, that each pause the mutator
      (user's program) for only a limited amount of time. As a result, the GC work can fit within the instruction-limited
      IC messages, regardless of the heap size and the object structures.

      According to GC benchmark measurements, the incremental GC is more efficient than the existing copying, compacting,
      and generational GC in the following regards:

      • Scalability: Able to use the full heap space, 3x more object allocations on average.
      • Shorter interruptions: The GC pause has a maximum limit that is up to 10x shorter.
      • Lower runtimes: The number of executed instructions is reduced by 10% on average (compared to the copying GC).
      • Less GC overhead: The amount of GC work in proportion to the user's program work drops by 10-16%.

      The GC incurs a moderate memory overhead: The allocated WASM memory has been measured to be 9% higher
      on average compared to the copying GC, which is the current default GC.

      To activate the incremental GC under dfx, the following command-line argument needs to be specified in dfx.json:

      ...
        "type" : "motoko"
        ...
        "args" : "--incremental-gc"
      ...
      
    • bugfix: array.vals() now returns a working iterator for mutable arrays (#3497, #3967).

0.8.8

02 May 09:38
0bdb1d6
Compare
Choose a tag to compare
  • motoko (moc)

    • Performance improvement: optimised code generation for pattern matching that cannot fail (#3957).

0.8.7

06 Apr 12:08
c5a81a4
Compare
Choose a tag to compare
  • motoko (moc)

    • Added ability to mo-doc for rendering documentation of nested modules (#3918).

    • bugfix: when re-adding recurrent timers, skip over past expirations (#3871).

    • bugfix: eliminated crash compiling local async functions that pattern match on arguments (#3910, #3916).

0.8.6

01 Apr 11:52
f8974d5
Compare
Choose a tag to compare
  • motoko (moc)

    • bugfix: avoid compiler crash (regression) when let-matching on constant variants (#3901, #3903).

    • Performance improvement: reduced cycle usage when receiving messages (#3893).

0.8.5

20 Mar 15:47
5fc5632
Compare
Choose a tag to compare
  • motoko (moc)

    • Performance improvement: Values of variant type that are compile-time known
      are relegated to the static heap now and don't get allocated each time (#3878).

    • bugfix: the global timer expiration callback was called unnecessarily in the
      default mechanism (#3883).