I'm more productive in this language even tho I hate it

I usually use c for systems programming but rust comes with so many convenient shit that I can't help but pick it everytime I need to write a tui or cli tool or driver or whatever.
I've been using it for months I tried to force myself to write in c but I couldn't. It was too cumbersome and my skills had atrophied from using the retardation of rust

  1. 1 week ago
    Anonymous

    The borrow checker is a cruel mistress, but it does work. Forget about life times they are too big brained for me.

    • 1 week ago
      Anonymous

      Lifetimes hurt my brain, ugly syntax doesn't help either

      • 1 week ago
        Anonymous

        the one thing I hate about Rust is the lifetime syntax, not sure how I'd do it instead though

        • 1 week ago
          Anonymous

          Don't use lifetimes unless you really have to

      • 1 week ago
        Anonymous

        You don't need to use lifetimes for most things. Cloning is fine.
        The syntax isn't ugly, you're just tasteless (and too used to other languages)

  2. 1 week ago
    Anonymous

    Rustsisters, I'm about to start using it (and HRT), is visual studio code really the best IDE to use?

    • 1 week ago
      Anonymous

      I use vim with rust analyzer and it's perfect.

  3. 1 week ago
    Anonymous

    Why the fuck would you force yourself to write in C if you know Rust?
    The only reason to write in C is if you're too lazy to learn Rust, or you're in anem environment where it's not an option, like some embedded or legacy kernel support.
    I'm in a company where the only language for our hardware is C. But somebody started Rust support two years ago, I'm gonna pick the project back up. You can be sure the moment I have it, I'm not touching a line of C anymore.

    • 1 week ago
      Anonymous

      >t.

      • 1 week ago
        Anonymous

        not an argument

      • 1 week ago
        Anonymous

        ACK-poodle

      • 1 week ago
        Anonymous

        >Wallace, 54 from Birmingham trooned out

      • 1 week ago
        Anonymous

        bro are they even trying hahahah

    • 1 week ago
      Anonymous

      Isn't Rust embedded still a pain/not feasible?

      • 1 week ago
        Anonymous

        NTA and I haven't personally used it for embedded but as far as I know it's mixed. Not every architecture/platform is supported by Rust, and these that are aren't 100% guaranteed to work(ie they don't automatically run tests on new compiler versions). And I heard there is some very unsafe fuckery with handling interrupts. But in general I heard mixed opinions, some people loved it some hated. You should probably look into the embedded book and check it for yourself.
        https://docs.rust-embedded.org/book/intro/index.html

  4. 1 week ago
    Anonymous

    my only gripe with rust is that it's compiler sucks ass and the output is bloated so can't really use it in something like arm cortex m, for anything above embedded side though it beats everything for sure

    • 1 week ago
      Anonymous

      GCC support for Rust when

      • 1 week ago
        Anonymous

        Didn't GCC added limited Rust support few months ago? They are missing some features like borrow checker but basic compilation should work IIRC.

      • 1 week ago
        Anonymous

        Implementing something that complex is going to take time.
        Rust frontend, GCC backend: https://blog.antoyo.xyz/rustc_codegen_gcc-progress-report-22
        GCC frontend for rust: https://rust-gcc.github.io/2023/04/24/gccrs-and-gcc13-release.html

  5. 1 week ago
    Anonymous

    no variadic functions

    • 1 week ago
      Anonymous

      it's supported for C ABI

    • 1 week ago
      Anonymous

      There should be an RFC out right now for implementing variadic generics, like C++. Variadic functions like the printf family of functions in C were a mistake, however.

      • 1 week ago
        Anonymous

        >Variadic functions like the printf family of functions in C were a mistake, however.
        ?

        • 1 week ago
          Anonymous

          Correct.
          https://cwe.mitre.org/data/definitions/134.html

          • 1 week ago
            Anonymous

            Zig doesn't have this issue. The format string has to be known at compile time.

            • 1 week ago
              Anonymous

              Well yeah. Zig has comptime. Basically a super powerful unified system for macros, generics, and constexprs. It's Zig's one big killer feature, and sadly the one thing Zig fans don't play up more often. Still, Rust does the same thing with proc macros.

              Doesn't change the fact that variadic functions are ok.

              No, they're not. There's plenty of better approaches developed by other languages that should be used. But if you have a singular compiled function that can reach arbitrarily down into the call stack based on a user supplied parameter (as we had with C's va_args), you have a recipe for memory corruption.

              • 1 week ago
                Anonymous

                >There's plenty of better approaches developed by other languages that should be used.
                Like what? They exist everywhere, and they won't overflow your buffer if you use JavaGolang or whatever other GC'd language.

              • 1 week ago
                Anonymous

                >and they won't overflow your buffer if you use JavaGolang or whatever other GC'd language.
                The solution used in Java and Go is to make variable arguments a syntactic sugar for passing an array as an argument (and that array has its length info embedded in it). If you wanted to do the same in Rust... you could just pass an array. Or you could use the fucking format macro which is literally just building a fucking parameter array for you.

                Meanwhile C's problem has NOTHING to do with GC. You could give C a GC, and its style of variadic functions would still be inherently insecure. C is not doing syntactic sugar. C is pushing an arbitrary number of parameters on the stack. Variadic functions in C do not know how many parameters they have. They just know how to read the next parameter. And that allows an attacker who is able to supply a format string to peek and poke at arbitrary locations in memory.

  6. 1 week ago
    Anonymous

    Why not c++?

    • 1 week ago
      Anonymous

      C++ suffers from the C baggage and it prevents C++ from having good defaults i.e. not move by default, implicit conversions etc

      • 1 week ago
        Anonymous

        The C "baggage" is the only part of C++ that is actually good. Nobody would have ever bothered with C++ otherwise.

        • 1 week ago
          Anonymous

          >The C "baggage" is the only part of C++ that is actually good
          Not a single thing is good about C baggage. C++ would not evolve into what it is if the C baggage was any good.

          > Nobody would have ever bothered with C++ otherwise.
          People back in the day were too naive and fell for the "C++ is a C superset" meme.

          At the end of the day C++ now is a horrible kitchen sink of a language with zero vision and coherence. It wants to be a Rust-like but also has to remain compatible with C idioms. Do you not see its struggle?

          • 1 week ago
            Anonymous

            I don't think C++ being somewhat C compatible is not the reason its a terrible kitchen sink mess. What features of C do you think are causing C++ real issues?

            • 1 week ago
              Anonymous

              Copy by default instead of move for example.

              Plus the nonsensical implicit conversion garbage which allows a function pointer to be treated as a bool. What a stupid idea.

              • 1 week ago
                Anonymous

                > Copy by default
                C does not have objects. It is not meaningful to move a primitive or struct.

                Implicit conversion of pointers to bool would have no effect on further development c++. You might not like it, but it in no way complicates or limits the language.

              • 1 week ago
                Anonymous

                All languages have objects. Any instance of a struct is an object.

              • 1 week ago
                Anonymous

                What does it mean though to move a struct. Moving is only meaningful when you have destructors.

              • 1 week ago
                Anonymous

                Moving in C just means making a shallow copy.

  7. 1 week ago
    Anonymous

    I am a nocoder. I am immune to rust tranny propaganda.

  8. 1 week ago
    Anonymous

    Use Zig

  9. 1 week ago
    Anonymous

    OP here, this is me btw

    • 1 week ago
      Anonymous

      cute

    • 1 week ago
      Anonymous

      Tranny

    • 1 week ago
      Anonymous

      larp

  10. 1 week ago
    Anonymous

    [...]

    NTA but zig is not an option until it reaches v1.

    • 1 week ago
      Anonymous

      Doesn't change the fact that variadic functions are ok.

  11. 1 week ago
    Anonymous

    wake me up when it has guaranteed consteval

    • 1 week ago
      Anonymous

      overrated.

  12. 1 week ago
    Anonymous

    How do scala users find libraries? For example if I want to find a library for C# or F#, I search for dotnet X library/wrapper. How do you do it with Scala/Clojure?

    • 1 week ago
      Anonymous

      Sorry wrong thread

    • 1 week ago
      Anonymous

      Scala and Clojure can use Java libraries just like how F# uses C# libraries.

  13. 1 week ago
    Anonymous

    Have the problems here been addressed yet?

    https://queue.acm.org/detail.cfm?id=3212479

    • 1 week ago
      Anonymous

      This is as much a criticism of C as it is of hardware vendors. And honestly, it's not a very strong criticism. The abstract machine presented by C is pretty damn generic and not that heavily tied to the PDP-11. There's a reason it was easily ported to other architectures. And making hardware that is optimized for running C code makes sense when so many operating systems and language interpreters are written in C. And many other languages use compiler backends designed to compile C, but which are portable to other front ends.

  14. 1 week ago
    Anonymous

    Just use Zig you homosexual

Your email address will not be published. Required fields are marked *