Showing posts with label macro. Show all posts
Showing posts with label macro. Show all posts

2010-11-14

programming in-the-large with c

8.5: news.adda/translate/info'hiding n type-safe linking:

2007 CMod Modular Information Hiding
and Type Safe Linking for C

CMod, provides a sound module system for C;
it works by enforcing a set of rules that are
based on principles of modular reasoning
and on current programming practice.

CMod's rules safely enforce the convention
that .h header files are module interfaces
and .c source files are module implementations.
Although this convention is well known,
developing CMod's rules revealed many subtleties
to applying the basic pattern correctly.
CMod's rules have been proven formally
to enforce both information hiding
and type-safe linking.

2010-03-30

macro -- compilation needs context

3.9: adda/macro/compilation needs context:

. when defining macro's that are etrees
rather than text substitutions,
a complication is the context needed:
. a macro is modular, yet it assumes
enough context to be compilable .

. but when does it need compilation?
it could instead have delayed compilation?
. for simplicity, for those reading the code,
you want it to be compilable
at least to the point so that
the etrees being formed are like those that
the reader gets when doing a mental parsing .
. back-end compilation and type-checking
can be done dynamically, at run time .