Why JavaScript Devs are Switching to Rust in 2024
ฝัง
- เผยแพร่เมื่อ 20 พ.ค. 2024
- In this video, we explore the reasons why JavaScript developers are increasingly drawn to Rust in 2024. Here's how Rust's robust features, including its: unique ownership model, memory management, and type system, offer a refreshing change from JavaScript's dynamic nature.
A lot of JavaScript developers wonder why they should switch to Rust in 2024 so in this video, we will explore some of the biggest challenges and changes if you decide to make the transition.
We also delve into practical steps for JavaScript developers transitioning to Rust, ensuring a smooth and efficient learning experience. Whether you're curious about Rust or planning to make the switch, this video provides valuable insights into Rust's growing influence in the programming world.
Try Warp now for FREE 👉 bit.ly/warpdotdev
Twitter 🐦
/ warpdotdev
TikTok 📱
/ warp.dev
LINKS
Rust Book: doc.rust-lang.org/book/
Rustlings: github.com/rust-lang/rustlings
Rust by Example doc.rust-lang.org/rust-by-exa...
TIMESTAMPS
0:00 Intro
0:17 Rust Background
0:53 Rust Compiled Language
1:15 Memory Management
2:56 Memory References and Borrowing
3:47 Variables and Mutability
5:35 Similarities between JavaScript and Rust
6:06 Types
7:54 Error Handling
8:54 Learning Steps you can Take
10:16 Outro - วิทยาศาสตร์และเทคโนโลยี
We are very excited to see what developers will build with Rust in 2024!
Let us know if you'd like to see Rust tutorials! 🦀
Oh yeaaaah bring in the tutorials😃
Very wanted!
Nice quick overview, but you didn’t explain why JS devs are switching.
Why is this man...
talking to me in the dark,
close up with a smile on his face ,
low voice, saxophone in the background,
winking rather slowly?
Where is my glass of wine?
You are serious or trying to be funny? Obviously what you said is not true. Its crazy scammers like you got views. Reported for misinformation I hope it will do something.
actually... we're staying with JavaScript
no we arent lol my company just switched over to leptos from next 11.
@@perc-ai javascript is most likely always going to be around. rust is pretty much the standard at this point for javascript tooling, but it still has a long ways to go for everything else. the web ecosystem needs more time and backing from large companies to take off in other places. it's still very new in the web space but the encouraging thing for rust is that it has been adopted at an extremely fast rate.
@@perc-aiunless it's warranted, it's a bad choice
@@arturfil for devs started out absolutely. For experienced devs it is a breeze to build web apps in rust. At some point you have to ask yourself am i only going to know JS my whole career :/
@@perc-aiThing is there are a whole lot of older projects that needs supporting. A lot of big companies cant even afford re-writing their apps.
Rust is rust it will be gone with time 😂
Its just doomed the moment it picks that name 😅
It's not JavaScript devs switching to Rust... It's tool devs switching to Rust.
Yes correct. For average JavaScript dev rust is overkill.
JS is going to get safe and fast because of this move i hope 70-90% of js code becomes rust
100% agree
@@pavlo276almost like JS is a crappy language to write tooling in...
Yea I was gonna say, javascript in terms of majority is not even close to the same use case....
Switch from JavaScript to Rust if you want to get one of those 10 jobs that are available in Rust 😅
A lot more than 10 jobs but they are also very hard to get because they virtually all require prior commercial experience or experience of some complementary skill such as blockchain.
that is the main point! Rust for the real time backend, mainly, JS is for the frontent.@@kevinmcfarlane2752
That was last year, now it's more like 3 :)
rust is not about job its about lifestyle
@@dog4ikWTF?
I have heard maybe only one or two isolated cases in the past 3 years of people actually switching from JS to Rust. Most of the time the switch is between frameworks, and the latest trend is switching to Svelte.
Typescript + Svelte/SvelteKit is the way to go for web.
If we need to build desktop app, Svelte + Tauri is the best match.
add one more: my team is switching from NodeJS + TS to Rust
@@nubunto my solo project was originally in TS, but i've switched it to rust after struggling with typescript's relative lack of runtime type safety.
@@bluelinden +1, it's something I also miss terribly. how's it going so far? over here, we noticed significant improvement switching to rust and cant wait to do more of it
@@nubunto currently dealing with either a rust-analyzer or NixOS bug that prevents rust-analyzer from checking procedural macros. something within glibc is freaking out about an unknown symbol, “__tunable_is_initialized”. cargo builds just fine, so i have no idea what’s going on.
No matter what you do , JavaScript will be around you like a shadow , you can ignore it but you can't remove / replace it
The web is the biggest and most influential platform ever. The overlord of the internet is JavaScript, and it's been this way for almost 30 years. JS, HTML and CSS rule the web, and no matter how hyped the language of the week is, or how much they try, they cannot reach the web without going through the web overlords. There's a lot of propaganda driven languages and tools, and the way you approached here, as if Rust would replace JS, is not only wrong but dishonest. A quick search about Rust shows how immature the ecosystem still is, with problems ranging from the insistent fight with the annoying borrow checker, binary bloat, unstable trait resolution, people constantly complaining they can't test their code because something irrelavant is blocking them, making them waste time between each iteration, and the persistent update break problem, that everytime a lib updates, programs would just stop compiling. Memory safety which is the main sale argument of Rust is absolutely irrelevant for JavaScript.
Just wanted to say that programs no longer complining after updating 3rd party dependencies is actually a good thing imho. The library obviously changed something about its APIs which your code used. This way, you immediately know you should go and check what changed. That's much better than waiting for the slight change to cause issues later on and having to actually debug your way find it. Maybe just my experience.
Well said. Rust is a different class/purpose language. This is mere hype
amethyst has been inactive for 2 years now. rocket only recently got support after a long time of inactivity. bevy for game development and axum or actix for backend. those are the stable recommended choices.
On fighting the borrow checker: Don't put Rc/RefCell on everything, instead design the memory management of your types to avoid circular references.
Or just clone small stuff and profile later
I just recreate variables on every function calls
@@acebesmonte Which can be extremely performant if they're all on the stack.
You actually answered a different question for me: why Rust is better than C/C++. Memory controllling is exhausting but Rust makes it more easy and fun. I am already thought about learning go and kotlin, but now I add Rust to the list
dont you think why they dont make syntax like C, that'd be a killer feature, because Rust syntax is uglier
@@un_defined it's very explicit though, wide code is good code.
Syntax is just syntax
such a great overview! rust can be somewhat intimidating when you're analyzing example code for the first time and this helps a lot.
8:48 - rust doesn't have ternary operator (e.g. foo ? a : b), however if blocks returns the value (so you can do let foo = if meaning_of_life { 42 } else { 0 }), and that's why you don't need return in that case. same goes in main -- you actually return the void type (), returned by each of match arm.
It's been two month I've been learning rust as a js dev and I'm having a blast. Currently building an emulator
I feel like the fact that "Rust does not target your browser but your system" (on 1:08) was a bit easily brushed off as something that would not change anything for people who are used to code in JavaScript. Like JS developers would just go: Ahh my code does not run in the browser any more and it is stuck here on my local machine. Ah well, I guess I will just code for myself from now on or maybe I could offer people to download an executable to run my programs, nobody will ever find that suspicious...
It's not that js devs are moving to rust, it’s js tools are moving to rust. There is a huge difference, which means, no matter how good rust promises, it needs js to live.
Your VS Code is gorgeous. What theme and font are you using? I want the smae ones :))
I've breathy read the "Rust the programming language" book and none of the imports/exports or the overall module system worked like it does in JavaScript. (Even compared with older CJS syntax.)
I think that JS devs are not abandoning JS in favor of Rust, it's only those who create tools for the JS ecosystem, so what is really happening is that we are becoming like Python, and it's C-based libraries.
Rust is a different class of language to JS they are not interchangeable. Language class determine how it relates to memory and consequently this affects performance. JS is in the same class of language as Python, Perl, and PHP, mid tear languages such as C#, Java, Go deal with memory in a slightly different way. And finally systems languages (Rust, C,, C++,Zig,) gives you control over more aspects of memory allocation (including where memory is allocated).
YES! and if a youtuber just straight up makes lies for views it's time to unsubscribe and dislike
Rust can do what JS can with WebAssembly, and once you learn it well it is easier to use than JS (and C++, and C, and bash, and Python...).
Is there any reason to switch? Do we have a framework to replace js with rust?
what font are you using in your vscode?
What font do you use? and whats the theme name?
@warpdotdev: what is an application of 'rust', especially comparing to js?
What is your font in vscode, looks nice
This is amazing. I started learning rust a few weeks back but took a break. This video has me excited to get back into again!
Why did you stop? I'm trying to learn rust too.
For me it's more like: I look at the tools I use most (WezTerm, Nushell, Helix, Broot, ripgrep) and they're all built with Rust. It just makes sense to use it.
If the first argument is about memory management, I'm not really sold, since I've never faced these problems with either JavaScript or TypeScript. It seems like memory has been fairly abundant enough with modern challenges I've faced.
I'm just not seeing why any of this would make JavaScript developers make a change.
Sure, if I have some very performance sensitive algorithm or use-case, but why would I be there in the JS in the first place?
Such an insightful and well-done video! Thank you 😊
JS developers switching to Rust ?? Maybe some do, but it's definitely not a trend. If you have said this about NodeJs developers you could have had a point, but even then that would be far fetched.
This video was awesome! Way underrated, keep it up
what is the font you are using? :o
This video is so well made. The animations, the editing, the content. I went ahead and signed in just to make a comment. Kudos!
Thanks a lot for this. I really was confused on how to start or how to understand these concepts. You made it very clear.
Great video, you taught me so much in one video, May be it's time to for you to teach me everything with roadmap
What's that font you use for the code in your video?
looks like the "intel" font 🤔"Intel One Mono"
Great video. Understood the important concepts that were hard to swallow. I would love to learn the rust from you please make a tutorial...
I tried rust a few times already but, I find it to be a more verbose F#/Ocaml, the functional style works very well with the borrow checker. But the rest of the low level stuff and syntax verboseness from a DX perspective I find F# to be as type safe and not having to deal with me only management make it a better choice for me. I still keep an eye on rust though it is a cool language after all
Great video! You did have one small mistake though. i32 range is around plus or minus 2 Billion, not million. Once again, great video!
As soon as I saw that part of the video I paused it and scrolled down. This is the first comment I saw about it. Kind of made me question everything else he says. If you do not know 32bit is billions not millions...
What? Javascript developers are absolutely not switching to rust
Server/Client are the two domains javascript excels at - and Rust is bad at both.
They aren't using it on servers since the whole reason folks switched to having JS on the server was to have only 1 language for both back and front-end. Rust's web-frameworks are complete overkill (and from personal experience, janky).
They aren't using it in the browser because WebAssembly is _still_ slow, even after all these years since it can't quickly mutate the DOM. Given that mutating the DOM is the main thing we use javascript for this instantly makes it a non-starter.
I _guess_ you could say that some developers are switching to Rust to create apps/binaries - but that's not what the title or the video say.
If you're new to programming feel free to disregard the video - it's just silly hype to get clicks
I expected better.
If you look at the well regarded frontend framework benchmark by krausest and compare JS framworks to Rust/WASM ones like Leptos, Dioxus and to a lesser extent Yew you can see that in raw DOM manipulation performance they are EXTREMELY competitive with the big and widespread JS frameworks.
the main hindrance would be their size, needing half a megabyte of wasm to load isnt exactly light - but then again things like React arent exactly much better.
Does anyone have seen any examples front-end on rust? I’ve just never seen anything like this… I don’t want argue about it, I really interested in it and want to understand is it possible that rust become one of the frontend part or it’s just a hipe
This video definitely inspired me to learn Rust, here we go 2024 🦀🚀. Thanks a lot and love Warp
God knows how I'd love to see Rust frameworks for web having high adoption! Web really needs even better tooling than TS, and JS needs a competitor. Competition always brings benefits to customers!
How? Browsers cant run rust
@@DiogoSilva-xx8nz They can with WASM
@@DiogoSilva-xx8nz 1. WASM. 2. Web doesn't only encompass the front-end.
@@renx81 wasm is a meme already, only fits a few edge cases. you wont see any ecommerce done with wasm ever
@@DiogoSilva-xx8nz maybe not right now but Figma uses wasm for their c++ code that runs in the browser.
Not sure when or if I will try it, but this video is really helpful
Great overview! I just wonder how the job market is doing with Rust and where can be implemented rust? on which platforms? what actually can we build with rust?
I just know that last Next.js is powered by Rust compiler and it made him a loooot faster than its was, but I'm just wondering what else can be done with Rust? :)
I was PHP developer, changed my way to JS & TS (React, React Native & Electron and also Node.js, for database used MySQL and MongoDB) and recently I was considering the idea of changing my path on Rust, but I didn't find it used pretty much, maybe the era of Rust is just beginning :)
I'm a PHP developer and also want to move to JS/TS (or maybe .net core). Can you give some notes for this plan? Thanks for your advice
also paying attention to the rust language, but it seems like it's in the distant future
Chirs I didn’t knew this is your channel. Glad to know that🎉 Great content although as always
"You can control how much memory is reserved with each type. Instead of the inferred i32, which reserves space for numbers from about negative two million to positive two million..." Um, you're off by 3 orders of magnitude: 2^32 = +4B, which means 2^31 = ±2B.
Love your new video!! Keep up the quality videos. These give me great snippets of present day information that I would not be in contact with otherwise
🥰
Just rewrote and entire SAAS in rust. It was well worth it. WASM is awesome too.
How does it de allocate the memory as soon as it's out of scope without it being costly?
It always surprises me how people discover other languages and stop liking their beloved JS/TS. Having previously known C#, Java, Python and some Go. None of these languages are perfect, but when I entered the world of JS, I couldn't believe that a language with such a nightmarish developer experience could be so popular. You really have to be ignorant of what the rest of the programming world and languages are like to settle for and like JS.
Naa man. I can get things done in half of the time for alternatives. The ecosystem is rich and its s productive language. Rust is none of the above.
The web is js, what would you want rust unless you're maybe doing tooling?
@@aberba That's a very hard take.
TS+Rust dev here. There's no way I would develop anything serious in Typescript.
You have to be extremely careful with it, as if you're carrying a glass dish on top of your head while performing in a circus. Or you can be relentless and then spend days debugging.
Not at all the case with Rust which immediately tells you if you have a potential error. Or if you forgot to check some enum variant. Or you haven't handled the network failure.
Agree with you. JS feels clumsy for me comparing with C#, Python, C++, Java (languages I know).
clumsy? really? C++ and Rust prroduction code is not clumsy? :)))@@andrry_armor
@@phoenix-tt I'm not sure you're building any serious web app then. How can you avoid js on the web?
Using Rust for web development is like using nail clippers for your lawn.
Maybe 2 or 3 years ago, but now it is really good.
Which is developers front or backend? Can I use rust in frontend instead of javascript,
Can anyone explain why JS still being single threaded language is most popular language for web development but multi threaded language like Java, C++ are not I get the syntax maybe difficult or most people will dont like it so on programming level why is that a problem.
+1 for referring to official docs and not encouraging users to watch hours and hours of videos to learn Rust.
The best way to learn is official docs and practice.
Thanks for a great video!
Great Editing and great video. Just a small error with i32, it stores until 2 billion not million
Love the video. Love to see more Rust tutorals.
I'm learning Rust for few weeks and I am 𝗌̶𝗍̶𝗋̶𝗎̶𝗀̶𝗀̶𝗅̶𝗂̶𝗇̶𝗀̶ loving it 😄😀
Learn methods like .map .and_then .and .unwrap_or .as_ref .deref
Read a little about Arc/Rc/Mutex/Refcell/Box
Your life will be easier
Could anyone recommend why to learn rust as a frontend developer? I’m interested in learning but not sure if it’s worth it and how to do the switch, thanks
Learning a new language is fun and useful. But there are more Go backend jobs than Rust jobs.
I love Rust, but JavaScript is not going away.
Maybe in 5 years there will be a little more Rust jobs than Go, hopefully.
As a secondary language can be useful.
yeah but the question was about "frontend" :)))))) @@AdamFiregate
@@AdamFiregate it won't be useful, its a waste of time
I learned rust back in 2020 because some of the task require to be run faster, like image processing etc.
Belive me rust is worth it
Why Rust and not Go?
@@slamislife74I only tried go a little and it was a while ago, but it is also a solid decision,
Rust is better when it comes to managing memory, multithreading, and personally i like more the documentation, syntax and tooling of rust
is there is a possibility to run rust in webassembly?
I switched a desktop app from javascript to rust and it improved 300% in size
How to be a front dev, in the first place? I have learnt some skills but how?
The only thing we desperately need is TSC to be ported to Rust or Go or Zig. That's it. That'd reduce CI/CD times by 2-3x which could yield faster turnaround times, and reduced cloud costs.
Not sure how knowing JS helps learning Rust. I would learn C, C++ then go for Rust, in fact most companies still on C++. Rust might replace C++ which I dont think would happen ever, but why would JS/UI developers move to Rust ?
bro i am a flutter dev and just started with web dev, it's just complete mess. I saw better option with Rust. But would rust be able to cut it. Like i'm in University and really wanna get placed next year.
A very good video and great production.
with increases on available ram and efficiency every year, is memory management really that much of an issue?
I have switched to leptos for my website, it's perfect, I feel very happy, but then I realize that React has been so much powerful on web, I want to use React-three-fiber to code my website, I try so much way to do it with Rust, but it so damn hard. I decided switched back to NextJS. I realize that, use the suitable tech stack is a simplest way. Rust for web should only be co exist with Javascript to handle heavy task.
Its 2 000 000 000 + instead of 2 000 000 + btw, for the 32 bit integer.
yeah, that'd be more like i22 :-)
How is rust used in web development?
one question where we can find jobs with RUST. May be some companies need it but it very specific companys
Thanx for links!!!
You have opened my eyes to Rust.
You're a true teacher.
This is the greatest video I've seen this week 👏👏👏👏👏👏🤝🤝🤝🤝🤝
This was a great overview of rust and I found this video really helpful for learning the key concepts that make rust different from something like Javascript. Thanks for the video!
Press X to doubt. Rust has it's place and so does javascript. They are very different.
Awesome 👏, Now it's high time to start learning Rust 😬
How are the memory benefits retained after compiling to JS?
Great video. Just a small fix. At 7:13, you should say billion instead of million.
Didnt Google show their first rust Linux Kernel, a few weeks ago?
As a JS Dev, we're literally not going to rust 😂
Need a complete tutorial for TypeScript Developer 💖
No null? How then do you know if a value was set or not?
You have the option enum which either has a Some(yourvalue) or None
Loved the theme, anyone knows which is it?
Atom one dark
I'm primarily a FE dev focusing on React; if JS had the same memory management concepts, I think 90% of the problems people run into with React would be solved. There are so many times where bugs arise because there is a misunderstanding about how references are used by React (e.g. dependencies in hooks, re-renders in components). If we had to be more explicit with how data is being moved around it'd make so many things a lot clearer and easier to understand.
I'm not really sure what I'll use Rust for, but I definitely want to try it out after watching this video!
Also, Warp is great! It's been my primary terminal since it came out :)
Nice video. Clear and to the point. Yes, I would like more tutorials on Rust.
JS devs are not switching to rust.
If/when Rust powers 95% of the internet tell me whether there will be one centralized site or a billion tutorials.
P.S. Rust and other modern languages will be the future, but as of now it doesn't really matter, and when it comes to many use cases the end user doesn't care what technology you use.
already subscribed and waiting for the Rust tutorials
small mistake at 7:10
you want to use Billion instead of Million.
Awesome! I'd like to see more Rust content!
Thank you for showing the concepts in Rust programming language with some examples, but still Why JavaScript Devs are Switching to Rust in 2024? Missleading video title!
Also at 7:02, i32 type holds values between -2,147,483,648 and 2,147,483,647, not -2,000,000 and 2,000,000.
Agree, this video is more about Rust than why JS Dev are switching to Rust. Especially as a Front end developer like me, after watching the whole video, I still don't understand why should I switch to Rust. It is not like I can write better React App or Vue App with Rust.
I'm hoping there's a way to either set constants which can be called endlessly, and also invoking a mutable variable in an immutable way
There is a const keyword. I believe this also works:
let mut foo = 69;
let immutable_reference = &foo;
I've stayed away from Rust because people made this out to be a huge, complicated deal but it seems like it just renamed pointers and auto enforces RAII at the compiler level and prevents race conditions with the 1 ref at a time.
Theres quite a lot more to it. Traits are more akin to Haskells Typeclasses than Interfaces. This video glared over the fact Enums are actually Tagged Unions, able to store runtime values. Its generics and macros are quite powerful but also difficult to learn.
If you look at it from a very high level, then yes, Rust is basically just RAII C++ (though it is kinda closer to C because it doesn't have inheritance and classes) with very strong static checks.
I do have to point out, however, Rust protecting from race conditions is not correct. It protects from data races, but not race conditions.
What Rust does better is that it comes with a standard library that isn't bloated to hell like C++ is, but it also isn't as barebones like C is. Also, I'd argue Rust fixes the external tool problems that C/C++ has like the build system and using external libraries.
Yeah, yeah, but if I wanna run Rust in the browser, I'll have to compile it to WASM, and if I'm using WASM already, why would I use a meme language like Rust instead of C++?
And I'm not even talking about the fact that WASM is an overkill for most use cases or that its context has no access to the DOM.
Still dont know, why devs would switch. Wrong title
As a web developer moving to rust, what can I build with rust???
wow
very nice and clean explanation
thank for sharing
I had a misconception when I first saw similar title of TH-cam videos. It turned out people who want to learn web development still have to learn JavaScript.
7:09 your i32 range is wrong BTW, it should be -2billion +to positive 2billion+
Good tutorial, but please make the coding part a bit slower next time. The code is marked very quickly, many arrows appear and before you could read the code in detail, it has already disappeared again.
Rust will not replace Javascript, instead they'll work completing each other. As a exemple, in one project I compiled some funcions from the Rust GEO crate to WASM and use in Javascript.