Just a shower thought I had when thinking about claims like “80% of all code will be written by AI”…

  • JackbyDev@programming.dev
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 day ago

    I could’ve sworn that I saw a headline recently that gcc isn’t deterministic. But maybe that was some really weird edge case or a bug.

      • jenesaisquoi@feddit.org
        link
        fedilink
        English
        arrow-up
        2
        ·
        21 hours ago

        I don’t think that’s true - or thst it is a bug. It would make reproducible builds impossible.

        • fragrantvegetable@sopuli.xyz
          link
          fedilink
          arrow-up
          2
          ·
          10 hours ago

          My understanding was that clang isn’t deterministic by default but can be made deterministic with flags. I checked and this is still true but not for the reasons I thought. I assumed this was due to the way LLVM iterates over functions and basic blocks in a non-deterministic order (because of the way they are laid out in memory) and because some optimisations use heuristics. But it appears LLVM tries to make all optimisation passes deterministic. The remaining non-determinism comes from file paths and timestamps which can be worked around with the correct flags and some extra work to create reproducible builds.

      • MangoCats@feddit.it
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 day ago

        Say what you will, Turbo C++ in 1991 was dysfunctional for anything over 5 pages of code, a lot like LLMs a year ago.