What essential skills/knowledge would you say are/is required to work as a Rust dev?

I did couple of small/mediumish personal projects in Rust using axum with sea-orm and later tauri with leptos. That’s on top of many years of experience working as a Java/Javascript dev and occasionally touching things like Python or Flutter. Most of things like databases and web stuff is transferable but what strictly Rust concepts are required to work as a Rust dev? In what fields it’s used the most?

  • hallettj@beehaw.org
    link
    fedilink
    English
    arrow-up
    8
    ·
    11 months ago

    Hey, you’re on a similar path to me. I’ve been on a Rust job for the past year.

    Being a general-purpose programming language Rust can be used in a lot of contexts. The work I’m doing is all API server stuff, which I’m sure you already have a solid background in. There are some niches where Rust stands out that might be worth studying depending on your interest, but none of these are essential to Rust work generally.

    • Crypto startups seem to be enthusiastic adopters of Rust. It’s not an area I want to get into personally, but this is likely the fastest path to a Rust job.
    • Rust is probably the best language for compiling to WASM for running in browsers, in lightweight server-less functions, and as plugins. That could dovetail with your frontend experience. Although it’s a bit of an uphill battle to argue for WASM over Javascript in these cases.
    • Rust makes an appealing choice for embedded programming as a safer alternative to C. This kind of work involves learning to program with nostd, and learning about controlling hardware.
    • In non-embedded systems low-level pieces like device drivers are another good candidate for Rust.
    • ExLisper@linux.communityOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      11 months ago

      You switched to Rust from other language? I think what I would really like to know deep knowledge about Rust do you need to make the switch. I read the whole book and did a deeper investigation about the main features for a talk about Rust in my company. I’ve spend some time reading about the ideas behind type classes, algebraic types, memory safety and others and how it compares to other languages. But that’s pretty much it. Is there anything else you need deeper understanding of? What are they asking about during interviews?

      • hallettj@beehaw.org
        link
        fedilink
        English
        arrow-up
        4
        ·
        11 months ago

        Oh right, there are some particular things that are helpful for a deeper language understanding.

        Type classes and algebraic types are for sure standout features of Rust that make it better than most languages. Much of my experience before Rust was Typescript, but I have some background in Haskell so I was fortunate to have a head start on these concepts. I haven’t done any Rust interviews - my current role switched from Haskell to Rust after I joined. So I don’t know what interviewers are asking.

        None of the prior languages you listed use manual memory management (which was the same for me). And even if you have that background, Rust does some things differently. (Although from what I understand explicitly codifies a number of ideas that experienced C++ devs have in their heads as “good practice”.) I think you’ll want to study up on how memory works. One of my favorite resources for this is Logan Smith’s Youtube channel. Those videos get me thinking about how this stuff I take for granted really works. The first two Rust videos on there, Use Arc Instead of Vec and Choose the Right Option are good ones to watch. Even if you opt not to use Arc<[T]> or Box it’s useful to understand how those differ from Vec and String.

        Closures are weird in Rust, and are worth understanding. You have to choose between Fn, FnMut, and FnOnce. Plus there is the move keyword. I love the post Finding Closure in Rust for explaining what’s going on there. (It takes the implement-your-own-version approach which is a genre where I’ve incidentally seen some other gems, like Implementing a simple Promise in Javascript, and The Git Parable for understanding how git really works.)

        Another area that is helpful to study is Rust’s implementation of async. It is similar to async as you’ve seen it before, but also different. For example in Javascript when you call an async function like, say, fetch it dispatches network requests right away. But in Rust a Future does not do anything until you call await on it. Learning about async leads into understanding of some more general language features. At the shallower end you learn about functions that return types based on trait, like impl Future or Box> because Future types often can’t be named directly so you have to describe what trait they implement instead. (This is very similar to how you work with functions that return closures.) At the deeper end you learn about working with Pin. You can get a deep dive on that in Pin and suffering by fasterthanlime. All of that guy’s posts are useful, but they are deep plunges so it can take some motivation to read them.

        Since I seem to be recommending people to learn from I’ll add Mara Bos’ blog. She’s the Rust Library team lead. Her blog gets into some of the nitty-gritty stuff that gets you thinking about the language on a deeper level. She also wrote a book recently, Rust Atomics And Locks. I haven’t read it yet, but it looks useful.

        • ExLisper@linux.communityOP
          link
          fedilink
          English
          arrow-up
          4
          ·
          11 months ago

          Thanks a lot, exactly what I was looking for. Those resources look very interesting and I definitely will check them out.

    • ExLisper@linux.communityOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      11 months ago

      I never worked on low level stuff so I think my best chance is web/desktop stuff. Any specific technologies that are getting popular in companies?

      • sugar_in_your_tea@sh.itjust.works
        link
        fedilink
        arrow-up
        3
        ·
        11 months ago

        May want to look at computation, so stuff like Rayon. We almost built a compute-heavy part of our web-app in Rust (rest is in Python), and I’d guess a lot of others do the same.

  • anlumo@feddit.de
    link
    fedilink
    English
    arrow-up
    5
    ·
    11 months ago

    Necessary skills:

    • Development processes: advanced git usage (like fixing history after a bad rebase, merging multiple completely divergent branches, etc), issue tracking
    • Devops: continuous integration, continuous deployment, Docker (also, how to build your own Docker images out of Rust projects), Kubernetes
    • Social: how to interact with coworkers without creating enemies for life
    • Mikina@programming.dev
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      11 months ago

      Don’t forget debugging! Throughout my carreer, I never really forced myself to just go with debugger (especially since when games are considered, where you are dealing with tens of instances running the same Update, so manual breakpoints are usually harder to use than just scrolling through printed values in a lof) and over-relied on debug logging.

      It was a mistake, and took me several years to realize that conditional breakpoints are a thing. And once you get into profiling, memory optimization and what-not, you will be greatefull that you’ve spend the time getting comfortable with all the debugging tools you can use.

      Trying to learn a debugger or profiler as you go through solving a problem at a job sucks. Am currently in the process of having to debug and solve shader performance issue, and oh boy that’s a lot of terms and tools I’ve never seen before, and most of the colleagues are as dumbfounded as I am, since when porting games you usually don’t need to deal with low-level rendering.

      • anlumo@feddit.de
        link
        fedilink
        English
        arrow-up
        3
        ·
        11 months ago

        I’m comfortable with debugging, but I rarely use it with Rust. With the language being so strict in everything, it’s clear most of the time what’s happening, and most situations can be resolved by simple logging of variables.

        In JavaScript, I have to use the debugger all the time, since variables can get some really weird invalid values with the completely wrong type.

        • YIj54yALOJxEsY20eU@lemm.ee
          link
          fedilink
          arrow-up
          2
          ·
          11 months ago

          That’s my favorite part about rust. Each step of the program is so well defined. No wondering if something will be uninitialized, throw, be null, or worse, what type of data you are working with in the first place. The option and result types have made working in languages without them a slog.

  • Vorpal@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    11 months ago

    It all depends on what part you want to work with. But some understanding of the close to hardware aspects of rust wouldn’t hurt, comes in handy for debugging and optimising.

    But I say that as somone who has a background (and job) in hard realtime c++ (writing control software for industrial vehicles). We recently did our first Rust project as a test at work though! I hope there will be more. But the question then becomes how to teach 200+ devs (over time, gradually presumably). For now it is just like 3 of us who know rust and are pushing for this and a few more that are interested.