[Haskell-cafe] generate Haskell code from model

Neil Mitchell ndmitchell at gmail.com
Fri Apr 13 15:27:11 EDT 2007


Just to say, I agree with Brian totally! I've been (violently and
forcefully) exposed to MOF tools in the past, and at every turn my
thought was "the Haskell would be clearer, shorter and executable!"

> Brian, but don't you think that you have to write a lot
> of boilerplate code in Haskell?

Can you give an example? Usually higher order functions, monads,
laziness etc can combine to make the boilerplate minimal, if not
invisible. This is exactly the kind of problem haskell-cafe will excel

> Second, if Haskell should be more successful in the
> real world there has to be a way of demonstrating
> basic ideas of a big program to "customers". How
> would you do this? Everybody knows UML class
> diagrams, for example. In contrast, nobody knows
> about termgraphs or lambda *g*.

The UML is not executable, draw a pretty picture. No one knows UML,
everyone knows pretty pictures - most people can guess at the meaning
of UML because they know the meaning of pictures. As to reverse
engineering a diagram from code, that always leads to ugly (and
pointless) diagrams.

> Third, assume you already have a model, want to
> write the corresponding code yourself?

If the model is executable, why do you want to write the code?

> Thank you very much for contributing to the discussion.
> Please assume, that you have to generate the code from
> a model.

If the model is the code, then the tool "cat" can be used to generate
the code from the model :-)

> Further assume, that you have no choice and
> are not allowed to discuss the sense of this approach :-)

Ah, artificial technical limitations are unlikely to be something that
people adhere too :)

If you can generate Java code from a model, why on earth would you
then want to generate Haskell code from it? I see know reason to use
the assembly language called Haskell vs the assembly language called
Java - since if you are compiling a model to anything, it is just
serving as an assembly language.



PS. Apologies - I got a 3rd in my degree module in meta-modelling -
apparently giving alternative (better) solutions in Haskell does _not_
get bonus marks. This makes me not like meta-modelling very much.

More information about the Haskell-Cafe mailing list