Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new tenses, and correct spelling mistakes and typos. #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions examples/wasi-introduction/wasi-introduction.all.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
First, we should answer the question, "What is WASI"? The formal answer to this is: WASI is the [WebAssembly System Interface](https://wasi.dev/), "a modular system interface for WebAssembly". To provide an easy introduction into why the idea of WASI is exciting, let's look at some possible use cases when the goals of WASI are met:

- **What can developers do with WebAssembly/WASI?**
- **Cross platform applications and games:** you could imagine where you have have a single binary or executable, that is then able to be run on any platform that has has a WebAssembly runtime. Allowing for cross platform applications, all running from a single released file.
- **Cross platform applications and games:** you could imagine where you have a single binary or executable, that is then able to be run on any platform that has a WebAssembly runtime. Allowing for cross platform applications, all running from a single released file.
- **Code re-use between platforms and use cases:** you could imagine code re-use across your application architecture between different platforms, such as a client and the server, mobile and desktop, or even IOT devices. Or if you are writing a library, writing a cross platform wrapper by implementing a thin "WASI Shell".
- **Running applications written in any Wasm/Wasi-compilable language on a single runtime:** Meaning instead of having multiple language specific runtimes, you could compile all of your different projects to the same target, and have a single runtime to run them all!
- **"Containerizing" applications and their dependencies as a single target:** Per the last point, an application, and it's depencies, all being compiled into a single (or multiple) WebAssembly files. Therefore, you could imagine no longer needing a container to wrangle all of your dependencies into a single unit, they all become WebAssembly run on a runtime. This would come with benefits such as better usabilty, and less/no container overhead. This would not be a replacement for containerization, but could be a better option for applications.
- **"Containerizing" applications and their dependencies as a single target:** Per the last point, an application, and it's dependencies, all being compiled into a single (or multiple) WebAssembly files. Therefore, you could imagine no longer needing a container to wrangle all of your dependencies into a single unit, they all become WebAssembly to run on a runtime. This would come with benefits such as better usabilty, and less/no container overhead. This would not be a replacement for containerization, but could be a better option for applications.
- **And Many More!**

It is important to note **These are high-level use-case examples, not all of these use cases can be done with the current version of WASI**, and we will be covering how WASI is still in progress and being standardized. However, now that we have a high level idea of what WASI can unlock for developers, lets start diving into the details on how this works:
Expand All @@ -29,12 +29,12 @@ I also think it'd be worth getting some key terms out of the way. This will make
- Most WebAssembly runtimes / interpreters can be used as a command line interface, or embedded/linked in a larger application by using it's library API.
- Each of these projects has their own strengths, and it really depends on what your use case is to choose the best host for you. And there are many more projects out there that you can choose from!
- **"Guests"**
- Guests are the WebAssembly modules that are executed by the host. If you plan to write WebAssembly modules, than you would be writing the guest application that is run inside the host application.
- Guests are the WebAssembly modules that are executed by the host. If you plan to write WebAssembly modules, then you would be writing the guest application that is run inside the host application.
- The host is able to provide additional functionality to guest, by doing tasks on the guests' behalf. This functionality is offered by passing functions to the importObject ([Similar to how we do this for the browser in the "Importing Javascript Functions Into Webassembly"](/example-redirect?exampleName=importing-javascript-functions-into-webassembly)).
- This brings us back to WASI, as WASI is a standardized set of APIs for hosts to do system level actions (such as filystem operations) for the guest WebAssembly module. Therefore, this allows developers to write WebAssembly modules that can access system resources!
- This brings us back to WASI, as WASI is a standardized set of APIs for hosts to do system level actions (such as filesystem operations) for the guest WebAssembly module. Therefore, this allows developers to write WebAssembly modules that can access system resources!

The last thing worth mentioning is that WASI uses a [capability based security model](https://github.com/bytecodealliance/wasmtime/blob/master/docs/WASI-capabilities.md). Meaning, the host must explicitly grant a capability to a guest module in order for the guest module to perform an action. For example in [Wasmtime](https://wasmtime.dev/), by default, the guest module cannot access any part of the host's filesystem. The user that invokes Wasmtime must pass in the `--mapdir` or `--dir` flag to grant modules the capability to access directories in the host filesystem.

At the time of this writing, a lot of WASI is still in proposals and things. Other system resources, like networking, are not yet part of the WASI standard, though they will be one day. So, if you're hoping to `bind()` to a socket in your WebAssembly module, WASI hosts don't yet expose those capabilities. Only a few features of what WASI is hoping to acheive is fully implemented and standardized. One of those features is filesystem access!
At the time of this writing, a lot of WASI is still in proposals and things. Other system resources, like networking, are not yet part of the WASI standard, though they will be one day. So, if you're hoping to `bind()` to a socket in your WebAssembly module, WASI hosts don't yet expose those capabilities. Only a few features of what WASI is hoping to acheive are fully implemented and standardized. One of those features is filesystem access!

Therefore, let's take a look at modifying the file system in the [WASI hello world example](/example-redirect?exampleName=wasi-hello-world), if there is a hello world currently for your language. If not, feel free to look at your language documentation, to see if they support WASI currently, and submit the [WASI hello world example for your language](https://github.com/torch2424/wasm-by-example).