GHC core packages: same core?
Hi, Just curious whether package http://hackage.haskell.org/package/ghc-core and http://hackage.haskell.org/package/extcore operate on the same flavor of GHC Core? There seem to be external [1] and internal [2] flavors of GHC Core. [1] http://www.haskell.org/ghc/docs/6.10.2/html/ext-core/core.pdf [2] http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/CoreSynType Thanks. -- Dimitry Golubovsky Anywhere on the Web
Hi Dimitry, ghc-core is a pretty-printer for GHC's internal Core language (you can get a non-pretty-printed version simply by compiling with (IIRC) -dverbose-core2core). This is what we actually optimize and generate code from, and the formatting of this output might change at any time. This is probably what you should be looking at, as a human trying to understand how your programs are being complied. extcore is a library that parses "external" Core, which is an alternative format intended to be stable and hence a suitable target for consumption by non-GHC tooling. You can have GHC output external core instead of machine code / C. I don't believe this is widely used yet. Cheers, Max 2009/10/12 Dimitry Golubovsky <golubovsky@gmail.com>:
Hi,
Just curious whether package http://hackage.haskell.org/package/ghc-core and http://hackage.haskell.org/package/extcore operate on the same flavor of GHC Core?
There seem to be external [1] and internal [2] flavors of GHC Core.
[1] http://www.haskell.org/ghc/docs/6.10.2/html/ext-core/core.pdf [2] http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/CoreSynType
Thanks.
-- Dimitry Golubovsky
Anywhere on the Web _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Max, Thanks for the explanation. So, the extcore library is expected to match the spec in http://www.haskell.org/ghc/docs/6.10.4/html/ext-core/core.pdf and the core itself can be produced with -fext-core, correct? I think it might be interesting for people working on alternative backends (inlcuding myself). On Tue, Oct 13, 2009 at 4:53 PM, Max Bolingbroke <batterseapower@hotmail.com> wrote: [skip]
extcore is a library that parses "external" Core, which is an alternative format intended to be stable and hence a suitable target for consumption by non-GHC tooling. You can have GHC output external core instead of machine code / C. I don't believe this is widely used yet.
-- Dimitry Golubovsky Anywhere on the Web
Dimitry, I *believe* ext-core will match that document, but I'm not sure of the exact status. Tim Chevalier has done a lot of great work maintaining the external core stuff and I think he is actively using the extcore library, so *that* should almost certainly match GHC's output. It's great to hear that you are interested in writing an alternative backend! I think LHC is also using ext-core to build a backend, so this seems like a viable approach. All the best, Max 2009/10/13 Dimitry Golubovsky <golubovsky@gmail.com>:
Max,
Thanks for the explanation. So, the extcore library is expected to match the spec in http://www.haskell.org/ghc/docs/6.10.4/html/ext-core/core.pdf and the core itself can be produced with -fext-core, correct? I think it might be interesting for people working on alternative backends (inlcuding myself).
On Tue, Oct 13, 2009 at 4:53 PM, Max Bolingbroke <batterseapower@hotmail.com> wrote: [skip]
extcore is a library that parses "external" Core, which is an alternative format intended to be stable and hence a suitable target for consumption by non-GHC tooling. You can have GHC output external core instead of machine code / C. I don't believe this is widely used yet.
-- Dimitry Golubovsky
Anywhere on the Web
On Wed, Oct 14, 2009 at 10:28 PM, Max Bolingbroke <batterseapower@hotmail.com> wrote:
Dimitry,
I *believe* ext-core will match that document, but I'm not sure of the exact status. Tim Chevalier has done a lot of great work maintaining the external core stuff and I think he is actively using the extcore library, so *that* should almost certainly match GHC's output.
It's great to hear that you are interested in writing an alternative backend! I think LHC is also using ext-core to build a backend, so this seems like a viable approach.
LHC is using a different external core parser. -- Cheers, Lemmih
On 10/13/09, Dimitry Golubovsky <golubovsky@gmail.com> wrote:
Max,
Thanks for the explanation. So, the extcore library is expected to match the spec in http://www.haskell.org/ghc/docs/6.10.4/html/ext-core/core.pdf and the core itself can be produced with -fext-core, correct? I think it might be interesting for people working on alternative backends (inlcuding myself).
Hi Dimitry, Sorry for the late reply, but the External Core produced by any version of GHC newer than 6.10.4 should match the document you cite, and if it doesn't, I'd like to know about; in that event, please file a bug report or post to the glasgow-haskell-users list with me CCed. Cheers, Tim -- Tim Chevalier * http://cs.pdx.edu/~tjc * Often in error, never in doubt "The higher you climb, the more you show your ass." -- Alexander Pope
participants (4)
-
Dimitry Golubovsky -
Lemmih -
Max Bolingbroke -
Tim Chevalier