Feel like everyone’s been telling me it’s the best thing since sliced bread. I’m just a hobbyist with like a single big project I’m maintaining but I’m starting to hate the code and idk maybe I should rewrite it in rust. Idk

  • harryprayiv@infosec.pub
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    19 days ago

    Another suggestion I have yet to see mentioned is Zig. It’s easier to learn than Rust but just as powerful. It’s arguably more ambitious than even Rust because they are approaching LLVM as well as building a C/C++ replacement.

  • asudox@lemmy.asudox.devM
    link
    fedilink
    arrow-up
    1
    ·
    13 days ago

    Rust can be a pain in the ass when you are writing the code, but once you wrap your head around its concepts, the pain will ease and you’ll appreciate them.

  • solrize@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    21 days ago

    What is the code written in now? What happens if you clean it up? What is the project if I can ask? Everything has a runtime, though some are more complex than others. You might like OCaml which is where Rust got some ideas, or Haskell if you like brain benders. Rust (like C) is for when you need very efficient code, and you incur some pain in order to get that.

    • droning_in_my_ears@lemmy.worldOP
      link
      fedilink
      arrow-up
      0
      ·
      21 days ago

      The code is in Typescript. It’s the backend of a web app that’s all. Doesn’t really need to be in Rust but idk I just want to make something that doesn’t use more resources than it needs to. Just to be neat :D

  • Lucy :3@feddit.org
    link
    fedilink
    arrow-up
    0
    ·
    21 days ago

    If you either hate yourself, or somehow manage to forget C/C++, JavaScript, Python and probably some more random languages, then yes. Because Rust is basically just a confusing, illogical mix of all of that. Otherwise, as others pointed out, learn anything else that is - if that’s what you want - memory safe, statically typed, yadda yadda yadda, and has a good dependency system, compiler and syntax. Other languages could very well fit much better too, depending on available libraries and features in general.

    • Nibodhika@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      21 days ago

      While I agree with you that OP shouldn’t migrate to Rust, the language is not illogical nor a mix of any of those. There’s a lot of stuff that Rust does extremely well that can’t be reproduced in any of the other languages, such as Options or Result types. And while it can become confusing when lifetimes get thrown at it as a general rule it’s not. Also the compiler messages are so thorough, I don’t think I have ever seen anything come close to it.

      Rust is not for everything, nor for everyone, but saying it doesn’t have it’s merits is dishonest.