Interactive D?

oliver oliver.ruebenkoenigREM at web.de
Sun Feb 24 05:38:32 PST 2008


Oskar Linde Wrote:

> bearophile wrote:
> > Oskar Linde:
> >> I got the idea to investigate the possibility of an interactive D 
> >> interpreter. A lazy afternoon of hacking resulted in a proof of concept, 
> >> and what follows is a short demo.
> >> Could there be any interest in pursuing this?

This sounds both interesting and helpful! I often find that a repl reduces development time. 

[...snip....]

> 
> What the code does is basically creating some run-time d-code wrapping 
> the expression together with some helpers to feed data and type 
> information back and forth. It then compiles the generated code into 
> object code and transforms it into a dynamic library loadable with 
> dlopen. The generated library is then loaded, executed and unloaded 
> within the interpreters memory space.
> 
> The "import" statement compiles the corresponding .d source file and its 
> dependencies into one dynamic library per module, and then loads them 
> into the interpreter. If, at any time, a .d source file is changed the 
> corresponding module (and modules depending on that module) are 
> unloaded, recompiled and reloaded.

I am curious on how you did that. Did you put the code somewhere (dsource) to look at?

Is it possible to write some text file with a couple of commands, read that into  the interpreter and, once i like the output, compile it?

[ ...snip...]

Oliver



More information about the Digitalmars-d mailing list