[Pyrex] Why were .pxd files invented?

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Apr 3 00:18:30 UTC 2007


Leif Strand wrote:

> And forcing the programmer to manually maintain the depedencies in the 
> Makefile isn't error-prone?

No, because if the .pxd and .pyx get out of step,
the Pyrex compiler will notice and complain. It
may be slightly more work for the programmer, but
it won't lead to undetected errors.

> The trick is to 
> add the -M* flags to the regular compile line.

You're right, it could be done that way. But I
still prefer to have the interface clearly separated,
because it makes it obvious when I'm changing it.
If I'm distributing a Pyrex module, I don't want
to be accidentally making changes that will affect
all its users.

Possibly I could do what the Oberon compiler did,
and not automatically write out the generated
interface, but just check and warn when it differs
from the previous one, and require a compiler
option to write out a new interface. I can't see
that fitting very well into a makefile-driven
workflow, however.

I'll keep the issue in mind for the future, but
I don't intend to change it in the near term.
What I have at the moment works, and I'm loathe
to make any major changes to the compiler without
very careful thought.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiem!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+



More information about the Pyrex mailing list