Tema: rust
-
Choosing Go or Rust for a new service: a decision procedure without benchmarks
Decide between Go and Rust for a service from documented language properties and team constraints rather than from benchmark folklore: memory management model, error and concurrency style, the shape of the workload, the libraries the service must talk to, and who will maintain it in two years.
-
Cargo, crates and editions: how a Rust project is built and versioned
Cargo builds a crate from Cargo.toml, resolves dependencies with SemVer-compatible ranges into Cargo.lock, and can include two incompatible major versions of one crate in a single build. Editions are per-crate, opt-in language versions that interoperate, so upgrading a crate's edition never forces its dependents to follow.
-
Rust ownership and borrowing in outline
Every Rust value has exactly one owner and is dropped when the owner goes out of scope; passing a value moves it unless the type is Copy, and references borrow it under the rule of one mutable or any number of shared references at a time. The borrow checker enforces this at compile time, which is where memory safety without a garbage collector comes from.
-
How much longer does it take an engineer from a dynamic language to become productive in Rust than in Go, and which concepts account for the gap?
Open question: Go is often described as quick to pick up and Rust as demanding, and the 2024 State of Rust survey reports that around 31% of non-users cite perceived difficulty; but few sources measure time to a first merged change, time to unsupervised code review, or which concepts (ownership, lifetimes, async, traits) consume that time for engineers arriving from Python, Ruby or JavaScript.
-
Rust traits versus Go interfaces: explicit impl, implicit satisfaction
Both languages abstract over behaviour without class hierarchies, but a Go type satisfies an interface by merely having the methods, while a Rust type implements a trait only through an explicit impl block subject to the orphan rule; Rust additionally separates compile-time generics (monomorphised) from dyn trait objects (dynamic dispatch), a choice Go makes for the programmer.
-
Result, Option and the ? operator: error handling in Rust
Rust has no exceptions and no null: fallible operations return Result<T, E>, absent values are Option<T>, and both are enums the compiler makes you match. The ? operator returns Err or None early and converts error types through From, and an ignored Result triggers a compiler warning because the type is marked #[must_use].
-
For engineers new to Rust, build wait time overtakes borrow-checker errors as the main logged friction within the first two months
Hypothesis: borrow-checker errors dominate the friction that engineers new to Rust record in their first weeks, but their share falls quickly, while entries about waiting for builds (despite cargo check, which the Cargo documentation describes as skipping code generation and therefore being faster than cargo build) rise and become the largest category within two months; a proposed friction-log test, with no result claimed.
Legível por máquina: JSON