Skip to content

Releases: dfinity/motoko

0.7.5

23 Dec 21:52
1c2f749
Compare
Choose a tag to compare
  • motoko (moc)

    • Add new primitives for a default timer mechanism (#3542). These are

      setTimer : (delayNanos : Nat64, recurring : Bool, job : () -> async ()) -> (id : Nat)
      cancelTimer : (id : Nat) -> ()

      By defining a system func timer the default mechanism can now be overridden by a custom
      implementation. Additionally by supplying the command-line flag -no-timer all aspects
      of timers can be suppressed, e.g. for space- or security-sensitive purposes, thus effectively
      reverting canisters to the pre-timers era.

    • bugfix: silence bogus cascading errors in stable compatibility check (#3645).

0.7.4

07 Dec 15:56
857b878
Compare
Choose a tag to compare
  • motoko (moc)

    • Add new keywords async* and await* (note the *) for efficient abstraction of asynchronous code (#3609).

        <typ> ::= ...
          async* <typ>             delayed, asynchronous computation
        <exp> ::= ...
          async* <block-or-exp>    delay an asynchronous computation
          await* <block-or-exp>    execute a delayed computation (only in async, async*)
      

      This avoids the resource consumption and latency of async/await by only committing state and suspending execution
      when necessary in the await*-ed computation, not necessarily at the await* itself.

      WARNING: Unlike async/await:

      • an async* value has no effect unless await*-ed;
      • each await* of the same async* value repeats its effects.

      This feature is experimental and may evolve in future. Use with discretion.
      See the manual for details.

    • Suppress GC during IC canister_heartbeat, deferring any GC to the scheduled Motoko heartbeat system method (#3623).
      This is a temporary workaround, to be removed once DTS is supported for canister_heartbeat itself (#3622).

    • Add a new generational GC, enabled with new moc flag --generational-gc (#3495).
      The generational garbage collector optimizes for fast reclamation of short-lived objects.
      New objects are allocated in a young generation that is more frequently collected than the older objects
      that have already survived a GC run.

      For many cases, the generational GC is more efficient than the existing compacting GC and copying GCs:

      • Lower runtimes: Less number of executed instructions on average.
      • Shorter interruptions: Young generation collection entails shorter program interruptions.

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

      ...
        "type" : "motoko"
        ...
        "args" : "--generational-gc"
      ...
      
    • moc.js : add trampoline and step limiter to interpreter, avoiding (some) stackoverflows and
      hangs (#3618, #3541).
      Enables execution of larger examples on web pages.

    • BREAKING CHANGE (Minor):

      Consider records with mutable fields as non-static (#3586).
      Consequently, an imported library declaring a mutable record is now
      rejected, not accepted, to be consistent with the declarations of
      mutable fields and mutable objects.

    • Experimental Viper integration by compiling a very narrow subset of
      Motoko to the verification intermediate language. See src/viper/README.md
      and the PR for details. (#3477).

  • motoko-base

0.7.3

01 Nov 14:13
7704993
Compare
Choose a tag to compare
  • motoko (moc)

    • Statically reject shared functions and function types with type parameters (#3519, #3522).

    • Performance improvement: Array.init and Array.tabulate (#3526).

  • motoko-base

0.7.2

25 Oct 15:49
be62293
Compare
Choose a tag to compare

0.7.1

24 Oct 19:28
db96474
Compare
Choose a tag to compare
  • motoko (moc)

    • Halve (default ir-checking) compilation times by optimizing type comparison and hashing (#3463)

    • Add support for type components in object type syntax (#3457, also fixes #3449)

      type Record = { type T = Nat; x : Nat};

    is now legal.
    Note the definition of T is neither recursive, nor bound in x : Nat,
    but can refer to an existing recursive type declared in an outer scope.

  • motoko-base

0.7.0

25 Aug 12:19
0c6948b
Compare
Choose a tag to compare
  • motoko (moc)

    • BREAKING CHANGE (Minor):
      Adds new syntax for merging records (objects) and
      adding/overwriting fields. The expression

      { baseA and baseB with field1 = val1; field2 = val2 }

      creates a new record by joining all (statically known) fields from
      baseA/B and the explicitly specified field1/2.
      This is a breaking change, as a new keyword with has been added.
      Restrictions for ambiguous and var fields from bases apply. (#3084)

    • Add new support for installing actor class instances on the IC,
      enabling specification of canister settings, install, upgrade and
      reinstall. (#3386)

      A new expression

        (system <exp> . <id>)
      

      where <exp> is an imported library and <id> is the name of
      an actor class, accesses a secondary constructor of the class
      that takes an additional argument controlling the installation.

      For example,

        await (system Lib.Node)(#upgrade a)(i);

      upgrades actor a with the code for a new instance of class Lib.Node,
      passing constructor argument (i).

    • Performance improvements for assigment-heavy code (thanks to nomeata) (#3406)

0.6.30

11 Aug 15:07
bf5a876
Compare
Choose a tag to compare
  • motoko (moc)

    • add primitives

      shiftLeft : (Nat, Nat32) -> Nat
      shiftRight : (Nat, Nat32) -> Nat

      for efficiently multiplying/dividing a Nat by a power of 2
      (#3112)

    • add primitives

      rts_mutator_instructions : () -> Nat
      rts_collector_instructions : () -> Nat

      to report approximate IC instruction costs of the last message
      due to mutation (computation) and collection (GC), respectively (#3381)

  • motoko-base

0.6.29

10 Jun 17:17
a0cae95
Compare
Choose a tag to compare
  • motoko (moc)

    • The language server now supports explicit symbol imports (thanks
      to rvanasa) (#3282)
    • The language server now has improved support for navigating to
      definitions in external modules (thanks to rvanasa) (#3263)
    • Added a primitive textCompare allowing more efficient three-way
      Text comparisons (#3298)
    • Fixed a typing bug with annotated, recursive records (#3268)
  • motoko-base

    • Add

      ExperimentalInternetComputer.countInstruction : (comp : () -> ()) -> Nat64

      to count the Wasm instructions performed during execution of comp() (dfinity/motoko-base#381)

    • Add

      ExperimentalStableMemory.stableVarQuery : () -> (shared query () -> async {size : Nat64})

      for estimating stable variable storage requirements during upgrade
      (dfinity/motoko-base#365)

    • Performance improvement to Text.compare (dfinity/motoko-base#382)

0.6.28

20 May 01:53
Compare
Choose a tag to compare
  • motoko (moc)

    • Add to_candid, from_candid language constructs for Candid serialization to/from Blobs (#3155)
    • New system field 'inspect' for accepting/declining canister ingress messages (see doc) (#3210)

0.6.27

04 May 13:33
6e25e40
Compare
Choose a tag to compare
  • motoko (moc)

    • Importing modules by relative path is now more robust (#3215).
    • Performance: persisting stable variables to stable memory is now
      performed in streaming fashion, reducing heap consumption and
      copying during an upgrade (#3149).
    • Performance: local 32- and 64-bit numeric values are now stored in
      using unboxed form when possible (thanks to nomeata) (#3207).
  • motoko-base

    • Fixed a bug in Trie.filter (and Trie.mapFilter) which could
      lead to missing matches in some cases (dfinity/motoko-base#371).