backgroundradial

Announcing WASIX

WASIX extends the WASI proposal to build useful and productive applications today with full POSIX compatibility

syrusakbary avatar
syrusakbary
Syrus Akbary

Founder & CEO

engineering

May 30, 2023

arrowBack to articles
Post cover image

Today we are very excited to launch a new initiative that will start shaping the future of WebAssembly on both the browser and the server.

WASI was announced about 4 years ago and was a great push to move the Wasm community forward. It got everyone so excited that even Solomon, the founder of Docker tweeted about it:

Note: Solomon Hykes is also an investor in Wasmer

The ambition of WASI is a great one and we continue to support it, but it's slow iteration pace it's holding back the progress on making Wasm widely adopted.

🥁 Drumroll

The Wasmer team and key community members have been working relentlessly to enhance the existing WASI ABI, stabilizing it and making it more compatible with POSIX programs.

Today, we are incredibly excited to launch WASIX!

WASIX is ready today for the community to build awesome apps and complete their runtimes: supporting threads, Berkeley sockets, forking and many more things that have been available for almost all the life of POSIX.

We believe this step will pave the way by making it easier to compile any apps into Wasm, to run them anywhere. And here’s the proof: curl fully running on WASIX! 🚀

# Run curl compiled to WASIX with Wasmer!
$ wasmer run --net curl/curl -- http://neverssl.com

<html>
	<head>
		<title>NeverSSL - Connecting ... </title>
		<style>
[...]

Note: You will need Wasmer 4.0.0-alpha.1 to run it

But not only curl... we also got bash, CPython, tokio, hyper, axum, static-web-server and many more apps and libraries running on WASIX. Even this very own website runs on WASIX!

Did you get as excited reading this as we did working on it? Continue reading to learn more about WASIX and how you can use it!

So, what exactly is WASIX?

WASIX is the long term stabilization and support of the existing WASI ABI plus additional non-invasive syscall extensions that complete the missing gaps sufficiently enough to enable real, practical and useful applications to be compiled and used now. It aims to speed up the ecosystem around WASI so that the Wasm’ification of code bases around the world can really start today! And it does so without any breaking changes to wasi_preview1.

WASIX:

  • It’s a toolchain:
    • Rust
    • C (upcoming support for Zig!)
    • AssemblyScript (expect upstream support soon!)
  • It's a specification: https://wasix.org/docs/api-reference
  • Runtime support: starting with Wasmer, but we expect more runtimes joining the initiative soon!
  • Is fully runnable in browsers

What extension features will you get with WASIX?

  • full support for efficient multithreading
  • full support for sockets (socket, bind, connect)
    • IPv4, IPv6
    • UDP, TCP
    • Multicast, Anycast
    • RAW sockets
  • changing the current directory (chdir)
  • setjmp / longjmp support (used extensively in libc ) via asyncify wizardy
  • pthreads support
  • process forking (fork and vfork )
  • subprocess spawning and waiting (exec , wait )
  • TTY support
  • asynchronous polling of sockets and files
  • pipe and event support (pipe, event )
  • DNS resolution support (resolve )

Running seamlessly in the browser or server

WASIX programs can run anywhere: in the browser or the server.

As an example, we have created wasmer-web , which basically showcases that any WASIX program published to Wasmer (including those with threads and forking!) works also with Wasmer running on the browser.

Too good to be true?

Try it yourself online and let us know your thoughts!

https://wasmer.sh/

Wasmer.sh

Wasmer.sh runs bash compiled to Wasm/WASIX and pipes the stdin/stdout to xterm.js. When you run wasmer run syrusakbary/python a new subprocess is created/forked.


So, how can you start using WASIX?

Please note that this is a preview release of the WASIX toolchains. Building code isn't trivial yet, and there are some implementation kinks to iron out. But we'll be working hard to make WASIX as reliable and easy to use as any other build target!

Rust

Compiling to Wasm/WASIX from Rust is simple. You can use tokio, mio (with full sockets support), …and anything you want!

Just use the WASIX toolchain!

$ cargo install cargo-wasix
# In a directory with a Cargo.toml:
$ cargo wasix build

Note: support for some libraries is not added upstream yet, so you may need to use a patched version.

Rust Demos

Sample Rust applications that you can compile to Wasm with WASIX:

See more examples here: https://wasix.org/docs/language-guide/rust/examples

C/C++

We are working on a toolchain for C that will make it a breeze to compile your C applications to WASIX.

Meanwhile, you can use wasix-libc to compile your C/C++ programs to WASIX.

https://github.com/wasix-org/wasix-libc

Here are some C applications that we compiled to WASIX:

See more examples here: https://wasix.org/docs/language-guide/c/examples


Better together

WASIX was started by just Wasmer, but we don't want it to stay that way!

We welcome all interested parties to help us evolve and improve the specification, and are hopeful that other runtimes will add support soon.

Check out the Community and Governance docs, and join the WASIX Discord to get in touch.

In summary...

We got curl, cpython, bash, tokio, axum, and many more programs with minimal-to-no-modifications compiling to Wasm/WASIX.

WASIX is here to allow any developer to target WebAssembly with their already existing applications without requiring any code modification, at all...

Please check wasix.org to learn more about WASIX

Stay tuned for more updates… incredible exciting stuff is on the horizon!

About the Author

Syrus Akbary is an enterpreneur and programmer. Specifically known for his contributions to the field of WebAssembly. He is the Founder and CEO of Wasmer, an innovative company that focuses on creating developer tools and infrastructure for running Wasm

Syrus Akbary avatar
Syrus Akbary
Syrus Akbary

Founder & CEO

Read more
Post cover image

wasixengineeringepollruntime

Boosting Performance: Integration of epoll syscall in WASIX

RudraAugust 8, 2023

engineeringdesignproduct

Welcome to the new Wasmer! 👋

Syrus AkbaryJune 6, 2023

engineeringecosystemreview

WebAssembly Core 2 - Reporting From the Town Square

Syrus AkbaryMay 11, 2022

engineeringruntime

Announcing Wasmer 3.0

Syrus AkbaryNovember 23, 2022