• UnfortunateShort@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    1 day ago

    I mean, Rust has the massive upsite that it won’t compile in many cases if you fuck things up. Then again, embedded or generally low-level driver-y stuff is still in its infancy in Rust. Relative to C/C++ that is.

    There is stuff that you need that has no official Rust support. There is poor documentation and half baked frameworks. There are examples being silently outdated, breaking changes between framework versions, and nighlty-versions from Github mixed in to fix them. And then of course plenty of timing and hardware dependent things you will need to do yourself.

    I do this for a living and personally tried to use AI here and there to help me out, but oftentimes it fails miserably. Not always, but very often.

    • MashedTech@lemmy.world
      link
      fedilink
      arrow-up
      9
      ·
      24 hours ago

      Rust helps you resolve memory bugs. Not logic bugs. Yeah, it’s going to be new memory safe code… But it won’t be bugfree code.

      • The_Decryptor@aussie.zone
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 hours ago

        It can help with logic bugs (e.g. by encoding the state machine logic directly in the type system, so an invalid transition won’t compile), and things like data sharing issues (Again, type system, tracks sharable objects vs. those that aren’t), but none of those are as “impervious” as the memory safety stuff.

        But that all still requires rearchitecting, because if the existing code already follows those rules, it already probably doesn’t suffer from those issues (e.g. I know you can do the state machine type stuff in C# at least)

        • MashedTech@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          7 hours ago

          Oh wait… It’s AI. Just to pass the compiler and the unit tests it will either cast to whatever it desires or just make the tests pass forcefully.