Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to newer GHC #455

Closed
10 tasks done
martijnbastiaan opened this issue Jan 24, 2024 · 3 comments
Closed
10 tasks done

Update to newer GHC #455

martijnbastiaan opened this issue Jan 24, 2024 · 3 comments
Assignees

Comments

@kleinreact
Copy link
Contributor

As it turns out, there are some bigger obstacles on the way of our idea to turn circuits into constrained arrows and to use proc notation instead of the circuit-notation plugin as well. Unfortunately, the Arrows language extension still is buggy in terms of supporting constrained arrows properly: https://gitlab.haskell.org/ghc/ghc/-/issues/7828


To give some more background: we cannot turn circuits into Arrows in general, as this would mean that any function can be lifted into a circuit, which is incompatible with the Fwd and Bwd separation used by circuit-notation and clash-protocols at the type level. A way out of this dilemma are constrained arrows, as for example supported with the Constrained Categories package, which enable the use of more specific categories than just (->). In this scope a well-defined notion of circuits-as-arrows can be defined.

However, the Arrows language extension seems not to be well prepared for those kinds of applications as well. While it can be utilized with the RebindableSyntax extension to inject custom arrow primitives, it breaks as soon as the new arrow primitives are equipped with constraints (see the issue mentioned above). Other than that, it also utilizes some unnecessary assumptions of being in (->). For example, it turns proc-code into arrow applications of arr (\x -> x) instead of using the identity arrow directly. This way required constraints on the usage of some constrained arrow primitives cannot be supported properly.


As a consequence, there seems to be no good alternative right now than upgrading circuit-notations with each new version of GHC to keep at least to status quo.

@martijnbastiaan
Copy link
Contributor Author

We've been making quite some progress, but clash-vexriscv turns out to be very brittle. So I'll have to sit down with @cuddlefishie to see what we can do at some point.

@martijnbastiaan
Copy link
Contributor Author

Fixed in #500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants