
GHC 8.2 Released - houli
https://ghc.haskell.org/trac/ghc/blog/ghc-8.2.11-released?utm_content=buffer256fb&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer
======
georgewsinger
> Compact regions, allowing better control over garbage collection in the
> presence of large heaps containing many long-lived objects.

Can someone explain how this feature works and/or how much impact it has on
Haskell's feasibility as a performant, i.e., game engine or real-time
application language?

~~~
kccqzy
In a nutshell, you can create a region and add data to this region and the GC
will never look inside it. That is, as long as there is one external reference
to _any_ object in this region, the whole region will be kept alive. This is
most useful when you know beforehand that you will never deallocate this
region of data anyway: it reduces GC latency. Another benefit is that this
region can then be serialized to disk efficiently. Deserialization is pretty
efficient as it involves as loading the whole thing into memory and fixing up
pointers. Reminds me of the Emacs dump[1] though.

[1]: [https://lwn.net/Articles/673724/](https://lwn.net/Articles/673724/)

------
z1mm32m4n
> A new, more type-safe type reflection mechanism

Does this mean GHC does not erase types at runtime? Or perhaps what do they
mean by "reflection" here; I only know it in the context of Java, where it
more or less felt like an anti-pattern.

~~~
MHordecki
If I understand the paper correctly, reflection in 8.2 involves some crafty
use of GADTs and compiler primitives to create a type descriptor of sorts that
allows you to decompose values at runtime in a typesafe manner, while still
allowing for erasure.

Paper: [https://www.microsoft.com/en-us/research/wp-
content/uploads/...](https://www.microsoft.com/en-us/research/wp-
content/uploads/2016/08/dynamic.pdf)

Package:
[https://downloads.haskell.org/~ghc/latest/docs/html/librarie...](https://downloads.haskell.org/~ghc/latest/docs/html/libraries/base-4.10.0.0/Type-
Reflection.html)

~~~
z1mm32m4n
Oh wow this is going to be a joy to read, thanks! Only a couple pages in and
it already looks well-written and thorough.

Also there's this: "This paper is literate Haskell and our examples compile
under GHC 8.0." A 26 page, typeset paper is certainly the longest example of a
literate Haskell program I've come across! Wow.

------
girzel
Cue a full month of regular busloads of archlinux package updates...

------
willtim
This is an impressive list of new features! Well done to all involved!

------
ihm
Where can one find more information on the module system? The release notes
don't seem to mention it.

~~~
shadytrees
Here is the proposal that landed in the ghc-proposals GitHub repo, written and
hand-illustrated by Ed Yang. [https://github.com/ezyang/ghc-
proposals/blob/backpack/propos...](https://github.com/ezyang/ghc-
proposals/blob/backpack/proposals/0000-backpack.rst)

A/V fans will enjoy this talk by Ed, whose energy and enthusiasm for the
extremely dry world of language module design knows no bounds. Also hand-
illustrated!
[https://www.youtube.com/watch?v=Rda6SNhznRs](https://www.youtube.com/watch?v=Rda6SNhznRs)

------
anta40
Guess soon we'll have a new release of the Haskell Platform...

------
hnbroseph
haskell's pretty cool, i guess. sometimes looks like an inscrutable APL
descendant with all those wacky operators.

