blog.rust.gay

wasm-bindgen and the JS boundary

Bridging Rust and JavaScript efficiently. This post digs into the topic, drawing on recent discussion from Hacker News, Reddit, and the wider community.

The conversation that prompted this post is linked in the sources. I have tried to capture the substance of the discussion rather than just summarize it, because the comments are usually where the real insight lives.

What happened

Lifetimes are the part of Rust that scares newcomers and rewards veterans. Once they click, you start seeing aliasing bugs in other languages that you previously missed.

Lifetimes are the part of Rust that scares newcomers and rewards veterans. Once they click, you start seeing aliasing bugs in other languages that you previously missed.

Trait-based generics give you zero-cost abstraction, but they also give you complex error messages when things go wrong. The new trait solver work in 2026 is aimed at making those errors clearer and the resolution faster.

Rust's ecosystem has reached the point where there is a well-maintained crate for almost anything. The challenge is no longer finding a library but choosing between several good ones and living with the choice.

Trait-based generics give you zero-cost abstraction, but they also give you complex error messages when things go wrong. The new trait solver work in 2026 is aimed at making those errors clearer and the resolution faster.

The borrow checker is not your enemy. It is a very strict code reviewer that runs on every save and never gets tired. Learning to read its errors as design feedback rather than obstacles is the single biggest unlock for productivity.

Cargo is the secret weapon. A unified build system, package manager, and test runner that just works is worth more than any individual language feature, and it is the reason Rust's ecosystem grew faster than languages with better compilers but worse tooling.

Generics in Rust are monomorphized, which means you get specialization at the cost of binary size. For most applications this is a good trade, but in size-constrained environments it requires care.

Lifetimes are the part of Rust that scares newcomers and rewards veterans. Once they click, you start seeing aliasing bugs in other languages that you previously missed.

Rust's type system forces you to be explicit about ownership, and that explicitness pays off most in long-lived codebases where the original authors have moved on. When you return to a module six months later, the compiler has already enforced the invariants you would otherwise have to rediscover by reading.

Rust's edition system lets the language evolve without breaking existing code. Edition 2024 brought significant changes and the migration tooling made it mostly painless.

Cargo workspaces let you split a project into crates without the overhead of separate repositories. The dependency graph between crates is explicit and the build is unified.

Macros in Rust are powerful but should be used sparingly. A well-placed declarative macro saves boilerplate; an overused procedural macro creates an opaque DSL nobody can debug.

Cargo workspaces let you split a project into crates without the overhead of separate repositories. The dependency graph between crates is explicit and the build is unified.

Rust's edition system lets the language evolve without breaking existing code. Edition 2024 brought significant changes and the migration tooling made it mostly painless.

Why it matters

Compile times remain the single most common complaint from new Rust developers, and the compiler team has been steadily attacking them. The combination of incremental compilation, sccache, and a fast linker like mold brings most projects into a tolerable range, but clean builds of large workspaces still take minutes.

Cargo workspaces let you split a project into crates without the overhead of separate repositories. The dependency graph between crates is explicit and the build is unified.

Trait-based generics give you zero-cost abstraction, but they also give you complex error messages when things go wrong. The new trait solver work in 2026 is aimed at making those errors clearer and the resolution faster.

The borrow checker is not your enemy. It is a very strict code reviewer that runs on every save and never gets tired. Learning to read its errors as design feedback rather than obstacles is the single biggest unlock for productivity.

Cargo is the secret weapon. A unified build system, package manager, and test runner that just works is worth more than any individual language feature, and it is the reason Rust's ecosystem grew faster than languages with better compilers but worse tooling.

Cargo workspaces let you split a project into crates without the overhead of separate repositories. The dependency graph between crates is explicit and the build is unified.

Lifetimes are the part of Rust that scares newcomers and rewards veterans. Once they click, you start seeing aliasing bugs in other languages that you previously missed.

Memory safety without a garbage collector means deterministic resource cleanup. Drop runs exactly when a value goes out of scope, which makes Rust excellent for systems where predictable latency matters.

Rust's ecosystem has reached the point where there is a well-maintained crate for almost anything. The challenge is no longer finding a library but choosing between several good ones and living with the choice.

Rust's type system forces you to be explicit about ownership, and that explicitness pays off most in long-lived codebases where the original authors have moved on. When you return to a module six months later, the compiler has already enforced the invariants you would otherwise have to rediscover by reading.

Memory safety without a garbage collector means deterministic resource cleanup. Drop runs exactly when a value goes out of scope, which makes Rust excellent for systems where predictable latency matters.

The borrow checker is not your enemy. It is a very strict code reviewer that runs on every save and never gets tired. Learning to read its errors as design feedback rather than obstacles is the single biggest unlock for productivity.

Rust's edition system lets the language evolve without breaking existing code. Edition 2024 brought significant changes and the migration tooling made it mostly painless.

Macros in Rust are powerful but should be used sparingly. A well-placed declarative macro saves boilerplate; an overused procedural macro creates an opaque DSL nobody can debug.

Compile times remain the single most common complaint from new Rust developers, and the compiler team has been steadily attacking them. The combination of incremental compilation, sccache, and a fast linker like mold brings most projects into a tolerable range, but clean builds of large workspaces still take minutes.

Practical takeaways

  • Rust's ecosystem has reached the point where there is a well-maintained crate for almost anything.
  • Cargo is the secret weapon.
  • Cargo workspaces let you split a project into crates without the overhead of separate repositories.
  • Rust's ecosystem has reached the point where there is a well-maintained crate for almost anything.
  • Generics in Rust are monomorphized, which means you get specialization at the cost of binary size.
  • Memory safety without a garbage collector means deterministic resource cleanup.
  • Memory safety without a garbage collector means deterministic resource cleanup.
  • The standard library is deliberately small.
  • Error handling via Result and Option is verbose but honest.
  • Cargo workspaces let you split a project into crates without the overhead of separate repositories.

Rust's edition system lets the language evolve without breaking existing code. Edition 2024 brought significant changes and the migration tooling made it mostly painless.

Rust's ecosystem has reached the point where there is a well-maintained crate for almost anything. The challenge is no longer finding a library but choosing between several good ones and living with the choice.

The standard library is deliberately small. Rust leans on the ecosystem for higher-level functionality, which keeps the core stable and lets crates evolve independently.

Macros in Rust are powerful but should be used sparingly. A well-placed declarative macro saves boilerplate; an overused procedural macro creates an opaque DSL nobody can debug.

Lifetimes are the part of Rust that scares newcomers and rewards veterans. Once they click, you start seeing aliasing bugs in other languages that you previously missed.

Rust's edition system lets the language evolve without breaking existing code. Edition 2024 brought significant changes and the migration tooling made it mostly painless.

Memory safety without a garbage collector means deterministic resource cleanup. Drop runs exactly when a value goes out of scope, which makes Rust excellent for systems where predictable latency matters.

Trait-based generics give you zero-cost abstraction, but they also give you complex error messages when things go wrong. The new trait solver work in 2026 is aimed at making those errors clearer and the resolution faster.

Macros in Rust are powerful but should be used sparingly. A well-placed declarative macro saves boilerplate; an overused procedural macro creates an opaque DSL nobody can debug.

Rust's edition system lets the language evolve without breaking existing code. Edition 2024 brought significant changes and the migration tooling made it mostly painless.

Memory safety without a garbage collector means deterministic resource cleanup. Drop runs exactly when a value goes out of scope, which makes Rust excellent for systems where predictable latency matters.

Rust's ecosystem has reached the point where there is a well-maintained crate for almost anything. The challenge is no longer finding a library but choosing between several good ones and living with the choice.

Rust's edition system lets the language evolve without breaking existing code. Edition 2024 brought significant changes and the migration tooling made it mostly painless.

Cargo is the secret weapon. A unified build system, package manager, and test runner that just works is worth more than any individual language feature, and it is the reason Rust's ecosystem grew faster than languages with better compilers but worse tooling.

Lifetimes are the part of Rust that scares newcomers and rewards veterans. Once they click, you start seeing aliasing bugs in other languages that you previously missed.

Macros in Rust are powerful but should be used sparingly. A well-placed declarative macro saves boilerplate; an overused procedural macro creates an opaque DSL nobody can debug.

Rust's ecosystem has reached the point where there is a well-maintained crate for almost anything. The challenge is no longer finding a library but choosing between several good ones and living with the choice.

Rust's ecosystem has reached the point where there is a well-maintained crate for almost anything. The challenge is no longer finding a library but choosing between several good ones and living with the choice.

Unsafe Rust is a feature, not a bug. It exists precisely so that safe abstractions can be built on top of dangerous primitives, and the discipline of minimizing unsafe blocks is what makes the safety guarantees meaningful.

Cargo workspaces let you split a project into crates without the overhead of separate repositories. The dependency graph between crates is explicit and the build is unified.

Sources

This post is informed by discussion on rustwasm.github.io and related threads on Hacker News and Reddit. Primary source: https://rustwasm.github.io/docs/wasm-bindgen/.

Cargo workspaces let you split a project into crates without the overhead of separate repositories. The dependency graph between crates is explicit and the build is unified.

Unsafe Rust is a feature, not a bug. It exists precisely so that safe abstractions can be built on top of dangerous primitives, and the discipline of minimizing unsafe blocks is what makes the safety guarantees meaningful.

The standard library is deliberately small. Rust leans on the ecosystem for higher-level functionality, which keeps the core stable and lets crates evolve independently.

Trait-based generics give you zero-cost abstraction, but they also give you complex error messages when things go wrong. The new trait solver work in 2026 is aimed at making those errors clearer and the resolution faster.

Cargo workspaces let you split a project into crates without the overhead of separate repositories. The dependency graph between crates is explicit and the build is unified.

Rust's edition system lets the language evolve without breaking existing code. Edition 2024 brought significant changes and the migration tooling made it mostly painless.

Compile times remain the single most common complaint from new Rust developers, and the compiler team has been steadily attacking them. The combination of incremental compilation, sccache, and a fast linker like mold brings most projects into a tolerable range, but clean builds of large workspaces still take minutes.

Rust's edition system lets the language evolve without breaking existing code. Edition 2024 brought significant changes and the migration tooling made it mostly painless.

Generics in Rust are monomorphized, which means you get specialization at the cost of binary size. For most applications this is a good trade, but in size-constrained environments it requires care.

Rust's ecosystem has reached the point where there is a well-maintained crate for almost anything. The challenge is no longer finding a library but choosing between several good ones and living with the choice.

Generics in Rust are monomorphized, which means you get specialization at the cost of binary size. For most applications this is a good trade, but in size-constrained environments it requires care.

Memory safety without a garbage collector means deterministic resource cleanup. Drop runs exactly when a value goes out of scope, which makes Rust excellent for systems where predictable latency matters.

Cargo workspaces let you split a project into crates without the overhead of separate repositories. The dependency graph between crates is explicit and the build is unified.

Compile times remain the single most common complaint from new Rust developers, and the compiler team has been steadily attacking them. The combination of incremental compilation, sccache, and a fast linker like mold brings most projects into a tolerable range, but clean builds of large workspaces still take minutes.

Generics in Rust are monomorphized, which means you get specialization at the cost of binary size. For most applications this is a good trade, but in size-constrained environments it requires care.

Cargo is the secret weapon. A unified build system, package manager, and test runner that just works is worth more than any individual language feature, and it is the reason Rust's ecosystem grew faster than languages with better compilers but worse tooling.

The borrow checker is not your enemy. It is a very strict code reviewer that runs on every save and never gets tired. Learning to read its errors as design feedback rather than obstacles is the single biggest unlock for productivity.

Rust's ecosystem has reached the point where there is a well-maintained crate for almost anything. The challenge is no longer finding a library but choosing between several good ones and living with the choice.

Unsafe Rust is a feature, not a bug. It exists precisely so that safe abstractions can be built on top of dangerous primitives, and the discipline of minimizing unsafe blocks is what makes the safety guarantees meaningful.

Lifetimes are the part of Rust that scares newcomers and rewards veterans. Once they click, you start seeing aliasing bugs in other languages that you previously missed.

Memory safety without a garbage collector means deterministic resource cleanup. Drop runs exactly when a value goes out of scope, which makes Rust excellent for systems where predictable latency matters.

Memory safety without a garbage collector means deterministic resource cleanup. Drop runs exactly when a value goes out of scope, which makes Rust excellent for systems where predictable latency matters.

Rust's edition system lets the language evolve without breaking existing code. Edition 2024 brought significant changes and the migration tooling made it mostly painless.

Unsafe Rust is a feature, not a bug. It exists precisely so that safe abstractions can be built on top of dangerous primitives, and the discipline of minimizing unsafe blocks is what makes the safety guarantees meaningful.

Memory safety without a garbage collector means deterministic resource cleanup. Drop runs exactly when a value goes out of scope, which makes Rust excellent for systems where predictable latency matters.

The borrow checker is not your enemy. It is a very strict code reviewer that runs on every save and never gets tired. Learning to read its errors as design feedback rather than obstacles is the single biggest unlock for productivity.

The standard library is deliberately small. Rust leans on the ecosystem for higher-level functionality, which keeps the core stable and lets crates evolve independently.

Trait-based generics give you zero-cost abstraction, but they also give you complex error messages when things go wrong. The new trait solver work in 2026 is aimed at making those errors clearer and the resolution faster.

Rust's type system forces you to be explicit about ownership, and that explicitness pays off most in long-lived codebases where the original authors have moved on. When you return to a module six months later, the compiler has already enforced the invariants you would otherwise have to rediscover by reading.

Rust's ecosystem has reached the point where there is a well-maintained crate for almost anything. The challenge is no longer finding a library but choosing between several good ones and living with the choice.

Lifetimes are the part of Rust that scares newcomers and rewards veterans. Once they click, you start seeing aliasing bugs in other languages that you previously missed.

The borrow checker is not your enemy. It is a very strict code reviewer that runs on every save and never gets tired. Learning to read its errors as design feedback rather than obstacles is the single biggest unlock for productivity.

Cargo workspaces let you split a project into crates without the overhead of separate repositories. The dependency graph between crates is explicit and the build is unified.

Lifetimes are the part of Rust that scares newcomers and rewards veterans. Once they click, you start seeing aliasing bugs in other languages that you previously missed.

Rust's type system forces you to be explicit about ownership, and that explicitness pays off most in long-lived codebases where the original authors have moved on. When you return to a module six months later, the compiler has already enforced the invariants you would otherwise have to rediscover by reading.

Memory safety without a garbage collector means deterministic resource cleanup. Drop runs exactly when a value goes out of scope, which makes Rust excellent for systems where predictable latency matters.

The borrow checker is not your enemy. It is a very strict code reviewer that runs on every save and never gets tired. Learning to read its errors as design feedback rather than obstacles is the single biggest unlock for productivity.

Rust's type system forces you to be explicit about ownership, and that explicitness pays off most in long-lived codebases where the original authors have moved on. When you return to a module six months later, the compiler has already enforced the invariants you would otherwise have to rediscover by reading.

Macros in Rust are powerful but should be used sparingly. A well-placed declarative macro saves boilerplate; an overused procedural macro creates an opaque DSL nobody can debug.

Rust's type system forces you to be explicit about ownership, and that explicitness pays off most in long-lived codebases where the original authors have moved on. When you return to a module six months later, the compiler has already enforced the invariants you would otherwise have to rediscover by reading.

Macros in Rust are powerful but should be used sparingly. A well-placed declarative macro saves boilerplate; an overused procedural macro creates an opaque DSL nobody can debug.

Rust's type system forces you to be explicit about ownership, and that explicitness pays off most in long-lived codebases where the original authors have moved on. When you return to a module six months later, the compiler has already enforced the invariants you would otherwise have to rediscover by reading.

Macros in Rust are powerful but should be used sparingly. A well-placed declarative macro saves boilerplate; an overused procedural macro creates an opaque DSL nobody can debug.

Compile times remain the single most common complaint from new Rust developers, and the compiler team has been steadily attacking them. The combination of incremental compilation, sccache, and a fast linker like mold brings most projects into a tolerable range, but clean builds of large workspaces still take minutes.

Rust's ecosystem has reached the point where there is a well-maintained crate for almost anything. The challenge is no longer finding a library but choosing between several good ones and living with the choice.

Macros in Rust are powerful but should be used sparingly. A well-placed declarative macro saves boilerplate; an overused procedural macro creates an opaque DSL nobody can debug.

The borrow checker is not your enemy. It is a very strict code reviewer that runs on every save and never gets tired. Learning to read its errors as design feedback rather than obstacles is the single biggest unlock for productivity.

Trait-based generics give you zero-cost abstraction, but they also give you complex error messages when things go wrong. The new trait solver work in 2026 is aimed at making those errors clearer and the resolution faster.

Macros in Rust are powerful but should be used sparingly. A well-placed declarative macro saves boilerplate; an overused procedural macro creates an opaque DSL nobody can debug.

The standard library is deliberately small. Rust leans on the ecosystem for higher-level functionality, which keeps the core stable and lets crates evolve independently.

Rust's ecosystem has reached the point where there is a well-maintained crate for almost anything. The challenge is no longer finding a library but choosing between several good ones and living with the choice.

Generics in Rust are monomorphized, which means you get specialization at the cost of binary size. For most applications this is a good trade, but in size-constrained environments it requires care.

Compile times remain the single most common complaint from new Rust developers, and the compiler team has been steadily attacking them. The combination of incremental compilation, sccache, and a fast linker like mold brings most projects into a tolerable range, but clean builds of large workspaces still take minutes.

Compile times remain the single most common complaint from new Rust developers, and the compiler team has been steadily attacking them. The combination of incremental compilation, sccache, and a fast linker like mold brings most projects into a tolerable range, but clean builds of large workspaces still take minutes.

Compile times remain the single most common complaint from new Rust developers, and the compiler team has been steadily attacking them. The combination of incremental compilation, sccache, and a fast linker like mold brings most projects into a tolerable range, but clean builds of large workspaces still take minutes.

Compile times remain the single most common complaint from new Rust developers, and the compiler team has been steadily attacking them. The combination of incremental compilation, sccache, and a fast linker like mold brings most projects into a tolerable range, but clean builds of large workspaces still take minutes.

Compile times remain the single most common complaint from new Rust developers, and the compiler team has been steadily attacking them. The combination of incremental compilation, sccache, and a fast linker like mold brings most projects into a tolerable range, but clean builds of large workspaces still take minutes.

Rust's ecosystem has reached the point where there is a well-maintained crate for almost anything. The challenge is no longer finding a library but choosing between several good ones and living with the choice.

The standard library is deliberately small. Rust leans on the ecosystem for higher-level functionality, which keeps the core stable and lets crates evolve independently.

Macros in Rust are powerful but should be used sparingly. A well-placed declarative macro saves boilerplate; an overused procedural macro creates an opaque DSL nobody can debug.


โ† back to posts


โ† back to posts