Open DigitalBrains1 opened 10 months ago
I wasn't yet aware of the new OPAQUE GHC pragma, and seeing CLASH_OPAQUE here confused me for a bit before I found the PR introducing it. Apparently, CLASH_OPAQUE is specific to code in the clash-compiler repo, which includes clash-cores.
I agree that relevant documentation (e.g. on the use of Synthesize annotations (1, 2) and primitives) should be updated to mention the existence of OPAQUE and when one would want to use it with it apparently being preferred over NOINLINE with GHC ≥9.4. On a related note, perhaps the documentation should also allude to the existence of the new-ish way to write blackboxes?
We have this example. But at a glance there are several things wrong:
(Clock _)
which does not type-check (we have a second argument these days).NOINLINE
. I don't think we should useCLASH_OPAQUE
either; I think we should point out people should probably use a relatively recent GHC andOPAQUE
for their own primitives. And perhaps point out that if they choose an old GHC nonetheless, they should useNOINLINE
.XException
s a lot.Point 2 will apply to more documentation, by the way.