[Pyrex] A couple of questions about pyrex

Stefan Behnel stefan_ml at behnel.de
Thu May 14 08:07:04 CEST 2009


Yingjie Lan wrote:
> After reading the language specification, I somehow got a hunch that we
> need a good principle, otherwise, this language will soon become
> complicated and ugly, hard to use and understand.

That's a really good idea. Let's start designing the language rather than
just writing a compiler for it. I wish we had done so right from the
beginning, rather than evolving the existing code over so many iterations.
Luckily, we finally won you for the project to do it all for us.


> Take one example, you
> have 'def', 'cdef', 'cpdef'. IMHO, 'cpdef' can be knocked off

Yes, that's a very humble opinion. There really can't be any reason at all
why it's there in the first place, because otherwise it would be obvious.


> -- whether
> use C style calling inside the module or not is really an issue the
> compiler can take care of -- and if you are starving for performance,
> you can give the compiler an option to call all 'def' functions/methods
> in C style inside the module whenever appropriate.

Sounds like a compiler directive at the top of the file, like "auto_cpdef",
might work nicely here. Although that stupid compiler should really be
smart enough to do it all for you. There really can't be a reason it's
*that* stupid.


> And I think Python is a very good example that we can follow.

That's a very good principle. Yes, maybe we should even start to use a
Python-like syntax. You know, with meaningful indentation and all that.
That would really safe the language from becoming complicated and ugly.

Stefan





More information about the Pyrex mailing list