Compile time executable calling?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Jul 15 21:10:34 PDT 2013


On 7/15/13 6:26 AM, Don wrote:
> On Friday, 12 July 2013 at 20:42:50 UTC, Tofu Ninja wrote:
>> So I had an idea recently, wouldn't it be cool to have the ability to
>> call an executable at compile time and capture its output. Something
>> like the string imports but instead of opening and reading a text
>> file, it run an executable, waits for it to finish, and grabs its output.
>>
>> It would get really cool if you could pass this executable some args
>> and then mix in its out put into your own code. It could be used
>> similarly to how CTFE are used but with out the overhead of trying to
>> compile that function and what not and with out the limitations on
>> what it can do.
>>
>> I could imagine all sorts of things that would be possible with this
>> that is currently not.
>>
>> Not sure if this is something that could be implemented easily, but
>> seems like something that could be done and something that would be
>> really cool.
>
> I personally think it's a *horrible* idea. It's one of those things
> which looks good in small cases but doesn't scale.

I think the right direction here is to factor compiler parts as a 
library. Then user code may insert external artifacts (notably REPL) on 
its own.

Andrei




More information about the Digitalmars-d mailing list