hylo-lang / hylo

The Hylo programming language
https://www.hylo-lang.org
Apache License 2.0
1.24k stars 58 forks source link

Make LLVM lowering deterministic #983

Open camio opened 1 year ago

camio commented 1 year ago

The inability to get reproducible compiler error output frustrates debugging.

dabrahams commented 1 year ago

The most likely source of nondeterminism here is the random order that things appear in hash containers from run to run (that's a Swift security feature). If you want to straighten that out there's probably a .sorted() that could be inserted somewhere.

kyouko-taiga commented 1 year ago

We can define the order in which Hylo IR functions will be transpiled to LLVM. That will likely make our builds much more deterministic.

Unfortunately we only have partial control over the order in which LLVM will manage it's internal representation, run its optimization passes, etc. That may be another cause of nondeterministic errors which we can't address without patching LLVM.