←
Rust for JavaScript Developers52 posts
Rust for JavaScript Developers avatar

Rust for JavaScript Developers

@rustforjsdev

A practical Rust course by @chatsidhartha, especially for JavaScript developers. Preorders open!

◷ Joined May 2022▧ 2 Photos and videos
Rust for JavaScript Developers avatar
Rust for JavaScript Developers@rustforjsdev·22 Jan 2023

Rust’s ownership rules 1. Every value in Rust must have a single owner 2. A value can have any number of immutable references 3. You can only create a single mutable reference to a value 4. If there’s a mutable reference to a value, you cannot have an immutable reference to it

Guillermo Rauch avatar
⟳ Rust for JavaScript Developers retweeted
Guillermo Rauch@rauchg·20 Jan 2023

Rust is re-defining Infrastructure engineering. We're seeing the foundations of our tools and services get refactored to it, from CLI to Cloud. Very excited about resources like @rustforjsdev that make it more accessible to everyone!

It’s exciting how much of modern JavaScript tooling is adopting Rust! There’s swc, turbopack, turborepo rewrite (nice work @vercel friends), the new parcel CSS compiler and now the new Tailwind compiler. It’s great to see.

Rust for JavaScript Developers avatar
Rust for JavaScript Developers@rustforjsdev·20 Jan 2023

It’s exciting how much of modern JavaScript tooling is adopting Rust! There’s swc, turbopack, turborepo rewrite (nice work @vercel friends), the new parcel CSS compiler and now the new Tailwind compiler. It’s great to see.

Whipped up a tiny abstraction to make it easier to run the Tailwind test suite against both our stable engine and the new Rust stuff... Couldn't resist the name 🏒🥅

Post attachment
Mara avatar
⟳ Rust for JavaScript Developers retweeted
Mara@m_ou_se·18 Jan 2023

🦀 It's "Rust", not "RUST".

Rust for JavaScript Developers avatar
Rust for JavaScript Developers@rustforjsdev·13 Jan 2023

In Rust, it is possible to force-ably allocate values on the heap using the Box type, here is an example of an i32 value allocated on the heap. age is now a pointer to a heap allocated i32.

Post attachment
Rust for JavaScript Developers avatar
Rust for JavaScript Developers@rustforjsdev·9 Jan 2023

Rust lets you iterate through something iterable using an Iterator. Here's an example of filtering an array for even numbers. We create an Iterator from our array using into_iter in this case, a version of iter that moves ownership of each value into our closure.

Post attachment
Rust for JavaScript Developers avatar
Rust for JavaScript Developers@rustforjsdev·8 Jan 2023

unwrap is fine for code in development or tests but for production, you should probably be calling unwrap_or which lets you set a default for when the value is None instead of panicking!

Sid avatar
⟳ Rust for JavaScript Developers retweeted
Sid@SidChatterjee·8 Jan 2023

I'm quite happy with how search turned out for @rustforjsdev It's fully accessible, works with Command+K as well and is fast as hell Shipping this to production now

0:17
Mara avatar
⟳ Rust for JavaScript Developers retweeted
Mara@m_ou_se·6 Jan 2023

🦀📔 What would you want to see in a book titled "Rust for C and C++ programmers"?