Reified generics mean living in constant fear that unprincipled frameworks are going to wreak dynamic madness over everything you thought you knew
Conversation
Value types and specialization is pretty nice to have though. Because it means you can allocate contiguous memory blocks easily and the tricks that Java devs have to pull for apps that need it are anything but easy or sane. Haskell, OCaml suffer from the same problem too.
1
1
Does that require reification? That hadn't occurred to me
2
1
You could have reification in the implementation without exposing dynamic reflection in the language.
1
3
If I understood what these words mean correctly, "reified generics" means that types "exist" at runtime, unlike in Haskell where they're erased. (But similarly to how Haskell does dictionary passing for type classes, most relevantly for Typeable.)
1
3
Oh. I was suggesting relevant types in the implementation without introspection in the language, but yes, you could also have the reverse, as D does. (I think compile-time introspection is nearly as bad as runtime if its usage isn't tracked in APIs, which may be the disconnect.)
2
2
Yeah, the issue with D is that you can't tell whether something is accessing type information statically or not - ie. you can't track the 'relevance' of type parameters. Tbf, I believe Rust is in the same boat thanks to specialization...
Is this a problem? Have you leaned heavily on static introspection and experienced issues? Recommend checking out youtube.com/watch?v=29h6jG.
1
1
Show replies




