
On 12 Jan 2005, at 11:10, Matthew Roberts wrote:
Can anyone attest to the sense (or otherwise) of the following programming "pattern"
- program all back end stuff in Haskell and compile to library - program all GUI stuff in *insert imperative language of choice" and link to the library for back end functionality
It seems the ultimate decoupling of interface from logic.
This is roughly how I handled a recent project, in a mixture of ML and Java. Frankly I regret it: if I did it again, I would do the whole thing in ML (or perhaps haskell). Once you get used to languages with real higher-order features and powerful abstraction notions, it is a real pain reverting to a language like Java (or C or C++ or perl or...) ML, despite being thought of as a primarily functional language, is still (IMO, of course) a 'better' imperative language than Java, because of features like closures and local declaration of functions. I think the same holds of haskell using an appropriate monad instead of ML's imperative features. All this is of course entirely dependent on having a suitable GUI library or set of bindings for haskell. I haven't tried wxHaskell yet so I can't comment there. (And for some applications, some languages may be too slow, but I was ignoring efficiency in the above) Jules