Jinja#16
Conversation
|
Sounds great; so we need to do this for all the functions right + need to document a bit how this works in term of code generation etc. (I can imagine that it can make debugging quite harder) |
|
I just had a glance and this looks exactly like what I was thinking. Using the control statements of Jinja too! I like! As for the debugging, this may make it easier to debug, since we can generate the cython sources and they actually remain legible. I should image that this might help. It's certainly going to make it easier to debug compared to using raw C and macros for metaprogramming(if that is even the right term). Not yet sure how one would integrate this build step into the Also note that this is a very uncommon or novel approach -- at least I haven't heard of anyone doing it like this. As such we may encounter criticism and potentially pitfalls that we have not anticipated. |
|
rebased on top of last changes on master |
|
All hail the rebase! |
|
@FrancescElies It was keeping me from making some improvements (e.g. direct indexing into arrays) because I was dreading adapting all the different versions of the same code and I feared accidentally breaking things because I overlooked some subtle difference. The code generation template makes this problem really simple. It allows spotting the differences at a single glance! @CarstVaartjes @esc |
Use: setup.py build_ext --from-templates
|
@ARF1 I merged your PR on the other branch and I cherry picked your I am sure tests could be improved and some of them might be not very readable, but at least will give us a sort of feeling if modifications are still good. Though I am not sure if they will be enough to test racing conditions once we introduce multi-threaded code. |
|
I am all for it.
|
|
Please do, I'm excited about how this approach will turn out! It looks promising! |
|
merging |
Explored an idea @esc proposed in https://groups.google.com/forum/#!msg/bcolz/kGjWKVuQG8s/NZ6IQz85qvgJ using jinja templates for producing cython code. This would help maintenance