Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A Haskell Compiler – Slides on GHC Implementation (2013) (stanford.edu)
101 points by TheAsprngHacker on Aug 19, 2018 | hide | past | favorite | 18 comments


It’s worth noting that while still likely largely accurate, ghc has evolved a bit since 2011


That runtime system is huge. I remember it was an obstacle to high-assurance in Haskell. Is there a detailed write-up on what those 80,000loc do? Maybe someone could redo it in one of the verifying, imperative languages like SPARK or ATS to increase its assurance without full verification.


For information about GHC's internals, I recommend reading https://ghc.haskell.org/trac/ghc. The RTS documentation is at https://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts.


Thanks!


The rts is pretty nicely written c code. And folks on the ghc irc channel on frenode and mailing lists are all pretty helpful when you have solid questions


You might find https://www.aosabook.org/en/ghc.html interesting, which gives an overview of GHC and the decisions they made around it.

I haven't heard anything about obstacles for high assurance, but the runtime is definitely considered stable, and rarely needs any components updated AFAIK.


That's doubtful that high-assurance Haskell is in much demand actually. People usually prefer much more strict (in both senses) languages for that, CakeML in particular comes to mind.


By the way, there is a project to "Implement a front-end for CakeML that accepts OCaml or Haskell syntax"

> An involved version of this project would be to write a new verified parser for an alternative syntax. A simpler version would be to re-target the parser in the OCaml compiler to produce CakeML abstract syntax, and treat this as an executable specification. Similarly for any Haskell compiler that is amenable to such treatment.

https://cakeml.org/projects


I tried to figure out what subset of sml cake uses but wasn’t able to find that anywhere in their docs

But yeah, it’s definitely true that high assurance / high quality tools are still in their relative infancy (there’s lots of great stuff, but nothing I’d be comfortable using with colleagues at the drop of a hat for a quick project next week)


Joachim Breitner did a simple high assurances rts backend a year or two ago


Do you know does it compare to JVM, v8, BEAM, etc? How many locs are they?


HotSpot has ~250,000 lines of C/C++.


How do you go to the next slide on mobile?



That's a pain point for me as well; what I did was edit the URL to make the anchor fragment #(n) where n is the index of the desired slide.


Click directly on the bottom right corner pagination index to move to next slide. It worked for me.


I recommend a separate tab, I couldn't use the back button to return to HN after navigating many pages, on desktop Chrome.


Tap the part of the slide that contains text




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: