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.
Conversation
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...
1
1
Is this a problem? Have you leaned heavily on static introspection and experienced issues? Recommend checking out youtube.com/watch?v=29h6jG.
1
1
Yup, I’ve seen this one before, it’s good. The issue with D’s introspection though is that you get template explosions similar to C++. Adding static guards on templates can help, but they are easy to forget to add.
I guess that’s orthogonal to breaking parametericity though 🤔
1
1
The benefit to parametericity is that you can rely on parameters ‘hiding’ information, and constraining the implementation. I’d like to have both introspectable and parametric parameters in my programming language.
2
3
Show replies
AIUI that's a unsolved problem in general, but D's compilation is faster by orders of magnitude so I guess there's some caching going on.
1
Explosions in the sense of error messages.
The other problems are compile time and code size; without a good incremental compiler you have to evaluate all your “reflection” every time you rebuild, and you have to generate specialized code
2





