Motoko (programming language)

From Internet Computer Wiki
Jump to: navigation, search

Summary

The Motoko programming language is a new, modern and type safe language for developers who want to build the next generation of distributed applications to run on the Internet Computer blockchain network. Motoko is specifically designed to support the unique features of the Internet Computer and to provide a familiar yet robust programming environment. As a new language, Motoko is constantly evolving with support for new features and other improvements.[1]

The Motoko compiler, documentation, and other tooling is open source and released under the Apache 2.0 license.

History

Design Intent

Key design points[1]:

  1. Motoko takes inspiration from several programming languages, including Java, JavaScript, C#, Swift, Pony, ML, Haskell.
  2. Object-oriented, functional, and imperative
  3. Objects as records of members
  4. async/await for sequential programming of asynchronous messaging
  5. Structural typing with simple generics and subtyping
  6. Safe arithmetic (unbounded and checked)
  7. Non-nullable types by default
  8. JavaScript-like syntax but statically typed and sane

Syntax

Features

Components

Language Extensions

Adoption

Development

References