Releases: dfinity/motoko
0.9.3
0.9.2
-
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
- Add
Principal.isController
function (dfinity/motoko-base#558).
- Add
0.9.1
0.9.0
-
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 indfx.json
:... "type" : "motoko" ... "args" : "--incremental-gc" ...
-
bugfix:
array.vals()
now returns a working iterator for mutable arrays (#3497, #3967).
-
0.8.8
0.8.7
0.8.6
0.8.5
0.8.4
-
motoko (
moc
)-
Performance improvement: UTF-8 coding and validation is now properly tail recursive (#3842).
-
Performance improvement: eliminated bounds checking for certain array accesses (thanks to nomeata) (#3853).
-
Performance improvement: optimized
{array, blob, text}.size()
operations (thanks to nomeata) (#3863). -
Performance improvement: efficient tuple results in
switch
statements (thanks to nomeata) (#3865). -
Performance improvement: more efficient untagging operation (#3873).
-
bugfix: restored a grammar regression caused by
let-else
(#3869).
-
-
motoko-base
-
Add
Array.subArray
function (dfinity/motoko-base#445). -
BREAKING CHANGE (Minor)
Optimized
AssocList.{replace, find}
to avoid unnecessary allocation (dfinity/motoko-base#535, dfinity/motoko-base#539).
Note: this subtly changes the order in which the key-value pairs occur after replacement. May affect other containers that useAssocList
. -
Performance improvement: Optimized deletion for
Trie
/TrieMap
(dfinity/motoko-base#525).
-
0.8.3
-
motoko (
moc
)-
new 'let-else' construct for handling pattern-match failure (#3836).
This is a frequently asked-for feature that allows to change the control-flow
of programs when pattern-match failure occurs, thus providing a means against
the famous "pyramid of doom" issue. A common example is look-ups:shared func getUser(user : Text) : async Id { let ?id = Map.get(users, user) else { throw Error.reject("no such user") }; id }
Similarly, an expression like
(label v : Bool { let <pat> = <exp> else break v false; true })
evaluates to a
Bool
, signifying whether<pat>
matches<exp>
. -
Improve recursive deserialization capacity to match recursive serialization capacity by reducing
Wasm stack consumption (#3809).
Because of the bounds on recursion depth imposed by fixed-size stack, the
advice remains the same: avoid deeply nested recursive data structures.
Think "shallow trees good, very long lists bad". -
bugfix: stack overflow in UTF-8 encode/decode for
moc.js
(#3825).
-
-
motoko-base
- add missing
unshare : Tree<K, V> -> ()
method to classRBTree<K, V>
to restore objects from saved state (dfinity/motoko-base#532).
- add missing