This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Extending C for Modules


Are there any existing [GCC] C extensions for modules? If so, could someone
post a link here?

If not, I'd like to develop such an extension. Here's a summary of the
features I want to implement:

- Basic support for modules. (Physically, modules are just source files with
  associated object files.) Symbols are private by default (they must be
  explicitly made public), and don't automatically "carry" into including
  modules. (In this way modules work somewhat like namespaces.)
- Automatic module init and cleanup. Modules can define two entry points (in
  addition to their other functions) for initialization and cleanup. The
  compiler would automatically determine module dependencies and call module
  init/cleanup functions in the appropriate places in user programs.
- Automatic module linking. You shouldn't have to specify in two or more
  places what libraries or modules your program uses (usually an #inclue in
  source, and as a Makefile rule). The compiler will link your program against
  the modules you specify, via "import" or "uses" keywords in source.

If anyone else has similar ideas/opinions, I'd like to hear about them.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]