What
We want to allow runtime packages to import functions from the host environment, this functionality is strictly restricted to runtime packages.
Why
In WebAssembly, importing functions is the only way to interact with the host environment.
However, we want to do things the right way: importing functions is limited to runtime packages to separate host-dependent code and functionality from the "application layer".
In the future, runtime interfaces will further improve portability, by encapsulating host specific capabilities.
How
We will add a new top-level declaration to define imports, which will look like:
pub import open_file(filename: String): i64 as open
What We want to allow runtime packages to import functions from the host environment, this functionality is strictly restricted to runtime packages.
Why In WebAssembly, importing functions is the only way to interact with the host environment.
However, we want to do things the right way: importing functions is limited to runtime packages to separate host-dependent code and functionality from the "application layer". In the future, runtime interfaces will further improve portability, by encapsulating host specific capabilities.
How We will add a new top-level declaration to define imports, which will look like:
The syntax is given by:
import
section