language/RELEASES.md
Version 1.4 of Move (released along with Diem Core version 1.4) includes named addresses, phantom type parameters, a new version of the bytecode format, and a number of bug fixes and other improvements.
phantom when they are not used for anything except
compile-time type checking. This avoids the need for spurious abilities to satisfy the
type checker.codespan-reporting crate
(#8812).disable_invariants_in_body pragma
(#8840).
Verifying global invariants remains an active area of development so there may
still be some related issues in this release.move compile command now includes the Move standard library by default
(#8679).df-cli tool
(#8615)
and refactored the Move CLI so that df-cli (or other clients) can
extend it with new subcommands
(#8764).move-command-line-common crate
(#8680).CompiledScript::into_module method
(#8655).CompiledModuleMut and CompiledScriptMut types
(#8667)
along with the into_inner, as_inner, and freeze methods from the
CompiledModule and CompiledScript types
(#8712).Version 1.3 of Move (released along with Diem Core version 1.3) introduces some syntax changes to the Move language so that you may need to update Move source code when moving to this release. The bytecode format remains the same as in version 1.2.
The main highlight of this release is a new language feature for unit testing. This provides an easy way to test individual functions and features in Move. More details are available in the unit testing change description.
In addition to the new unit testing feature, this release includes a few other changes to the Move language:
Added new module address syntax, e.g., module 0x1::M, to specify the address of a module
from within Move code
(#7915).
This replaces the compiler's --sender option to specify the address on the command line.
The syntax for an address value is changed to @ followed by a number
(#8285).
Previously an account address value was specified
as a hexadecimal value with an 0x prefix, and hexadecimal values could not be
used as ordinary integer numbers. With this change, addresses and numbers can be
specified as either decimal and hexadecimal values, and the @ prefix distinguishes
the address values.
Introduced a general syntax for attributes in Move (#8169). Move attributes are based on the Rust attribute syntax, which is in turn based on the standards found in ECMA-334 and ECMA-335. Attributes can currently be attached to address blocks, modules, scripts, and any module top level member. They are currently used for unit testing, and other attributes may be defined in the future.
--sender option. Instead of specifying the address on the command line,
you can use the new module address syntax in the Move code
(#7915).The syntax for specifications in Move is still in development and is documented separately from the rest of the language. This release includes a number of changes for Move specifications:
let binding semantics (let x = E and let post y = E)choose x where p and choose min i where p expression formsmodule M { invariant p; }) for global invariantsspec f instead of spec fun f)succeeds_ifinvariant moduletype<T>() expressionIn addition to the specification changes, the Move Prover has been improved with bug fixes and some larger changes, including:
gas_schedule::CostStrategy to GasStatus and cleaned up some of its APIs
(#7797).ChangeSet and AccountChangeSet types so that their fields must be
accessed by API functions, which also enforce a new invariant that the AccountChangeSet is
not empty
(#8288).self_module_handle_idx field
(#8389).vm Rust crate to move-binary-format,
which is a much better description of its contents.
(#8161).ident_str! macro to create const IdentStr values
(#8300).MoveResource trait to add a separate MoveStructType trait
(#8346).mdBook format
(#8450).Version 1.2 of Move (released along with Diem Core version 1.2) includes several new language features, a new version of the bytecode format, significant improvements to the Move Prover, and numerous bug fixes.
friend modules.resource/struct distinction to enable more fine-grained control over the operations allowed on a record value.This release includes several changes and enhancements:
execute_function API now returns the serialized return values (#7671).InternalGasUnits type has been introduced to distinguish the unscaled units within the VM from the scaled GasUnits type (#7448).Fixed bugs:
StructHandleIndex rather than the module containing the declaration (#7321).parse_type_tag function can now handle struct names containing underscores (#7151).MoveToGeneric, ImmBorrowFieldGeneric, and MutBorrowFieldGeneric instructions have been added to the bytecode verifier (#7752).To make it easier to use Move for projects besides Diem, we are working toward separating the parts of Move that are specific to Diem. There is much more to do, but in this release, the standard library has been separated into two parts: move-stdlib (#7633) and diem-framework (#7529).
Besides adding support for the new language features mentioned above, the compiler in this release includes a number of fixes and usability enhancements:
move_to, in a script context will no longer crash the compiler (#4577).let binding with a name starting with an underscore, e.g., _x, can now be used later in the code: the underscore prefix merely disables the compiler diagnostic about unused locals (#6786).break is used outside of a loop (#7560).spec block inside a spec context (#7387).The Move CLI has been enhanced in several ways:
doctor command to detect inconsistencies in storage (#6971, #7010, and #7013).publish command’s —-dry-run option has been removed (#6957). Use the equivalent "check" command instead.test command has a new --create option to create test scaffolding (#6969).-v option now includes the number of bytes written (#7757).AnnotatedMoveStruct are no longer private and AnnotatedMoveValue::Vector preserves the type information for its elements (#7166).diem-writeset-generator and diem-transaction-replay tools have been significantly enhanced to support the process of upgrading the Diem Framework.