4 ms·
Rethinking Static Reference Tables in GHC
- wafflesraccoon 8y agoDoes he define GHC anywhere in the article? Any idea what that might be?
- jjaredsimpson 8y agohttps://www.haskell.org/ghc/ https://www.haskell.org/ghc/ The canonical haskell compiler.
- justinjlynn 8y agoAt this point, I think it's fair to say that GHC is the Haskell compiler.
- chowells 8y agoAs for why he doesn't define it: he's been one of two primary authors of GHC for over 20 years. He assumed anyone reading his blog would already be aware of that, because why else would they be reading his blog?
- fake-name 8y agoI dunno, maybe because people link to stuff without context?
- kornish 8y agoGoogling "Simon Marlow" gives the following: > Simon Marlow is a British computer programmer, author, and co-developer of the Glasgow Haskell Compiler. He and Simon Peyton Jones won the SIGPLAN Programming Languages Software Award in 2011 for their work on GHC.
- tuukkah 8y agoPrimary takeaway, for (Haskell) programs compiled with GHC: "Code size: overall binary sizes are reduced by ~5% for large programs, ~3% for smaller programs."
- chriswarbo 8y agoLooks like this "pays for itself" (as in https://prog21.dadgum.com/136.html https://prog21.dadgum.com/136.html ), which is always nice to see for a simplification :) The top-level `Map` example resonated with me, since I recently needed to speed up some scripts which look up data from some statically-known JSON files, which match some user-provided properties. I was using `jq`, but ended up doing an O(N^2) nested loop which was too slow. I wrote a Haskell version, which was easy enough with the Aeson library, but then I was able to speed it up massively by using Template Haskell to read the files, parse the JSON and build a `Map` from properties to data at compile time. This is encoded in the resulting program as a top-level definition, just like the example shown in this article. The resulting binary only needs to do an O(log N) lookup at runtime, which is more than acceptable :)
- infinity0 8y agoWould this also benefit non-top-level thunks? We had a ridiculous space-leak at DFINITY just last month where the workaround I found involved turning off full-laziness [1] as well as using a variant of `Control.Monad.forever` defined in terms of `(>>=)` rather than `(* >)` - which is how `Control.Monad` does it, which interacted badly with how Conduit implements `(>>=)` and `(* >)`. We never got to the bottom of exactly why it leaked but I'll be sure to try it out again with GHC 8.6. However it's not clear that long-lived CAF data would have been the problem in our case. [1] https://www.well-typed.com/blog/2016/09/sharing-conduit/ https://www.well-typed.com/blog/2016/09/sharing-conduit/