View mode: basic / threaded / horizontal-split · Log in · Help
February 14, 2008
Article first draft: The Joy and Gibbering Terror of Custom-Loading Executables
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!
February 14, 2008
Re: Article first draft: The Joy and Gibbering Terror of Custom-Loading Executables
Burton Radons wrote:
> 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

Can you please put the docs up from exelib.zip there too?

Could also use some example code.
February 14, 2008
Re: Article first draft: CTFE,DDL,DLL all dead ?
I will read your article a third time, but I think it means : No need 
for CTFE anymore, DDL is dead. Furthermore we can use D as ultra fast 
scripting on-the-fly-compiled language. (using eval)

Sorry I must be wrong!

B
February 14, 2008
Re: Article first draft: CTFE,DDL,DLL all dead ?
"Bjoern" <nanali@nospam-wanadoo.fr> wrote in message 
news:fp2apd$d82$1@digitalmars.com...
>I will read your article a third time, but I think it means : No need for 
>CTFE anymore, DDL is dead. Furthermore we can use D as ultra fast scripting 
>on-the-fly-compiled language. (using eval)
>
> Sorry I must be wrong!
>
> B

This approach seems to have its merits but not without caveats.  I don't 
think it replaces anything you mentioned, but perhaps complements them.

-Craig
February 15, 2008
Re: Article first draft: CTFE,DDL,DLL all dead ?
Bjoern Wrote:

> I will read your article a third time, but I think it means : No need 
> for CTFE anymore, DDL is dead. Furthermore we can use D as ultra fast 
> scripting on-the-fly-compiled language. (using eval)
> 
> Sorry I must be wrong!

It can take a big chunk out of any situation where you need to use a switch to select between templates, but it'll have little effect on anything which uses templating and CTFE for expressiveness. Or maybe it will - it's a diverse concept that I haven't fully explored.

As to DDL, it looks like a great utility that could easily be used for many of the same things my library could, and is portable and supports D modules more thoroughly to boot. I didn't know of it until you mentioned it, but I remember Eric Anderton talking about it years ago. My code is much more ramshackle and driven for a singular purpose.
February 15, 2008
Re: Article first draft: The Joy and Gibbering Terror of Custom-Loading Executables
Amazing.

I am not a native English speaker, but "here me out" should probably be 
"hear me out". And later, have a look at "It would've been easier for me 
to have done it than to written about it".

Cheers,
Bastiaan.


Burton Radons wrote:
> 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!
February 15, 2008
Re: Article first draft: The Joy and Gibbering Terror of Custom-Loading Executables
Mr. Radons, this is *AMAZING* ! Thank you for sharing it with us! I 
would (seriously) like to see this in Phobos one day (hopefully Phobos 
developers are reading this thread). It deserves to go into Phobos, 
definitely.

Kind regards
February 15, 2008
Re: Article first draft: The Joy and Gibbering Terror of Custom-Loading Executables
Naturally, a _portable_ version of your code should go into Phobos. :)
February 15, 2008
Re: Article first draft: The Joy and Gibbering Terror of Custom-Loading Executables
I like where this is going.

Now it just needs to become portable, and awesomeness will ensue.

Unfortunately I don't have time to play with this stuff, but I'm glad 
you explained how to make this stuff happen.  This kind of thing is 
ultimately rather useful to me.
February 15, 2008
Re: Article first draft: The Joy and Gibbering Terror of Custom-Loading
Bastiaan Veelo Wrote:

> Amazing.
> 
> I am not a native English speaker, but "here me out" should probably be 
> "hear me out". And later, have a look at "It would've been easier for me 
> to have done it than to written about it".

Ah, it's been a weird quirk as I grow older that I've started to write the wrong homonym on occasion; I guess the neural pathways, previously clear towards each word, get intertwined as you hear both words over time and have to sort them out from some difficult contexts. Thanks!

The latter part should disappear soon, as in in two minutes.
« First   ‹ Prev
1 2 3
Top | Discussion index | About this forum | D home