News for hackers. Stuff that matters.
Re:Compilers are hard by Garlef on Thursday January 21, 2021 @08:52AM (#25858745)
Well... would this satisfy you? (I removed the _add part for convenience. You could still argue that `_concat` is not a literal... if by literal you mean a primitive provided by the language itself. Note that i'm not claiming that this is a dependent type system. But you can emulate some features of such a type system.)

https://www.typescriptlang.org/play?#code/C4TwDgpgBAggTnAPAO...

Re:Compilers are hard by lifthrasiir on Thursday January 21, 2021 @09:37AM (#25859214)
Uh, no? _concat is a type-level function and you can't generalize it to receive runtime arguments in any way. I do acknowledge the value of type-level evaluation, but there is a very deep gap between type-level evaluation and dependent typing.