Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
b02b0d1
fix(motoko): restore missing pages, fix nav order, rewrite stale links
marc0olo May 18, 2026
1fcca8a
fix(infra): harden Motoko sync script with collision detection and UN…
marc0olo May 18, 2026
0bcdca7
fix(motoko): collapse Basic syntax by default, move language-manual f…
marc0olo May 18, 2026
3ae83d1
fix(motoko): strip link from aside titles, remove unused dirname import
marc0olo May 18, 2026
a2bfe0c
docs(motoko): correct and complete the motoko-repo-sync-proposal
marc0olo May 18, 2026
47effba
fix(motoko): avoid cross-line aside title merge by using non-newline …
marc0olo May 18, 2026
e5895cf
feat(infra): add line range and <motokoExamples> placeholder support …
marc0olo May 18, 2026
6dbed2e
feat(motoko): rewrite file-embed paths to <motokoExamples> placeholde…
marc0olo May 18, 2026
a4ee163
fix(motoko): preserve orthogonal-persistence overview, fix index link…
marc0olo May 18, 2026
bc69180
docs(plan): add REPL meta flags analysis as Problem 7 + Proposed Chan…
marc0olo May 18, 2026
0b47019
docs(plan): add three critical upstream gaps found by agent review
marc0olo May 18, 2026
e349947
docs(plan): strengthen sync proposal with anchored URLs, changelog fi…
marc0olo May 18, 2026
6721923
feat(plugin): add motokoRoot placeholder and inline markdown inclusio…
marc0olo May 18, 2026
70ac1e4
docs(plan): fix sidebar ordering analysis — reference renumber, funda…
marc0olo May 18, 2026
76f879d
refactor(sidebar): extract Motoko section into sidebar-motoko.mjs
marc0olo May 18, 2026
fb2e227
docs(plan): add task 11 — upstream index.md stubs enable full autogen…
marc0olo May 18, 2026
be26458
infra(sync): replace sync-motoko.sh with simplified rsync version
marc0olo May 18, 2026
e82bf27
revert: restore sync scripts to working state for current upstream
marc0olo May 18, 2026
e296e4a
fix(infra): restore correct sync scripts (subdirectory-preserving ver…
marc0olo May 18, 2026
43f59fc
docs(plan): fix stale overview.md reason, _category_.yml framing, and…
marc0olo May 18, 2026
fdd34f1
docs(motoko-sync): clarify §1 and §8 are optional in sync proposal
marc0olo May 18, 2026
748db1d
docs(motoko-sync): expand §4 with maintainer confirmation to remove c…
marc0olo May 18, 2026
3268e58
docs(motoko-sync): delete top-level index.md files, document symlink …
marc0olo May 18, 2026
994dc9e
docs(motoko-sync): remove exclude flags from final rsync — upstream d…
marc0olo May 18, 2026
2e0a8d9
fix(motoko): fix broken anchors, mo-doc URL, and caffeinelabs org refs
marc0olo May 18, 2026
3ee9a09
docs(developer-tools): add mo-doc section and update comments page links
marc0olo May 18, 2026
a47d8ff
fix(postprocess): redirect mo-doc and docs.motoko.org links to intern…
marc0olo May 18, 2026
01e8f48
fix(developer-tools): correct broken candid-spec.md relative path
marc0olo May 18, 2026
88416f4
docs(developer-tools): clarify mo-doc install — binary is inside the …
marc0olo May 18, 2026
028704f
fix(developer-tools): remove banned em-dash in mo-doc section
marc0olo May 18, 2026
35d84b6
refactor(developer-tools): give Motoko its own section, remove it fro…
marc0olo May 18, 2026
aea4517
docs(motoko-sync): update §10 redirect target and document dfx/em-das…
marc0olo May 18, 2026
3bf44de
docs(motoko-sync): clarify PR #6069 must follow the sync reorganizati…
marc0olo May 18, 2026
c92fa7a
fix(postprocess): handle docs.internetcomputer.org/developer-tools/#m…
marc0olo May 18, 2026
9925fbf
docs(motoko-sync): clarify title: frontmatter prerequisite and link-h…
marc0olo May 18, 2026
a525c78
fix(postprocess-motoko): add ic-interface-spec anchor routing and exp…
marc0olo May 18, 2026
8dc32b2
docs(motoko-sync): strengthen copy-over-symlinks rationale in sync plan
marc0olo May 18, 2026
366adf7
docs(developer-tools): remove duplicate vscode-motoko link and redund…
marc0olo May 18, 2026
c78513e
fix(developer-tools): update vscode-motoko repo URL to caffeinelabs org
marc0olo May 18, 2026
90cdb64
fix(ci): initialize .sources/motoko submodule in build workflows
marc0olo May 18, 2026
181dd8b
fix(data-persistence): replace Nat→Int with accurate unsafe upgrade e…
marc0olo May 18, 2026
0500d9f
fix(motoko): align overview with motoko source and remove stale comment
marc0olo May 19, 2026
ca32f82
fix(motoko): restore AI agents wording from upstream commit 57671b6
marc0olo May 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,070 changes: 1,070 additions & 0 deletions .docs-plan/motoko-repo-sync-proposal.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/workflows/deploy-ic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: Initialize examples submodule
- name: Initialize submodules
run: |
git config --global url."https://github.com/".insteadOf "git@github.com:"
git submodule update --init --depth 1 .sources/examples
git submodule update --init --depth 1 .sources/examples .sources/motoko

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/preview-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: Initialize examples submodule
- name: Initialize submodules
run: |
git config --global url."https://github.com/".insteadOf "git@github.com:"
git submodule update --init --depth 1 .sources/examples
git submodule update --init --depth 1 .sources/examples .sources/motoko

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
Expand Down
48 changes: 30 additions & 18 deletions docs/developer-tools/index.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: "Developer tools"
description: "Overview of the ICP developer toolchain: icp-cli, CDKs, JS SDK, PocketIC, and more"
description: "Overview of the ICP developer toolchain: icp-cli, Motoko, CDKs, JS SDK, PocketIC, and more"
sidebar:
hidden: true
---

Developer tools are used to create, manage, and interact with canisters. ICP provides tooling across several categories: command-line tools, canister development kits (CDKs), client libraries, testing tools, browser-based IDEs, and Candid tooling.
Developer tools are used to create, manage, and interact with canisters. ICP provides tooling across several categories: command-line tools, Motoko, canister development kits (CDKs), client libraries, testing tools, browser-based IDEs, and Candid tooling.

## Command-line tools

Expand Down Expand Up @@ -44,18 +44,38 @@ Quill is suited for:
Resources:
- [Quill GitHub repo](https://github.com/dfinity/quill)

## Canister development kits (CDKs)

A canister development kit (CDK) provides a programming language with the libraries and toolchain support needed to compile code to WebAssembly and interact with the ICP system API.

### Motoko
## Motoko

Motoko is ICP's native programming language, designed around the actor model, orthogonal persistence, and asynchronous message passing. It compiles directly to WebAssembly and includes a standard library (`mo:core`) with modules for common data structures, cryptography, and system interaction.
Motoko is ICP's native programming language, designed specifically for the actor model, orthogonal persistence, and asynchronous message passing. It compiles directly to WebAssembly without requiring a separate CDK and includes a standard library (`mo:core`) with modules for common data structures, cryptography, and system interaction.

Third-party Motoko libraries are distributed through [Mops](https://mops.one), the Motoko package manager. Use `mops add <package>` to add a dependency to your project.

For language documentation, see [languages/motoko](../languages/motoko/index.md).

### Motoko VS Code extension

The [Motoko extension for VS Code](https://github.com/caffeinelabs/vscode-motoko) adds Motoko language support to VS Code: syntax highlighting, type checking, auto-completion, and inline diagnostics. Install by searching for "Motoko" in the VS Code extensions panel.

### mo-doc

`mo-doc` generates documentation for Motoko source code from `///` doc comments, producing HTML (default), Markdown (`--format plain`), or AsciiDoc (`--format adoc`) output.

Install: `mo-doc` is bundled inside the Motoko compiler tarball. Download the archive for your platform from the [Motoko releases page](https://github.com/caffeinelabs/motoko/releases), then extract it; the binary is at `bin/mo-doc` inside the archive.

```bash
# Platform: Darwin-arm64, Darwin-x86_64, Linux-aarch64, Linux-x86_64
tar xzf motoko-<platform>-<version>.tar.gz
./bin/mo-doc # HTML output to ./docs
./bin/mo-doc --format plain --output ./api-docs # Markdown output to ./api-docs
./bin/mo-doc --source ./src --output ./out # custom source and output paths
```

For how to write doc comments in Motoko source, see [Comments](../languages/motoko/fundamentals/basic-syntax/comments.md).

## Canister development kits (CDKs)

A canister development kit (CDK) provides an existing programming language with the libraries and toolchain support needed to compile code to WebAssembly and interact with the ICP system API.

### Rust CDK (`ic-cdk`)

The Rust CDK (`ic-cdk`) is the official DFINITY-maintained library for building canisters in Rust. It exposes the ICP system API as safe Rust abstractions, including:
Expand Down Expand Up @@ -144,14 +164,6 @@ Limitations:
- Projects are limited to 5 MB and 2 canisters
- ICP Ninja is not a replacement for icp-cli for production workflows

## Editor tooling

### Motoko VS Code extension

The [Motoko extension for VS Code](https://github.com/dfinity/vscode-motoko) (`dfinity/vscode-motoko`) adds Motoko language support to VS Code: syntax highlighting, type checking, auto-completion, and inline diagnostics.

Install by searching for "Motoko" in the VS Code extensions panel, or visit the [vscode-motoko repository](https://github.com/dfinity/vscode-motoko) for details.

## Candid tools

### didc
Expand All @@ -162,12 +174,12 @@ Install: download a prebuilt binary from the [releases page](https://github.com/

Resources:
- [Candid GitHub repo](https://github.com/dfinity/candid)
- Candid specification: [candid-spec.md](candid-spec.md)
- Candid specification: [candid-spec.md](../references/candid-spec.md)

## Next steps

- **Start building:** [Quickstart](../getting-started/quickstart.md): deploy your first canister with icp-cli
- **Rust development:** [Rust language guide](../languages/rust/index.md)
- **Motoko development:** [Motoko language guide](../languages/motoko/index.md)

<!-- Upstream: informed by dfinity/portal — docs/building-apps/developer-tools/dev-tools-overview.mdx, docs/building-apps/developer-tools/icp-ninja.mdx, docs/building-apps/developer-tools/cdks/index.mdx, docs/tutorials/developer-liftoff/level-1/1.2-dev-env.mdx; dfinity/icp-cli — docs/telemetry.md, docs/guides/installation.md, docs/guides/creating-recipes.md, docs/guides/creating-templates.md; dfinity/candid — README.md; dfinity/icp-js-sdk-docs — core/latest.zip (agent, candid, principal, identity), auth/latest.zip, bindgen/latest.zip, pic-js/latest.zip -->
<!-- Upstream: informed by dfinity/portal — docs/building-apps/developer-tools/dev-tools-overview.mdx, docs/building-apps/developer-tools/icp-ninja.mdx, docs/building-apps/developer-tools/cdks/index.mdx, docs/tutorials/developer-liftoff/level-1/1.2-dev-env.mdx; dfinity/icp-cli — docs/telemetry.md, docs/guides/installation.md, docs/guides/creating-recipes.md, docs/guides/creating-templates.md; dfinity/candid — README.md; dfinity/icp-js-sdk-docs — core/latest.zip (agent, candid, principal, identity), auth/latest.zip, bindgen/latest.zip, pic-js/latest.zip; caffeinelabs/motoko — doc/md/motoko-tooling/3-mo-doc.md -->
2 changes: 1 addition & 1 deletion docs/guides/backends/data-persistence.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ When upgrading a Motoko canister, the type of every persistent field must be com

**Unsafe changes (will trap on upgrade):**
- Remove or rename a persistent field
- Change a field's type (e.g., `Nat` → `Int`)
- Change a field's type to an incompatible type (e.g., `Int` → `Float`, or `Nat` → `Text`)
- Change a non-optional field to a different type

</TabItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Motoko language documentation"
title: "Actors & async data"
---

The actor programming model was designed to solve concurrency issues by encapsulating [state](/languages/motoko/fundamentals/state) and computation within independent units called **actors**.
The actor programming model was designed to solve concurrency issues by encapsulating [state](/languages/motoko/fundamentals/actors/state) and computation within independent units called **actors**.

The actor model is built on four key principles:

Expand Down Expand Up @@ -68,35 +68,7 @@ A trap will only revoke changes made since the last commit point. In particular,

Consider the following stateful `Atomicity` actor:

```motoko
persistent actor Atomicity {

transient var s = 0;
transient var pinged = false;

public func ping() : async () {
pinged := true;
};

// an atomic method
public func atomic() : async () {
s := 1;
ignore ping();
ignore 0/0; // trap!
};

// a non-atomic method
public func nonAtomic() : async () {
s := 1;
let f = ping(); // this will not be rolled back!
s := 2;
await f;
s := 3; // this will not be rolled back!
await f;
ignore 0/0; // trap!
};

};
```motoko no-repl file=<motokoExamples>/atomicity.mo
```

Calling the shared function `atomic()` results in an error because it traps before completing. Since the trap happens before any `await` or return, all changes are discarded. The variable `s` stays at 0, and `pinged` remains false. Even though `atomic()` calls `ping()`, that message is only queued and never sent because no commit point is reached.
Expand All @@ -108,20 +80,7 @@ Calling `nonAtomic()` also fails with an error, but the state is partially updat

Here is an example program that uses async functions:

```motoko
persistent actor Counter {

var count = 0;

public shared func inc() : async () { count += 1 };

public shared func read() : async Nat { count };

public shared func bump() : async Nat {
count += 1;
count;
};
};
```motoko file=<motokoExamples>/counter-actor.mo
```

The `Counter` actor declares one field and three public, shared functions:
Expand Down Expand Up @@ -257,7 +216,7 @@ In other languages without these features, developers often need to use advanced

To demonstrate how asynchronous actors work, consider the following example.

Customers place orders at a pizza restaurant, but the chef can only make one pizza at a time. Orders are taken **[asynchronously](/languages/motoko/fundamentals/actors-async#async--await)**, meaning customers do not have to wait for previous orders to be completed before placing their own. However, each pizza is prepared sequentially. This is representative of an asynchronous actor.
Customers place orders at a pizza restaurant, but the chef can only make one pizza at a time. Orders are taken **[asynchronously](/languages/motoko/fundamentals/actors/actors-async#async--await)**, meaning customers do not have to wait for previous orders to be completed before placing their own. However, each pizza is prepared sequentially. This is representative of an asynchronous actor.
<!-- TODO(FUTURE): It would be cleaner to use a Deque or Queue pushing new order to the end and popping the next order to make from the front. -->
```motoko no-repl
import Array "mo:core/Array";
Expand Down
Loading
Loading