[Python-Dev] pragmas as callbacks (original) (raw)

Greg Wilson gvwilson@nevex.com
Tue, 29 Aug 2000 11:54:23 -0400 (EDT)


Marc-Andre Lemburg wrote: I'd rather not add complicated semantics to pragmas -- they should be able to set flags, but not much more.

Greg Wilson writes:

That's probably what every Fortran compiler vendor said at first --- "just a couple of on/off flags". Then it was, "Set numeric values (like the debugging level)". A full-blown HPF compiler's pragmas are now a complete programming language, so that you can (for example) specify how to partition one array based on the partitioning in another.

Same thing happened with the C preprocessor --- more and more directives crept in over time. And the Microsoft C++ compiler. And I'm sure this list's readers could come up with dozens of more examples.

Pragmas are a way to give instructions to the interpreter; when you let people give something instructions, you're letting them program it, and I think it's best to design your mechanism from the start to support that.

Greg "oh no, not another parallelization directive" Wilson