
2012/3/19 Richard O'Keefe
On 19/03/2012, at 8:01 AM, Damien Desfontaines wrote:
The project I suggest is mainly inspired by Ticket #1555 [1] : I think that would be a great idea to make it possible to call some Haskell code into OCamL. In particular, this would contribute to the spreading of Haskell in countries where OCamL is proeminent, mainly France and Italy. The idea would be the following : building a translator which would turn Haskell code into (purely functional) OCamL code, in order to enable the use of Haskell functions and libraries within OCamL programs, in a "human-readable" way (the OCamL source code generated would ideally be understandable enough to be manually modified).
You might want to consider targeting F# as well as (or instead of) OCaml. I've had nothing but trouble with GODI, to the point where I gave up on OCaml entirely. On the other hand, F# came with Mono...
Thank you for answering that fast and for your advices. I'm afraid I have absolutely no experience with F#. I guess I can learn it in several months, I heard it is derived from OCaml, but I think I would be really less efficient working with a brand new language such as F# instead of OCaml, which I already master. But the real question is : what would be the most useful ? I am quite convinced that I could work faster and most efficiently with OCaml than with F#, but if the community considers that such a project would be far more useful if I would "translate" Haskell into F# instead of OCaml, I can adapt.
F# has built-in support for lazy evaluation (although it is not the default), so this might simplify your task. Indeed, F# has comprehensions too, so the main impedance mismatch would be typeclasses. This would make an F# target a sensible half-way point for an OCaml target.
OCaml has a built-in module for lazy evaluation as well (even if it is not in
the Pervasives (= default) module, and a syntax for list comprehensions as well.
So, in my opinion, the main challenge would be dealing with typeclasses, exactly
like in F#.
2012/3/19 Stephen Tetley
Hi Damien
A translator might be a lot of work.
Matthew Naylor had a translator between Haskell and Clean [1], which performed well according to [2]. The translator was his Master project in the UK so I think that means it would represent approximately a years work.
Thanks for your answer. I must admit that I do not really realize how much work such a project represents. I will probably need the help of someone who is more experienced than me to decide my timeline, and perhaps to restrict the final goal of my work (perhaps to a syntaxic subset of Haskell ?). If someone is interested in mentoring me for this work, I would be glad to discuss those technical details with him. Damien D.