Compiler versions

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Wed Apr 7 13:06:04 EDT 2004


"Simon Peyton-Jones" <simonpj at microsoft.com> writes:

> And indeed such a thing might be more generally useful, across all
> Haskell implementations not just GHC.  Perhaps it should be
> 
>      module System.Compiler where
> 	compilerName :: String
> 	releaseDate :: CalendarTime 	-- or (Day,Month,Year)?
> 	version :: (Int,Int)
> 	patchLevel :: Int
> 
> So then a program could ask whether it was being run by Hugs or GHC or
> whatever.

I remember Mark Jones suggesting more-or-less exactly this idea
back in about 1998/1999.  It has been implemented in nhc98 ever
since, but I finally deleted it from CVS recently because no other
systems supported it.  And (probably the more major reason) because
I frequently forgot to keep it up to date.  Here was the signature:

    module Haskell where
 
    import Time
    import Locale
 
    systemName     :: String        -- "Hugs", "GHC", "hbc", "nhc", "qhc", ...
    haskellVersion :: Int           -- 13, 14, 98, 2000, ...
    releaseDate    :: CalendarTime  -- ...
    version        :: String        -- some combination of the above
 
> Questions:
> * Would this be a good thing to agree across compilers?

Yes.

> * What should the interface be?  I gave one possibility above; George
>   gives another.

I'm agnostic.

Regards,
    Malcolm


More information about the Libraries mailing list