Releases: dfinity/motoko
0.15.1
-
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
-
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 astransient
and actor/actor classes aspersistent
.
New error messages and warnings will iteratively guide you to inserttransient
andpersistent
as required, after which anystable
keywords can be removed. Use the force.In the near future, the
persistent
keyword will be made optional again, andlet
andvar
declarations within actor and actor classes will bestable
(by default) unless declaredtransient
, inverting the previous default for non-persistent
actors.
The goal of this song and dance is to always default actor declarations to stable unless declaredtransient
and make thepersistent
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
, orgenerational-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 (originallynan
).
-
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
0.14.13
-
motoko (
moc
)-
Introduce
await?
to synchronizeasync
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
-
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).
- optimization: for
0.14.11
0.14.10
0.14.9
0.14.8
-
motoko (
moc
)-
Add random-access indexing to
Blob
, support special methodsget
andkeys
(#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 viaargs
indfx.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
foremacs
(#5043). -
bugfix: Avoid generating new Candid
type
s arising from equal homonymous Motokotype
(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
-
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 declaredin
, notstable
, 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).
- Deprecated