[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"header-categories":3,"post-rust-for-javascript-developers":73,"parsed-post-d55543df-6143-41f3-970e-4485d1ab8e37":142},{"success":4,"data":5},true,{"items":6,"pagination":70},[7,16,24,32,40,48,56,63],{"id":8,"name":9,"description":10,"parentId":11,"createdAt":12,"updatedAt":12,"parent":11,"children":13,"_count":14},"ai-future","AI & The Future","Artificial intelligence and emerging technology",null,"2026-07-24T06:02:45.990Z",[],{"posts":15},1,{"id":17,"name":18,"description":19,"parentId":11,"createdAt":20,"updatedAt":20,"parent":11,"children":21,"_count":22},"tools-productivity","Tools & Productivity","Developer tools and workflow optimization","2026-07-24T06:02:45.712Z",[],{"posts":23},7,{"id":25,"name":26,"description":27,"parentId":11,"createdAt":28,"updatedAt":28,"parent":11,"children":29,"_count":30},"career","Career & Growth","Professional development for developers","2026-07-24T06:02:45.486Z",[],{"posts":31},3,{"id":33,"name":34,"description":35,"parentId":11,"createdAt":36,"updatedAt":36,"parent":11,"children":37,"_count":38},"opinion","Opinion & Analysis","Industry analysis and technical opinions","2026-07-24T06:02:45.272Z",[],{"posts":39},6,{"id":41,"name":42,"description":43,"parentId":11,"createdAt":44,"updatedAt":44,"parent":11,"children":45,"_count":46},"tutorials","Tutorials","Step-by-step learning guides","2026-07-24T06:02:44.965Z",[],{"posts":47},21,{"id":49,"name":50,"description":51,"parentId":11,"createdAt":52,"updatedAt":52,"parent":11,"children":53,"_count":54},"software-engineering","Software Engineering","Best practices, patterns, and principles","2026-07-24T06:02:44.689Z",[],{"posts":55},24,{"id":57,"name":58,"description":59,"parentId":11,"createdAt":60,"updatedAt":60,"parent":11,"children":61,"_count":62},"devops-cloud","DevOps & Cloud","Infrastructure, deployment, and cloud computing","2026-07-24T06:02:44.453Z",[],{"posts":39},{"id":64,"name":65,"description":66,"parentId":11,"createdAt":67,"updatedAt":67,"parent":11,"children":68,"_count":69},"web-development","Web Development","Frontend and backend web development tutorials and guides","2026-07-24T06:02:44.169Z",[],{"posts":55},{"page":15,"limit":71,"total":71,"totalPages":15,"hasNext":72,"hasPrev":72},8,false,{"success":4,"data":74},{"id":75,"slug":76,"title":77,"excerpt":78,"content":79,"status":80,"visibility":81,"featuredImage":82,"canonicalUrl":11,"readingTime":83,"viewCount":84,"commentEnabled":4,"publishedAt":85,"scheduledAt":11,"createdAt":86,"updatedAt":87,"seoTitle":88,"seoDescription":78,"seoKeywords":11,"authorId":89,"author":90,"coAuthors":95,"tags":96,"categories":107,"comments":109,"_count":110,"relatedPosts":112},"d55543df-6143-41f3-970e-4485d1ab8e37","rust-for-javascript-developers","Rust for JavaScript Developers: First Steps","A gentle introduction to Rust's key concepts through the lens of JavaScript familiarity — ownership, borrowing, and why they matter.","## Why Rust?\n\nAs a JavaScript developer, you might wonder why you'd learn a systems language. Here's why:\n\n- Tools like **esbuild**, **swc**, **Turbopack**, and **Biome** are written in Rust\n- WebAssembly opens Rust to the browser\n- Understanding memory management makes you a better developer in any language\n\n## Variables and Mutability\n\nIn JavaScript, `let` allows reassignment. In Rust, variables are immutable by default:\n\n```rust\nfn main() {\n    let name = \"Mbeah\";      \u002F\u002F immutable\n    \u002F\u002F name = \"Essilfie\";    \u002F\u002F ❌ compile error!\n\n    let mut age = 25;        \u002F\u002F mutable (opt-in)\n    age = 26;                \u002F\u002F ✅ works\n}\n```\n\n::callout{icon=\"i-lucide-lock\" color=\"primary\"}\nImmutability by default forces you to be intentional about state changes. This prevents accidental mutations — a common source of bugs in JavaScript.\n::\n\n## Ownership: The Big Idea\n\nEvery value in Rust has exactly one owner. When the owner goes out of scope, the value is dropped (freed):\n\n```rust\nfn main() {\n    let s1 = String::from(\"hello\");\n    let s2 = s1;  \u002F\u002F s1's ownership MOVES to s2\n\n    \u002F\u002F println!(\"{}\", s1); \u002F\u002F ❌ error: s1 no longer valid\n    println!(\"{}\", s2);    \u002F\u002F ✅ works\n}\n```\n\nIn JavaScript terms: imagine if assigning a variable to another made the original `undefined`. That's a move.\n\n## Borrowing: References Without Ownership\n\n```rust\nfn print_length(s: &String) {  \u002F\u002F borrows s, doesn't own it\n    println!(\"Length: {}\", s.len());\n}\n\nfn main() {\n    let message = String::from(\"hello\");\n    print_length(&message);    \u002F\u002F lend it out\n    println!(\"{}\", message);   \u002F\u002F still valid!\n}\n```\n\nRules:\n- You can have many `&T` (shared\u002Fread references)\n- OR one `&mut T` (exclusive\u002Fwrite reference)\n- Never both at the same time\n\n## Pattern Matching\n\nLike a supercharged `switch` that the compiler verifies is exhaustive:\n\n```rust\nenum HttpStatus {\n    Ok,\n    NotFound,\n    ServerError(String),\n}\n\nfn describe(status: HttpStatus) -> &'static str {\n    match status {\n        HttpStatus::Ok => \"All good!\",\n        HttpStatus::NotFound => \"Resource not found\",\n        HttpStatus::ServerError(msg) => {\n            println!(\"Error: {}\", msg);\n            \"Internal error\"\n        }\n    }\n}\n```\n\n## Error Handling (No Exceptions!)\n\n```rust\nuse std::fs;\n\nfn read_config() -> Result\u003CString, std::io::Error> {\n    let content = fs::read_to_string(\"config.toml\")?; \u002F\u002F ? propagates errors\n    Ok(content)\n}\n```\n\nThe `?` operator is like a `try\u002Fcatch` that returns early on error — but the compiler forces you to handle every error path.\n\n## Mapping JS Concepts to Rust\n\n| JavaScript | Rust |\n|-----------|------|\n| `let` \u002F `const` | `let mut` \u002F `let` |\n| `null` \u002F `undefined` | `Option\u003CT>` |\n| `try\u002Fcatch` | `Result\u003CT, E>` |\n| `interface` | `trait` |\n| `class` | `struct` + `impl` |\n| garbage collection | ownership + borrowing |\n\nStart small — build a CLI tool, contribute to a Rust project, or try rewriting a hot path in WebAssembly.\n","published","public","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1550439062-609e1531270e?w=1200&q=80",13,457,"2026-07-05T06:03:09.056Z","2026-07-24T06:03:09.059Z","2026-07-28T17:07:16.258Z","Rust for JavaScript Developers: First Steps | BitBlog","fddb5d93-7a2c-4d86-a06a-fa32e73a01c6",{"email":91,"bio":92,"id":89,"name":93,"avatarUrl":94},"mbeahessilfieprince@gmail.com","Fullstack Software Developer ","Mbeah Essilfie","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F93322394?v=4",[],[97,102],{"id":98,"name":99,"color":100,"description":101},"javascript","JavaScript","#f7df1e","The language of the web",{"id":103,"name":104,"color":105,"description":106},"rust","Rust","#dea584","Systems programming language",[108],{"id":41,"name":42,"description":43},[],{"comments":111},0,[113,122,132],{"id":114,"slug":115,"title":116,"excerpt":117,"featuredImage":118,"viewCount":119,"readingTime":71,"publishedAt":120,"author":121},"2997028f-4d22-4eb7-9d86-894a54cb559a","building-type-safe-apis-nuxt3-prisma","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.","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1498050108023-c5249f4df085?w=1200&q=80",1922,"2026-07-23T06:02:46.910Z",{"id":89,"name":93,"avatarUrl":94},{"id":123,"slug":124,"title":125,"excerpt":126,"featuredImage":127,"viewCount":128,"readingTime":129,"publishedAt":130,"author":131},"da9e4553-8b0d-411e-b4ec-f9684017e163","mastering-tailwind-css-design-systems","Mastering Tailwind CSS: From Utility Classes to Design Systems","Go beyond basic utility classes and learn how to build cohesive, maintainable design systems with Tailwind CSS.","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1555066931-4365d14bab8c?w=1200&q=80",257,10,"2026-07-21T06:02:49.268Z",{"id":89,"name":93,"avatarUrl":94},{"id":133,"slug":134,"title":135,"excerpt":136,"featuredImage":137,"viewCount":138,"readingTime":139,"publishedAt":140,"author":141},"50add5fc-4026-4267-b917-7f71ea9e35b0","complete-guide-vue3-composables","The Complete Guide to Vue 3 Composables","Understand the power of Vue 3's Composition API through practical, real-world composable patterns that you can use today.","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1517694712202-14dd9538aa97?w=1200&q=80",990,12,"2026-07-19T06:02:51.753Z",{"id":89,"name":93,"avatarUrl":94},{"data":143,"body":145,"toc":585},{"title":144,"description":144},"",{"type":146,"children":147},"root",[148,157,163,211,217,231,242,253,259,264,272,284,290,298,303,337,343,356,364,370,378,399,405,575,580],{"type":149,"tag":150,"props":151,"children":153},"element","h2",{"id":152},"why-rust",[154],{"type":155,"value":156},"text","Why Rust?",{"type":149,"tag":158,"props":159,"children":160},"p",{},[161],{"type":155,"value":162},"As a JavaScript developer, you might wonder why you'd learn a systems language. Here's why:",{"type":149,"tag":164,"props":165,"children":166},"ul",{},[167,201,206],{"type":149,"tag":168,"props":169,"children":170},"li",{},[171,173,179,181,186,187,192,194,199],{"type":155,"value":172},"Tools like ",{"type":149,"tag":174,"props":175,"children":176},"strong",{},[177],{"type":155,"value":178},"esbuild",{"type":155,"value":180},", ",{"type":149,"tag":174,"props":182,"children":183},{},[184],{"type":155,"value":185},"swc",{"type":155,"value":180},{"type":149,"tag":174,"props":188,"children":189},{},[190],{"type":155,"value":191},"Turbopack",{"type":155,"value":193},", and ",{"type":149,"tag":174,"props":195,"children":196},{},[197],{"type":155,"value":198},"Biome",{"type":155,"value":200}," are written in Rust",{"type":149,"tag":168,"props":202,"children":203},{},[204],{"type":155,"value":205},"WebAssembly opens Rust to the browser",{"type":149,"tag":168,"props":207,"children":208},{},[209],{"type":155,"value":210},"Understanding memory management makes you a better developer in any language",{"type":149,"tag":150,"props":212,"children":214},{"id":213},"variables-and-mutability",[215],{"type":155,"value":216},"Variables and Mutability",{"type":149,"tag":158,"props":218,"children":219},{},[220,222,229],{"type":155,"value":221},"In JavaScript, ",{"type":149,"tag":223,"props":224,"children":226},"code",{"className":225},[],[227],{"type":155,"value":228},"let",{"type":155,"value":230}," allows reassignment. In Rust, variables are immutable by default:",{"type":149,"tag":232,"props":233,"children":237},"pre",{"className":234,"code":235,"language":103,"meta":144,"style":236},"language-rust","fn main() {\n    let name = \"Mbeah\";      \u002F\u002F immutable\n    \u002F\u002F name = \"Essilfie\";    \u002F\u002F ❌ compile error!\n\n    let mut age = 25;        \u002F\u002F mutable (opt-in)\n    age = 26;                \u002F\u002F ✅ works\n}\n","undefined",[238],{"type":149,"tag":223,"props":239,"children":240},{"__ignoreMap":144},[241],{"type":155,"value":235},{"type":149,"tag":243,"props":244,"children":247},"callout",{"color":245,"icon":246},"primary","i-lucide-lock",[248],{"type":149,"tag":158,"props":249,"children":250},{},[251],{"type":155,"value":252},"Immutability by default forces you to be intentional about state changes. This prevents accidental mutations — a common source of bugs in JavaScript.",{"type":149,"tag":150,"props":254,"children":256},{"id":255},"ownership-the-big-idea",[257],{"type":155,"value":258},"Ownership: The Big Idea",{"type":149,"tag":158,"props":260,"children":261},{},[262],{"type":155,"value":263},"Every value in Rust has exactly one owner. When the owner goes out of scope, the value is dropped (freed):",{"type":149,"tag":232,"props":265,"children":267},{"className":234,"code":266,"language":103,"meta":144,"style":236},"fn main() {\n    let s1 = String::from(\"hello\");\n    let s2 = s1;  \u002F\u002F s1's ownership MOVES to s2\n\n    \u002F\u002F println!(\"{}\", s1); \u002F\u002F ❌ error: s1 no longer valid\n    println!(\"{}\", s2);    \u002F\u002F ✅ works\n}\n",[268],{"type":149,"tag":223,"props":269,"children":270},{"__ignoreMap":144},[271],{"type":155,"value":266},{"type":149,"tag":158,"props":273,"children":274},{},[275,277,282],{"type":155,"value":276},"In JavaScript terms: imagine if assigning a variable to another made the original ",{"type":149,"tag":223,"props":278,"children":280},{"className":279},[],[281],{"type":155,"value":236},{"type":155,"value":283},". That's a move.",{"type":149,"tag":150,"props":285,"children":287},{"id":286},"borrowing-references-without-ownership",[288],{"type":155,"value":289},"Borrowing: References Without Ownership",{"type":149,"tag":232,"props":291,"children":293},{"className":234,"code":292,"language":103,"meta":144,"style":236},"fn print_length(s: &String) {  \u002F\u002F borrows s, doesn't own it\n    println!(\"Length: {}\", s.len());\n}\n\nfn main() {\n    let message = String::from(\"hello\");\n    print_length(&message);    \u002F\u002F lend it out\n    println!(\"{}\", message);   \u002F\u002F still valid!\n}\n",[294],{"type":149,"tag":223,"props":295,"children":296},{"__ignoreMap":144},[297],{"type":155,"value":292},{"type":149,"tag":158,"props":299,"children":300},{},[301],{"type":155,"value":302},"Rules:",{"type":149,"tag":164,"props":304,"children":305},{},[306,319,332],{"type":149,"tag":168,"props":307,"children":308},{},[309,311,317],{"type":155,"value":310},"You can have many ",{"type":149,"tag":223,"props":312,"children":314},{"className":313},[],[315],{"type":155,"value":316},"&T",{"type":155,"value":318}," (shared\u002Fread references)",{"type":149,"tag":168,"props":320,"children":321},{},[322,324,330],{"type":155,"value":323},"OR one ",{"type":149,"tag":223,"props":325,"children":327},{"className":326},[],[328],{"type":155,"value":329},"&mut T",{"type":155,"value":331}," (exclusive\u002Fwrite reference)",{"type":149,"tag":168,"props":333,"children":334},{},[335],{"type":155,"value":336},"Never both at the same time",{"type":149,"tag":150,"props":338,"children":340},{"id":339},"pattern-matching",[341],{"type":155,"value":342},"Pattern Matching",{"type":149,"tag":158,"props":344,"children":345},{},[346,348,354],{"type":155,"value":347},"Like a supercharged ",{"type":149,"tag":223,"props":349,"children":351},{"className":350},[],[352],{"type":155,"value":353},"switch",{"type":155,"value":355}," that the compiler verifies is exhaustive:",{"type":149,"tag":232,"props":357,"children":359},{"className":234,"code":358,"language":103,"meta":144,"style":236},"enum HttpStatus {\n    Ok,\n    NotFound,\n    ServerError(String),\n}\n\nfn describe(status: HttpStatus) -> &'static str {\n    match status {\n        HttpStatus::Ok => \"All good!\",\n        HttpStatus::NotFound => \"Resource not found\",\n        HttpStatus::ServerError(msg) => {\n            println!(\"Error: {}\", msg);\n            \"Internal error\"\n        }\n    }\n}\n",[360],{"type":149,"tag":223,"props":361,"children":362},{"__ignoreMap":144},[363],{"type":155,"value":358},{"type":149,"tag":150,"props":365,"children":367},{"id":366},"error-handling-no-exceptions",[368],{"type":155,"value":369},"Error Handling (No Exceptions!)",{"type":149,"tag":232,"props":371,"children":373},{"className":234,"code":372,"language":103,"meta":144,"style":236},"use std::fs;\n\nfn read_config() -> Result\u003CString, std::io::Error> {\n    let content = fs::read_to_string(\"config.toml\")?; \u002F\u002F ? propagates errors\n    Ok(content)\n}\n",[374],{"type":149,"tag":223,"props":375,"children":376},{"__ignoreMap":144},[377],{"type":155,"value":372},{"type":149,"tag":158,"props":379,"children":380},{},[381,383,389,391,397],{"type":155,"value":382},"The ",{"type":149,"tag":223,"props":384,"children":386},{"className":385},[],[387],{"type":155,"value":388},"?",{"type":155,"value":390}," operator is like a ",{"type":149,"tag":223,"props":392,"children":394},{"className":393},[],[395],{"type":155,"value":396},"try\u002Fcatch",{"type":155,"value":398}," that returns early on error — but the compiler forces you to handle every error path.",{"type":149,"tag":150,"props":400,"children":402},{"id":401},"mapping-js-concepts-to-rust",[403],{"type":155,"value":404},"Mapping JS Concepts to Rust",{"type":149,"tag":406,"props":407,"children":408},"table",{},[409,426],{"type":149,"tag":410,"props":411,"children":412},"thead",{},[413],{"type":149,"tag":414,"props":415,"children":416},"tr",{},[417,422],{"type":149,"tag":418,"props":419,"children":420},"th",{},[421],{"type":155,"value":99},{"type":149,"tag":418,"props":423,"children":424},{},[425],{"type":155,"value":104},{"type":149,"tag":427,"props":428,"children":429},"tbody",{},[430,465,492,512,533,562],{"type":149,"tag":414,"props":431,"children":432},{},[433,450],{"type":149,"tag":434,"props":435,"children":436},"td",{},[437,442,444],{"type":149,"tag":223,"props":438,"children":440},{"className":439},[],[441],{"type":155,"value":228},{"type":155,"value":443}," \u002F ",{"type":149,"tag":223,"props":445,"children":447},{"className":446},[],[448],{"type":155,"value":449},"const",{"type":149,"tag":434,"props":451,"children":452},{},[453,459,460],{"type":149,"tag":223,"props":454,"children":456},{"className":455},[],[457],{"type":155,"value":458},"let mut",{"type":155,"value":443},{"type":149,"tag":223,"props":461,"children":463},{"className":462},[],[464],{"type":155,"value":228},{"type":149,"tag":414,"props":466,"children":467},{},[468,483],{"type":149,"tag":434,"props":469,"children":470},{},[471,477,478],{"type":149,"tag":223,"props":472,"children":474},{"className":473},[],[475],{"type":155,"value":476},"null",{"type":155,"value":443},{"type":149,"tag":223,"props":479,"children":481},{"className":480},[],[482],{"type":155,"value":236},{"type":149,"tag":434,"props":484,"children":485},{},[486],{"type":149,"tag":223,"props":487,"children":489},{"className":488},[],[490],{"type":155,"value":491},"Option\u003CT>",{"type":149,"tag":414,"props":493,"children":494},{},[495,503],{"type":149,"tag":434,"props":496,"children":497},{},[498],{"type":149,"tag":223,"props":499,"children":501},{"className":500},[],[502],{"type":155,"value":396},{"type":149,"tag":434,"props":504,"children":505},{},[506],{"type":149,"tag":223,"props":507,"children":509},{"className":508},[],[510],{"type":155,"value":511},"Result\u003CT, E>",{"type":149,"tag":414,"props":513,"children":514},{},[515,524],{"type":149,"tag":434,"props":516,"children":517},{},[518],{"type":149,"tag":223,"props":519,"children":521},{"className":520},[],[522],{"type":155,"value":523},"interface",{"type":149,"tag":434,"props":525,"children":526},{},[527],{"type":149,"tag":223,"props":528,"children":530},{"className":529},[],[531],{"type":155,"value":532},"trait",{"type":149,"tag":414,"props":534,"children":535},{},[536,545],{"type":149,"tag":434,"props":537,"children":538},{},[539],{"type":149,"tag":223,"props":540,"children":542},{"className":541},[],[543],{"type":155,"value":544},"class",{"type":149,"tag":434,"props":546,"children":547},{},[548,554,556],{"type":149,"tag":223,"props":549,"children":551},{"className":550},[],[552],{"type":155,"value":553},"struct",{"type":155,"value":555}," + ",{"type":149,"tag":223,"props":557,"children":559},{"className":558},[],[560],{"type":155,"value":561},"impl",{"type":149,"tag":414,"props":563,"children":564},{},[565,570],{"type":149,"tag":434,"props":566,"children":567},{},[568],{"type":155,"value":569},"garbage collection",{"type":149,"tag":434,"props":571,"children":572},{},[573],{"type":155,"value":574},"ownership + borrowing",{"type":149,"tag":158,"props":576,"children":577},{},[578],{"type":155,"value":579},"Start small — build a CLI tool, contribute to a Rust project, or try rewriting a hot path in WebAssembly.",{"type":149,"tag":581,"props":582,"children":583},"style",{},[584],{"type":155,"value":144},{"title":144,"searchDepth":586,"depth":586,"links":587},2,[588,589,590,591,592,593,594],{"id":152,"depth":586,"text":156},{"id":213,"depth":586,"text":216},{"id":255,"depth":586,"text":258},{"id":286,"depth":586,"text":289},{"id":339,"depth":586,"text":342},{"id":366,"depth":586,"text":369},{"id":401,"depth":586,"text":404}]