AWS re:Invent 2022 - Rust is interesting, but does it really make sense for me? (BOA201)

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 75

  • @__jan
    @__jan ปีที่แล้ว +19

    9:31 the HashMap will allocate when you insert new entries into it, so that code isn't allocation free.

    • @EngineerNick
      @EngineerNick ปีที่แล้ว +7

      I think he clarifies that it doesn't reallocate parts of the string. It might allocate more space to store &str pointers as you say.

  • @DezzKB
    @DezzKB ปีที่แล้ว +7

    19:40 you can easily hide an error from the func by `let _ = func()` or `func().ok()`. But yes, Rust demands you to do it explicitly.

  • @CristobalRuiz
    @CristobalRuiz ปีที่แล้ว +22

    I skipped to the end of the talk. Conclusion: "I can't say if RUST is good for you." Of course. Only I know what I need.

    • @anon3118
      @anon3118 ปีที่แล้ว +1

      Ty. Ima head out

  • @pooladkhay
    @pooladkhay 2 ปีที่แล้ว +23

    Your book is one of the best resources available 🔥

    • @timClicks
      @timClicks ปีที่แล้ว +6

      Thank you for saying so!

  • @a0um
    @a0um ปีที่แล้ว +12

    Glad to see a presentation without meme or animated GIFs

  • @TRK--xk7bb
    @TRK--xk7bb ปีที่แล้ว +14

    For those comparing Go and Rust, look at it this way: Go is the best gateway drug to Rust.
    Learning Go makes it easier to learn Rust if you don't have a C/C++ background. Go also offers 80% of the benefits of Rust for 20% of the effort (for a newbie). Rust is definitely the better language, and once you master it you can be even more productive in it than Go. If you're company is trying to decide between Go and Rust - and are having a hard time deciding - then you're most likely better off using Go as it's easier and more opinionated. Trying to adopt Rust from zero experience can be a recipe for disaster.

    • @nandomax3
      @nandomax3 ปีที่แล้ว

      For sure learning curve impacts a lot those decisions. Here where I work we adopted kotlin because we were all Java programmers

    •  ปีที่แล้ว

      I consider reliability benefits of Rust the most important and go offers maybe 30% of them, not 80.

    • @PouriyaJamshidi
      @PouriyaJamshidi ปีที่แล้ว +3

      I do not really get it why a garbage collected language is being compared to a non-garbage collected one.
      Go should be compared to Java, Nim, etc

    • @ykmnkmi
      @ykmnkmi ปีที่แล้ว +1

      if our company had a lot of time, we would probably write a backend on Rust, but of course there is a better option - Go.

    •  ปีที่แล้ว

      @@ykmnkmi does your company count debugging time towards the decision?

  • @GoonCity777
    @GoonCity777 ปีที่แล้ว +5

    Tom slyly left out that Pattern Matching is in newer versions of Python lol. I’m def a fan of both

    • @yawaramin4771
      @yawaramin4771 ปีที่แล้ว +5

      As far as I know Python's pattern matching is nowhere near the level of Rust or ML-like languages, most significantly there's no exhaustivity check.

    • @GoonCity777
      @GoonCity777 ปีที่แล้ว

      @@yawaramin4771 for now

  • @RobertKing
    @RobertKing ปีที่แล้ว +6

    Amazing talk Tim. I remember meeting you at python meetups many years ago, it seems we have both transitioned towards rust.

  • @rodelias9378
    @rodelias9378 ปีที่แล้ว +5

    Nice talk Tim. 07:06-07:11 love that part.. :D

  • @szaszm_
    @szaszm_ ปีที่แล้ว

    You should include the Q&A in the videos. Those who are not interested can still skip it.

  • @DezzKB
    @DezzKB ปีที่แล้ว

    19:00 you can have raw pointers with any values you wish even with null value. But only in "unsafe" sections you can dereference raw pointers. So, generally you can dereference null-pointer and crash your program with segfault or access violation, but only in "unsafe" sectoin.

  • @DezzKB
    @DezzKB ปีที่แล้ว +1

    16:00 this is true only for safe Rust without using standard library or any other libraries. Generally, Rust can't avoid race conditions, only data races because of standard library which has a lot of instruments to overcome borrow-checker limitations. We can rewrite such example in Rust using interior mutability (RefCell, Mutex/RwLock and atomic's) and the execution result of the example program will be also unpredictable.

    • @kevinmcfarlane2752
      @kevinmcfarlane2752 10 หลายเดือนก่อน

      Nothing can avoid race conditions as opposed to data races. But actor frameworks or actor languages make it easier to avoid race conditions.

  • @ProfessorWaltherKotz
    @ProfessorWaltherKotz ปีที่แล้ว +2

    13:00 Most C++ compilers will give you a big warning though... (Not sure about C).

    • @szaszm_
      @szaszm_ ปีที่แล้ว +1

      Most C++ compilers are also C compilers with a different driver in the same project, so the warnings are quite similar if not identical.

  • @realsong-fake
    @realsong-fake ปีที่แล้ว +25

    For most people there is no real benefit to write in Rust. It makes more sense to depend on stuff that is written in it.

    • @leighwanstead3254
      @leighwanstead3254 ปีที่แล้ว +8

      Easy developing concurrent code

    • @oconnor663
      @oconnor663 ปีที่แล้ว +21

      One big counterexample for me is enums. (I haven't finished the video yet. Does this come up?) I constantly run into situations in Python or Go where I feel like an enum is really the best way to express something, and I miss having them.

    • @realsong-fake
      @realsong-fake ปีที่แล้ว +6

      It's not about language features. Rust has nice high level features but it's still a system level language. Most people never would want or need to touch one.

    • @YoTengoUnLCD
      @YoTengoUnLCD ปีที่แล้ว +7

      @@realsong-fake lol

    • @PiotrSarnacki
      @PiotrSarnacki ปีที่แล้ว +12

      @@realsong-fake it started as a systems programming language. These days it can be successfully used in many more domains

  • @skytech2501
    @skytech2501 ปีที่แล้ว

    Python is safe!?

  • @DanielSantanaBjj
    @DanielSantanaBjj 8 หลายเดือนก่อน

    Great video!!!
    #rust

  • @StefaNoneD
    @StefaNoneD ปีที่แล้ว

    3:15 Python is not safe in my opinion, because it's a dynamic typed language which results to many runtime errors. Java would be a better example.

    • @awssupport
      @awssupport ปีที่แล้ว

      Thanks for the feedback! 👍 I've passed this along, internally, for review. 🧐 ^RS

  • @KevinInPhoenix
    @KevinInPhoenix ปีที่แล้ว +7

    While Rust may be the solution for certain edge cases I have found that Go works better for me. YMMV.

  • @Art-kz6zf
    @Art-kz6zf ปีที่แล้ว

    Just wish Rust had as good remote debugging feature as JVM and .NET for example.. 🤞

  • @32zim32
    @32zim32 ปีที่แล้ว +1

    Not all is done at compile time. Many rust code uses some sort of smart pointera which are just another way of reference counter GC

    • @ythanzhang
      @ythanzhang ปีที่แล้ว +1

      It is also about control, you can throw around Rc and not think about life time and ownership.
      But when you really need performance, you can always get that in rust without rewritting your project in a different language.

  • @k3dare
    @k3dare ปีที่แล้ว +9

    Rust is great until you have to fight with the borrow checker and manage lifetimes manualy instead of focusing on your program

    • @bannguy
      @bannguy ปีที่แล้ว +8

      "focusing on your program" should include weeding out memory management bugs as well

    • @BeffJezos69
      @BeffJezos69 ปีที่แล้ว +14

      If you're fighting the borrow checker and managing lifetimes, you're probably architecting your program wrong.

  • @thanatosor
    @thanatosor ปีที่แล้ว

    Answer : Yes, it does

  • @vaibhavmaurya8505
    @vaibhavmaurya8505 ปีที่แล้ว +2

    Incredible session. Sorry, but your answer about the ampersand 4:48 was not at the point. Rust variable is by default read only unless explicitly declared as mutable using `mut` keyword. Ampersand means the reference is borrowed not transferred, but keep that in mind that it is different from usual concept in C/C++, it has more to say, I would suggest the Rust book.

    • @timClicks
      @timClicks ปีที่แล้ว +5

      I try to teach one thing at a time. I don't want to introduce the term "borrowing" in the first 5 minutes of people's introduction to the language.

    • @Kaiwa1234
      @Kaiwa1234 ปีที่แล้ว +1

      This guy just suggested... the rust book... to a Rust book author? Also that dude in the crowd was so annoying, randomly interjecting over and over. It's not a 1:1 conversation man... Ask your questions at the end!

    • @vaibhavmaurya8505
      @vaibhavmaurya8505 ปีที่แล้ว

      @@Kaiwa1234 I care and respect the concept of Rust and I admire the community who built this language. I have told respectfully and if I was the author I would have been proud of the clarity the book serves.

    • @vaibhavmaurya8505
      @vaibhavmaurya8505 ปีที่แล้ว

      @@timClicks I understand.

  • @fdwr
    @fdwr ปีที่แล้ว +5

    "does it really make sense for me?"
    Any programming language that is so pedantically opinionated as to complain during compilation about my mere *naming convention* is not for me. Any language that complains about 'let mut x : f32 = 0' not being able to initialize a floating point value with 0 (which is losslessly identical to 0.0) is not worth my time. I just don't have time for nonsense. Dear Rustaceans, loosen your compiler's pedanticness (keep memory safety, but drop the pointlessly picky aspects) and lessen your sense of superiority about your language over others, and you will find significantly more people joining the ranks of your crowd. 👍
    1:54 "Rust solves pain points ... with a limited number of downsides" 🤔 I really did hope for this to be a successor to C++, but the more I tried it, the more I realized it was a different language that fixes some aspects while adding in its own warts, rather than being a clear improvement/upgrade, as a number of those "limited downsides" are pretty darn annoying.

    • @MrPetzold123
      @MrPetzold123 ปีที่แล้ว +3

      Naming conventions are increasingly more important when programs grow. Previously, this was often just documented somewhere in some "company sw engineering style guide" etc, as was things like tab vs spaces, placing of {} etc...Rust just enforces all of this, with the great advantage that all Rust code looks stylishly similar.
      Float initialization with 0.0 instead of 0. Yeah, it's pedantic, but then you can omit type and it infers it.
      Yes, it forces you to type let mut in variable declaration and &mut in both call and function signature when changing things, but these features...as an old C programmer I appreciate each and every one of those things, because "when it compiles, it works". Yes, I'm yet another Rust fanboy, guilty as charged :-)

  • @bulend81
    @bulend81 ปีที่แล้ว

    i have doubt of those numbers 17:36 - 18:26

  • @vnshngpnt
    @vnshngpnt ปีที่แล้ว +1

    Potentially good talk ruined by (he/him)

  • @phanvanhoa
    @phanvanhoa ปีที่แล้ว

    Rust give you what none other language does: Borrow Checker :v