This strikes me as a well reasoned, level-headed response. I mainly work in other languages (C++, JS), but I've found Rust's DX to be light-years ahead of the other languages, for the reasons you covered pretty thoroughly in your video.
Rust's performance isn't a feature, it's a consequence of what really matters about Rust: a complete lack of ambiguity. Rust does exactly what you tell it to do, and it will tell you if that will cause problems. That back and forth lets me write concepts I wouldn't even dream of doing in something like C# or JavaScript.
I am not a programmer but rust compiler error and the way it writes them in command line is litterally the most satasfying way i have ever seen its unlike c or c++ where i see a millions of red lines and not understanding what the hell just happened
Prime said it best, lerning a new language gives you a new perspective on how to approach a problem from a different view, we are all learning all the time anyways
I have been programming rust and typescript for over 5 years. And I find writing something (except UI related stuff) in Rust actually takes less time. I think the main thing that makes me think that is that the tooling and documentation are so much better in Rust. Documentation in typescript even in popular libraries is far worse and almost always completely different. Also there are so many different package managers and build systems and none of these really work with each other. It can be really frustrating to get new projects started in Typescript. Rust on the other hand is really straight forward to get started with. I think Theo actually has I blind spot in this regard. He has spent a ton of time finding the right combination of typescript tools to make developing in it easy. Most people don't put that much time into it and end up with a fragile code base and build system. It's great that he makes repo templates for people so that don't have to put that much work in but it's in a sea of other not as good templates. In fact, all these templates and cli tools for starting new projects in typescript really shows how difficult and bad the eco system around typescript is. The only time I need something similar in Rust is when starting a new wasm project which is the main reason I don't do more with wasm.
@@pedrolucasdeoliveiralara8199 I see a lot of people using Rust claiming that kind of productivity but when it comes for them to actually factually demonstrate that in practice...you hear crickets.
@@encapsulatio rust is a safer alternative to senior c++ developers. EVERYONE who is not a senior c++ developer should never use rust because golang is out there doing the same things rust do, with pretty much the same performance and 10x less code.
@@pedrolucasdeoliveiralara8199 The "10x less code" remark makes me think you're just some inexperienced software developer who in addition also has not programmed in Rust at a level to even form that kind of opinion.
The university I applied was teaching C++ from the first year. I don't say it's great language, but it kinda shaped my programming language preferences. When I started learning C#, JS, Python etc., there was some things I dislike about each of them, and none of this languages "clicked" with me. But when I started learning Rust, I've immediately felt myself at home. Also, I think that the difficulty of learning a language is personal. For instance I still have problems while working with Python.
I think Rust has a ton of features coming from Python. I felt very happy in Rust coming from Python (and various other languages, you've mentioned) :D Python has some special edge cases that aren't solved yet, I would say. That's where I get stuck from time to time. But that's normal, in every lang!
This is the first video of yours I've seen and wow! You present everything so clearly and eloquently. I can't believe I wasn't subscribed to you before - I am now, and I look forward to your next upload!
Great video. I have experience at an established startup with a Ruby codebase that has grown large and difficult to work in. New services are spun up in Kotlin because of the excellent type system so your point on having the flexibility later is spot on.
My thoughts on it (this is gonna be a large comment sorry :D) : I think the JS/TS -> Golang -> Rust chart is a continuation of the Discord blogpost. As a reminder, Discord used Golang on their API backend and had periodic latency issues when Golang started the garbage collector after a set amount of time. They were one of the first success stories of Rust where it has shown a clear, real world benefit over another solution. So most people only think about performance and also for another reason; "managed languages" (basically the opposite to system languages) are generally thought of as memory-safe (not saying they are) due to their garbage collector taking care of leaks and the lack of pointers or adjacent features like references to owned values. On paper the leaks don't matter because the GC takes care. Similarly static types are still thought of a hassle by some people, while TypeScript is often seen as good enough. So bringing the arguments (other than performance) in favor of Rust is often more tricky. I think with "deep understanding of memory" more the lifetime aspect of memory and the basic concept of pointers/references (basically why they are different to owned variables). As a C/C++ developer this might not seem as deep but from the viewpoint of someone from managed languages it's a pretty deep topic. While the compiler helps, a developer who doesn't understand it might make bad design decisions that lead portability later on and likely isn't as fast when writing Rust. That said; in the chart I think Golang in the middle also made little sense, from a business perspective I would try and minimize the amount of rewrites. If I see the App taking off it's more likely that performance and reliability should be future proof. According to the explanation the time spent in Golang should be relatively short but would require a new team of Go-Devs to pull off.
The Golang GC issue that Discord had is said to have been "toned down" after the Go team came to know about it, but not fully gone. Discord didn't bother to contact them about it, and that issue is still like a black blot on Go's reputation till now lol
I use rust at a startup. When the comparision is rust vs typescript, maybe I agree that it is easier to iterate in typescript. But, for us, the choice was rust vs C. It was much easier to iterate in rust than in C.
7:58 This way of mitigating memory leaks instantly reminded me of the famous quote by Rasmus Lerdorf, creator of PHP: "I'm not a real programmer. I throw together things until it works then I move on. The real programmers will say "Yeah it works but you're leaking memory everywhere. Perhaps we should fix that." I’ll just restart Apache every 10 requests"
My #1 reason for chosing rust for all (yes, literally all) my personal projects is value-holding enums and match. they are the best. I love them. They make it so much easier to model so many problem domains. safety and speed make it easier to justify using rust, nto the core reason i love it.
I originally agreed with Theo's video, as I had made 2 attempts to learn Rust and gave up when dealing with strings. However after forcing myself to learn it over the holidays for the 3rd time, I've started to fall in love with it. People keep harping on about its performance, but it's actually the language semantics that is beautiful about Rust. I don't think the DX is significantly slower than TypeScript, and I'm not surprised that orgs that adopt Rust for its performance discover there's a lot more benefits to using it. That being said, the pain of its learning curve is very real.
@@d0nutptr i am on this team. i learned it on stream 2020 for advent of code. my first examples were SOOOO BAD. it was SOOO hard. I was the one who made fun of rust constantly online. now i feel like i am that annoying guy trying to rust everything
@Nunes (Dev) you just have to start, there's really no magical tutorial that will definitely teach you what you need to know. Think about a project, or excercises such as Advent of Code's ones and tinker with the language, until you get it right
Nice video! I agree that the tooling and developer experience for cargo is nice. I started learning rust a few months ago, and cargo has been one of the things that has made me very happy. It is easy to create projects and add dependencies.
The embedded DSL thing is not grappled with enough. The fact that you can write HTML, CSS, and many other languages within Rust and have it all statically validated is ridiculous. The macro system is one of the best (non-functional) pre-processor experiences I have ever had. I still can't under appreciate the pattern matching either, I know that some people say the pattern matching is over-hyped, but man does it feel good to just be able to say "come to this branch if you have this shape", and exhaustive switches by default. SOO much to love about rust besides performance. I really think Theo needs to simply spend more time with Rust. Some of the arguments he makes against rust are very reminiscent of arguments javascript devs made against typescript early on. The type-system gets in my way, it takes so long to write things that are stupid simple in javascript, etc, etc, etc. Many of those people quietly changed their minds over the years, and I think Theo might on Rust as well. That is before you EVEN BEGIN to grok the fact that Theo doesn't write in regular typescript. He NEVER sits down and starts with a blank editor and a .tsconfig.json and index.ts file. He pretty much exclusively starts with a T3 app, which has Nextjs, typescript, trpc, tailwind, prisma, and NextAuth preconfigured and wired up out of the box. The Rust ecosystem is actively working on similar constructs as we speak. Given a few more years, spinning up a fully functional, SPA-first, scalable, memory-safe, fully-authorized Rust stack may be as simple as "> create app next-million-dollar-idea". The thing I am super excited about is the current work going on to bring Rust to mobile; not just as a linked library, but as a first-class dev language. This circles back to our DSL point, as one thing pretty much no other cross-platform framework can deal with is home-screen widgets. They are just so different between platforms, and they have to be declared to the systems as separate runnable processes that don't touch your code at all except when the user interacts with your touch points, that the only real solution is to develop native widgets in whichever native language you want, and then link them to your cross-platform app. Even React Native has to use this route (which is theo's preferred solution for mobile). Rust would be able to actually write those within Rust itself and package them in a way the system would accept. I am hyped for further developments in this space.
I started with rustlings a few days ago by completing Rustlings in two days. I was coming from PHP, Javascript, Python. Though I have experience in writing exploits in C/C++, Lua, Bash and Ruby. I must admit Rust is my new favorite language, despite its drawbacks in sense of beauty of the syntax and missing shortcuts. Though that can be improved over time.
Awesome video, thanks for your perspective! I feel like there is some repetition which stretched the duration of the video, but nonetheless I found it interesting and kept watching till the end, so keep it up :)
I don't care what others say and only reason I will keep learning rust just because I like it! (I just started learning Rust a few days ago!) I actually been thinking about learning any of low level languages and Rust seems like the best option for me.
Awesome video. Totally agree that most of Theo’s opinions are heavily colored by a startup perspective which won’t apply to most of us in large, established engineering teams. Also love the Lambda breakdown. Beyond that, the implication that most backend work can be accomplished with serverless seems reductive.
One question that people don't really talk about is simplicity. I do like a lot of the concepts of rust, like the borrow checker etc, but I don't like a lot of the semantic and syntactical complexities, like traits and operators etc. It's one of the reasons I prefer C89 over C++, that I have a simple syntax, just functions, structs and a few global variables, and that it doesn't change. Is there in the rust community a project to fix a minimal subset of the language - kinda like C89, so without vectors or other built-in functions, preferably even smaller than libc (personally speaking printf should have been provided in source, implemented in fwrite, instead of being in libc) - that could be standardized and could stay stable for a few decades, like C has been? Because as much as I would like to use a few of the language features of rust, I really rather not use a language that changes every year. A language should be a tool, not a platform, the platform are the libraries that are built with it, and as long as it's changing this much l don't think it could ever replace C in environments where this stability, to be able to build other platforms, is really needed, like in OS libraries and the like, and without native support for that the prospects of the language are not as great as it may look now, especially since a lot of the low level bindings are not that reliable (fot example, I tried to use FFI to connect to Vulkan, and I couldn't get it to work; maybe I'm just bad at it, but for the time being direct driver access seems a lot easier in C than in rust). Edit: After watching this video to the end, it seems it's much more about organizations/ companies than for people who just want to put their own ideas into code (especially single developers / open source projects etc). I still stand with my comments, but it's obviously different for these kind of commercialized environment, so I don't know if it's actually a critique or more of a description of where the language stands, of people in organizations vs. people who come more from an academic or artistic background (I'm personally coming from the mathematical side of it, and find it much easier to reason about computers as state machines etc, that's probably also why I like languages like C and Fortran more than many modern, less precise languages, which don't have a full standard document and a strict syntax and semantic description, but rely on implemention specifics instead).
I agree with you. Ive tried rust recently and for a solo developer dealing with the added complexity of the language is quite not worth it fro what it gives. I guess also this depends on the project, but for game development i much rather prefer C.
It does not take more work to write the same code in Rust when spending the same amount of time writing a feature in Rust vs. TypeScript. It DOES require more knowledge, but once you have it, you have it. Also, nobody cares about throwing away code in a project. If the really like it, then they can keep it in isolation as a reference. People don't pay Rust programmers any more than Go programmers, and Go doesn't require much more knowledge than TypeScript. Also, iteration is more important than how often something might be run. You should use only 1 language within a project if you can, and Rust has you covered far better when you get to the inevetable multithreaded madness. Infact, Rust removes the "madness" all together.
Yeah, performance is not unimportant, but to me the low overhead, no runtime, optional standard lib are in my view what C/C++ have had that gave it the monopoly in the embedded world where I work. Rust solves that while also greatly improving reliability with its type system and compile time guarantees, which is huge for many embedded projects.
When you are starting a new project and selecting the tech stack In a large company, you are often under the same pressure as a startup. If you don't deliver fast enough, the project gets shelved.
Okay, this is interesting. I'm a Python dev, picking up Rust in my spare time so I can write software music synthesizers (VST instruments) and then hopefully migrate/embed them in hardware. Eventually, I hope to have a set of connected arduinos (or whatever hardware) working as the logic modules in a synthesizer. So it sounds like the deep understanding of memory and getting really familiar with pointers will be truly vital, especially if I plan to embed any audio samples as sound sources. Along with learning audio algorithms, of course. What am I getting myself into?? 😂
Programmers are amazing. One dude doesn't like something, the other dude doesn't like that the first dude doesn't like something and bam - we have two points of view from which we can learn. Truly amazing
Fantastic video, well thought out. Hope to see more from you soon as you did a great job of condensing things down so that I can get more software context easily.
I'm a fullstack web developer(4y exp), coming from ML/data science background, I don't have deep knowledge of computers, I coded a bit in C i enjoyed it and understood well the pointers, but i lack knowledge about a lot of things, like protocols, network systems, and lot of low level stuff. One of my goals is to be able to work on low level engine something ! I just like optimizations, but I don't know if learning Rust is a good idea without that theory! I don't think i can find a job in Rust, even if i become good with it, because i feel like writing Rust is one thing, but writing something meaningful, like a system or an engine is a another level, i don't know how to make this transition, maybe read some books or something idk
Good stuff, but I saw you talking about the issues mainly of lamdba, what about cloudflare workers(they solve a lot of serverless problems, mainly cold starts.)
That's a good point! I completely forgot about Cloudflare workers while doing the research for this video. I also haven't used Cloudflare Workers before so it wasn't something I considered. It's totally possible that those solve some of these issues, but I'd need to dig into them more to know for sure! Excellent point :)
I've worked with typescript for over 6 years, and 3 with Rust. I'd prefer rust pretty much anywhere, except for GUI things. The most important advantage of Rust is just not having to think about ESNext, commonJS, node versions, eslint, prettier, jest, mocha and all that. The JS / TS / npm ecosystem is so much more hassle prone than Cargo. Yeah, learning rust is hard, but if you understand it, you'll love it. However, that learning curve will not be worth it for everyone.
what theo forgot is the JS is fast but it got bulky because of JS weakness. Type safety is not after thought in rust.. single thread is not a weakness for js even in rust we adopted it. JS has been scalable we just end up with too many abstraction. now based on every weakness and strength of high level languages having a low level language adopt all the good parts is going to be better than a high level language band aiding.. a high level language will always be limited moving on Rust will eventually be better at all categories while high level language will always be confined. but a high level languages is always going to be fast at experimentation of new things. a low level language could learn from it .
You forgot just one thing, when you make something faster you gain a cashback on your cloud budget. When your application run better and with more performance the credit card ticket come's with a fucking price.
VS Code is trash with Rust. I tried it and the IDE would literally take 5-8 seconds to parse the code i write and recognize that things like arguments in a defined function are actually arguments and not variables that i'm trying to define: fn func(a: i32, b: i32) { do stuff } If would fail to run my code saying that it can't find a and b. I then switched to Pycharm, which I use for Python anyway. I've never had issues with anything since then.
People who follow Theo have to be careful, he throws around a lot of absolutes and forgets that he doesn't represent the perspective of every developer. I subscribe to him because I'm in the typescript world and I feel like I can generally spot when he's wrong, but in this case I would have had no clue without watching this video.
Learning basic Rust, meaning, writing Rust as you would a language like Typescript/JavaScript is NOT hard AT ALL. (Its a terrible idea to do so, but, you can, and the performance benefits are still massive). So the argument "its hard" - no it is not. This is a myth. Rust only becomes hard once you _really_ want to squeeze out that extra performance etc. But if you are writing basic, simplistic applications like you would in Typescript, Rust is most certainly not hard. And thanks to the ecosystem you have a wide variety of tools instantaneously available, using cargo, similar to the nodejs ecosystem.
This is a good video. It kind of agreed with all the negatives of rust though and will still be the reason I won't learn it. But to be fair I just program for fun so I have no need for rust to begin with.
My biggest "Aha moment" with Rust was actually when I was doing a refactor. The compile dramatically reduced the cognitive load by limiting how much I needed to thing about integrating the change in the rest of the project. I focused on the logic I felt was needed, then started to sub it in where it was required and just rode the compiler suggestions to the finish line.
I conclude that if one wants to write some ill thought out code, in a hurry, with no regard to it's resource consumption, performance, correctness, reliability, longevity, maintainability, scalability, in general with no regard for any kind of quality metric, then there is no reason to use Rust. If your mission is to slap something to gather to enable grabbing some VC capital there is no reason to use Rust. I find it sad that such software developers, with no pride in their work, exist at all. It's likely why we live in a swamp of misbehaving and insecure software. Arguably such an attitude is professional, borderline criminal, negligence.
Languages has no value in themselves. After years of web development I came to the conclusion that even performance is not the only way to choose a stack. One has to determine what's the aim of the project and choose what is necessary and what's optional following multiple criterias. One of them is performance bit not only that, what's the features of this app can help answer the question and most of the time rust is not the answer. The majority of website today in the world are build on the LAMP stack and it works fine. It's stable, cheap and maintainable. Since nodejs other stacks have dominated the market most new and pro developers should focus on these, more jobs and more freelance projects. Rust, Golang and new languages and stacks are for specific needs that you won't encounter soon.
Why make a case for rust's performance advantage not being the leading factor to its selection if people are willing to tradeoff that factor for JavaScript hacks to those issues
My position in the video is that organizations are often choosing Rust in cases where you need performance, but that's because they don't recognize the other, more interesting benefits of the language. Rust is more than fast, it's great for large codebases, cross-team collaboration, and the types of developer workflows that we see at most larger organizations. Many languages are fast. C and C++ are fast. Zig is fast. Java can be fast (use in HFT). But what sets Rust apart from these options is not just speed, but its reliability and maintainability. I believe those properties are so much more important in a vast majority of situations than performance. To suggest that Rust's core benefit is performance is to condemn it to consideration only in performance critical situations. tl;dr: I think we should be using Rust in more situations than just those that call for performance. I think Rust has qualities beyond just performance. Because those qualities are more often applicable to the kinds of work we, as software devs, do day to day they're more important qualities of Rust.