JIT for CTFE

Stefan Koch via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Wed Aug 2 12:49:51 PDT 2017


On Wednesday, 2 August 2017 at 18:36:53 UTC, Moinak Bhattacharyya 
wrote:
>
> The newCTFE, while a worthwhile effort, is still an interpreter 
> and is rendered redundant by JIT'ing. This way, the interpreter 
> doesn't need to be added to every time there is a new language 
> feature, and a wider range of behavior is enabled (e.g. calling 
> to external linkage functions not written in D), which, IMO, 
> would be very useful and would enable build-system-in-language 
> type behavior like Jai.

newCTFE is explicitly written to by easily extendable it should 
not be hard to patch it such that external functions may be 
called.
As long as you know the path to the library you want to load the 
function from and the function signature of course.

Also please look at the compile-time taken by llvm.
My bytecode interpreter beats the llvm backend in a mixture of 
average ctfe cases (3 : 1).

It is also planned for newCTFE to use it's own jit which will be 
much faster then anything you can do with llvm even if orcjit is 
used.




More information about the digitalmars-d-ldc mailing list