From node.js to Rust, week 2

Advent of Rust: Week 2 Recap

Week 2 of the Rust guide for node.js and JS/TS developers

Day 7: Syntax & Differences Between Rust and JavaScript

Day 7 goes over the some of the Rust-specific syntax that will get in your way. We also introduce Vectors and double-ended queues as replacements for JavaScript arrays.

Day 8: From objects and classes to HashMaps and structs

Day 8 maps use cases for JavaScript Objects, Maps, and classes to Rust’s HashMaps and structs. We also start the Traffic Light example which extends over the next three days.

Day 9: Class Methods for Rust Structs (+ enums!)

Day 9 adds behavior to data with impl and touches on how Rust enums are vastly more capable than anything you’ve used in the JavaScript world.

Day 10: From Mixins to Traits

Day 10 clarifies some of the early frustrations people experience when dealing with Rust’s traits, Rust’s answer to reusable behavior.

Day 11: The Module System

Day 11 takes Rust’s module system and decomposes it into the parts that matter, specifically how exactly do you import code from one file into another?

Day 12: Strings, Part 2

After six days we have finally gone through enough to tackle the rest of the Stringproblem. Day 12 goes over how to accept borrowed and owned strings in as pleasant a way as Rust allows.

Day 13: Results & Options

The last day of our second week goes over two of Rust’s most common data structures, the Result and the Option. Both of these enums help Rust represent problems and nothingness without throwing errors or passing around nulls and undefineds.

Next week:

The next week worth of posts will go over closures, error handling, Rust’s lifetimes, Arrays, loops, and iterators. Subscribe to the RSS feed to get notified of posts as they come.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jarrod Overson

I write about JavaScript, Reverse Engineering, Security, and Credential Stuffing. Also a speaker, O'Reilly Author, creator of Plato, Director at Shape Security.