Playing: 657: Rust for JS Devs β Part 2
0:00
LOUDNESS
Episode 574
|Feb 10th, 2023
Supper Club Γ Qwik framework from MiΕ‘ko Hevery, the Creator of Angular
Episode 393
|Oct 4th, 2021
Hasty Treat - Spicy Takeout - PHP Is Good and Weβre Just Re-Creating It
Aug 23rd, 2023
Rust for JS Devs β Part 2
π Download ShowβοΈ Edit Show NotesIn this episode of Syntax, Wes and Scott jump into part 2 of their look at Rust for JavaScript developers, including variables in Rust, type systems in Rust, signed and unsigned integers, and more.
Show Notes
- 00:10 Welcome
- 00:43 Audio issue bugs
- 03:17 Building decks
- 06:06 Variables in Rust
- Syntax 647: Rust for JavaScript Developers - Node vs Rust Concepts
let x = 5; // x is immutable
let mut x = 5; // x is mutable
const MAX_POINTS: u32 = 100_000; // must be defined at compile time
- 10:42 Type System in Rust
- 15:52 Types in Rust
- 19:06 Why does Rust have signed and unsigned integers?
- 23:35 Slicing strings with &str
- 27:35 enum
- 27:55 struct
- 28:19 Vec
- 29:33 HashMap and HashSet
- 33:00 Converting Signed to Unsigned Numbers
let unsigned_value: u8 = 200;
let signed_value: i8 = unsigned_value as i8;
struct User {
username: String,
email: String,
sign_in_count: u64,
active: bool,
}
// You can create an instance of a struct like this:
let user1 = User {
email: String::from("someone@example.com"),
username: String::from("someusername123"),
active: true,
sign_in_count: 1,
};
impl User {
fn login(&mut self) {
self.login_count += 1;
}
}
- 49:17 SIIIIICK ΓΓΓ PIIIICKS ΓΓΓ
ΓΓΓ SIIIIICK ΓΓΓ PIIIICKS ΓΓΓ
- Scott: Thermacell Patio Shield
- Wes: Magnet Phone Mount
Shameless Plugs
- Scott: Sentry
- Wes: Wes Bos Tutorials
Tweet us your tasty treats
- Scott's Instagram
- LevelUpTutorials Instagram
- Wes' Instagram
- Wes' Twitter
- Wes' Facebook
- Scott's Twitter
- Make sure to include @SyntaxFM in your tweets
- Wes Bos on Bluesky
- Scott on Bluesky
- Syntax on Bluesky