Compile time executable calling?

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Jul 12 16:43:42 PDT 2013


On Fri, Jul 12, 2013 at 03:35:30PM -0700, Walter Bright wrote:
> On 7/12/2013 3:12 PM, Timothee Cour wrote:
> >I think the OP was refering to something different: ability to call
> >an arbitrary executable / shell command during compile time of a D
> >function, whereas optabgen is during compiling dmd itself:
> 
> It's still the same idea - using external programs to generate source
> code.

This idea isn't new. lex/yacc (or their modern incarnations flex/bison)
come to mind. The usage is a bit clunky, but the essence is the same. 


> >what we want to have is this:
> 
> I do understand that. I'm just saying that this can currently (but
> awkwardly) be done in the makefile.

At what point does the balance shift from having such an ability
built-in, vs. just using OS-level facilities for combining different
programs? For example, one could pipe source through a program that
performs arbitrary transformations on it, then pipe the result through
the compiler. Or one can write a program that generates arbitrary source
code and pipe that into the compiler.

Presently, such things are easily handled by a modern build system (of
which makefiles are a rather clunky implementation thereof).


T

-- 
This is not a sentence.


More information about the Digitalmars-d mailing list