Haskell front ends, was pretty newby

Bernard James POPE bjpop at cs.mu.OZ.AU
Wed Sep 24 22:12:16 EDT 2003


Hi all,

I'm not sure I'll answer the question properly, but I think
it raises an interesting issue, regarding the state of Haskell
front ends.

> What I had in mind what to pp my own programs, 
> to clean the source layout, rather.

> so the two gain i was expecting were : 
> - cleaning the layout, after i removed all the debugging code
> - generating the type 

> alos, Im surprised that this bland issue has not already been 
> solved (PP lib paper looks dated 96). no  offence intended, but 
> aas im newbie, i wonder what am i missing ? what is different in 
> the process of creation so that this need did not arised already? 
> i should admint i'm puzzled, given the facilities at hand...

Is this what you are after?

   A tool to read in Haskell source, and then print it out 
   (to file or screen) in a pretty printed manner. It should
   retain comments from the source. And possibly add 
   type annotations.

Such a tool would be very nice indeed. Though I do not think such
a thing exists at the moment. 

Why not? Good question. One thing that Haskell is really lacking (IMO) 
is a common front end. Something that can lex, parse, type check ...
do all the things that a compiler or interpreter would do before
it starts to generate code. Such a thing would be great for many
people. It would help define the language. It would help implementors
and researchers. It would probably even serve as a good source of
example Haskell code for those looking to study the language.
And, importantly, it would enable Haskell specific editors, 
refactorers, pretty printers and so on.

Some work has been done towards this, including the hsparser
library and supporting material that comes with GHC these days.
I have been a very happy client of that parser for a long time now
(sorry about the pun).

At the recent Haskell workshop I saw a presentation about the 
nice tools that the Programatica group are working on. This seems
to include most of the front end of a Haskell system. 

   http://www.cse.ogi.edu/PacSoft/projects/programatica/

It appears that binary forms of their programs are available:

   http://www.cse.ogi.edu/~hallgren/Programatica/download/

Alas, I could not find a source distribution and I'm not sure if one
exists.

One problem I see is that it is hard to justify the large amount of
work that is required to implement such a thing when it might not
be regarded as research worthy. 

Though, in the long run I think the research community is being held 
back because we must continually re-implement the front end of
Haskell, and often we only get part way through it before we run
out of steam (see Hatchet for example, I'm a guilty party...).

We owe it to ourselves to implement a front end. Though I 
fully appreciate the difficulty of the task, and I'm not putting my 
hand up to do it at the moment (grumble, thesis writing, grumble). 
Perhaps there are some keen Haskell hackers out there who are itching for
a nice project?

And by the way, I don't want to sound like I'm complaining too much,
because, as I said, I've been using the hsparser and pretty printer
extensively, and I failed to finish Hatchet.

Cheers,
Bernie.


More information about the Haskell mailing list