[Haskell-cafe] sharing
Tom Schouten
tom at zwizwa.be
Wed Feb 5 17:40:23 UTC 2020
On 2/5/20 10:39 AM, Carter Schonwald wrote:
> Try using clash, its its own thing, and overanalysis might be more
> challenging than just trying it out
>
Fair point.
> - There is another Functional HDL that solves this using some
> unsafe reference trick to keep track of the sharing. I believe it
> is CλaSH but I'm not sure. I believe you can get away with this
> because the semantics is pure so in practice doesn't cause any
> inconsistencies, but it really doesn't sound like something I
> would do without some kind of proof that it is actually ok. If it
> is ok, it would probably make sense to abstract this in a library.
> Maybe someone has done that already?
>
I was able to recover some information from my notes. I ran into this a
while ago, then decided to keep the implementation simple and just use
Monads:
A survey in Andy Gill's presentation on observable sharing:
http://www.ittc.ku.edu/~andygill/talks/20090903-hask.pdf
Just checked the Clash website and there is a link to Christiaan Baaij's
master thesis, which has a description of the sharing problem in Appendix C:
https://essay.utwente.nl/59482/1/scriptie_C_Baaij.pdf
I think there is probably a use for a generic library that can do this
kind of sharing recovery. Still I'm not quite happy with the "can be
unsafe in some cases" remarks and would like to learn more. However
there might be a tradeoff to use this as a simplified interface to
something that is implemented in a safe monadic style under the hood.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20200205/401ef440/attachment.html>
More information about the Haskell-Cafe
mailing list