Paul Krill
Editor at Large

Spin 2.0 shines on Wasm component composition, portability

news
Nov 9, 20232 mins

Framework for building and running server-side WebAssembly applications allows you to compose apps from Wasm components written in different programming languages.

shutterstock 288379226 time-lapsed photo of spinning carousel at night
Credit: Michal Moravec / Shutterstock

Spin 2.0, an upgrade to Fermyon’s framework for building WebAssembly (Wasm) applications for the cloud, has arrived, enabling Wasm component composition and laying a foundation for portability across runtimes and implementations.

Introduced November 2 and accessible from GitHub, Spin 2.0 is intended to improve both the developer experience and runtime performance. Featured is an updated spin.toml manifest that focuses on simplicity and on resources a component is allowed to access, such as a Redis database. When writing applications, developers can interact with built-in persistence, configuration, or data services from within Wasm components or communicate with external systems.

Spin 2.0 leverages the WebAssembly Component Model and the upcoming WASI Preview 2 (WebAssembly System Interface) in production environments. The component model introduces a way to bring efficient high-level interfaces to content running in Wasm, regardless of the programming language used to create the content, and the ability to compose new components that use these interfaces. Rust, JavaScript, TypeScript, and Python can be used to build components that run inside Spin applications, and these components can interact with each other.

Spin 2.0 also offers significantly improved performance compared to Spin 1.0, which was introduced in March 2022, due in large part to the Wasmtime pooling memory allocator. Spin enables the development of event-driven microservices, serverless-style APIs, websites, full-stack, and AI-capable applications as Wasm components.

These applications are orders of magnitude smaller than container images, portable across OSes and CPU architectures, offer incredibly low startup latency, and can run tens of thousands of requests per second, Fermyon said. And they can run anywhere, the company added, ranging from tiny devices to Docker Desktop, Kubernetes, Nomad, and Fermyon Cloud.

Wasm is a binary instruction format and virtual machine that serves as a compilation target for C/C++, C#, Rust, and other programming languages, offering both choice of languages for building web apps and near-native application performance. Fermyon said Wasm is making its way into more parts of modern computing, from browser applications to server-based apps, plugin systems, IoT scenarios, and more.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author