Runtime execution

Marco Leise via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Oct 19 01:35:18 PDT 2014


Am Sun, 19 Oct 2014 06:55:17 +0000
schrieb "Bauss" <jj_1337 at live.dk>:

> Is there anyway to pull of a runtime compilation of D code or at 
> the very least asm execution?

Sure. For runtime compilation you invoke any installed D
compiler and compile a conventional shared library that you
then load with:
http://dlang.org/library/core/runtime/Runtime.loadLibrary.html

For ASM execution you'd simply load the ASM into an executable
memory area (See virtual memory page protection attributes for
your OS) and call or jump into it through D's inline asm {}
blocks.

I hope that helps.

-- 
Marco



More information about the Digitalmars-d-learn mailing list