[Haskell-cafe] Hello and type-level SKI

Jay Sulzberger jays at panix.com
Sat Sep 13 04:02:38 UTC 2014




On Fri, 12 Sep 2014, Gershom B <gershomb at gmail.com> wrote:

> > On September 12, 2014 at 7:30:28 PM, Brandon Allbery (allbery.b at gmail.com) wrote:
> > On Fri, Sep 12, 2014 at 7:25 PM, Jay Sulzberger wrote:
> > 
> > >
> > > What have I misunderstood? And, in case GHC really does now
> > > handle stuff beyond the HMD horizon, what does the New Core
> > > language look like?
> > >
> > 
> > Standard Haskell is (or was) H-M extended with typeclasses. GHC moved
> > beyond that years ago; internally it's System Fw (
> > http://en.wikipedia.org/wiki/System_F#System_F.CF.89), and its Core
> > language reflects this.
> 
> It has now moved beyond that too and is system FC
> (https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/FC)
> which adds equality constraints and coercions.
> 
> Also note that, as I understand it, typeclass constraints are
> dealt with in the typechecker, before core is generated. So if
> you use a terrible combination of features and instances and
> produce something at the type level that loops, then the
> typechecker just doesn’t terminate (well, it actually runs out
> of context stack typically…). You can find more details in the
> commentary
> (https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/HscMain)
> which now looks way clearer than last time I checked.
> 
> -g

Thanks, Gershom!

I just glanced at the page.  I know that GHC is a serious
compiler, but just the high level flow diagram impresses.  The
compiler deals with stuff more logically complex than the usual
presentations of System FC deal with, such as "strictness".  To
think that sometimes it runs without dumping core, and even, I
believe this part of Haskell propaganda, often produces correct
programs, ah, well, I say MORE FUNDING and don't worry about
success.

oo--JS.


PS.  I just looked at

https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/CoreSynType

I am reassured.


More information about the Haskell-Cafe mailing list