Opened 4 years ago

Closed 9 months 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 Revisions:

Description

{-# LANGUAGE GADTs #-}

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:  http://www.haskell.org/ghc/reportabug

Change History (16)

comment:1 Changed 4 years ago by simonpj

  • Summary changed from panic! (the 'impossible' happened) with GADT with -fext-core to External 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.

Simon

comment:2 Changed 4 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...

Tim

comment:3 Changed 4 years ago by igloo

  • Milestone set to 7.6.1

comment:4 Changed 3 years ago by dterei

  • Cc dterei added

comment:5 Changed 3 years ago by dterei

  • Architecture changed from x86_64 (amd64) to Unknown/Multiple
  • Operating System changed from Windows to Unknown/Multiple

comment:6 Changed 3 years ago by Eventh

  • Cc eventh@… added

comment:7 Changed 3 years ago by igloo

  • Milestone changed from 7.6.1 to 7.6.2

comment:8 Changed 2 years ago by igloo

  • difficulty set to Unknown

See also #7713, #8001.

comment:9 Changed 13 months ago by kosmikus

  • Cc mail@… added

comment:10 Changed 11 months ago by thoughtpolice

  • Milestone changed from 7.6.2 to 7.10.1

Moving to 7.10.1.

comment:11 Changed 10 months 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-2.3.1.1’ package.

comment:12 Changed 10 months ago by thoughtpolice

  • Resolution set to wontfix
  • Status changed from new to closed

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 10 months ago by thoughtpolice

  • Milestone 7.10.1 deleted

comment:14 Changed 9 months ago by kmels

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

comment:15 Changed 9 months ago by kmels

  • Cc c.lopez@… added
  • Resolution wontfix deleted
  • Status changed from closed to new

comment:16 Changed 9 months ago by thoughtpolice

  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.