clash-lang / ghc-typelits-natnormalise

Normalise GHC.TypeLits.Nat equations
Other
43 stars 15 forks source link

Deterministism #2

Closed Ericson2314 closed 6 years ago

Ericson2314 commented 9 years ago

When I rebuild (with cabal), I get lines like

[ 4 of 34] Compiling CLaSH.Promoted.Nat ( src/CLaSH/Promoted/Nat.hs, dist/build/CLaSH/Promoted/Nat.o ) [GHC.TypeLits.Normalise changed]

every time. I assume this means there is something non-deterministic going on (or GHC just assumes the worst).

christiaanb commented 9 years ago

I have observed this as well. I don't think it's specific to this plugin, but holds for all. That means one of two things:

  1. It's a bug in GHC
  2. It's intentional because plugins can perform arbitrary I/O. So for example you could make plugin that doesn't work on Monday morning; in that case compiling the module that depends on the plugin should also fail on Mondays.

Option 1 seems more likely, so I guess further investigations is warranted.

cartazio commented 8 years ago

@christiaanb I spoke with duncan recently and both he and I think its probably a GHC issue. (i was recently using this plugin myself, but then discovered i didnt need to :) )

cartazio commented 8 years ago

worth reporting, though probably at this point can't be cleanedup till post 8.0 major version i suspect :)

christiaanb commented 8 years ago

@cartazio Good to know that there are more who also think it's a GHC issue. With regards to reporting: I could report it, but I don't feel like putting in the effort of creating a minimal test case, as this GHC hiccup is not causing any failures as far as I know.

With regards to your use of this plugin: you found another plugin? found out you can just write your code another way? or you just stopped using GHC.TypeLits.Nat?

cartazio commented 8 years ago

Found that the way I'm using known nats just needs sameNat and gcastwith because it corresponds with when I need to do a run time check anyways. :)

I do suspect that even hello world with the plugin mentioned would get the rebuilds. But I've not tested thst :)

On Monday, May 9, 2016, Christiaan Baaij notifications@github.com wrote:

@cartazio https://github.com/cartazio Good to know that there are more who also think it's a GHC issue. With regards to reporting: I could report it, but I don't feel like putting in the effort of creating a minimal test case, as this GHC hiccup is not causing any failures as far as I know.

With regards to your use of this plugin: you found another plugin? found out you can just write you code another way? of just stopped using GHC.TypeLits.Nat?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/clash-lang/ghc-typelits-natnormalise/issues/2#issuecomment-217793931

ggreif commented 8 years ago

@Ericson2314 https://ghc.haskell.org/trac/ghc/ticket/12567

Ericson2314 commented 8 years ago

Thanks!

christiaanb commented 6 years ago

Fixed by: https://github.com/clash-lang/ghc-typelits-natnormalise/commit/c89a4e1779ba51410ea59bf32d5bc0473b83f00d