RE: GHCi (was Re: Mixture of Integer and Float arithmetic without "fromIntegral "?)

(GHCi is the revised Plan.)
Incidentally, GHCi is just about working. It acts as a compiler with a built-in 'make' too. This is good, not because it
On Fri, Dec 08, 2000 at 12:37:59AM -0800, Simon Peyton-Jones wrote: figures out
dependencies, which is easy, but because it remembers the results of one compilation for the next. This about doubles the speed of compilation for large systems. Mixed interpreted/compiled code is on the way.
Will it be easy to add support for preprocessors?
Classic Hugs has a flag -F for specifying a preprocessor for all source files, and I've hacked an option to redefine the set of source file suffixes. Then the preprocessor can be written to do different things depending on the suffix. Is this sort of thing compatible with GHCi?
In principle, yes. But there are several stages to GHC's compilation cycle; where exactly the user-specified preprocessing stage would fit in is something we'd need to discuss. Cheers, Simon

On Mon, 11 Dec 2000, Simon Marlow wrote:
In principle, yes. But there are several stages to GHC's compilation cycle; where exactly the user-specified preprocessing stage would fit in is something we'd need to discuss.
Aren't there only two reasonably "standard" and "portable" stages: just before and just after unliteration? And unliteration itself is a kind of such source preprocessing. So it's really a question of specifying the order of preprocessings. When multiple preprocessors are being applied, it's not obvious what extensions to use. I tried to allow such stacking in my hsc2hs preprocessor by letting it accept any name ending in "c" and creating the output file with this "c" removed, thus turning foo.hsc into foo.hs and foo.lhsc into foo.lhs. Perhaps it would be better to mark a source to be preprocessed by appending a whole new extension with its own dot instead of modifying the old extension, like autoconf turning config.h.in into config.h. Preprocessors in general may produce more files. For example hsc2hs sometimes produces .c and .h files as well. This requires a naming convention too. It would be cool if Makefiles could be avoided in simple cases, or at least be simpler. I just want ghc to do the right thing with all kinds of files. ghc --make looks promising. -- Marcin 'Qrczak' Kowalczyk
participants (2)
-
Marcin 'Qrczak' Kowalczyk
-
Simon Marlow