Тёмный

Was I Wrong About Rust? 

Theo - t3․gg
Подписаться 287 тыс.
Просмотров 66 тыс.
50% 1

I did a video a few weeks ago about how moving from Go to Rust may have been a mistake. After a lot of chats with a lot of Rust devs, I MIGHT be wrong. Even if Prime agreed with me before.
SOURCE
ielm.io/blog/turbo
Check out my Twitch, Twitter, Discord more at t3.gg
S/O Ph4se0n3 for the awesome edit 🙏

Наука

Опубликовано:

 

30 апр 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 382   
@cempack
@cempack Месяц назад
RUST MENTIONED
@jorenchik8731
@jorenchik8731 Месяц назад
Where? 😮
@VivekYadav-ds8oz
@VivekYadav-ds8oz Месяц назад
Dammit you blink for one second and you miss it 😒
@cempack
@cempack Месяц назад
@@VivekYadav-ds8oz ikr !
@DannyLeWasTaken
@DannyLeWasTaken Месяц назад
RAHHHHHHH 🦀🦀🦀🦀🦀🦀🦀
@CoolestPossibleName
@CoolestPossibleName Месяц назад
MENTIONED mentioned
@alexpyattaev
@alexpyattaev Месяц назад
Rust story is about correctness, not coding speed. You move slowly, but the resulting code is far more reliable. Our team rewrote about 15k loc from python/numpy to rust. Code size grew by about 3k loc. Speed went through the roof (that was not the most important point though). Importantly, amount of strange results in the program output that we could not attribute to any particular location in code went to zero. So, as a nuclear option for fixing the truly obnoxious and untraceable bugs, rust works great. Also importantly, the "external" bits of the system are still in python, so we did not have to mess with api that we expose. By the way, we still have no idea where the bugs were exactly in the original code, we just know they did not survive the rewrite.
@doc8527
@doc8527 Месяц назад
Your experience has little to do with Rust. What you are referring to is just the benefit of using a strong static typed language. Static is the key here. Rust is further upon that for the memory-manage safety, which is irrelevant to your case. Since you mentioned numpy, most likely it's just a data processing layer rather than manipulating memory address, you will pretty much got the same feeling if the team decided to use C++/C#/java as long as it doesn't heavily involve memory management. Nowadays people really don't realize that subtle differences they got from the languages.
@alexpyattaev
@alexpyattaev Месяц назад
@@doc8527 This may be true, but my experience with both C++ and Java is generally that porting code from Python to them results in more bugs per feature, not less, especially so with C++. Strong typing is, quite probably, not the critical component of success. For what its worth, our Python code is fully annotated with mypy, so it is somewhat strictly typed in its own right. Cant say anything about C#, never did anything big in it.
@Tigregalis
@Tigregalis Месяц назад
@@doc8527 what other proven strong, static typed languages are there that approach (or exceed) the ergonomics of Python, other than Rust? genuine curiosity
@doc8527
@doc8527 Месяц назад
​@@Tigregalis One possible answer I have in mind is Zig in terms of the memory management. They have some syntax to help you free pointer properly. Syntax and looseness wise, maybe Typescript. But in all seriousness, "ergonomics" is a pretty subjective term, a lot of people just don't realize they are in familiarity category or truly ergonomics. In fact, Rust is anti-ergonomic. It's extremely verbose to ensure the correctness. This is the tradeoff. You can argue that the ergonomics is from the correctness, memory management, but not the code syntax itself. That's why it can be a big improvement for people who are starting from the C world. Again, it's still a subjective thing. From people who just start from the dynamic typed languages like python, JavaScript, and never used static typed language in the past. For whatever the projects they are working on, aren't really beneficial from it because most don't heavily involve the memory management (if it truly matters, the first lang (js, python) they pick really counter against the thing they tried to do, which doesn't make sense). So many are just impressive by the static strong typed, hence to answer back your question, if you are in the second case, Java (everything in class might bother you), C++, C#, C (don't abuse pointer then you should be fine, if everything works without pointer, don't touch it), and Go will pretty much give you the same "ergonomics" after few days/weeks of experience. It's just too early to talk about ergonomic before you run into real issue. There are also other factors like the available community libraries. Maybe you just like Python's syntax and rich libraries. When we talked about "ergonomic", we need to think about what it means. Obviously, there are always exception depending on what you are doing.
@mapron1
@mapron1 10 дней назад
" So, as a nuclear option for fixing the truly obnoxious and untraceable bugs..." ... rewriting project from scratch knowing all specs works great. I had rewritten project from 'old C++' (pre C++03) to C++17, and got all what you said (performance, tests, predictability) etc.
@LightTheMars
@LightTheMars Месяц назад
I find contributing to Rust projects much easier than contributing to JS projects. The strictness makes it easy to know whether what you're doing to this unknown codebase is right or not. It raises the confidence a lot.
@AlexWilkinsonYYC
@AlexWilkinsonYYC Месяц назад
Refactoring becomes a breeze as well.
@gusryan
@gusryan Месяц назад
The little bit of Rust experience I have has felt like this. JS and Go are both convenient but they're two of the most foot-gun-ey languages out there. Rust is incredibly inconvenient to write in but the "fearless concurrency" meme is also real. If you just wanna willy nilly share some mutable state between channels in Go nothing will stop you from blowing your foot off but in Rust you're forced to clone/implement Send and Sync/use Arc
@mclrc361
@mclrc361 Месяц назад
the "once you opt-out of the borrow checker, you're just writing weird C" comment makes me think that you haven't written much rust at all
@tiagocerqueira9459
@tiagocerqueira9459 Месяц назад
Yeah, I don't know where this misconception started, like every Rust codebase sprinkles unsafe for fun or wtv
@oserodal2702
@oserodal2702 Месяц назад
Even then, unsafe Rust is *still* very much "not just C".
@nubunto
@nubunto Месяц назад
@@tiagocerqueira9459aaahn… no. And unsafe rust relaxes _some_ rules not at all related to the borrow checker.
@Holobrine
@Holobrine Месяц назад
Yeah, in reality unsafe is used sparingly, clearly signposted, and wrapped in safe APIs. It’s like having little islands of C code that is more consistent with the rest of your code than C would actually be.
@tinrab
@tinrab Месяц назад
Imo, memory safety is like point #20 down the list of good things about Rust. I don't think most people care about it. I don't like how that's all that's being discussed about when it comes to Rust, as if it's that important.
@flyingsquirrel3271
@flyingsquirrel3271 Месяц назад
I still just don't buy that "sweeping changes" are that more difficult in Rust. In fact, I would be terrified to do a "sweeping change" in JS, because there are SO many opportunities to introduce subtle bugs when changing a lot of code obviously. In Rust, I basically start somewhere - remove something, change function signatures, replace a type with an enum, etc. etc. - and the compiler errors will show me where other code breaks and lead me naturally until everything works again. Edit: Sure, depending on the size of the change, it will take time until I can run my code again at all. But what's the point of running code that can easily be proven by the compiler to be incorrect?
@ascandone
@ascandone Месяц назад
You should try TDD
@flyingsquirrel3271
@flyingsquirrel3271 Месяц назад
@@ascandone You mean write a shit ton of extra code instead of writing the actual code in a way that can be meaningfully inspected by a compiler? Edit: Also, when using TDD, making "sweeping changes" is also extremely hard, no matter the language.
@chrisdaman4179
@chrisdaman4179 Месяц назад
I can tell you first hand rust is not easy to refactor. It's just a lie that it is. We have a saying on our team that it's easier to re-write rust code, then to change existing rust code.
@flyingsquirrel3271
@flyingsquirrel3271 Месяц назад
@@chrisdaman4179 Your first hand experience contradicts my first hand experience, so I guess it depends on what you're building, how you build it, probably size of codebase, size of team, etc..
@chrisdaman4179
@chrisdaman4179 Месяц назад
@@flyingsquirrel3271 I mean... I do work with rust professionally in a code base with easily 50,000 lines of code across our different crates. It's bad for just about every task outside of CLI tools, and even there it's only ok if you like clap... Which not all of us do. Even the Rust Bois on the team regret selecting it for our primary language.
@spageen
@spageen Месяц назад
WORDS MENTIONED
@Tigregalis
@Tigregalis Месяц назад
Gentlemen, we are listening to opinions on how easy it is to develop in Rust, from someone who has never written a line of Rust before
@random_bit
@random_bit Месяц назад
Facts, but to be fair, dev time in Rust does take more time if you come from JS land. Granted JS just lets you do whatever B's you want. I however love writing rust
@Greeem
@Greeem Месяц назад
Proper rust that isn't unwrap()s everywhere is indeed very time consuming and difficult for most people to write.
@random_bit
@random_bit Месяц назад
@@Greeem unwrap() isn't "improper", it's just a short hand that _can_ cause panics. If you know this and opt into it, while also handling those cases/propagating them up to a panic handler, what exactly is improper ?
@rcoder01
@rcoder01 Месяц назад
Easy way to get rid of your unwraps: find and replace with expect
@12crenshaw
@12crenshaw Месяц назад
Gentleman, I listen to opinions on how easy it is to write rust form someone who doesn't write in rust while I myself will probably never touch rust. You won my friends, you're more obnoxious than c++ users
@hobbit125
@hobbit125 Месяц назад
Really wish Theo would stop talking about how he imagines what programming in Rust is like based on memes and vibes when he's never written anything meaningful in rust. The idea that rust makes it hard to change code is completely wrong. It makes it easy and safe to do so.
@aaronwillett1333
@aaronwillett1333 Месяц назад
Theo is a streamer/uninformed opinion first, programmer second. To be expected.
@kurt7020
@kurt7020 Месяц назад
"Long compile times": Rust has incremental builds. Has for a while now. Unless you're building within a Docker container, for-the-first-time, every time, as part of some CI pipeline, it's a non-issue. Writing rust on my local dev machine, not an issue.
@kashperanto
@kashperanto 29 дней назад
Not to mention that you can't take compile times or even development/iteration times out of context. A less strict language may let you iterate faster, but are you truly factoring in all of the time you spend debugging things that can't happen in the other language? One nasty memory bug can add literal days of time. You need *a lot* of slow builds to come close to that much of a time sink. I think even just the everyday debugging of code that is wrong but made it through the compiler takes up all of that build time and then some, especially for low-level languages. This is the same problem I have with people who don't like tests (even unit tests). They make unexamined claims that tests add time and are wasted when refactoring, but they are likely doing the same work *manually* and throwing it away *every* time.
@Go_with-Christ
@Go_with-Christ 27 дней назад
Literally everyone commenting on compile time speeds mentions the word "slow"
@VivekYadav-ds8oz
@VivekYadav-ds8oz Месяц назад
You can just sense Prime's Twitch audience invading this comment section..
@aaronbrown3820
@aaronbrown3820 Месяц назад
Theo has been wrong about many things
@Patmorgan235Us
@Patmorgan235Us Месяц назад
PRIME MENTIONED
@oserodal2702
@oserodal2702 Месяц назад
Prime has been lowkey moving away from Rust for the past few months.
@Luxalpa
@Luxalpa Месяц назад
@@oserodal2702 Not lowkey. He's actively hating on Rust in a very biased way, spreading lots of misinformation, while it seems he's glorifying Golang. It's very strange watching his earlier takes on Go and the current ones. I stopped watching his content for the most part because of it. I know Theo doesn't like Rust either, but even in the original video to which this one is a response to, I found his takes generally well-reasoned and balanced.
@aniketbisht2823
@aniketbisht2823 Месяц назад
@@Luxalpa Most of Prime's criticism of Rust is valid. He did have a honeymoon phase with the language in the beginning and was quite evangelistic about it. But now having been experienced in it and using it in production, he has found some of it's shortcomings, for use in the real world.
@thegeniusfool
@thegeniusfool Месяц назад
There is a huge difference between coding influencers and actual senior coders.
@Quephara
@Quephara Месяц назад
Quoting theo : You should learn how to communicate, just look at where it got me He's a good communicator, not a good programmer. That's also why he thinks you don't need to type fast. I listen to him because it gives me hope, if he made it, I can. I'm following the advice of prime though
@thegeniusfool
@thegeniusfool Месяц назад
Clarification: I am not saying that one is "better" than the other, just different [kinds of] people. I would -- relative most audiences -- complicate matters intrinsically being a geek [rather] supreme with 45 languages in which I have been paid to develop code, and, yes, over some 40 (....) years. So I have forgotten how those learning these matters think. So I am glad to see somewhat lighter coders focus on communicating.
@rolandrodriguez
@rolandrodriguez Месяц назад
I made it about 10 mins in before I bailed. If you’re wondering if you should put in the effort to learn Rust, do it. It will be difficult for a few months and then you’ll gain momentum and realize the ROI for the gains far outweigh the time cost of learning.
@somebody-anonymous
@somebody-anonymous Месяц назад
Mentioning mentioned
@Kane0123
@Kane0123 Месяц назад
So mentioned.
@TheRadischen
@TheRadischen Месяц назад
Brazil mentioned
@alexleung842
@alexleung842 Месяц назад
Have you gone through the webpack codebase?? It's been a mess especially in the early days. Just because it's in JS doesn't mean the barrier to entry for contributing is low
@J-wm4ss
@J-wm4ss Месяц назад
yeah javascript is so inconsistent - having two equals operators that mean two different things, shallow and deep copying messes, the weirdness of bolting typescript on (it's an extra language and there are things like enums, which are considered bad, while rust has a really good enum system) make javascript bad for a mission-critical system that's supposed to be run many times a day.
@livioribeiro
@livioribeiro Месяц назад
Any project that is complex enough can be very hard to get started with. For what I have heard, it takes a couple months for a developer to be fully productive in the Terraform codebase, and it is written in Go.
@jorgemartin3057
@jorgemartin3057 Месяц назад
I think theo is overestimating how hard it is to write rust. Its not that bad, and in many ways its type system makes it VERY expressive
@AdamFiregate
@AdamFiregate 24 дня назад
I agree. He should have spent at least 100 hours with Rust to have a sense of it as Prime mentioned this 100 hour rule.
@LtdJorge
@LtdJorge 8 дней назад
The type system is incredible. We have to thank the creators taking so much inspiration from functional languages.
@stonehat
@stonehat Месяц назад
If they are maintaining it and we get it for free, they can write it however they like.
@tiagocerqueira9459
@tiagocerqueira9459 Месяц назад
Maaan stop portraying Rust as this impossible to write language. It's not true, it's a systems programming language and that won't change, if you don't like those, fine but there's a lot of people that do
@computerfan1079
@computerfan1079 Месяц назад
It is not a systems programming language. The whole point of Linux is that you can write low level and high level code
@baconmanthelegend
@baconmanthelegend Месяц назад
@@computerfan1079the whole point of Linux? What
@arson5304
@arson5304 Месяц назад
@@baconmanthelegend i think he meant rust lol
@tiagocerqueira9459
@tiagocerqueira9459 Месяц назад
@@computerfan1079 assuming you meant Rust: it's cool you have high level abstractions but fundamentally you still need to understand how memory is managed, thus it's a systems programming language
@Quephara
@Quephara Месяц назад
Quoting theo : When I write rust I feel like I have to think.
@Sneg00vik
@Sneg00vik Месяц назад
I noticed that when I return to my Rust pet-project six months later, I literally get into my code within an hour. There is no such thing in Python and C++.
@einargs
@einargs Месяц назад
Haskell is actually great at doing breaking changes to fix these kinds of things. It still takes years of course, but they're willing to change fundamental parts of the language, like adding applicative between functor and monad and moving fail out of monad and into monad fail
@LutherDePapier
@LutherDePapier Месяц назад
I heartly disagree about the comparison with gamers. We're not asking "why can't you add more maps?" We're asking: "You've designed and shipped a live game for which you require your users' time and money, why didn't you put in place the tools to better support said live game before you actually shipped it?"
@ColinFox
@ColinFox 25 дней назад
Well, to be fair, there ARE a lot of gamers that make incredibly naive or silly requests of devs. You may not be one of them, but hoo boy are they out there.
@alienm00sehunter
@alienm00sehunter Месяц назад
Once you are used to Rust, the borrow checker doesn't really slow you down. I feel as if the strict type system is actually what tends to slow down development.
@chrisdaman4179
@chrisdaman4179 Месяц назад
This is just not true at all. The borrow checker is really an issue when refactoring anything sufficiently large. I know you here prime SAY this, but it's just not true. Try working on a rust codebase with more than 5000 lines of code, and you will change your tune.
@keyboardcruiser1799
@keyboardcruiser1799 Месяц назад
​@@chrisdaman4179isn't that a good thing, demonstrating the use of why a borrow checker is useful? You don't want subtle bugs to go left unnoticed after a big (+5000 LoC) refactor. It's way harder to fuck up with the borrow checker.
@chrisdaman4179
@chrisdaman4179 Месяц назад
@@keyboardcruiser1799 This assumes you solved the problem correctly the first time, and it should never change, and it assumes rust stops issues that it doesn't. Change your API out of necessity in a code base this large or larger and cry. Clippy breaks down and you are forced to compile for every error, and that takes longer than other languages. It's just a fever dream for theater kids that want to feel superior to everyone else.
@__Brandon__
@__Brandon__ Месяц назад
Maybe you just don't have a good design if you are unable to refactor it. When you write your code it should be written in a way that it can be refactored. You want to abstract the required complexity without adding any unnecessary complexity. I don't know your exact situation, but the only way I can see you getting yourself into a situation where refactoring isn't possible is if you made abstractions that added unnecessary complexity. Perhaps you just need to write code that can be refactored and not add a bunch of extra complexity that isn't needed
@chrisdaman4179
@chrisdaman4179 Месяц назад
@@__Brandon__ That's super helpful and realistic to type. Now let's see some of your code that's graced by the gods of good design? You can try to wrap your insult in extra fluff, but it doesn't change the fact that the limiting factor for the team of people from multiple background is the language currently in use. You probably have only used rust for side projects by yourself. Thats how rust devs work best anyway. Useless projects alone in their bedrooms.
@AbstruseJoker
@AbstruseJoker Месяц назад
This man has not written go in his life
@shaneosbourne8640
@shaneosbourne8640 Месяц назад
high respect for starting the video in this way
@vulbyte
@vulbyte Месяц назад
calling typescript typesafe pains me
@AlexWilkinsonYYC
@AlexWilkinsonYYC Месяц назад
Our experience was there is a threshold with a project where when it becomes big enough that you essentially have a dev (or two...) spending a lot of their time hunting dumb bugs like intermittent undefineds to keep development rolling. That's why we switched to Rust. We could not maintain our codebase and continue to add features that worked reliably in JS/TS with only a few devs. Similar to what the TurboRepo person said "The number of github issues decreased dramatically, and we had to check that people were still using our product" (paraphrasing).
@alienm00sehunter
@alienm00sehunter Месяц назад
I don't think discord moved away from Go. That blog post was about one of their performance critical services.
@random_bit
@random_bit Месяц назад
Theo, I cannot stress how joyful the rust compiler is for bug fixing or general guidance towards using correct types. I think you as a TypeScript dev will learn to love it and get pissed at how TS doesn't do more like rustc Edit: Theo, the reason discord moved from Go was the latency introduced by the Garbage Collector at specific intervals leading to an unpleasant audio experience. That is inherently a language choice problem.
@cchance
@cchance Месяц назад
My issue with this take is you say "if it's 3x longer to write in rust" ... it isn't though it really isn't lol for 99% of what you deal with in most of these projects it's no harder than writing to c# or typescript lol for the other 1% or even 5-10% its definitly a cliff more difficult but for the vast majority of features being "experimented with" won't ever touch that small slice.
@chrisdaman4179
@chrisdaman4179 Месяц назад
This is just not true for production code. Rust takes significantly longer to write than other languages. You only hold this opinion if you have never built a real application in rust that isn't a junky toy project.
@mornwind318
@mornwind318 Месяц назад
​@@chrisdaman4179Rust isn't any harder to write an API in than TypeScript. In fact stuff like serde and sqlx make it a pleasure to do so.
@chrisdaman4179
@chrisdaman4179 Месяц назад
@@mornwind318 Serde is cool, but you are not comparing to reality. RU-vid and social media has you convinced the whole industry is Rust/TS. There are significantly better languages for creating API. Real applications don't use TS as much as you would think. The rest of Rust's web frameworks are hideous to work in too. So while Serde is neat, that doesnt overcome the rest of the rust issues. Not to mention that async rust is clunky and unmaintainablely prohibitive to teams.
@dansimco
@dansimco Месяц назад
even after a couple of decades of javascript experience, I found the on-ramp to rust much smoother than typescript.
@supernerd6983
@supernerd6983 Месяц назад
I don't know why I keep coming here you guys I'm too stupid for this channel
@immdipu
@immdipu Месяц назад
same lol
@farrela.846
@farrela.846 Месяц назад
Yea same lol
@MrDragos360
@MrDragos360 Месяц назад
I don't know why I keep comming here, i found this guy promoting gatekeeping and supporting increasing the development complexity just because he or some like to flex and keep others away.
@C4CH3S
@C4CH3S Месяц назад
you are not, this channel is just JS complexity propaganda. any other programming channel wont flood you with dumb things such as _points at whatever bullshit is going on at the JS clown fiesta_ I still come here for the drama tho lmao
@Tagvi
@Tagvi Месяц назад
​@@MrDragos360 I subbed to Theo nearly 2 years ago, and this was INTENDED to be a more senior channel. He has no obligation to bring this down to 1 month experience junior devs, but he actually puts in the effort to make things more understandable since the channel inevitably grew to a lot more (including junior) subscribers, which I do respect him for, but in no way does he have an obligation of any kind. I just don't get what you want, this is a channel for senior devs that are interested in the complexities of dev, no one is forcing you to watch this.
@chaosfenix
@chaosfenix 14 дней назад
I think one of the biggest benefits to working in rust is the ability to effectively orchestrate code development among many developers. If only one or a handful of people are writing for a particular project it isnt all that difficult to make sure things operate properly. Once you are working with dozens of programmers across multiple companies the guarantees and checks you get by using rust really start to show their value.
@user-pb4hb3zv6j
@user-pb4hb3zv6j Месяц назад
It's way easier to maintain large complex applications and libraries in rust than it is in javascript
@garad123456
@garad123456 Месяц назад
You can't "opt-out from the borrow checker"
@HUEHUEUHEPony
@HUEHUEUHEPony Месяц назад
unsafe keyword: let me introduce myself
@garad123456
@garad123456 Месяц назад
@@HUEHUEUHEPony unsafe does not disable borrow checker.
@Mr_Yeah
@Mr_Yeah 26 дней назад
@@HUEHUEUHEPony > It’s important to understand that `unsafe` doesn’t turn off the borrow checker or disable any other of Rust’s safety checks: if you use a reference in unsafe code, it will still be checked. - The Rust Programming Language (aka the book)
@ordazgustavo
@ordazgustavo Месяц назад
35:58 I don’t think the problem is rust, you mention that esbuild was crated in a couple of weeks and we don’t have anything similar but we have had SWC for a long time. I think the problem is that everyone is trying to create their own solutions and over engineered tooling before solving the most basic needs for 80% of the use cases
@flwi
@flwi Месяц назад
Interesting video. Cool that you're open to changing your mind on camera! I've worked with scala for the past years and am currently learning rust (for backend) and typescript with react for frontend stuff. Rust definitely has its quirks, but it often feels like they make a lot of sense. The adt modelling in rust is really great and the pattern matching makes it very usable. It's a real bummer that typescript doesn't have that. I also wish that typescript had typeclasses. e.g. requiring an Ord instance for sorting an array by the values or one of their properties. I expected to have more trouble learning rust, but I have more trouble learning all the intricacies of react.
@khai96x
@khai96x Месяц назад
TypeScript may not have type classes, but JavaScript has symbols. The issue is most of existing JS builtins and ecosystem don't make use of symbols, making it less useful than Rust's traits, which was introduced from day one.
@Adowrath
@Adowrath Месяц назад
@@khai96x But what are Symbols other than roundabout interfaces?
@khai96x
@khai96x Месяц назад
@@Adowrath What are traits then if not interfaces?
@ald890
@ald890 Месяц назад
Soydev changed his mind? episode 9001
@guest7329
@guest7329 Месяц назад
for system level tools traidoffs very different. What would you do if node segfault's? Speed of iteration matters only then releases rock solid (for low level tools)
@anon_y_mousse
@anon_y_mousse Месяц назад
I think that maybe some people missed your overall point, which is a very valid point that applies no matter what language the project was written in or what language they want to move the project to. For my own perspective on this constant RIIR mentality, I've found nearly universally that when rewrites happen, features are lost. Even if the program runs faster, if it does less, as the user of that program I don't care if it's now viewed as a "safer" program. Of course, as anyone who knows more than one systems language can tell you, there's more than one way to skin a cat and Rust isn't any safer than other languages, even C. There are plenty of tools to do analysis of your code and keep your program error free that are far better than the Rust compiler and target languages like C. You can write high quality code in nearly any language, it's just a matter of skill. One could claim all they want that "Rust forces you to do things a certain way", but if you already write your code in that way then you shouldn't have problems with C, and if you don't already write your code that way then you were using C wrongly anyhow. If you didn't already know how to correctly write code, then you probably shouldn't have been a programmer in the first place, or you should just use JavaScript. As for the comments on async, I have always believed it's the wrong solution for the problem at hand. It's an attempt to merge the concept of a coroutine with threads and make them take less effort than threads, but it's still just threads with you having less control over what happens. True coroutines don't require separate threads, but the concept has been bastardized by everyone who keeps incorporating async garbage into languages. I look at them as being unnecessary work because it's better overall to just use the OOP method of saving state in memory somewhere, maybe even on the stack, and then just calling a function to update that state, which is more or less the generator concept. Consider that C already has that in its standard library with FILE's, where you can read some input or write some output and it's buffered. If you really want to read input in the background, then just use a separate thread, which even C has in its standard library now too. Although, I doubt anyone will read all of this, and it's most likely that someone will see this last line and comment that they read the whole post when they didn't.
@RockTheCage55
@RockTheCage55 Месяц назад
This is how i do it. I always start with javascript. I then transition to go if either there is performance issues or if it can save me quite a bit on my cloud bill. I would only got to rust if it would save me a lot of money or if the performance difference made real significant performance impact (maybe on a hot path). If I end up needing rust i considering myself lucky because that mean whatever app i'm developing is being used a LOT.
@Shaar_
@Shaar_ Месяц назад
"Was I Wrong About flutter?" next ?
@nUrnxvmhTEuU
@nUrnxvmhTEuU Месяц назад
Only if he finds it's even worse than he thought
@kenny_u
@kenny_u Месяц назад
I must say, I enjoy that you post videos like this when you get more accurate knowledge about something you were misinformed about and want to share it. The world would be a much better place if more people did this!
@X39
@X39 27 дней назад
25:30 i never heard someone bring up the argument for a language of "The good thing is, this stuff can be made so unmaintainable, that reusing old code is a breeze" For rewriting things, you do not have to use new types either in any typed language, it generally is a good idea to replace your broken code tho, which does apply for both typed and ducktyped languages
@dzienisz
@dzienisz Месяц назад
"Today Theo" explaining "Old/Young Theo" that he was wrong. I can't wait for a video where "Future Theo" will explain "Today Theo" using this video :P
@Rohinthas
@Rohinthas Месяц назад
It would be so funny if this video ended with: No, I was right the entire time and ya'll dont know what you are talking about
@_engid
@_engid Месяц назад
6:40 "Once you opt out of the borrow checker, you're writing a weird syntax for C" is over exaggerated. Even unsafe rust has more guardrails than C. I get your point that Rust is rigid and makes building flexible systems hard, but the value of using rust doesn't go away as soon as you need to use unsafe or use indexes as if they were pointers. You're still in a much safer environment than writing raw C.
@GnomeEU
@GnomeEU Месяц назад
I never used Rust. But the Theory behind it sounds good. Fast as C without so much memory issues. I would use it if it had the eco system of dotnet. A language is just as good as the framework around it.
@CatFace8885
@CatFace8885 Месяц назад
I'm not much of a Rustacean, but the Rust ecosystems actually pretty decent for many things from what I've heard. Fully mature and fleshed out? Probably not. But that may not be a problem for everything
@astronemir
@astronemir Месяц назад
I disagree that spot fixes are easier in go or C. Once you are “stable” those spot fixes take FOREVER to approve due to problems already mentioned in this video. This is project specific, yes. If you write internal tooling for Netflix and you breaking something isn’t going to make your biggest customer pissed off and walk away and shut down your startup, just fix it and ship, and let the users send bug reports. But if you are a platform tool targeting certain kind of enterprise devs, the nightly builds failing can be literal tens of millions or more down the drain for your large manufacturing tech customer, who will leave you. And then you will go bankrupt. Point isn’t that you can’t create stable in C or go. It’s just that doing so requires long iteration and test driven development or just slow development. Which is not ideal for a startup like this. Thus, think about the kind of customer you have. If you have regular people who when Netflix takes a little too long to load will just turn it off and watch RU-vid and come back later, and maybe after weeks or months of this will actually start canceling at a few %, just ship. But if you have 5 Major European enterprises and a small fraction of American tech startups as your customers, losing any of the big boys can literally kill your company and your job, you need to use the better tool. Rust or TDD or slow code is better here. And let’s be real unless you hire uncle Bob himself you are not getting 20 year olds writing test driven code in go or C. So now you have a million betas and release channels and golden tests and people having to manually try and QA things for each bug fix and release. Bug reports pile up in the repo but most Importantly your big time customers expect stability and features. So you focus all your time on delivering that bare minimum for them and nothing else. You become slow. Seen it with so many tools. Vs if you are writing some OS software to help out a smattering of fellow devs, or to serve to web clients who could be just as well down because their wires were literally chewed on by rats, it’s ok to just ship. Context matters.
@thegoldenatlas753
@thegoldenatlas753 26 дней назад
its hilarious how your main reasoning is "js to rust is hard" meanwhile i moved from js to rust and feel for the first time like i can actually understand what im doing.
@bojanmatic024
@bojanmatic024 Месяц назад
What browser are you using there?
@icedlee337
@icedlee337 Месяц назад
your deduction about garbage-collectionlessness being less important for temporal operations like build tools is valid but the premise is incorrect if the build tool is daemonized (like Nx for example)
@arcuscerebellumus8797
@arcuscerebellumus8797 Месяц назад
Which is mostly how I would imagine frequently required features to operate, right? Why spin up something and then tear it down 20 times a second if you cen just put it there and feed it data? But then you probably wouldn't want your build tools being called 20 times a second either...
@Luxalpa
@Luxalpa Месяц назад
I think an important thing here that's also being missed is that GC is very memory hungry typically, because the memory always grows until the next GC run. And if you're parsing in a lot of files, that's a lot of heap memory. If you're not carefully managing that, you very quickly can end up with gigantic memory usage and slowdowns. I wrote an application in Rust that has to parse a lot of JSON data and I ended up using a steaming JSON parser and a partially custom Vec implementation, because I wanted to keep the memory usage of the application under 128 MB (the JSON is several GB in size) so that it fits into the memory-constrained Docker container.
@ultimatedude5686
@ultimatedude5686 Месяц назад
@@Luxalpa Out of curiosity why did you need a partially custom Vec implementation?
@joshka7634
@joshka7634 Месяц назад
I'd be interested to see data to back serverless cold start in rust being slower than javascript (and a small google search finds the opposite)
@Luxalpa
@Luxalpa Месяц назад
Yes. I had looked this up several times on Google and everyone said the opposite, so this really threw me off!
@cherubin7th
@cherubin7th 29 дней назад
Slow is smooth and smooth is fast.
@DemiImp
@DemiImp 14 дней назад
There's a browser solution for breaking JavaScript language changes. In the script tag, it can specify the version the JS is.
@mtddm372
@mtddm372 Месяц назад
That was a really interesting and enjoyable to watch video. Thanks Theo
@JLarky
@JLarky Месяц назад
9:45 if you are coming up with new (let's say) css-in-js solution you not only need to implement it in Rust, but also you need turbo pack to merge that in main, because you can't just easily include native compiled modules as you can import a JavaScript plugin
@akuoko_konadu
@akuoko_konadu Месяц назад
I like that Theo took it back, the guy is a prime example of humbleness
@_Aarius_
@_Aarius_ 21 день назад
32:50 i use rust for lambda / serverless and honestly its been great. my cold starts have been ~5ms + the time it takes to create a db connection, on most functions. Compile with size optimisations and maybe use UPX (affects actual runtime perf but can improve coldstart due to package size), and its honestly been a pretty great experience. Can get away with pretty low memory usage too
@mikekeathley1120
@mikekeathley1120 6 дней назад
Sometimes I think FE web devs should be required to develop in a "heavy" backend language like Java, Rust, C#, or any other so that they can experience what development on a large code base in a stable ecosystem is like. Most of the problems that JS developers are attempting to solve using JS for JS problems are either already solved in another language or are better solved in another language. One of your arguments against using Rust (or even Go) for this tool was because JS devs would have to learn another language. I audibly said, "Good." Learning JavaScript made me a better Java developer. Learning Clojure also made me a better Java developer. Learning Python taught me the value of rapid micro-iterations. Dabbling in C gave me an appreciation for simply having structs and functions. When you learn another language that puts a particular paradigm at the forefront, it teaches you the absolute best techniques and paradigms for a given situation. For example, Clojure taught me the importance of thinking in terms of composed expressions to get transparently get a value back. Now, I try to code as few statements as I feasibly can and try to consolidate an entire method body into a few manageable and significant expressions. This makes the code cleaner and the intent easier to understand. If more JS/TS devs ventured out of the JS ecosystem and spent a serious amount of time learning the value of backwards compatibility and stability, the web ecosystem would be in a much better place.
@tserica
@tserica Месяц назад
One thing that can make refactoring Rust code easier is using traits and impl parameters in your calls instead of concrete types. This can also make your API more flexible and capable.
@duckhorse2563
@duckhorse2563 Месяц назад
Uganda mentioned
@dougsaylor6442
@dougsaylor6442 18 дней назад
This was a really neat video with some interesting takes. 😊
@user-dn7qr7vs1h
@user-dn7qr7vs1h 12 дней назад
I don't understand how a highly-verbose language with a very limited abstraction tools (Go) can be better for fast-prototyping than a languages that are less verbose and have better abstraction support (and I don't mean Rust. It's type system and verbosity don't allow fast-prototyping, I believe).
@vregile
@vregile Месяц назад
PRIMEAGEN MENTIONED!!!!
@AlexGrand
@AlexGrand Месяц назад
We stopped using turborepo because of a broken caches, sometimes turbo is pushing broken files (like a half of a file, or some file is completely missed from tsc output). We tried to find a reproducible case, but it's a random but, which broke our production and stage envs multiple times. Also, it was really hard to debug, because you have correct local cache, but remote was broken.
@innomin8251
@innomin8251 Месяц назад
I would argue garbage collection and memory management in general is actually critically important if you want fast build tools. Think about the number of times the code has to be copied in memory every time you’re doing one of those transpile operations… malloc isn’t free, and I need to point no further than Go’s now abandoned memory arena experiment, and the performance benefits that it enabled in specific use cases. TL;DR: if memory management wasn’t important, then Go wouldn’t be trying things like memory arenas.
@Oktokolo
@Oktokolo 13 дней назад
Actually i love the Web ecosystem slowing down a bit. Stability is a value on its own. It makes it easier to research stuff. I hate when everything i find is already outdated.
@taquanminhlong
@taquanminhlong Месяц назад
The expressiveness of rust would be the greatest thing imo. Once you get used to rust, it just feel normal anyway. 😂
@transcendtient
@transcendtient Месяц назад
If you work for a company that's been in business for 10 years and looks basically the same *hint that's you*... You can afford to write in something that isn't a JS framework. I have no idea why the benchmark for what language to use is always "startup".
@mr_shevich
@mr_shevich Месяц назад
Hi Theo, I love ur channel , it is one of the best Fullstack resource to learn Ive ever seen. Do you have some open vacancies in your company? I would love to join
@bjesuiter
@bjesuiter Месяц назад
When you start to build libraries in Rust, you may not be able to simply do a major version bump
@davidwhatever9041
@davidwhatever9041 Месяц назад
kudos for having the integrity to revisit the topic
@computerfan1079
@computerfan1079 Месяц назад
I would recommend actually writing some Rust. There are drivers and even OSes that barely use Unsafe, I don't think many tools need it at all. Feature flexibility is not the same as memory safety. In fact, the memory safety aspect makes it easier to refactor since the compiler points out any problems that arise. Usually you have good takes, but this is just not a good one.
@blenderpanzi
@blenderpanzi Месяц назад
A lot of programming languages that started under unix emulate the POSIX API on Windows. By which I mean things like errno values, stat(), file permissions, unlink(), etc. which work quite different on Windows. Some languages that do that are e.g. Python, NodeJS, apparently Go. Can't remember if also Ruby. This emulation can lead to subtle bugs, especially around file permissions. Rust doesn't do that. Instead it gives you a general API for things that are the same under Windows and POSIX, plus platform specific traits for appropriate data types that give you the platform specific functionality. Meaning you have to make an explicit decision on how exactly your program should work under Windows. I don't use Windows, so I would be ok with it not being supported at all, but I think poorly emulating the POSIX API is the worst option.
@TekExplorer
@TekExplorer 4 дня назад
Rust: make invalid states *_UNREPRESENTABLE_*
@TekExplorer
@TekExplorer 4 дня назад
10:50 plugin systems! if a well defined plugin system is created, it would not be difficult to use wasm components to make extensions with pretty much any language, js included.
@jakubpietras9925
@jakubpietras9925 20 дней назад
I would add even more nuance to the subtle effect of reduced innovation that you are talking about - are we sure there would be many people determined enough to write bindings and plugins, who at the same time would get immediately discouraged when seeing it's in another language? How many of the people who would get discouraged by the need to learn something more, would make a valuable contribution/innovation? I am not saying that you are bad developer if you really like to work only with one language and nothing else, but are you a great one with a broad perspective that tends to contribute to complex tools codebases?
@prozacgod
@prozacgod Месяц назад
@6:54 - one of my ... "concerns?" ( poorly worded ) perhaps curiousities? - About rust vs C, this comes from a lack of rust experience, would be that C as a language and C++ for that matter, has made a number of concessions in the language to make code more succinct, improve performance etc. And I often wondered if that is ... not be pure logic - but ... similar to "the type of the thing your working with" - like if I have to explain constexpr to c++ then in order to get simlar gains in Rust I will have to get rust to know this about the lifecycle of that memory reference/variable (type system) - and if that feature is missing then the optimization can't be done. Hence the need for C? So will rust slowly but surely degrade into a poorer representation of itself in order to have the deep low level features of C/C++ over time? How is that mitigated? Obviously it takes time for a language to mature, and right now C/C++ is looking at rust like "your time will come child, be patient" lol. But I mean, it would seem that C/C++ still has SOME good advantages over rust, and rust has good use cases now. (I suppose that in some extreme cases, like embedded development, you'd want to have C/C++/Rust just to cover your bases, the day-to-day coding is done in rust, and perfomant interfaces may need to be written in C/C++) (Let me know if I missed the mark completely, I am an old dog learning new tricks.)
@ultimatedude5686
@ultimatedude5686 Месяц назад
I'm not sure exactly what you're trying to say. The lifetime of a variable only really matters during type-checking, it doesn't directly affect performance. Rust performance is about on par with C/C++. If you want the maximum possible performance you can use unsafe code, though it's not really necessary most of the time.
@irlshrek
@irlshrek 20 дней назад
well, ive been working with Rust and I honestly have no reason or intention of not using it. it really is phenomenal
@briankejlberg7563
@briankejlberg7563 Месяц назад
A comment on the friction for the community to build a new loader or plugin in turbopack. In your opinion would that friction be "solved" by providing a JS plugin interface, so innovators that don't know rust well enough or don't have the time to learn it for building a POC of a new thing. When the POC in JS is mature enough, and the solution to the problem is popular enough, the author or somebody else would then be able to write the more performant rust counter part?
@monad_tcp
@monad_tcp Месяц назад
17:57 because Typescript doesn't have proper enums, which are disjoint types (gadts).
@Maxjoker98
@Maxjoker98 Месяц назад
I think the programming language has to work with the specific code style, project requirements, and people that will be working on the project. You can develop Javascript front-end libraries in C, it's just a mess and most people won't be able to deal with it. And you won't be iterating as fast, but if you plan ahead and your team/your self is coordinated enough, everything is possible.
@BogdanTheGeek
@BogdanTheGeek Месяц назад
Bun is not the biggest user of Zig. Uber is.
@Redyf
@Redyf Месяц назад
MENTIONS MENTIONED
@elliemeyer9164
@elliemeyer9164 25 дней назад
I fankly can't understand why it was given the very mame "rust"..
@RustSimply
@RustSimply 25 дней назад
"Rust is hard" :sigh: I made a channel specifically to address this rhetoric. To be fair, this idea, "Rust is hard", still exists within the community too, but, I'm sorry, I just don't think its true... anymore.
@remrevo3944
@remrevo3944 Месяц назад
11:12 I strongly disagree that you can have confidence in typescript in terms of types. Especially in a medium to large code base you are not extremely familiar with. When done intentionally it is comically easy to violate typescripts typesystem. (*Without* the usage of any any-type.)
@hamzarashid7579
@hamzarashid7579 Месяц назад
MELKY MENTIONED
@TheUnknownFactor
@TheUnknownFactor Месяц назад
From my perspective, the main thing I dont like about turbopack is that it's porting the trashpile that is webpack. Every single other bundler/build tool since the days of Grunt has been easier to configure than webpack
@sagnikc395
@sagnikc395 Месяц назад
i took your advice last time to shift to go from rust for building internal CLI tools and have been more productive in building stuff and delivering outcomes than I would have been in trying and learning rust and trying to make something barely functional.
@mikkelens
@mikkelens 28 дней назад
I don't understand why you are saying that you would "have to learn rust" if you were already using it ("shifting" from it). Just say you chose to learn something else.
@azreow
@azreow 9 дней назад
The DX argument for why you should use something is such a subjective thing that I don't believe it holds any weight in conversations about when you should or shouldn't do something. If you, as a developer, enjoy something that someone else doesn't, that doesn't mean that the thing you enjoy is objectively better or worse. Every developer values different things in their coding experience, so there is not objectively better DX.
@graffhyrum
@graffhyrum Месяц назад
Saying Rust is 3x the time of Go is absurd. Google's engineering director just did a talk about how their Rust projects are "about as productive" as their Go projects. ru-vid.com6mZRWFQRvmw?si=Yor3rbm2BN4zlmQy
@Sammysapphira
@Sammysapphira Месяц назад
Thank you for supporting your humble anime profile picture devs
@sebastianmihaiprisacariu8975
@sebastianmihaiprisacariu8975 Месяц назад
Regarding Tailwind - I actually find Tailwind to be a bit more difficult to debug. It's harder to find the right component using the Devtools. I switched from Tailwind to CSS Modules with PostCSS. With the "go-to-definition" feature of the CSS Module plugin for VSCode it's especially easy to debug and work with CSS. To me it mainly comes down to Tailwind giving you a good style system to work with and not making you name things, while CSS Modules give more flexibility and easier debugging & code readability.
@nicolasgomez5207
@nicolasgomez5207 Месяц назад
MENTIONED MENTIONED
@boccobadz
@boccobadz Месяц назад
"Why don't you load one stash instead of doing select * and loading stashes of everybody on the server?", why Blizz? Yes, gamedev is not easy but most hirings are DEI-based instead of skill based so most people at AAA-studios these days have no idea not only about gaming but also about performance driven programming.
@ChrisPepper1989
@ChrisPepper1989 Месяц назад
I disagree with the "your just kinda fucked" a lot of that "type pain" is easily fixed by decent IDE features, type renaming, restructuring and function signature changes are a huge PITA unless you have a tool that will essentially do it for you
@thunder____
@thunder____ Месяц назад
Just use ASM for everything, problem solved
@CsAlchemy-eg6ch
@CsAlchemy-eg6ch 29 дней назад
PERFORMANCE AND SCALABILITY MENTIONED !
@nevokrien95
@nevokrien95 26 дней назад
There are important rust libs that are archived... because they trust back compatibility that much.
Далее
Cloudflare Can't Stop Lying
44:41
Просмотров 45 тыс.
Cool Tools I’ve Been Using Lately
23:11
Просмотров 89 тыс.
HELLUVA BOSS - THE FULL MOON  // S2: Episode 8
23:10
Pretty much every website uses the wrong font size…
15:33
How Rust rose to dominance (by accident)
11:01
Просмотров 31 тыс.
You dont know OOP
50:48
Просмотров 272 тыс.
How Figma Hacked Postgres Into Scalability
36:56
Просмотров 55 тыс.
I screwed up.
7:47
Просмотров 117 тыс.
The Biggest Lie In HTML
23:56
Просмотров 90 тыс.
Pratik Cat6 kablo soyma
0:15
Просмотров 8 млн
Bardak ile Projektör Nasıl Yapılır?
0:19
Просмотров 3,4 млн
ПК с Авито за 3000р
0:58
Просмотров 1,5 млн
What’s your charging level??
0:14
Просмотров 7 млн