tuura / plato

A DSL for asynchronous circuits specification
Other
12 stars 2 forks source link

Unable to translate Concepts #97

Open ARandomOWL opened 3 years ago

ARandomOWL commented 3 years ago

(Had to update stack.yaml to be able to build, see #96.)

After stack setup --no-system-ghc stack build stack test passes successfully stack runghc translate/System.hs -- examples/Celement_with_env_1.hs returns:

translate/System.hs:46:1: error:
    Failed to load interface for ‘Concept’
    Perhaps you meant Convert (needs flag -package-key ghc-8.0.1)
    Use -v to see a list of the files searched for.
snowleopard commented 3 years ago

I guess Stack has moved on but Plato hasn't been built for a while and needs some maintenance work to make it buildable again. I don't think I have time for this at the moment but I'm happy to review a PR.

jrbeaumont commented 3 years ago

If stack has updated, it may also have updated how it loads in modules. If I get a chance soon I'll dust off the old Haskell skills and have a look. Let me know if you have any ideas, or if you want to have a go please feel free!

jrbeaumont commented 3 years ago

I had a look at this this afternoon, and it's a headscratcher.

Between it being a while since I looked at Plato, and GHC and/or Stack have moved on and simply put, it's not as simple as it once was.

We used to pass the filepath for the concept file to be translated into translate/System.hs and it would import this, and then we'd use the file itself to generate the helper file which it would then run to compile and translate the concepts.

Now it seems, it requires that Concept is imported before we can translate anything, but we need the Signals from Concept in order to translate.

I thought maybe it was no longer getting the input filepath, but it is.

I'm considering a Signal module which has up to 26 signals (A - Z), which all concept files import, and the translate code imports too. I have no idea if it will work, but if it does, it sets the max number of signals until something else is done.

Any ideas on how this may be fixed in a better way?

snowleopard commented 3 years ago

@jrbeaumont Thanks for looking into this! To be honest, I don't quite understand the problem -- I have very little memory of how things used to work :)

I'm considering a Signal module which has up to 26 signals (A - Z), which all concept files import, and the translate code imports too. I have no idea if it will work, but if it does, it sets the max number of signals until something else is done.

Will this rule out signal names like uv? Sounds pretty limiting.

Could you describe how things used to work and how your solution with the Signal module works in more detail?