On Monday, 23 September 2019 at 20:24:54 UTC, jmh530 wrote:
On Monday, 23 September 2019 at 19:40:13 UTC, Ivan Butygin
wrote:
On Monday, 23 September 2019 at 12:22:47 UTC, Martin
Tschierschke wrote:
Can you please give (again?) a link or a more detailed
description of the JIT, explaining some use cases?
https://wiki.dlang.org/LDC-specific_language_changes#.40.28ldc.attributes.dynamicCompile.29
[snip]
I think the wiki has room for improvement...or, ideally, there
would be a tutorial that goes through all the JIT functionality
in LDC.
I don't really understand the difference between dynamicCompile
and dynamicCompileEmit. Is it that with dynamicCompileEmit I
can still call foo normally? Also, do I have to use either bind
or a delegate to get the JIT functionality? What is the
advantage or cost of f (the binded version) and d (the delegate
version)? Does the indirection from the delegates outweigh the
benefit from simplified computation in these cases? Is there
any issue with aliasing f or d to be named foo (or just calling
them foo from the start?)?
What am I doing wrong on run.dlang.org:
https://run.dlang.io/is/itIPQK
With @dynamicCompileEmit normal calls to function will go to
static version but these functions can still be targets for bind.
Objects returned from bind are reference counted. You can get
delegate from them to use is context where delegate is expected
but you need to retain object somewhere. Delegate version will
add additional call indirection I think but otherwise they are
identical.
Also, something got broken with bools, I need to check :)
https://run.dlang.io/is/x3orGK