Skip to content

Latest commit

 

History

History
74 lines (51 loc) · 5.16 KB

second-wind.md

File metadata and controls

74 lines (51 loc) · 5.16 KB

π pi-day-2024-with-py

Second Wind ...

Around June of 2024, long after pi day, I decided to check in to see what had changed in the Web Assembly ecosystem. Wow!

Some things were predictable.

WASM I/O 2024

But, then we learned more at WASM I/O 2024:

CNCF - Cloud Native Wasm Day EU 2024

What Now?

With over 30 sessions published, what should I focus on next?

I am not really interested in ...

  • server-side compute usage of wasm yet - perhaps next time
  • registry usage - they need to mature
  • composition - yet - the componmemt model spec is intriguing, but too green

I did do a quick experiment with py2wasm on pi_digits.py and will complete it with some rough perf measurement. Initial test shows 10_000 digits of pi generated in ~1.6 secs. pi_digits.wasm is about 26MB. Interesting. But more work is needed.

As more runners adopt WASI 0.2 (threads, network, etc.) support, I would like to build something more real world. We will see.

For example, wasmer has support for a lot of extensions, but I do not believe they are implementing WASI 0.2/0.3; but rather their own WASIX extension set.

Also, I want to spend some more time with assemblyscript.

Runners I am Watching

Runner Comments
wasmtime The Byte Code Alliance runner written in Rust; uses the Cranelift code generator
wasmer Written in Rust; no spec version mentioned but says implements WASIX, WASI and emscripten; supports the Single Pass, Cranelift and LLVM pluggable compilers
wazero This is the runner of choice for most of the golang community. The main branch indicates support for WASM Core V1 and V2 specs; WASI preview 1

Code Generators or Compilers

The different runners use different terminology to describe how wasm generation occurs.

Wasmtime uses the term code generator. And suggests it is currently implemented using the Cranelift code generator.

Wasmer uses the terms native backend in some places; and compiler in others. Wasmer documents their pluggable compilers as follows.

Pluggable compilers — A compiler is used by the engine to transform WebAssembly into executable code:

  • wasmer-compiler-singlepass provides a fast compilation-time but an unoptimized runtime speed,
  • wasmer-compiler-cranelift provides the right balance between compilation-time and runtime performance, useful for development,
  • wasmer-compiler-llvm provides a deeply optimized executable code with the fastest runtime speed, ideal for production.

Wazero supports a wasm interpreter as well as AOT compilation via its so-called zero dependency optimizing compiler.

References