|
|
|
|
|
by Merovius
21 days ago
|
|
> but the reason against using runtime reflection is mostly that it's slow. More specifically, it is that it would introduce surprising performance cliffs – code becoming surprisingly slow due to seemingly unrelated changes. Though BTQH I think an even more important argument is that you would need to have effectively two generics implementations, one working at runtime and one working at compile time. That's a lot of complexity, with surprising failure modes if these two are not bug-compatible. > But that runtime reflection is exactly how you would work around it today. I think the overwhelming majority of people will "work around it" by just not trying to use generic methods. |
|
My understanding is that go already has a hybrid system works at compiletime and sometimes at runtime.