Rust is a systems programming language known for its performance, safety, and concurrency features. WebAssembly (WASM) is a binary instruction format designed to run in web browsers, alongside JavaScript, enabling high-performance applications on the web.
-
Compilation to WebAssembly: Rust code can be compiled to WebAssembly using tools like
wasm-packor directly withrustc. This process produces a.wasmfile containing the binary instructions that can run in the browser. -
WebAssembly Modules: These
.wasmfiles are modular and self-contained units of code that can be loaded and executed by web browsers. They provide a compact and efficient representation of Rust functions, suitable for web delivery. -
JavaScript Interoperability: Rust code can interact with JavaScript through a well-defined interface. This allows Rust functions to be called from JavaScript and vice versa, enabling seamless communication between the two languages.
-
Performance Benefits: By leveraging Rust's performance optimizations and compiling to WebAssembly, web applications can achieve near-native speeds for computationally intensive tasks. This makes Rust and WebAssembly a compelling choice for games, multimedia applications, simulations, and more.
WebRTC (Web Real-Time Communication) is a free, open-source project that provides web browsers and mobile applications with real-time communication capabilities via simple application programming interfaces (APIs). Here are some key terminologies:
Signaling is the process of coordinating communication between peers. This includes the exchange of session control messages such as offers, answers, and ICE candidates.
ICE is a framework used in WebRTC to establish a connection between two peers. It helps in finding the best path for media traffic and dealing with firewalls and NATs.
SDP is a format for describing streaming media initialization parameters. In WebRTC, SDP is used to negotiate media capabilities and connection settings between peers.
STUN is a protocol used to discover the public IP address of a peer and determine the presence of NATs or firewalls. It helps in establishing direct peer-to-peer connections.
TURN is a protocol used when direct peer-to-peer communication fails due to firewalls or NATs. It relays media streams through a third-party server to establish connectivity.
NAT is a technique used to modify network address information in IP packet headers while in transit. It allows multiple devices in a local network to share a single public IP address.
MediaStream represents a stream of media data, such as audio or video. It is used in WebRTC to handle local audio and video streams from the user's device.
PeerConnection is the main object in the WebRTC API. It represents a connection between local and remote peers and handles sending and receiving audio, video, and data streams.
DataChannel is a bidirectional communication channel between peers. It allows the exchange of arbitrary data, such as text or binary messages, in a peer-to-peer fashion.
Constraints are used to specify requirements for media streams and connections, such as video resolution, audio sample rate, or bandwidth limitations.
Codec (Coder-Decoder) is a software component that converts audio and video data into a compressed format for transmission and then decodes it back into its original form.
This list provides an overview of some common WebRTC terminologies. For more in-depth information, refer to the official WebRTC documentation and specifications.
- Official Rust and WebAssembly Book
- wasm-pack: Tool for building, testing, and publishing Rust-generated WebAssembly
- rustwasm GitHub Organization: Community-driven organization for Rust and WebAssembly projects