On Apr 7, 2008, at 2:05 PM, Martin C. Martin wrote:

> Robert Bradshaw wrote:
>> Thanks. This looks very interesting. Also, I much prefer this type  
>> of "macro" to the text-substitution C-style macros that have  
>> occasionally been suggested.
>
> Glad you like it.  It's certainly a lot cleaner.
>
>> One thought that kept going through my head as I was reading this,  
>> however, is that one of the current defects (in my mind) is its  
>> inconsistency with actual Python, and the associated learning  
>> curve to read and write Python. Some of this inconsistency (e.g.  
>> (minimal) static typing information) is necessary to achieve the  
>> kind of speedups we need, but I think the focus should be on  
>> features that narrow the gap between Cython and Python, not those  
>> that widen it.
>>
>>  On the other hand, features like the one above can be very  
>> useful, and
>>  it'd be a shame to deny their availability to "power  
>> users" (though it
>>  would take away one thing that I really like about Cython--almost  
>> any
>>  Python programmer can at least read a Cython function without any
>>  additional knowledge).
>
>
> Yes, this certainly adds a whole new dimension to Cython that's not  
> in Python.
>
> Perhaps this is a time to reflect on the goals that Cython has had  
> up to now, and whether to expand them.  Cython and Pyrex started  
> with the goal of making it easy to wrap existing C/C++ code as  
> Python extensions, but if you add the ability to declare that a  
> variable has a Python type, you get a language where you can code  
> Python when you need to, but then when you need speed, sprinkle a  
> few type declarations around and get code and speed similar to C.
>
> Is it worth widening the gap a little to provide a useful language  
> in its own right?  The gap is still much, much smaller than that  
> between C++ and C, for example.

The goal of Cython is for it to be the best way to write Python  
extension modules. This has two (interrelated) sub-goals: make it  
easy to wrap C/C++ libraries, and make it a good Python -> C  
compiler. The target (and largest) audience is especially Python  
programmers.

Though it is tempting to head down the language development path,  
adding little (or big) features that make it more powerful than  
Python itself, I think doing so will actually be counterproductive to  
the goals stated above. Perhaps there could be a Cython++ that is a  
proper superset of the Cython language with more powerful features  
(though I'd hope not near the gap of C vs. C++) but in the near term  
we should be focusing on things like being able to compile all of  
Python as it is.

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to