writing compiler in haskell

Mark Carroll mark@chaos.x-philes.com
Fri, 11 Apr 2003 09:29:10 -0400 (EDT)


On Fri, 11 Apr 2003, Debanjan Chatterjee wrote:

> I am doing my Masters in Computing. The master's course is a conversion
> course for non-computing graduates. And, the only language taught in the
> course is Java. My undergraduate degree is in accounting. I would like
> to ask whether with my background I can learn Haskell and as well write
> a compiler for C-- in Haskell in three months for my dissertation. Is
> this a feasible project within the time frame? I would also like to
> mention that I have never written a compiler before. I would grateful if
> anyone can advise me on this matter.

Although a C-- compiler in Haskell would probably be great, with your
background I fear that it would take longer than three months unless you
work really hard on it over that time: just getting properly into the
"functional" way of thinking can take a few weeks even with a strong
conventional programming background, and a good understanding of monads
would be very helpful for compiler-writing. Programs always take much
longer to write than you first thought in any language, especially in this
case where a C-- compiler is a non-trivial project that will also have you
trying out your still-young software design skills.

Mind you, if your Java skills are not yet expert, it may be tough in that
too, and I am sure that the people on this list will be happy to help you
rapidly get to grips with Haskell and point you toward the tools that will
most benefit this particular project. And, Java+Haskell probably does a
lot more for your longer-term computing skills than just Java, so partly
it depends what you're hoping to get out of your conversion course.

I wonder if it is easier to show the correctness of Haskell code, and if
that lends itself to the creation of mission-critical financial software.
Even if so, persuading someone else of that may be hard.

Good luck!

-- Mark