<br><br><div class="gmail_quote">On Sat, Jul 13, 2013 at 9:05 AM, Ary Borenszweig <span dir="ltr"><<a href="mailto:ary@esperanto.org.ar" target="_blank">ary@esperanto.org.ar</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 7/12/13 5:42 PM, Tofu Ninja wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So I had an idea recently, wouldn't it be cool to have the ability to<br>
call an executable at compile time and capture its output. Something<br>
like the string imports but instead of opening and reading a text file,<br>
it run an executable, waits for it to finish, and grabs its output.<br>
<br>
It would get really cool if you could pass this executable some args and<br>
then mix in its out put into your own code. It could be used similarly<br>
to how CTFE are used but with out the overhead of trying to compile that<br>
function and what not and with out the limitations on what it can do.<br>
<br>
I could imagine all sorts of things that would be possible with this<br>
that is currently not.<br>
<br>
Not sure if this is something that could be implemented easily, but<br>
seems like something that could be done and something that would be<br>
really cool.<br>
</blockquote>
<br></div></div>
What would actually be cool is to run any kind of code at compile time (within a sandbox, if you want). For example reading a mysql database and generating classes for the tables at compile time. No need to run a separate executable and remember to run it before compiling your program.<br>

<br>
But this has been discussed many times in this list, and it won't happen, because compile time functions are not jitted and run, they are just interpreted.<br>
<br>
You ask for executing a program at compile time. Somebody will ask reading a file at compile time. Another one will ask reading a schema from a database. Yet another will want to do a web scraper at compile time to generate efficient code from that (not sure that's useful :-P)<br>
</blockquote><div><br></div><div>reading a file at compile time is already possible with string import.</div><div> </div></div><br>