webassembly system interface (wasi) changes everything.. getting started tutorial using rust & wasm

preview_player
Показать описание
in this video we look at how using WASI (web assembly system interface), we can create more powerful webassembly applications that can interact with i/o such as the console and filesystems using WASI.

we create some rust cli apps and then build their equivalent webassembly cli apps in rust. we explore how to write to the console. write to files and access command line arguments. finally we look at how we can use runtimes to excute our cli apps or create native executables, as well as thinking about webassembly/wasi use cases.

code is on github

00:00 - introduction
01:50 - creating a rust cli application with cargo new
03:20 - executing our rust cli application
03:45 - introducing WASI (Web Assembly System Interface)
04:25 - targeting our rust application for WASI
05:15 - building our wasi webassemby app
07:30 - introducing wasmtime (webassembly runtime)
07:50 - installing wasmtime
08:06 - executing our wasm with wasmtime runtime
09:07 - speeding up development with cargo wasi
10:15 - executing our wasi webassembly module with wasmer runtime
11:10 - creating a webassembly exe with wasmer
12:41 - comparing rust cli app sizes with wasmer cli apps
14:00 - webassembly and wasi use cases
15:15 - accessing command line arguments with wasi
19:20 - writing files using webassembly, wasi and rust
23:30 - filesystem sandboxes with wasi
24:30 - webassembly wasi use-cases vs native rust
26:00 - outro
Рекомендации по теме
Комментарии
Автор

Chris! You have great tutorials and content. This should be a 1.2m subscribers channel - Keep up the good work and don't become like all those programming "influencers"... I like that your content has no "noises", no "extra hyping", clear and clean voice, and no fancy ridiculous editing.

shlomohassid
Автор

These videos are incredible. Thank you for making them!! Such a rapid and pragmatic way to show these emerging developer technologies. I'm very keen on the WASI spec, sorta anticipate a time where the defacto deployment preference will be pushing WASM assemblies up to cloud providers, with the cloud providers able to trivially sandbox process IO behind WASI sys calls (and balance execution on shared hardware). Can totally see it being a slick alternative to current docker deployments. Ideally just need really optimized high level language runtimes to be running on WASM to make it practical for most devs (me specifically :P). Rust is nice, would prefer JS/TS or C#.

BinaryReader
Автор

Best explanation I’ve watched so far on this topic. Great video!

NPCsNeverGetShadowBannedOnYT
Автор

Ctrl-E to go to end of line in the terminal. Use Crl-R for history-search-backwards. Thanks for the video - I will probably use wasi myself now.

PaulEmsley
Автор

It seems like you could design an Operating System to bridge the wasi <-> hardware gap. No linux, just "drivers" to coordinate with the system interface. Not sure if there's anything to gain from this, but seems really cool!

tyty
Автор

Imagine video games mods being written in WASM instead of Lua.

karelhrkal
Автор

TS is compiled to JS now just like C++ was compiled to C at first. I think just like C++ TS will not be compiled to its older subset. I can see TS being compiled to WASM to run natively on browsers in the future.

ay-pjco
Автор

Is wasm64 not availiable yet? That means every usage of f64 wouldn't be valid?

АнатолийБугаков-ег
Автор

It would be interesting if wasi (or something similar) became the next application deployment environment. Never mind Docker, this could also replace Java as the go-to cross-platform target.

How far from a good, cross platform GUI widget library are we?

stinkytoe
Автор

I only need concurrency and http requests and I could start using this for everything.

Автор

Been a C# dev for a decade+. Been looking into C and C++ for performance reasons, and thus also been looking into Rust, which seems to be replacing C/C++ completely (since it has same/better performance, guaranteed no memory leaks and null pointers, and is even compatible with C/C++ libs.)
Now I am learning the greatness of a standardized system interface (across platforms) which WASI seems to bring. But I don't understand. Will everything be complied to Javascript as is the case for WASM?

diligencehumility
Автор

I liked the video but the music in the introduction was quite jarring, I don't think it fits your tone

gabekoleszar
Автор

Hmm, even with the sandboxing, you can still do harm to the underlying system. Imagine writing an infinitely big file. Or using up all CPU...

AlexEllwein
Автор

An application which has access to filesystem, network and IO is inheritely not safe and breaks the encapsulation. I think WASI is going contrary to the spirit of WASM.

peppybocan
Автор

Tune down that intro song, it literally blew off my phone's speaker

Mempler
join shbcf.ru