Hacker News new | ask | show | jobs
by fish2000 4267 days ago
This is pretty awesome – I’m writing a Python extension in C++ that piggybacks on top of NumPy dtype codes, and I thought that I could “just” use templates to deal with dynamic typing. It proved to be waaaay less straightforward than that, and I had to hack through a lot of stuff with cumbersome macros, and wound up with a gigantic binary image as a result. Actually doing type erasure in C++ (which type erasure, as I understand, is like de rigueur in Java) cuts through all of that cruft… and so, to the refactormobile! Yes.
1 comments

Care to blog about your refactor? I can sort of see how you could use type erasure combined with numpy dtypes but it would be great to see a concrete example.