this post was submitted on 07 Apr 2026
2 points (100.0% liked)

Programmer Humor

42719 readers
19 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 

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

you are viewing a single comment's thread
view the rest of the comments
[โ€“] jenesaisquoi@feddit.org 0 points 2 months ago (1 children)

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

[โ€“] fragrantvegetable@sopuli.xyz 1 points 2 months 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.