GHC 8.2 Released
ghc.haskell.org
GHC 8.2 Released
1–10 of 16 posts
Re: GHC 8.2 Released
#2Re: GHC 8.2 Released
#3Does 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.
Re: GHC 8.2 Released
#4Can 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?
Re: GHC 8.2 Released
#5Re: GHC 8.2 Released
#6> 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.
Re: GHC 8.2 Released
#7> 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.
Re: GHC 8.2 Released
#8> 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.
Paper: https://www.microsoft.com/en-us/research/wp-content/uploads/...
Package: https://downloads.haskell.org/~ghc/latest/docs/html/librarie...
Re: GHC 8.2 Released
#9> 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?
Re: GHC 8.2 Released
#10> 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.
The resolution of this apparently contradiction is in the type class mechanism. Type classes ("classes" for short) can be seen as functions from type to value that are automatically resolved by the compiler as much as possible. (There are many other semantically-valid interpretations, like predicates on types, proof obligations, etc.)
Most classes are library-level constructs, defined and implemented entirely with libraries, but there are a few special ones that are completely managed by the compiler. One of the few compiler-managed classes is named Typeable, which allows you to request a runtime representation of the type of an expression. It then provides tools for testing if the runtime representations correspond to the same type, and proving two types are the same at runtime. This is useful in the case where you can prove something is type safe, but the type system doesn't provide you with the tools to express it.
Common cases where you end up doing this in Haskell are creating heterogeneous stores with type-safe keys, or mechanisms like GHC's exception system.
Anyway, the new part here is the addition of a variant of Typeable. It gives more information at compile time so that it can enable a few more tricks within the type system and the implementation doesn't depend on as many unsafe internal primitives.