Hey!

I’m a professional software engineer with several years of experience using Rust. Unfortunately I don’t really have the time to contribute to Lemmy directly myself, but I love teaching other people Rust so if:

  • You are curious about Rust and why you should even learn it
  • You are trying to learn Rust but maybe having a hard time
  • You are wondering where to start
  • You ran into some specific issue

… or anything to do with Rust really, then feel free to ask in the comments or shoot me a PM 🙂

  • Otter@lemmy.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    You are wondering where to start

    Since a lot of people are new, this might be helpful! Maybe what your learning journey was like, and if there are any resources you recommend?

    Also thank you :)

    • SorteKanin@feddit.dkOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 months ago

      TL;DR:

      • Learned basic C++ as my first language (would not recommend) many years ago
      • Went to study computer science at university
      • Was intrigued by Rust from online blog posts, learned it in my free time as a student
      • Have been working professionally with Rust for more than 2 years now

      Long version:

      I “learned” C++ as my first language many years ago. I say “learned” because I just learned the basic syntax and some of the concepts about computers, like how the stack and the heap works and processes and threads and stuff like that. It was very early and I didn’t really understand much, was just experimenting.

      I then started studying computer science. We were exposed to many different programming languages at the university. Over the years, you got a feel for the strengths and weaknesses of each one. Especially during my master’s I learned a lot as I was exposed to Haskell and in general nicer-working type systems.

      Around the same time I started noticing blog posts about Rust online. I became quite intrigued with the language as it had a lot of promise and I was curious if it could really live up to the hype.

      I then just started reading The Book and I was very quickly convinced that this language was actually living up to the hype. It’s a very nice blend of object-oriented and functional programming, with an algebraic type system and monad-like error handling, which is just miles ahead of the usual exception-based error handling that many other languages use.

      Then I basically started using it in all my side-projects in my free time, slowly building up a familiarity with the package ecosystem and the idiomatic way of writing Rust, reading lots of examples and documentation and such.

      Nowadays, I would humbly call myself an expert in Rust or at least close to it. I think I’ve seen nearly all the language has to offer and ran into many of its weirder parts. I have a very good understanding of ownership and the borrow checker and I usually know exactly what is wrong and what to do about it when the compiler yells at me. The only thing I haven’t really touched is embedded (no-std) programming in Rust.

  • z3rOR0ne@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    Great thread! Just subscribed to this c/

    Sorry I know its a few days old now, but I thought I’d just chime in and ask my question.

    First and foremost I’m a self taught web Dev(TypeScript, NodeJS, HTML, CSS), who has also done some small bit of learning C (built a basic UNIX shell and rebuilt some of the ls command in C) and done some shell scripting.

    I’m about half way through the Book and am also following along with a 9 hour long intro Video course from Free Code Camp where the instructor generally just has you go through practice.rs

    I’m mainly interested in using Rust as my go to back end language for HTTP/TCP servers and developing JSON and HTML APIs. Can you tell me which frameworks and crates/packages would be good for me to be aware of?

    I’m also interested in creating some CLI and TUI applications, so any frameworks/crates/packages I should be aware of in that realm you might recommend would also be greatly appreciated!

    Thanks so much. I got some great insights just by perusing this thread thus far!

    • SorteKanin@feddit.dkOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      3 months ago

      I’m mainly interested in using Rust as my go to back end language for HTTP/TCP servers and developing JSON and HTML APIs. Can you tell me which frameworks and crates/packages would be good for me to be aware of?

      Look into axum. It’s built on top of tower and tower-http, which is a general server/client framework. Axum makes it super easy to make HTTP servers, using either raw HTML or JSON. It has in-built functionality for JSON and if you want to do HTML you can reach for stuff like maud or askama.

      There’s lot of crates around axum as well. You can try searching lib.rs which is a bit more nicely categorized than crates.io. For logging for example, look into tracing.

      I’m also interested in creating some CLI and TUI applications, so any frameworks/crates/packages I should be aware of in that realm you might recommend would also be greatly appreciated!

      For command-line arguments, use the derive functionality from clap. It lets you declare the arguments you want/need as a type and produces all the argument parsing logic for you.

      For TUI, I haven’t tried it myself but I’ve heard that ratatui is good.

      • z3rOR0ne@lemmy.ml
        link
        fedilink
        English
        arrow-up
        0
        ·
        3 months ago

        Thanks so much! I’ll be bookmarking these and checking them out as I go along.

        Lastly, I just wanted to ask a couple more questions if that’s OK.

        How long did it take you before you started to become proficient enough in Rust that you could be productive for your employer? Were you already proficient in other systems level programming languages like C or C++ before learning Rust?

        Did you get hired as a Rust developer or were you working or your current employer utilizing another programming language and you eventually move to developing in Rust?

        Do you see there being more jobs utilizing Rust in the future?

        I know that’s a lot, so if you don’t want to field all of those, I understand, but I’m very curious so I thought I’d just put those out there.

        Thanks again!

        • SorteKanin@feddit.dkOP
          link
          fedilink
          English
          arrow-up
          0
          ·
          edit-2
          3 months ago

          How long did it take you before you started to become proficient enough in Rust that you could be productive for your employer?

          Not too long, around 3 months maybe. But it depends how much time you spend obviously. Learning the language is fairly quick. Learning the more exotic parts of the language took a bit longer but that’s mostly cause I didn’t need those things until later. Learning the package ecosystem is also something that can take a bit of research and you kinda have to just keep yourself up to date about cool crates via blog posts and sharing on online communities like this. But all this will probably depend on your prior expertise. I have a master’s in computer science so it wasn’t a huge deal for me.

          Were you already proficient in other systems level programming languages like C or C++ before learning Rust?

          I was… okay at C++ before-hand so kinda. But honestly C++ is such a shitty language that looking back I barely had any grasp at that time honestly. With Rust, it’s so much easier and I understand how the system works so much better now, simply because Rust forces me to understand it. The compiler is a great teacher!

          Did you get hired as a Rust developer or were you working or your current employer utilizing another programming language and you eventually move to developing in Rust?

          I was not hired as a Rust developer. There was actually barely any Rust at the company when I joined. There were a few other colleagues interested in it and when I came in we really went for it. It took some convincing of management and stuff but now we use it in a lot of places and I write almost exclusively Rust at work.

          But I think I was very lucky in this aspect. There are few places where you will have such an opportunity to influence the technology in that way.

          Do you see there being more jobs utilizing Rust in the future?

          110%. Rust is set to replace languages like C and C++, and at the same time it is heavily competing with other programming languages. Even languages like Python. There’s a huge opportunity to improve software reliability across the field with Rust.

          Rust is supported by the largest tech companies in the world and is getting integrated into Linux. There has not been a language with this level of dedication and support behind it for a long time.

          Growth is happening and it will only accelerate in the coming years. You can even see it happening on Google Trends. It’s a great time to learn the language to get ahead of the curve!

          I know that’s a lot, so if you don’t want to field all of those, I understand, but I’m very curious so I thought I’d just put those out there.

          Hey I made this thread to answer questions, thank you for asking! I’m sure there are many lurkers who were also curious.

          • z3rOR0ne@lemmy.ml
            link
            fedilink
            English
            arrow-up
            0
            ·
            edit-2
            3 months ago

            Thanks so very much. Very informative and encouraging. As a mainly TypeScript developer whose only done some dabbing in C, bash, and python, I’ve been looking for a language that’s a bit more abstracted than C, but not so pigeonholed into specific use cases like Golang (I’m still developing an opinion on Golang, not sure how I feel about it).

            Rust so far has appeared like quite a beautiful language and the compiler in particular is the best I’ve ever seen in terms of helpful error/warning messages!

            I’m sure I’ll have my small complaints as I struggle to get good at Rust in the near future, but I think this is going to be my go to back end language for some time.

            I have plans to eventually convert the C code of the terminal based browser, links, to a Rust project to learn more about how a very basic browser is built. I’d also like to do the same for the TUI system monitoring tool btop, which is written in C++.

            I think just attempting those two “rewrite it in Rust” projects, once I have other smaller projects under my belt, will probably give me a good understanding not only of Rust, but also aspects of the HTTP/HTTPS protocols and systems programming not commonly encountered in the field of web development.

            Last question, I promise, lol. But what do you make of this plan? Are their any caveats or concerns I should be made aware of in regards to this endeavor?

            Again, thanks for everything!

            • SorteKanin@feddit.dkOP
              link
              fedilink
              English
              arrow-up
              0
              ·
              3 months ago

              (I’m still developing an opinion on Golang, not sure how I feel about it).

              I don’t have concrete experience with Go but I’ve read enough about the language to form an armchair opinion. If you ask me, it seems pretty bad. It’s like you just took C and you threw a garbage collector and an async runtime on top and called it a day. No lessons learned from any of the 40 years prior of programming language theory, just C with a garbage collector. I think the only reason anyone is using Go is because it’s Google and they pushed it a lot. If someone made Go today and wasn’t a billion-dollar corporation and tried to convince people to use it, nobody would use it.

              I have plans to eventually convert the C code of the terminal based browser, links, to a Rust project to learn more about how a very basic browser is built.

              I usually use reqwest for HTTP request stuff. But if your goal is to learn about more low level stuff, you might want to use a lower level library like hyper or even just only using the stuff in the standard library.

              I’d also like to do the same for the TUI system monitoring tool btop, which is written in C++.

              I’m a big fan of bottom, which is a TUI resource monitor. Maybe you’ll get some inspiration from there.

              But what do you make of this plan? Are their any caveats or concerns I should be made aware of in regards to this endeavor?

              I can’t really think of any problems. I think it sounds like a good idea to build some concrete stuff and see what you run into. Just realize that it might take a while before you get used to writing idiomatic Rust code, so don’t expect your first project to be your prettiest work… 😅

              • z3rOR0ne@lemmy.ml
                link
                fedilink
                English
                arrow-up
                2
                ·
                edit-2
                2 months ago

                Definitely. Okay, that’s about all I have to ask now. I’m bookmarking this thread though to refer back to. You’ve given me some great insights and resources, and have also pointed me in the right direction going forward.

                For now I’ll be just making my way through the Book. I also have Programming Rust, by O’Reilly, Command Line Rust by O’Reilly, and Rust for Rustaceans to reference along with the plethora of online resources.

                I might PM you some time in the future (if that’s okay) should I get stuck on something I can’t figure out through the usual means (i.e. documentation, stack overflow, etc.).

                Again, can’t thank you enough for the help. Cheers!