Skip to content
Merged
Changes from all commits
Commits
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
31 changes: 19 additions & 12 deletions design/DFX-Interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,15 @@ No constraints are imposed where imported files reside (this may be refined to p
This _writes_ to `another/path/output.wasm`, but has no other effect. It does
not create `another/path/`.

Compiler warnings and errors are reported to `stderr`. Nothing writes to `stdout`.

Compiling Motoko Files to IDL
-----------------------------

As the previous point, but passing `--idl` to `moc`.

The IDL generation does not issue any warnings.


Resolving Canister aliases
--------------------------
Expand All @@ -95,6 +99,8 @@ The `canisterid` here refers the “textual representation“ without the `ic:`

This files informs motoko about the interface of that canister. It could be the output of `moc --idl` for a locally known canister, or the IDL file as fetched from the Internet Computer, or created any other way.

Open problem: how to resolve mutual canister imports.

Compiling IDL Files to JS
-------------------------

Expand All @@ -110,6 +116,8 @@ No constraints are imposed where these imported files reside (this may be refine
This _writes_ to `another/path/output.js`, but has no other effect. It does
not create `another/path/`.

Compiler warnings and errors are reported to `stderr`. Nothing writes to `stdout`.

Invoking the IDE
----------------

Expand All @@ -131,18 +139,17 @@ The command

moc --print-deps some/path/input.mo

prints to the standard output all URLs _directly_ imported by
`some/path/input.mo`, one per line, e.g.
prints to the standard output all URLs _transitively_ imported by
`some/path/input.mo`, one per line. Each line outputs the original
URL, and optionally a full path if `moc` can resolve the URL, separated by a space.
For example,

mo:stdlib/List
mo:other_package/Some/Module
ic:ABCDE01A7
ic:alias
relative/path
mo:stdlib/List
mo:other_package/Some/Module
ic:ABCDE01A7
canister:alias
./local_import some/path/local_import.mo
./runtime some/path/runtime.wasm

This _reads_ only `some/path/input.mo`, and writes no files.
This may _read_ the same files as `moc -c` would, and writes no files.

By transitively exploring the dependency graph using this command (and
resolving URLs appropriately before passing them as files to `moc`), one can
determine the full set of set of `.mo` files read by the two compilation modes
described above (to wasm and to IDL).