Building Type-Safe APIs with Nuxt 3 and Prisma
Learn how to build end-to-end type-safe APIs using Nuxt 3 server routes and Prisma ORM for a seamless developer experience.
A gentle introduction to Rust's key concepts through the lens of JavaScript familiarity — ownership, borrowing, and why they matter.
Mbeah Essilfie
July 5, 2026 at 06:03 AM
As a JavaScript developer, you might wonder why you'd learn a systems language. Here's why:
In JavaScript, let allows reassignment. In Rust, variables are immutable by default:
fn main() {
let name = "Mbeah"; // immutable
// name = "Essilfie"; // ❌ compile error!
let mut age = 25; // mutable (opt-in)
age = 26; // ✅ works
}
Every value in Rust has exactly one owner. When the owner goes out of scope, the value is dropped (freed):
fn main() {
let s1 = String::from("hello");
let s2 = s1; // s1's ownership MOVES to s2
// println!("{}", s1); // ❌ error: s1 no longer valid
println!("{}", s2); // ✅ works
}
In JavaScript terms: imagine if assigning a variable to another made the original undefined. That's a move.
fn print_length(s: &String) { // borrows s, doesn't own it
println!("Length: {}", s.len());
}
fn main() {
let message = String::from("hello");
print_length(&message); // lend it out
println!("{}", message); // still valid!
}
Rules:
&T (shared/read references)&mut T (exclusive/write reference)Like a supercharged switch that the compiler verifies is exhaustive:
enum HttpStatus {
Ok,
NotFound,
ServerError(String),
}
fn describe(status: HttpStatus) -> &'static str {
match status {
HttpStatus::Ok => "All good!",
HttpStatus::NotFound => "Resource not found",
HttpStatus::ServerError(msg) => {
println!("Error: {}", msg);
"Internal error"
}
}
}
use std::fs;
fn read_config() -> Result<String, std::io::Error> {
let content = fs::read_to_string("config.toml")?; // ? propagates errors
Ok(content)
}
The ? operator is like a try/catch that returns early on error — but the compiler forces you to handle every error path.
| JavaScript | Rust |
|---|---|
let / const | let mut / let |
null / undefined | Option<T> |
try/catch | Result<T, E> |
interface | trait |
class | struct + impl |
| garbage collection | ownership + borrowing |
Start small — build a CLI tool, contribute to a Rust project, or try rewriting a hot path in WebAssembly.
Fullstack Software Developer
Learn how to build end-to-end type-safe APIs using Nuxt 3 server routes and Prisma ORM for a seamless developer experience.
Go beyond basic utility classes and learn how to build cohesive, maintainable design systems with Tailwind CSS.
Understand the power of Vue 3's Composition API through practical, real-world composable patterns that you can use today.
