Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Generics are convenient but they come at a cost in complexity in the type system and run-time.

By run-time they mean compile-time? There shouldn't be a run-time penalty right?

Also, is there some measure of the additional compilation cost now that generics has been added?



The “runtime” as in the compiler runtime which provides the scheduler, garbage collector, etc.


The runtime also includes reflection, so preserving compatibility of the type system while adding generics was definitely a challenge, so adding generics to Go was definitely a great achievement.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: