Brifing

GC and Exception Support in Wasmtime

New features and performance improvements for WebAssembly.

Hacker News1 min

1New Features with Wasmtime 47

With the release of Wasmtime 47, the GC and exception proposals for WebAssembly are enabled by default. This makes it easier to bring more languages to WebAssembly and everywhere Wasmtime runs.

2GC Proposal and Benefits

The Wasm GC proposal provides efficient support for high-level languages in WebAssembly. It eliminates the need to embed their own garbage collectors, offering smaller .wasm files and faster runtime.

3Exception Proposal and Advantages

The Wasm exception proposal provides efficient support for exception-using languages in WebAssembly. It removes the need to implement custom calling conventions, offering faster runtime and smaller .wasm files.

4Wasmtime's GC Implementation

Wasmtime uses a Cheney-style semi-space copying collector. This divides the GC heap into two semi-spaces and copies live objects from one space to the other. This method works quickly and securely.

5Performance and Security

Wasmtime's GC implementation fulfills WebAssembly's promise of being fast, safe, and portable. Reusing linear memories for the GC heap provides significant advantages in terms of performance and security.

6Testing and Validation

Wasmtime extended its fuzzing infrastructure to ensure the correctness of the GC proposal. This tests interesting and arbitrary object graphs and detects heap corruptions to ensure GC works correctly.

7Future Work

The Wasmtime team has focused on the correctness of GC so far and less on its performance. In the future, performance engineering work is expected to further optimize GC.

Original article: Hacker News — Wasmtime'da GC ve İstisna Desteği