Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Official C Challenge ①

Name: Anonymous 2010-07-18 12:23

Task:  Come up with an extension to the C programming language.  Provide a clear description of the extension, and a code sample that clearly shows what the extension is intended to do.

Prize:  (Winning criteria are not specified.)  The winner will have his extension featured in the C11 language standard.

My entry:  ... Sorry, I think C is perfect in every way already.

Name: 70 2010-08-31 12:25

>>71
Python's module system is bad. It is extremely order-dependent, and it's easy to create circular dependencies where code just breaks without any logical warnings. You get into a situation where you can't see classes from a file you imported because it imports another file that imports you, and it depends which one is imported first from main... I don't like it at all. The module system is perfectly logical from a language implementer's standpoint, but it is not practical. If you've had to debug cyclic imports, you'd agree.

http://stackoverflow.com/questions/744373/python-cyclic-imports

What I'm suggesting for C would be completely order-independent. Things like macros in headers would still need to be #included traditionally to be used.

>>73
Well, the language specifies that a function needs to be declared before it can be called. The language extension I'm suggesting would be to change the spec so that a function only needs to be declared somewhere in the same translation unit (not necessarily above where it is called). Then you could get rid of header files entirely for whole-program compilation, and I would expect that compiler developers would add incremental whole-program compilation soon afterward.

This change would of course be entirely backwards-compatible, and you would still support header files for dynamic libraries, macros, and old code.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List