Make .lh headers optional and generate ".olh" files from the exported stuff in the .lc file. The .olh files should be possible to read by both a C compiler and a LRL compiler. The Makefile can have a rule for generating .olh files from .lc files, e.g. .lc.olh: lrlc -h $< -o $@ .SUFFIXES: .lc .olh 1. Can we use #defines to replace LRL specific stuff with whitespace if the C compiler reads the file? some stuff are tricky, such as array parameters and optional types. - advantage: this would allow the C interop to be used for this. - advantage: if C or a language based on C is adds the features found in LRL (such as pointer ownership), then it can define _LRLinterop to some version, and all the _LRLxxx values, and then include the file directly. 2. Or should we generate both C and LRL code, and select between them by an #ifdef? 3. Use something like 1, but try to use as much C standard stuff as possible. Have a header that defines a "profile" with defaults. This format could be used by other programming languages too. - advantage: this would allow the C interop to be used for this. - advantage: C programmers could also add LRL stuff to their headers if they want to have minimal support for LRL (like they often do with C++). Example of 1: /*#LRLHDR# Generated file. Do not modify. */ #if !defined(_LRLinterop) || _LRLinterop < 1L #define _LRLinterop 1L #define _LRLptr * #define _LRLbyte uint8 #define _LRLown #define _LRLrefown(r) #endif _LRLbyte _LRLptr find_space(_LRLbyte _LRLptr s); Example of 2: /*#LRLHDR# Generated file. Do not modify. */ #ifdef _LRL byte^ find_space(byte^ s); #else unsigned char *find_space(unsigned char *s); #endif Example of 3: /*#INTEROPHDR# Generated file. Do not modify. */ #ifdef _INTEROPHDR #define _IHptrdefault nonown const #define _IHargdefault const #define _IHfuncdefault nonpure #define _IHtype_charptr utf8zstring #define _IHtype_ucharptr binary #endif #define _IHownptr * char *find_space(char *s); char _IHownptr get_error_string(int errorcode);