3 ms·
This is untrue, you can compartmentalize your C implementations using tools like Cython. The fact that you write these as isolated special implementations is a
by mlthoughts2018 6y ago
This is untrue, you can compartmentalize your C implementations using tools like Cython.
The fact that you write these as isolated special implementations is a good thing and not a deficiency of generics.
This way it can be gradual. You only target certain functions or modules for optimized C implementation, you don’t waste static typing overhead or compliance to a generic interface on the 99% of the code that will have no material gain from any optimization.
It’s similar with gradual typing in Python as well. Annotate what you need, omit annotations for what you don’t. Implement an extension module or multiple dispatch for what you need, use plain Python for everything else.