Hacker News new | past | comments | ask | show | jobs | submit login

Lifetimes are already generics, so it is harder to add "lifetime only GATs" than it is GATs, in my understanding.



Lifetimes do not influence code generation (besides potential specialization on 'static, which I'm not sure if it's a thing).

But besides that the amount work is indeed very close by each other. Which is why there is currently no plan to first have lifetime only GATs stable as far as I know.


You're not wrong that they don't influence codegen, but I don't know why you're bringing that up. I don't see the connection.

You cannot specialize on lifetimes, it is not sound.


Because to have lifetime only GATs you need to change the syntax and liftime checker but once you checked the type you can treat it ignoring lifetimes and in turn ignoring the GAT aspect.

But then if you did so you probably already implemented most/all of the code to typecheck non lifetime GATs and then doing the rest proper is probably not to hard either and might be not harder then doing liftime only GATs.

> You cannot specialize on lifetimes, it is not sound.

Good to know, given that specialization was stuck in nightly in the last years I didn't use it and in turn didn't look to much into it.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: