Hi Francois-Xavier,
> Ocaml (http://caml.inria.fr/) is a beautiful functionnal (but impure)
> language
I think most of us know ocaml :-), and I like it too: sober and
consistent design with an excellent compiler and libraries,
> (with side effects, sorry, nobody's perfect),
and a fatal flaw too ;-)
> So the question is:
> Did you find any problem in implementing it in a pure functionnal style=
,
> and could you tell me what are the pros and the cons in doing it this
> way ??
This is a really hard question! I think that making a binding to wxWidget=
s
is difficult in two areas:
1) technical: getting the marshalling layer working between wxWidgets and
the host language. (haskell solution: use wxEiffel wrappers and a haskell
wrapper generation tool (wxdirect)).
2) design: how do you represent the c++ model in your strongly typed
host language? (haskell solution: monads for side effects, phantom types
for modelling (type) inheritance, and type classes to group common operat=
ions.
(and at the higher wx level: existential types to model get/set functions
as attributes))
Regarding your specific question, I think that the pure functional interf=
ace
works out pretty well, also with regard to error messages produced by
the compiler. I guess that if you would have objects in your language, th=
at
might also provide a good direction -- however, note that one mostly uses
wxWidgets classes, you don't implement them yourself -- as such, the obje=
cts
will mostly be used as interfaces/types -- not as values that you manipul=
ate.
If you want to know more about the way inheritance is modelled in wxWidge=
ts,
you should read chapter 2/3 (?) of my thesis (available on my home page
(www.cs.uu.nl/~daan)) and read the quickstart guide and links on the wxHa=
skell
page.
Hope this helps,
Daan.
ps. I guess that most people on this list are more interested in specific
wxHaskell things, so maybe you should write to me directly.
>
> I thank you in advance
> Fran=C3=A7ois-Xavier Houard
> Id...@In...
>
>
>
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> Build and deploy apps & Web services for Linux with
> a free DVD software kit from IBM. Click Now!
> http://ads.osdn.com/?ad_id=1356&alloc_id438&op=CCk
> _______________________________________________
> wxhaskell-users mailing list
> wxh...@li...
> https://lists.sourceforge.net/lists/listinfo/wxhaskell-users
>
>
|