Re: [Cython] [ENH] Compile-time code execution (macros / templates)

2021-02-24 Thread Prakhar Goel
Celelibi, AST modification is a rare use-case but when you need it, you _really_ need it (speaking from actual experience here)! Think something like ISPC. Cython already deals with the function AST. Your proposals will implicitly require rewriting the AST. Why not support it explicitly? It feels

Re: [Cython] [ENH] Compile-time code execution (macros / templates)

2021-02-24 Thread da-woods
A few things to point out: 1) Because Cython is mainly a is code translation tool it doesn't currently have an overview of how things would eventually be evaluated - it leaves a lot for the C compiler to sort out. Your suggestion would presumably add a dependency on a C compiler at the .pyx ->

Re: [Cython] [ENH] Compile-time code execution (macros / templates)

2021-02-24 Thread Celelibi
Le Tue, Feb 23, 2021 at 11:24:42AM -0500, Prakhar Goel a écrit : >I had similar ideas in the past (assuming I understand your proposal). I'd >love it if a decorator could link to some python function. This python >function would get something that represents the cdef function (with the