• SpaceNoodle
    link
    fedilink
    arrow-up
    36
    ·
    5 months ago

    I don’t get it. What’s wrong with constexpr? It’s vastly preferable to macros due to type safety, and const due to compile-time optimization.

    • RustyNova
      link
      fedilink
      arrow-up
      14
      arrow-down
      1
      ·
      5 months ago

      I don’t get it either. OP might be angry at compile time (Couldn’t be worse than rust)

      • anton@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        7
        ·
        5 months ago

        Rust doesn’t allow type inference in function signatures, c++ does with auto. IIRC, they recommended against using it, because of -you guessed it- compile time.

        • RustyNova
          link
          fedilink
          arrow-up
          3
          ·
          5 months ago

          TBH I thought it was for refactoring type safety. Making sure that the type is understood and not ready to just change wildly accidentally.

          • SpaceNoodle
            link
            fedilink
            arrow-up
            1
            ·
            5 months ago

            I thought that was part of the point - simplifying refactoring.

      • SpaceNoodle
        link
        fedilink
        arrow-up
        1
        arrow-down
        6
        ·
        5 months ago

        Not fair to compare it to the very immature Rust.

        • RustyNova
          link
          fedilink
          arrow-up
          8
          arrow-down
          1
          ·
          5 months ago

          I do love rust. But I do like making fun of it too.

          Although I don’t see how rust is immature? Unless I missed the joke?

          • SpaceNoodle
            link
            fedilink
            arrow-up
            1
            arrow-down
            6
            ·
            5 months ago

            It’s very young for a programming language, and is still rapidly evolving.

            • calcopiritus
              link
              fedilink
              arrow-up
              5
              arrow-down
              1
              ·
              5 months ago

              It’s more than 10 years old. It has stable syntax, big standard library, big library ecosystem, plenty of rust programs already in production.

              If by “evolving” you mean “changing”, I don’t think that is an issue at all. At most, they add features. They don’t change or remove. And with the editions system, it should be no issue.

              If by “evolving” you mean “improving”, then I don’t see how that could ever be an issue.