• ElCanut@jlai.lu
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    8 months ago

    Rust developer: I’d like to compile some code

    Rust compiler: the fuck you are

    • Malle_Yeno@pawb.social
      link
      fedilink
      arrow-up
      1
      ·
      8 months ago

      The rust compiler holds your hand, wraps you in blankets, makes you hot chocolate, kisses you on the forehead before it gently and politely points out what you did wrong and how you can solve it step-by-step. It would never think of something as heinous as swearing at you, shame on you for insulting my wife’s honour like this.

      • ElCanut@jlai.lu
        link
        fedilink
        arrow-up
        2
        ·
        8 months ago

        Rust compiler is passive agressive, like:

        “There’s an error at line 286 because you still don’t know how to use the borrow checker after all this time ♥️”

      • _xDEADBEEF@lemm.ee
        link
        fedilink
        arrow-up
        1
        ·
        8 months ago

        except when it gives errors about lifetimes of some object.

        boy, that makes my brain hurt

      • planish@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        8 months ago

        The rust compiler produces a flawless understanding of your code, and then quits out because understanding that code is a Nightly-only feature and you’re using the stable build.

      • hector@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        8 months ago

        I don’t know from where this legend comes from but lifetimes/concurrency/macros errors are brain-hurting.

        Most of the time I find myself dropping project because I wrote my program in a correct way but Rust just does not like how it is designed lol. I can’t get shit done with this language

  • Strykker@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    8 months ago

    Except the C++ “Core dumped” line is telling you it just wrote a file out with the full state of the program at the time of the crash, you can load it up and see where it crashed and then go and look at what every local variable was at the time of the crash.

    Pretty sure you can even step backwards in time with a good debugger to find out exactly how you got to the state you’re currently in.

          • ysjet@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            arrow-down
            1
            ·
            8 months ago

            Imagine if you knew the most basic foundational features of the language you were using.

            Next we’ll teach you about this neat thing called the compiler.

            • Russ@bitforged.space
              link
              fedilink
              English
              arrow-up
              0
              ·
              8 months ago

              I’m not a C/C++ dev, but isn’t apport Ubuntu’s crash reporter? Why would dumps be going into there?

              Though on a rhetorical thought, I am aware of systemd’s coredumptctl so perhaps its collecting dumps the same way systemd does.

              • ysjet@lemmy.world
                link
                fedilink
                English
                arrow-up
                1
                ·
                edit-2
                8 months ago

                https://wiki.ubuntu.com/Apport

                It intentionally acts as an intercept for such things, so that core dumps can be nicely packaged up and sent to maintainers in a GUI-friendly way so maintainers can get valuable debugging information even from non-tech-savvy users. If you’re running something on the terminal, it won’t be intercepted and the core dump will be put in the working directory of the binary, but if you executed it through the GUI it will.

                Assuming, of course, you turn crash interception on- it’s off by default since it might contain sensitive info. Apport itself is always on and running to handle Ubuntu errors, but the crash interception needs enabled.

          • current@lemmy.ml
            link
            fedilink
            arrow-up
            0
            arrow-down
            1
            ·
            8 months ago

            i mean you’re expected to know the basic functioning of the compiler when you use it

  • FlatFootFox@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    8 months ago

    My favorite compile error happened while I was taking a Haskell class.

    ghc: panic! (the ‘impossible’ happened)

    The issue is plainly stated, and it provides clear next steps to the developer.

    • Ignotum@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      8 months ago

      I had a similar error, though not from the compiler
      Error message just read this should never happen

  • Subverb@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    8 months ago

    Nevermind that the C++ program is two orders of magnitude faster when completed.

    I would love to learn and use Rust but I’m a embedded systems guy. Everything of consequence is C and C++.

    • henfredemars@infosec.pub
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      8 months ago

      Yes. It’s a surprisingly bad debugger the more you think about it. I use it largely in assembly and it loves to spit out random errors about memory it tried to access based on the current register state. The shortcuts are kind of dumb.

      It certainly works but I wouldn’t call it a pleasure to use.

      Ex: try disp x/1i $eip often just doesn’t work.

    • spacebanana@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      8 months ago

      Java is a traditional and conservative language, which has its strong upsides, like the syntax being familiar to many people who haven’t used the language before. It’s a language that brought us the JVM, gave a job to many people and established fundamentals for other languages to inspire and improve on. If you don’t like Java, you can just use another language for the JVM, like Scala, Kotlin or Clojure.

      • KammicRelief@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        8 months ago

        and inspired C#, which is pretty rad! (humble opinion… preparing for downvotes because I don’t get the feeling lemmy is where M$ devs hang out)

      • Doc Avid Mornington@midwest.social
        link
        fedilink
        English
        arrow-up
        0
        arrow-down
        1
        ·
        8 months ago

        You only named one upside, I can’t think of any other, and C-like syntax is pretty common, so it’s not much of an upside. It’s at least debatable whether the JVM is a good thing at all - the majority of languages get along perfectly well without it, and there’s no reason to believe the ones that do target it wouldn’t be doing just fine if it didn’t exist. It’s weird to say Java gave a job to anybody - the demand to have software written resulted in programmers being hired; if Java hadn’t been pushed on the market by Sun, it would have just been another language. Java didn’t establish any fundamentals at all, it just borrowed from other places. While all three of the other languages you mention are interesting, for sure, I’m not sure why somebody who doesn’t like Java should limit themselves to JVM languages.

    • flubba86@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      8 months ago

      The one thing I can say about java; the kinds of people who like Java tend to really like Java. Everyone else just leaves them to it.

      • Lemzlez@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        8 months ago

        And the people hating on it somehow never used any version above 8, which is 10 years old and EOL.

        • QuaternionsRock@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          8 months ago

          I’ve used Java 21 pretty extensively, and it’s still comically bad compared to various alternatives, even apples-to-apples alternatives like C#. The only reason to use Java is that you’ve already been using Java.

          • Lemzlez@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            ·
            8 months ago

            it’s still comically bad compared to various alternatives, even apples-to-apples alternatives like C#.

            I’d be interested to hear why. IMO Java has the superior ecosystem, runtime(s!), and community. The best part is that you don’t even HAVE to use java to access all this - you can just use kotlin, groovy, scala,… instead.

            In terms of the language itself, while it (still) lacks some more modern language features, it has improved massively in that area as well, and they’re improving at a significant rate still. It also suffers from similar issues as PHP, where it has some old APIs that they don’t want to get rid of (yet?), but overall it’s a solid language.

          • Tom@programming.dev
            link
            fedilink
            arrow-up
            0
            ·
            8 months ago

            Having used PHP and Java extensively in my career, it’s always entertaining to read what people think about these languages.

            • zalgotext@sh.itjust.works
              link
              fedilink
              arrow-up
              1
              ·
              8 months ago

              I haven’t touched PHP since college, so about a decade, but back then I compared it to a very disorganized but well equipped toolbox. Everything you need to do your projects is there, but it’s scattered through 12 different unorganized drawers and cubbies, there’s an annoying mix of metric and imperial stuff, plus some random bits and bobs you inherited from your grandfather that you have no idea what they do.

      • lowleveldata@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        8 months ago

        you can follow any exception down to the exact line of code

        Which is usually not a piece of code written by us and is caused by another piece of code not written by us either

      • merc@sh.itjust.works
        link
        fedilink
        arrow-up
        0
        ·
        8 months ago

        but you can follow any exception down to the exact line of code (or JNI call, I guess) where the problem occurs.

        But, it’s not really where the problem occurred. How often do you get a stack trace and the bug fix is at the line referenced by the stack trace? Almost never. It’s more that it takes you down to the exact line of code where the effects of the problem are bad enough to affect the running of the program. But, the actual problem happened earlier, sometimes much earlier.

        For example, NullPointerException isn’t actually the problem, it’s a symptom of the problem. Something didn’t get initialized properly, and nobody noticed for a while, until we tried to use it, and got a null pointer. Sometimes it’s easy to go from the effect (null pointer) to the cause (uninitialized thing). But, other times that “thing” was passed in, so you have to work backwards to try to figure out where that thing comes from, and why it’s in that broken state.

        Sure, it’s better than nothing, but it’s still frustrating.

      • kbal@fedia.io
        link
        fedilink
        arrow-up
        0
        ·
        8 months ago

        Super-advanced java devs like me do it like try{} catch (Exception e) { System.out.println("something went wrong"); e.printStackTrace(); }