Opened 7 years ago

Closed 4 years ago

#5630 closed bug (wontfix)

External Core needs love

Reported by: quux Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.2.1
Keywords: Cc: dterei, eventh@…, mail@…, c.lopez@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:



data T a b where
  T1 :: a -> b -> T [a] (a,b)
main = putStrLn ":("

and then "ghc this.hs -fext-core" results in

>ghc core-sandbox.hs -fext-core
ghc core-sandbox.hs -fext-core
[1 of 1] Compiling Main             ( core-sandbox.hs, core-sandbox.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.2.1 for i386-unknown-mingw32):
	make_exp (App _ (Coercion _))

Please report this as a GHC bug:

Change History (16)

comment:1 Changed 7 years ago by simonpj

Summary: panic! (the 'impossible' happened) with GADT with -fext-coreExternal Core needs love

External Core is defined by a data type in coreSyn/ExternalCore.lhs. This data type has received No Love for years. As a result, it is lagging way behind Core, as is External Core's concrete syntax. For example it does not accommodate GADTs at all, I think. In this particular ticket, we are trying to convert a Coercion from Core to ExtenalCore.Exp, but there are no coercions (yet) in Exp.

In short, External Core needs some love and attention.

(I suspect it's ended up in this state because most people are using the GHC API instead, but the idea of giving Core a proper, printable external realisation remains a good one..)

If anyone feels able to draft it into the 21st century I'd be happy to advise. For what it's worth, I think that a promising approach might be to abolish the ExternalCore data types in favour of those in IfaceSyn, which serve a very similar purpose. The IfaceSyn types didn't exist when External Core was first implemented, but they very much do now, and they *cannot* lag.

So I suggest that we abandon ExtCore as it is, and instead write a printer and parser for IfaceSyn. But it needs a volunteer.


comment:2 Changed 7 years ago by tim

The reason for having the ExternalCore data types is that External Core has a semantics (through the ext-core typechecker and interpreter), and I'm not sure whether IfaceSyn does (though I'm not really familiar with it). (Of course, the semantics probably doesn't reflect GADTs right now...)

I'm not really sure I'm up for giving ext-core more love at this point, but I wanted to recommend some caution...


comment:3 Changed 7 years ago by igloo

Milestone: 7.6.1

comment:4 Changed 7 years ago by dterei

Cc: dterei added

comment:5 Changed 7 years ago by dterei

Architecture: x86_64 (amd64)Unknown/Multiple
Operating System: WindowsUnknown/Multiple

comment:6 Changed 6 years ago by Eventh

Cc: eventh@… added

comment:7 Changed 6 years ago by igloo


comment:8 Changed 5 years ago by igloo

difficulty: Unknown

See also #7713, #8001.

comment:9 Changed 4 years ago by kosmikus

Cc: mail@… added

comment:10 Changed 4 years ago by thoughtpolice


Moving to 7.10.1.

comment:11 Changed 4 years ago by Fuuzetsu

While it was already moved up to 7.10, I'd like to mention that I just hit it in 7.8.3 so it has not gone away while noone was looking.

Specifically I hit this with ‘sizes-’ package.

comment:12 Changed 4 years ago by thoughtpolice

Resolution: wontfix
Status: newclosed

This bug is obsolete now, considering we've removed external core completely in HEAD. Nobody had maintained it for years, so it was pretty bitrotten.

As a result I'm closing this as WONTFIX.

comment:13 Changed 4 years ago by thoughtpolice

Milestone: 7.10.1

comment:14 Changed 4 years ago by kmels

Could you refer to the changeset where -fext-core was removed please?

comment:15 Changed 4 years ago by kmels

Cc: c.lopez@… added
Resolution: wontfix
Status: closednew

comment:16 Changed 4 years ago by thoughtpolice

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.