{"id":13433383,"url":"https://github.com/Mercateo/rust-for-node-developers","last_synced_at":"2025-03-17T12:31:43.969Z","repository":{"id":41063448,"uuid":"60426257","full_name":"Mercateo/rust-for-node-developers","owner":"Mercateo","description":"An introduction to the Rust programming language for Node developers.","archived":false,"fork":false,"pushed_at":"2023-06-21T22:10:09.000Z","size":2835,"stargazers_count":1779,"open_issues_count":15,"forks_count":80,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-02-28T18:33:38.561Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mercateo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-04T19:13:49.000Z","updated_at":"2025-02-24T14:25:57.000Z","dependencies_parsed_at":"2022-07-16T16:17:12.038Z","dependency_job_id":null,"html_url":"https://github.com/Mercateo/rust-for-node-developers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mercateo%2Frust-for-node-developers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mercateo%2Frust-for-node-developers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mercateo%2Frust-for-node-developers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mercateo%2Frust-for-node-developers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mercateo","download_url":"https://codeload.github.com/Mercateo/rust-for-node-developers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244033803,"owners_count":20387004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T02:01:25.003Z","updated_at":"2025-03-17T12:31:42.467Z","avatar_url":"https://github.com/Mercateo.png","language":"Rust","readme":"# Rust for Node developers\n\n\u003e An introduction to the Rust programming language for Node developers.\n\n\u003e 💡 **2nd edition.** I initially wrote this tutorial in the summer of 2016. Rust 1.0 was roughly a year old back than. This tutorial stayed quite popular over time even though I haven't added new chapters. As years passed by the Rust (and Node) ecosystem evolved further and this tutorial wasn't up-to-date with all changes. With the recent release of [_\"Rust 2018\"_](https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html) (which I'll explain later in more depth) I took the opportunity to update this tutorial as well. Enjoy the read! 🎉\n\nHi there, I'm Donald. [I'm a JavaScript developer](https://github.com/donaldpipowitch) who wants to learn Rust and as a part of this process I'll write here about my learnings. But what is Rust and **why do I want to learn it**? Rust is a systems programming language like C or C++, but with influences from functional programming languages and even scripting languages like JavaScript. It _feels_ very modern - which is no surprise, because it is a relatively young language. [It went 1.0 in 2015!](http://blog.rust-lang.org/2015/05/15/Rust-1.0.html) That doesn't only mean it is _fun to write_, because it has less clutter to carry around, it is also _fun to use_, because it has a modern toolchain with a great package manager. Rust's most unique feature is probably the compile-time safety check: it catches errors like segfaults without introducing a garbage collector. Or to phrase it differently: maximum safety with maximum performance.\n\nProbably even more important than its features is the ecosystem and the community behind the language. Rust really shines here - especially for people who love the web. The language was (and still is) heavily influenced by developers from Mozilla. They have written [`servo`](https://github.com/servo/servo), a modern browser engine, in Rust and [parts of Firefox are now running Rust code](https://hacks.mozilla.org/2017/11/entering-the-quantum-era-how-firefox-got-fast-again-and-where-its-going-to-get-faster/). [Rust is also great for authoring WebAssembly code](https://www.rust-lang.org/what/wasm) (short: _Wasm_), a [binary format for the web](https://webassembly.org/), which is [supported in Firefox, Edge, Chrome and Safari](https://caniuse.com/#feat=wasm).\n\nTo summarize: Rust is a young modern language with a great tooling and ecosystem, good safety and performance promises and which can be used for a lot of different projects - from low level tasks to command line tools and even web projects.\n\nBefore we dive into our tutorial we want to look at least once into a real Rust file:\n\n```rust\nfn main() {\n    println!(\"Hello World!\");\n}\n```\n\nThe JavaScript equivalent _could roughly_ look like this:\n\n```js\nfunction main() {\n  console.log('Hello World!');\n}\n```\n\nNothing too scary, right? The `!` behind `println` could be a bit confusing, but don't mind it for now. Just think of it as a special function.\n\nHow do we move on from here? First I'll guide you how my current setup looks like to use Node and Rust. Many people seemed to like that I introduce some convenient tooling and IDE configurations _before_ actually speaking about Rust itself. But you can skip this chapter, if you want. After the setup step I'll create several kitchen sink like examples - first with Node and then with Rust. I'll try to explain them as best as I can, but _don't_ expect in-depth explanations in every case. Don't forget that I'm trying to learn Rust - _just like you_. Probably you need to explain _me_ some things, too! And before I forget it: my Node examples will be written in [TypeScript](https://www.typescriptlang.org/)! Writing them in TypeScript will make it a little bit easier to compare some examples to Rust.\n\nOne word about the structure of this tutorial before we start. Every chapter has its own directory. If a chapter has sub-chapters they also have sub-directories. And if a (subd-)chapter contains code examples, you'll find a `node` and a `rust` directory which contain all the code of this (sub-)chapter. (One example: The chapter [_\"Package Manager\"_](package-manager/README.md) can be found inside [`package-manager/`](package-manager). It has the sub-chapter [_\"Publishing\"_](package-manager/README.md#publishing) and the corresponding code examples can be found in [`package-manager/publishing/node/`](package-manager/publishing/node) and [`package-manager/publishing/rust/`](package-manager/publishing/rust).)\n\n# Table of contents\n\n1. [Setup](setup/README.md)\n2. [Hello World](hello-world/README.md)\n3. [Package Manager](package-manager/README.md)\n4. [Read files](read-files/README.md)\n5. [Write files](write-files/README.md)\n6. [HTTP requests](http-requests/README.md)\n7. [Parse JSON](parse-json/README.md)\n\nThank you for reading this tutorial. ♥\n\nI highly appreciate pull requests for grammar and spelling fixes as I'm not a native speaker. Thank you!\n","funding_links":[],"categories":["Rust","others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMercateo%2Frust-for-node-developers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMercateo%2Frust-for-node-developers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMercateo%2Frust-for-node-developers/lists"}