Draft:Interface definition language for WebAssembly components

  • Comment: References appear to be a collection of companies promoting themselves and unreliable blogs. Devonian Wombat (talk) 05:46, 20 May 2026 (UTC)


WIT (WebAssembly Interface Type, sometimes expanded as Wasm Interface Type, file extension: .wit) is an interface description language (IDL) used to define the interfaces of WebAssembly components.[1] Developed under the W3C WebAssembly Community Group as part of the Component Model proposal, WIT provides a language-agnostic way for WebAssembly modules written in different programming languages to describe the functions and data types they import and export, enabling cross-language interoperability without requiring a shared runtime or foreign function interface.[2]

WIT is the standard IDL for WebAssembly System Interface (WASI) since the release of WASI 0.2 in January 2024,[3] and is used by runtimes and platforms including Wasmtime, Fastly Compute, Fermyon Spin, and wasmCloud.[4]

History

The concept of interface types for WebAssembly was first publicly proposed in August 2019 by Lin Clark of Mozilla, who described a mechanism to let WebAssembly modules exchange high-level values such as strings and records without manual memory-management glue code.[5] The early work resulted in a formal WebAssembly "interface-types" proposal housed in the W3C WebAssembly Community Group.[6]

An earlier IDL called WITX, based on the WebAssembly text format, was used to define the APIs of WASI Preview 1 (also known as WASIp1).[7] As work on the broader Component Model advanced — championed by Luke Wagner, a Distinguished Engineer at Fastly and co-chair of the W3C WebAssembly Working Group — the interface-types proposal evolved into the WIT format that is in use today.[8] WIT replaced WITX with a richer type system, support for modular interface packages, and the ability to describe both imports and exports of a component in a single definition.[9]

On 25 January 2024, the WASI Subgroup of the W3C WebAssembly Community Group voted to release WASI 0.2 (WASIp2), which formally adopted the Component Model and made WIT the standard way to define all WASI interfaces going forward.[3]

Design

Core concepts

A WIT definition is organized around two main constructs: interfaces and worlds.[1]

An interface is a named collection of type definitions and function signatures that describes a focused piece of functionality—for example, reading from a file system or making an HTTP request. Interfaces are grouped into packages, which carry a two-level namespace (a namespace field identifying the organization or registry, and a package field naming the logical group).[10]

A world aggregates a set of imported and exported interfaces and types, expressing what features a component offers and what features it depends on. Worlds serve as the compilation target: a component author selects a world, and the component's binary must satisfy all of its imports and exports.[1]

Type system

WIT supports primitive types (booleans, integers of various widths, floating-point numbers, characters, and strings) as well as compound types including records, variants (tagged unions), enums, flags (bitfield sets), tuples, lists, options, and results.[11] The type system is designed so that every WIT type can be mechanically lowered to the Canonical ABI, the binary calling convention that components use at the boundary.[12]

Language-agnostic bindings

Because WIT definitions are independent of any source language, toolchains can generate idiomatic bindings automatically. For example, the wit-bindgen project produces Rust, C, C++, Go, and C# bindings from a .wit file, while Jco targets JavaScript and TypeScript.[13] This allows a component written in one language to be consumed by a host or another component written in a different language without hand-written FFI code.[14]

Adoption

WIT is integral to the server-side and edge-computing WebAssembly ecosystem. Fermyon's Spin framework uses WIT-defined interfaces to let developers write serverless functions in any supported language and deploy them on Fermyon Cloud or self-hosted infrastructure.[15] The Cloud Native Computing Foundation (CNCF) incubation-stage project wasmCloud relies on WIT to define the capability contracts between application components and infrastructure providers; American Express has used wasmCloud to build an internal function-as-a-service platform built on WebAssembly components.[16] Microsoft has adopted WIT for WebAssembly-based extension development in Visual Studio Code.[13]

Industry analysts at InfoWorld and The New Stack have characterized the Component Model (and by extension WIT) as a potential enabler of a "Docker moment" for WebAssembly, in which portable, composable components could complement or replace containers in cloud-native deployments.[17][18]

See also

References

  1. ^ a b c "WIT Reference — The WebAssembly Component Model". Bytecode Alliance. Retrieved 2026-02-25.
  2. ^ Butcher, Matt. "What Is a WebAssembly Component? The Ultimate Guide". The New Stack. Retrieved 2026-02-25.
  3. ^ a b "WASI 0.2 Launched". Bytecode Alliance. 2024-01-25. Retrieved 2026-02-25.
  4. ^ Sheldon, Robert. "WasmCloud makes strides with Wasm component model". TechTarget. Retrieved 2026-02-25.
  5. ^ Clark, Lin (2019-08-21). "WebAssembly Interface Types: Interoperate with All the Things!". Mozilla Hacks. Mozilla. Retrieved 2026-02-25.
  6. ^ "WebAssembly/interface-types — Explainer". W3C WebAssembly Community Group. Retrieved 2026-02-25.
  7. ^ "Interfaces". WASI.dev. Retrieved 2026-02-25.
  8. ^ Wagner, Luke (2025). The WebAssembly Component Model. WAW 2025 — WebAssembly Workshop (co-located with POPL). Retrieved 2026-02-25.
  9. ^ "What's The State of WASI?". Fermyon. Retrieved 2026-02-25.
  10. ^ "Packages — The WebAssembly Component Model". Bytecode Alliance. Retrieved 2026-02-25.
  11. ^ "WIT specification". W3C WebAssembly Community Group. Retrieved 2026-02-25.
  12. ^ "The WebAssembly Component Model — The Why, How and What — Part 1". NGINX Unit Blog. F5. Retrieved 2026-02-25.
  13. ^ a b "Using WebAssembly for Extension Development". Microsoft (Visual Studio Code Blog). 2024-05-08. Retrieved 2026-02-25.
  14. ^ "WebAssembly to Let Developers Combine Languages". The New Stack. Retrieved 2026-02-25.
  15. ^ "WebAssembly, WASI, and the Component Model". Fermyon. Retrieved 2026-02-25.
  16. ^ "WebAssembly components: the next wave of cloud native computing". Cloud Native Computing Foundation. 2024-07-09. Retrieved 2026-02-25.
  17. ^ "Wasm 3.0: No Component Model and No 'Docker Moment'". The New Stack. Retrieved 2026-02-25.
  18. ^ "Building the component model for Wasm". InfoWorld. Retrieved 2026-02-25.

WebAssembly

Category:Interface description languages Category:WebAssembly Category:World Wide Web Consortium standards Category:Computer file formats

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.