Were you committing the sin of sloth when writing that post? But seriously, announcing something like that and not following "show me the code" is rather unusual these days.
This reads quite complicated, a simple example would really help to get the picture.
Just as side-note: There is already a kind of C module system, at least when you can live with GPL licensed code: The GNU Portability Library (Gnulib). It's a source code collection designed for portability and in combination with GNU Autotools a very powerful toolbox.
Gnulib is distributed in source code format and comprises several bundled functions aka "modules" including dependencies.
You either download individual files online or clone the whole repository for local usage. There is the gnulib-tool utility which you use to copy the required source modules into your project. They come along with Autoconf macros and build scripts.
After properly setting up your configure.ac and Makefile.am, all imported modules will be build, the resulting object is a static libary libgnu.a, ready for linking.
On the source code side, the only thing you will do is #include "<module>.h" and use the available functions.
Autoconf & Automake take care of the rest for building.
For me, this feels very much like a module system (designed for maximum portability), but of course there might be other definitions of a module system.
10 comments
[ 2.8 ms ] story [ 29.0 ms ] threadEdit: Removed slander.
Just as side-note: There is already a kind of C module system, at least when you can live with GPL licensed code: The GNU Portability Library (Gnulib). It's a source code collection designed for portability and in combination with GNU Autotools a very powerful toolbox.
You either download individual files online or clone the whole repository for local usage. There is the gnulib-tool utility which you use to copy the required source modules into your project. They come along with Autoconf macros and build scripts.
After properly setting up your configure.ac and Makefile.am, all imported modules will be build, the resulting object is a static libary libgnu.a, ready for linking.
On the source code side, the only thing you will do is #include "<module>.h" and use the available functions.
Autoconf & Automake take care of the rest for building.
For me, this feels very much like a module system (designed for maximum portability), but of course there might be other definitions of a module system.
https://www.gnu.org/software/gnulib/MODULES.html