[Haskell-cafe] Translating Haskell to VHDL. What approach to follow?

Alfonso Acosta alfonso.acosta at gmail.com
Mon Nov 6 09:17:56 EST 2006


On 11/6/06, Neil Mitchell <ndmitchell at gmail.com> wrote:
> Can you explain more about the "declare the interface" remark? I
> suspect this can be acheived with Yhc using the signatures from the
> .hi files, or embeding the information with our "typerep" Haskell
> extension.

I think you're correctly suspecting it.

What I meant is that, like with every structured programming language
(that I know about at least) all VHDL functions and procedure
declarations (Entities & Architectures as well) include a mandatory
interface declaration which includes the type of its parameters and
possible return value.

That implies I need a way to infere or directly obtain the types of
the functions used in the core representation. That as you said, can
probably be done by means of the .hi files or the typerep extension
you mentioned. I'll try to have a look at both options. Any good
documentation pointers?

I think that should be all the type information required for the translation.

> Yhc is a great, so don't let me stop you using it... but I can't resist
> explaining why FC is the way it is.  There is a real tension here
> between simplicity and types.  The reason that GHC uses FC as its
> intermediate language is precisely because FC is the simplest *typed*
> language we know that can serve as a target for Haskell.  If you drop
> the types, you certainly can use a simpler language!

I'm sure SystemFC wasn't arbitrarily chosen, and works well for its
main purpose (being GHC's intermediate language). On the other hand it
can be a bit complicated if it is used as the input of backend whose
goal is translating to a another another high abstraction language.

For my planned backend, it _seems_ to be enough to use a desugarized
version of the initial source file as input and being able to
obtain/infer the type its the functions.

That doesn't mean I have already discarded GHC, I recorsidered it
again after reading that there is some work being done to update it.

Does http://www.haskell.org/ghc/docs/papers/core.ps.gz still apply?


More information about the Haskell-Cafe mailing list