Proposal: First class types (at compiletime)

TheGag96 thegag96 at gmail.com
Thu Jul 20 15:46:26 UTC 2023


On Thursday, 20 July 2023 at 15:11:39 UTC, Commander Zot wrote:
> and it wouldn't need too much changes i think (but i might be 
> wrong there):

Unfortunately, I think that may be the case. Work has actually 
been done to explore in this in the past by Stefan Koch under the 
name "type functions":

https://forum.dlang.org/post/swuxfggqgibqbxoaiheg@forum.dlang.org

He had a WIP implementation and everything. However, it wasn't 
met with much reception from the higher-ups and was more or less 
dropped, I think. Languages like Jai and Zig it seems have shown 
this as largely been a mistake... D's compile-time capabilities 
are super cool, but the C++ carryover of having basically a 
separate language of sorts by way of templates to operate on 
types is slow to compile and hokey compared to just... writing a 
function. Honestly, the point where we started having to do 
recursion to do list operations on `AliasSeq`s should have clued 
us in that we should have been thinking about type functions.


More information about the Digitalmars-d mailing list