Move (Programming Language)

What Is Move (Programming Language)?

The Move programming language was initially created to build the Diem blockchain, a project backed by Meta.

Although the Diem blockchain was eventually discarded, Move is still in use today as an independent programming language.

Enabling Secure and Scalable Smart Contracts

Move is an executable bytecode language for implementing smart contracts and custom transactions.

It aims to address some challenges in other blockchain programming languages, such as Solidity.

However, Move retains the fundamental goals of achieving digital scarcity and providing control over digital assets.

It focuses explicitly on preventing double-spending and enabling asset holders to maintain ownership information.

Move emphasizes safety while maintaining a streamlined design and significantly lower gas costs compared to blockchains not built on Move.

How Does the Move Programming Language Work?

Move incorporates linear logic, where resources can only be used once and cannot be copied or implicitly discarded.

This allows developers to define custom resource types that are treated differently from other types and cannot be erased or duplicated.

A Secure and Resource-Centric Programming Language

Move’s static type system requires variables to be defined with a specific type (e.g., number or word).

It protects prioritized resources, which can be used like regular elements, stored in data structures, or used as calculation values.

Resources are transparent within modules but hidden from external calls.

Modules in Move offer flexibility and safety by establishing relationships among modules, resources, and procedures similar to object-oriented programming’s classes, objects, and methods.

Enhancing Safety and Verification

Move allows for on-chain verification of safety properties and supports off-chain static verification tools, reducing complexities associated with on-chain verification.

Its design is based on three core decisions:

  1. Avoiding dynamic dispatch to simplify call site determination and identify procedure call effects more easily
  2. Modularity to isolate modules for functional verification, abstract data, and localize critical operations on resources
  3. Safety through encapsulation of modules with the language’s type system, preventing external code from violating module types

Move’s limited mutability permits using reference types, similar to C++. References are essential for mutating Move values, typically created and destroyed within a transaction script.

Move’s bytecode verifier employs “borrow checks” similar to Rust to confirm the presence of at least one mutable reference.

How Is the Move Programming Language Different?

The Move programming language distinguishes itself from other blockchain programming languages in several ways:

  • It does not impose limits on defining custom data types or procedures.
  • Access control policies are embedded in the language semantics.
  • It avoids a default type system for digital assets, unlike Bitcoin or Ethereum.
  • It allows individual assets to have representations in the programming language, while custom assets need to undergo safety property review by developers.

These features enable Move to easily create new assets with scarcity without requiring developers to engineer it themselves.

It also allows developers to customize and modify access control, making the language more versatile and scalable compared to its counterparts.

Components of the Move Programming Language

The Move programming language consists of several key components:

  • Types: Boolean, unsigned integers (64-bit
  • Struct: Two specific types: kind (for resource structures) and unrestricted (for general structures).
  • Procedures: Methods that can be public or internal, with acyclic module dependencies to prevent re-entrance attacks.
  • Bytecode verifier: Checks safety properties before module publication, including type checking, stack balance checking, reference checking, control graph development, reference linking, and resource checking.
  • Bytecode Interpreter: Executes bytecode after verification, similar to Ethereum’s use of gas to ensure termination of infinite loops.
  • Move Virtual Machine: Similar to other blockchains, with blocks containing multiple transactions and each transaction producing a transaction effect. The effect updates the global state of the blockchain, maintaining a separation between effects and state transitions.

Which Blockchains Use the Move Programming Language?

Move was initially used for the discarded Diem blockchain project by Meta (formerly Facebook).

Other blockchains are built on the Move programming language.