Neil Mitchell wrote:
I guess I started this discussion by asking for a concrete thing,
rather than describing what I'm hoping to do. In reality, any solution
that accomplishes my end goal suits me perfectly - so perhaps I should
say what I'm hoping to do.
Currently Yhc has an external core format, Yhc.Core. However, its
certainly not a "state dump" of the internals of Yhc's syntax - it
dropped some features (FatBar) and added others (Lambda). The
intention is that Yhc.Core is a standalone format and library which
Yhc currently generates, but that any compiler could potentially
generate Yhc.Core, and even if we end up rewriting 50% of Yhc we
aren't going to have to change Core.
Realistically, GHC is the compiler that can actually compile Haskell
programs, so I'd love to "get Yhc.Core" from GHC. This would
immediately give the benefit that lots of Haskell source analysis
tools (at least 6 so far) would suddenly work with all of GHC's
Haskell. I don't mind how we get Yhc.Core out of GHC, ...
So presumably you'd be happy if you could do something like this:
import qualified GHC
getYHCCore :: FilePath -> YHC.Core
getYHCCore file = do
s <- GHC.newSession
ghc_core <- GHC.compileToCore s "Foo.hs"
convertToYHCCore ghc_core
ie. without any on-disk representation at all, just using the GHC API. We don't
currently have GHC.compileToCore, but it would be just a matter of doing the
plumbing.
Cheers,
Simon
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc