Skip to content

Releases: dfinity/motoko

0.15.1

30 Jul 11:51
e0a80e3
Compare
Choose a tag to compare
  • motoko (moc)

    • bugfix: persistent imported actor classes incorrectly rejected as non-persistent (#5667).

    • Allow matching type fields of modules and objects in patterns (#5056)
      This allows importing a type from a module without requiring an indirection or extra binding.

      // What previously required indirection, ...
      import Result "mo:core/Result";
      type MyResult<Ok> = Result.Result<Ok, Text>;
      
      // or rebinding, ...
      import Result "mo:core/Result";
      type Result<Ok, Err> = Result.Result<Ok, Err>;
      type MyResult<Ok> = Result<Ok, Text>;
      
      // can now be written more concisely as:
      import { type Result } "mo:core/Result";
      type MyResult<Ok> = Result<Ok, Text>;
      

0.15.0

25 Jul 10:01
5643e16
Compare
Choose a tag to compare
  • motoko (moc)

    • Breaking change: the persistent keyword is now required on actors and actor classes (#5320, #5298).
      This is a transitional restriction to force users to declare transient declarations as transient and actor/actor classes as persistent.
      New error messages and warnings will iteratively guide you to insert transient and persistent as required, after which any stable keywords can be removed. Use the force.

      In the near future, the persistent keyword will be made optional again, and let and var declarations within actor and actor classes will be stable (by default) unless declared transient, inverting the previous default for non-persistent actors.
      The goal of this song and dance is to always default actor declarations to stable unless declared transient and make the persistent keyword redundant.

    • Breaking change: enhanced orthogonal persistence is now the default compilation mode for moc (#5305).
      Flag --enhanced-orthogonal-persistence is on by default.
      Users not willing or able to migrate their code can opt in to the behavior of moc prior to this release with the new flag --legacy-persistence.
      Flag --legacy-persistence is required to select the legacy --copying-gc (the previous default), --compacting-gc, or generational-gc.

      As a safeguard, to protect users from unwittingly, and irreversibly, upgrading from legacy to enhanced orthogonal persistence, such upgrades will fail unless the new code is compiled with flag --enhanced-orthogonal-persistence explicitly set.
      New projects should not require the flag at all (#5308) and will simply adopt enhanced mode.

      To recap, enhanced orthogonal persistence implements scalable and efficient orthogonal persistence (stable variables) for Motoko:

      • The Wasm main memory (heap) is retained on upgrade with new program versions directly picking up this state.
      • The Wasm main memory has been extended to 64-bit to scale as large as stable memory in the future.
      • The runtime system checks that data changes of new program versions are compatible with the old state.

      Implications:

      • Upgrades become extremely fast, only depending on the number of types, not on the number of heap objects.
      • Upgrades will no longer hit the IC instruction limit, even for maximum heap usage.
      • The change to 64-bit increases the memory demand on the heap, in worst case by a factor of two.
      • For step-wise release handling, the IC initially only offers a limited capacity of the 64-bit space (e.g. 4GB or 6GB), that will be gradually increased in future to the capacity of stable memory.
      • There is moderate performance regression of around 10% for normal execution due to combined related features (precise tagging, change to incremental GC, and handling of compile-time-known data).
      • The garbage collector is fixed to incremental GC and cannot be chosen.
      • Float.format(#hex prec, x) is no longer supported (expected to be very rarely used in practice).
      • The debug print format of NaN changes (originally nan).
    • Fixed file indices in the DWARF encoding of the debug_line section. This change is only relevant when using the -g flag (#5281).

    • Improved large array behavior under the incremental GC (#5314)

0.14.14

30 Jun 19:21
c85d17e
Compare
Choose a tag to compare
  • motoko (moc)

    • Lazy WASM imports: avoids unnecessary function imports from the runtime, improving compatibility with more runtime versions (#5276).

    • Improved stable compatibility error messages to be more concise and clear during canister upgrades (#5271).

0.14.13

17 Jun 14:52
f622ca4
Compare
Choose a tag to compare
  • motoko (moc)

    • Introduce await? to synchronize async futures, avoiding the commit point when already fulfilled (#5215).

    • Adds a Prim.Array_tabulateVar function, that allows faster initialization of mutable arrays (#5256).

    • optimization: accelerate IR type checking with caching of sub, lub and check_typ tests (#5260).
      Reduces need for -no-check-ir flag.

0.14.12

12 Jun 10:57
1b6a063
Compare
Choose a tag to compare
  • motoko (moc)

    • optimization: for --enhanced-orthogonal-persistence, reduce code-size and compile-time by sharing more static allocations (#5233, #5242).
    • bugfix: fix -fshared-code bug (#5230).
    • bugfix: avoid stack overflow and reduce code complexity for large eop canisters (#5218).
    • Added the rootKey primitive (#4994).

0.14.11

16 May 10:40
03d0a69
Compare
Choose a tag to compare
  • motoko (moc)

    • Enhance syntax error messages with examples and support find-references and go-to-definition
      functionality for fields in the language server (Serokell, Milestone-3) (#5076).

    • bugfix: mo-doc now correctly extracts record-patterned function arguments (#5128).

0.14.10

12 May 13:56
74b7366
Compare
Choose a tag to compare
  • motoko (moc)

    • Added new primitives for cost calculation:
      costCall, costCreateCanister, costHttpRequest, costSignWithEcdsa, costSignWithSchnorr (#5001).

0.14.9

25 Apr 13:51
da83616
Compare
Choose a tag to compare
  • motoko (moc)

    • Added new primitives for exploding fixed-width numbers to bytes:
      explodeNat16, explodeInt16, explodeNat32, explodeInt32, explodeNat64, explodeInt64 (#5057).

0.14.8

17 Apr 13:42
39caa9c
Compare
Choose a tag to compare
  • motoko (moc)

    • Add random-access indexing to Blob, support special methods get and keys (#5018).

    • Officializing enhanced orthogonal persistence (EOP) after a successful beta testing phase (#5035).

      EOP needs to be explicitly enabled by the --enhanced-orthogonal-persistence compiler flag or via args in dfx.json:

        "type" : "motoko"
        ...
        "args" : "--enhanced-orthogonal-persistence"
      
    • Add support for parser error recovery to improve LSP (Serokell, Milestone-2) (#4959).

    • We now provide a proper motoko-mode for emacs (#5043).

    • bugfix: Avoid generating new Candid types arising from equal homonymous Motoko type (if possible)
      in service definitions (#4309, #5013).

    • bugfix: Provide a more consistent framework for dealing with internally generated type indentifiers,
      fixing caching bugs, e.g. in the VSCode plugin (#5055).

0.14.7

04 Apr 10:55
15b91cb
Compare
Choose a tag to compare
  • motoko (moc)

    • Preserve and infer named types both to improve displayed types in error messages, and to preserve function signatures when deriving Candid types (#4943).
      The names remain semantically insignificant and are ignored when comparing types for subtyping and equality.

      For example,

      func add(x : Int, y : Int) : (res : Int) = x + y;

      now has inferred type:

      (x : Int, y: Int) -> (res : Int)

      Previously, the type would be inferred as:

      (Int, Int) -> Int
    • Refine the *.most stable signature file format to distinguish stable variables that are strictly required by the migration function rather than propagated from the actor body (#4991).
      This enables the stable compatibility check to verify that a migration function will not fail due to missing required fields.
      Required fields are declared in, not stable, in the actor's pre-signature.

    • Added improved LSP cache for typechecking (thanks to Serokell) (#4931).

    • Reduce enhanced-orthogonal-persistence memory requirements using incremental allocation within partitions (#4979).

  • motoko-base

    • Deprecated ExperimentalCycles.add, use a parenthetical (with cycles = <amount>) <send> instead (dfinity/motoko-base#703).