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

I don't think there's another widely used name for it except dynamic or virtual dispatching (with inline caching of the lookup table). C is too low level and simple a language to have it in the string lookup form and in C++/Rust name mangling, symbol stripping from binaries, and generics would make the feature very difficult to implement and rather unergonomic. C#/F# and CLR C++/VB probably already have this in the form of the reflection/.Net runtime APIs (including JIT for generics) but implementing it in C++ or Rust would be very complex and it would be yet another feature that bifurcates the language ecosystem (like heap allocation for embedded). Python and Javascript do have this feature but you still have to have access to the scope to do it (self['fn_name'] or this['fn_name']) and this implementation exists in one way or another in most dynamic languages.

You can do this as a hack in most compiled languages by exporting symbols from a shared library and just using the OS specific dynamic linker but this is ugly, slow, and pointless in a static language.




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

Search: