digitalmars.D.learn - Runtime execution
- Bauss (2/2) Oct 18 2014 Is there anyway to pull of a runtime compilation of D code or at
- Marco Leise (13/15) Oct 19 2014 Sure. For runtime compilation you invoke any installed D
- Mjkp (4/6) Oct 19 2014 You can call dmd using std.process to compile a D plug-in edited
Is there anyway to pull of a runtime compilation of D code or at the very least asm execution?
Oct 18 2014
Am Sun, 19 Oct 2014 06:55:17 +0000 schrieb "Bauss" <jj_1337 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
Oct 19 2014
On Sunday, 19 October 2014 at 06:55:18 UTC, Bauss wrote:Is there anyway to pull of a runtime compilation of D code or at the very least asm execution?You can call dmd using std.process to compile a D plug-in edited in your D program and dynamic link the output .dll or .so just after the dmd process 's successfully returned.
Oct 19 2014