February 24, 2007
Frits van Bommel wrote:
> That depends on what you mean by "library functions". Obviously you mean a function in a library, but that's not really what matters here. The important question is whether the source is available to the compiler. It doesn't care where the compiled version ends up, because it doesn't use it. It just needs to see the source.
> 
> So basically, for a library with declaration-only (no or incomplete implementation) "headers" the answer is no, for libraries that ship with full source (that's used to satisfy imports, so no .di modules) the answer is yes. Just like with normal source files.

My question was general. C runtime functions, Phobos functions, any third party functions that come as `lib` files (either C or D).

-- 
serg.
February 24, 2007
Serg Kovrov wrote:
> 
> My question was general. C runtime functions, Phobos functions, any third party functions that come as `lib` files (either C or D).
> 

You can only compile-time execute D functions that have their full source (and the full source of any functions they call) available to the compiler at compile-time.
February 24, 2007
Tyler Knott wrote:
> You can only compile-time execute D functions that have their full source (and the full source of any functions they call) available to the compiler at compile-time.

Yeah I figured this much yet.

So, to access for example, math functions - I should provide D source code. Sadly, there is not much I can do without at least C runtime...

-- 
serg.
February 25, 2007
Serg Kovrov wrote:
> Tyler Knott wrote:
>> You can only compile-time execute D functions that have their full source (and the full source of any functions they call) available to the compiler at compile-time.
> 
> Yeah I figured this much yet.
> 
> So, to access for example, math functions - I should provide D source code. Sadly, there is not much I can do without at least C runtime...
> 

It does limit what we can do however it is more secure.  In time the functions you need may appear as compile-timeable functions in D libs. Or if you have to C source, you may have a chance of being able to port them over.  If they use assembly, then it will make things more difficult.

-Joel
February 25, 2007
janderson wrote:
> It does limit what we can do however it is more secure.  In time the functions you need may appear as compile-timeable functions in D libs. Or if you have to C source, you may have a chance of being able to port them over.  If they use assembly, then it will make things more difficult.

I expect that, over time, the capability of the compile time function evaluator will improve. Some things are likely never to be evaluated, however:

1) inline assembly - this would require building a CPU emulator. That's an incredible amount of work for essentially 0 gain.

2) C code - c'mon, write it in D!

3) Functions only available in object form - see (1).
4 5 6 7 8 9 10 11 12 13 14
Next ›   Last »