Article first draft: The Joy and Gibbering Terror of Custom-Loading Executables

Burton Radons burton-radons at shaw.ca
Wed Feb 13 18:53:29 PST 2008


I've made a first draft of an article on custom-loading executables, which can be used for dynamic compilation, alternative (and potentially portable) plugin structures to DLLs, scripting-style eval, and turning a compiler or most any other program into a library.

There are four separate formats of the document but here's the HTML which branches everywhere:
http://members.shaw.ca/burton-radons/The%20Joy%20and%20Gibbering%20Terror%20of%20Custom-Loading%20Executables.html

Or if that breaks your newsreader:
http://tinyurl.com/22a6x7

A decent library for Phobos is included (http://members.shaw.ca/burton-radons/exelib.zip). It has actual (lean but complete) documentation under docs/index.html; I'd particularly check out exe.dynamism's RuntimeTemplate, which is suggestive of what this kind of thing can do to coding.

The background is that I've been doing this off and on for eight years now (starting with a library called Stonewheel for DJGPP, resurrected briefly with a truly incomprehensible announcement in 2002 for D) and I recently sent an e-mail to Walter saying that I'd implemented the scripting-language function "eval" and found it to only take 20 ms per call with DMD, and I rambled about the fine points of doing this kind of tomfoolery. By the time I said I'd loaded DMD manually and it was now taking 1 ms per call, he told me to make an article of it which I was planning to anyway.

As a draft and as someone who's always been a lousy teacher, I'd like input on anything that seems confusing or you'd like expanded upon or even whole new sections you feel deserve coverage, like the D side of runtime templating. I know I race through the process of loading and linking, but the poor teacher part comes into play - I have no idea how to think like someone who doesn't know what I know. Toodles!


More information about the Digitalmars-d-announce mailing list