jsrosetta

Node.js → Rust

3 concepts with Rust examples.

Variables and Constants

What const and let in Node.js correspond to in Go, Rust, Swift, and Java.

  • Node.js
  • Go
  • Rust
  • Swift
  • Java

Async/Await

How Node.js's Promise and async/await compare to goroutines (Go), Future + tokio (Rust), Swift concurrency, and CompletableFuture (Java).

  • Node.js
  • Go
  • Rust
  • Swift
  • Java

Error Handling and try/catch

How Node.js's throw and try/catch/finally compare to error values in Go, Result in Rust, throws in Swift, and exceptions in Java.

  • Node.js
  • Go
  • Rust
  • Swift
  • Java