[Cython] Proposal: idea for automatic management of dynamic memory
Stefan Behnel
stefan_ml at behnel.de
Fri Apr 11 12:40:48 CEST 2008
Hi Dag,
I agree that the the impact of the syntactic change is likely low, given the
fact that it doesn't support allocation any more fine-grained than a function
body.
BTW, do we actually support cdef's inside blocks?
Dag Sverre Seljebotn wrote:
> Introducing some special syntax candy for the landscape that is
> "in-between" these two options just doesn't seem worth it (it makes the
> Cython language heavier and ultimately more difficult to learn).
> Especially when with this syntax candy
>
> a) it looks like the data is going to be allocated on the stack
> b) in a language that doesn't already have a concept of allocating
> objects on the stack (as opposed to C and C++), and
Not much of a problem IMHO.
> c) magically it doesn't allocate it on the stack anyway
I was just suggesting the similarity, not in the way it works internally, but
in the way it works from a user POV. There is no real difference between
cdef int[10] myarray
and
cdef int[some_value] myarray
except that the second is currently illegal.
> BTW: Why would NumPy be overkill?
Because of an external dependency for what seems to be a very simple feature?
Stefan
More information about the Cython-dev
mailing list