RE: [Haskell-cafe] Re: [Haskell] ANNOUNCE: GHC survey results

| If anything I would like to see the Haskell community produce a Haskell | front end which was compiler neutral. That would facilitate many | interesting projects, and that might even help with the need to support | new extensions as they come along. There are already some candidates | floating around, but it seems they are not widely adopted. Well, "ghc -c -fext-core Foo.hs" is a Haskell front end that produces System F code ("External Core"), in a file Foo.hcr. I'm not sure whether that was what you meant. However, External Core doesn't seem to have really caught on. Only 5% said it was essential, with another 16% saying "nice to have". I'm sure there's room to improve the ExtCore route. Simon

"Simon Peyton-Jones"
| If anything I would like to see the Haskell community produce a Haskell | front end which was compiler neutral. That would facilitate many | interesting projects, and that might even help with the need to support | new extensions as they come along. There are already some candidates | floating around, but it seems they are not widely adopted.
Well, "ghc -c -fext-core Foo.hs" is a Haskell front end that produces System F code ("External Core"), in a file Foo.hcr. I'm not sure whether that was what you meant.
External Core is great for some purposes - if you want to play with new optimisation techniques for instance. A tracing system like Hat however wants to have lots of direct linkage back to the original source code. External core doesn't bear a terribly close resemblence to the source - it would require a significant amount of re-sugaring for presentation to the user of Hat. It also loses the actual location of expressions (line/column), although perhaps GHC-as-library would be better in this respect. The ideal front-end for a syntax-directed tool like Hat consists solely of a lexer/parser to an abstract syntax tree, with no desugaring whatsoever, and no typechecking. This is essentially what we have at the moment, but based on nhc98's front-end. For better coverage of language extensions, ghc's parser might be preferable. One can imagine that other tools would want to plug into the pipeline at differents points (after desugaring but before type-checking; after type-checking; etc.) Regards, Malcolm

On 2005-06-30, Malcolm Wallace
The ideal front-end for a syntax-directed tool like Hat consists solely of a lexer/parser to an abstract syntax tree, with no desugaring whatsoever, and no typechecking. This is essentially what we have
This sounds suspiciously like camlp4 in the ocaml world: http://pauillac.inria.fr/caml/camlp4/ camlp4 is, for an ocaml tool, a very nice program. I wish extending Haskell syntax could be as easy as extending OCaml syntax is. camlp4 has a separate frontend/backend system. Standard frontends include a full standard OCaml parser and a "new syntax" OCaml parser. The OCaml distribution also includes a Scheme frontend. Backends include a binary AST representation and pretty-printed OCaml syntax. camlp4 can be integrated into the compilation (ocamlc) phase, and is very slick in many ways. Learning curve is not one of them. -- John

On Thu, 2005-06-30 at 10:36 +0100, Simon Peyton-Jones wrote:
| If anything I would like to see the Haskell community produce a Haskell | front end which was compiler neutral. That would facilitate many | interesting projects, and that might even help with the need to support | new extensions as they come along. There are already some candidates | floating around, but it seems they are not widely adopted.
Well, "ghc -c -fext-core Foo.hs" is a Haskell front end that produces System F code ("External Core"), in a file Foo.hcr. I'm not sure whether that was what you meant.
That is one option, but it wasn't really what I meant. I was thinking of plain old Haskell library code that implements Lexer, Parser, Desugar, Type Inference etc. All the bits that happen at the front of a Haskell compiler. This is what hatchet was supposed to be, and may one day become. I've tried in the past to pull the front end off ghc and nhc98 without much luck. Though it looks like ghc-as-a-library might be just what the doctor ordered. There is also the Programmatica project which seems to do a lot of what I'm thinking of already.
However, External Core doesn't seem to have really caught on.
One problem is that different tools will want different views of the code. External Core is probably too far away from the original source for something like hat.
Only 5% said it was essential, with another 16% saying "nice to have".
I would hazard a guess that fewer than 5% of GHC's users are writing source transformation tools :)
I'm sure there's room to improve the ExtCore route.
You are right, and to be honest I haven't really given much thought to that route until now. Thanks for the pointer. Cheers, Bernie.

Hi, Bernard Pope wrote:
There is also the Programmatica project which seems to do a lot of what I'm thinking of already.
Yes, programatica does a good job. We have switch from using Hatchet to Programatica (and we may switch to the ghc frontend promised for ghc-6.6 that we would need to extend by formulas for specifications) Programatica has an alternative way for producing html documentation from Haskell sources. browse http://www.cse.ogi.edu/~hallgren/Programatica/tools/pfe.cgi I would like to see the advantages of both, programatica's documentation generation and haddock, to be united. (programatica sources don't go through haddock and have few type signatures that haddock could exploit, and haddock comments are useless for programatica.) Unfortunately, the markup used by both programs is different. "{-+" in programatica and "{- |" in haddock. Is there any chance that both documentation approaches could be streamlined? Christian

Hi, Christian Maeder wrote:
I would like to see the advantages of both, programatica's documentation generation and haddock, to be united. (programatica sources don't go through haddock and have few type signatures that haddock could exploit, and haddock comments are useless for programatica.)
Unfortunately, the markup used by both programs is different. "{-+" in programatica and "{- |" in haddock.
Is there any chance that both documentation approaches could be streamlined?
Yes, adding support for Haddock style comment markup to the current HTML renderer in the Programatica tools shouldn't be hard, so I might do that. If I also add support for generating Haddock style documentation, I could take advantage of the fact that the Programatica tools can infer types, to compensate for the lack of explicit type signatures in source code. -- Thomas H
participants (6)
-
Bernard Pope
-
Christian Maeder
-
John Goerzen
-
Malcolm Wallace
-
Simon Peyton-Jones
-
Thomas Hallgren