www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - DDL 1.2 Beta

reply pragma <ericanderton yahoo.com> writes:
All,

   After much work, DDL 1.2 Beta is ready for public consumption.  The 
library interface is complete, the OMF loader works well, and the 
runtime linker performs as designed.  As such, I've labeled this as RC1 
for the project.

http://www.dsource.org/projects/ddl
http://www.dsource.org/projects/ddl/wiki/Downloads
http://www.dsource.org/projects/ddl/wiki/Tutorial/Installation

This beta release features OMF object support that is stable and works 
very well with the Win32 version of DMD.  Linux support, completed 
documentation and tutorials are all still pending completion in the next 
few months.

Special thanks to the project contributors who made getting this far a 
reality.

http://www.dsource.org/projects/ddl/wiki/Contributors

As always, the project is open to critique, criticism and contributions. 
  Feel free to post here, on the project forum or even in the project 
wiki.  My mailbox is also open for all of the above.

http://www.dsource.org/projects/ddl/wiki/Community

- Pragma

---------------
So what is DDL?
---------------

DDL stands for "D Dynamic Libraries" and as the name implies, provides 
dynamic library loading for the D Language. It can be used as a plugin 
architecture, a replacment for DLL files, an interface for dynamic 
reflection, or as a means for working with intermediate files.

More information in the project FAQ:

http://www.dsource.org/projects/ddl/wiki/FAQ

----------
An Example
----------

(A better formatted example can be found here: 
http://www.dsource.org/projects/ddl/wiki/Tutorial/UsingDDL/Quick)

/////////////////
// plugin.d
module plugin;

char[] helloWorld(){
     return "hello world";
}
/////////////////

/////////////////
// example.d
import ddl.DefaultRegistry;
import ddl.Linker;

import mango.io.Stdout;

void main(){
     auto linker = new Linker(new DefaultRegistry());
     linker.loadAndRegister("example.map");

     auto plugin = linker.loadAndLink("plugin.obj");

     auto helloWorld = plugin.getDExport!(char[] 
function(),"plugin.helloWorld")();

     Stdout.put(helloWorld());
     Stdout.put(CR);
}
/////////////////
Sep 04 2006
next sibling parent Tom S <h3r3tic remove.mat.uni.torun.pl> writes:
This is totally sweet, Eric ! I'm looking forward to using DDL in many 
projects. Congratulations !


--
Tomasz Stachowiak
Sep 05 2006
prev sibling next sibling parent reply "John Reimer" <terminal.node gmail.com> writes:
Excellent work, Eric!

I know the many hours of work that you've put into this.  Thanks for  
putting all that effort into a very useful project.  I'm really following  
this one closely.

-JJR
Sep 05 2006
parent pragma <ericanderton yahoo.com> writes:
John Reimer wrote:
 Excellent work, Eric!
 
 I know the many hours of work that you've put into this.  Thanks for 
 putting all that effort into a very useful project.  I'm really 
 following this one closely.
 
 -JJR
Thanks John, I sincerely appreciate the support. :)
Sep 05 2006
prev sibling next sibling parent reply Derek Parnell <derek nomail.afraid.org> writes:
On Mon, 04 Sep 2006 21:56:00 -0400, pragma wrote:

    After much work, DDL 1.2 Beta is ready for public consumption.
Sorry for the belated congratulations. You and your 'team' have done a great service to the D community. I've been waiting eagerly for this product to come out into the light. -- Derek (skype: derek.j.parnell) Melbourne, Australia "Down with mediocrity!" 6/09/2006 11:24:48 AM
Sep 05 2006
parent reply pragma <ericanderton yahoo.com> writes:
Derek Parnell wrote:
 On Mon, 04 Sep 2006 21:56:00 -0400, pragma wrote:
 
    After much work, DDL 1.2 Beta is ready for public consumption.
Sorry for the belated congratulations. You and your 'team' have done a great service to the D community. I've been waiting eagerly for this product to come out into the light.
No apology is needed! Besides, I'm at least a few months late myself - what's a day or two, right? ;) I'm just happy that you're interested. I'm just curious to see how this helps you out with Freudo. - Eric
Sep 05 2006
parent Derek Parnell <derek nomail.afraid.org> writes:
On Tue, 05 Sep 2006 21:58:57 -0400, pragma wrote:

 I'm just happy that you're interested.  I'm just curious to see how this 
 helps you out with Freudo.
Me too ;-) My intention is to have the 'built-in' functions as pluggable modules and provide an extension mechanism so that other authors can add their own built-in functions. This will get over the problem in which a useful user-written function is written in the interpreted language, but would actually benefit from being fully compiled. -- Derek (skype: derek.j.parnell) Melbourne, Australia "Down with mediocrity!" 6/09/2006 12:11:11 PM
Sep 05 2006
prev sibling next sibling parent Chad J <gamerChad _spamIsBad_gmail.com> writes:
Yay!  I'm very glad this is out there, since I'll need dynamic linking 
at some point.  Hopefully this will work on WinCE, or I can make it.

Thanks for your effort on this technology!

pragma wrote:
 All,
 
   After much work, DDL 1.2 Beta is ready for public consumption.  The 
 library interface is complete, the OMF loader works well, and the 
 runtime linker performs as designed.  As such, I've labeled this as RC1 
 for the project.
 
 http://www.dsource.org/projects/ddl
 http://www.dsource.org/projects/ddl/wiki/Downloads
 http://www.dsource.org/projects/ddl/wiki/Tutorial/Installation
 
 This beta release features OMF object support that is stable and works 
 very well with the Win32 version of DMD.  Linux support, completed 
 documentation and tutorials are all still pending completion in the next 
 few months.
 
 Special thanks to the project contributors who made getting this far a 
 reality.
 
 http://www.dsource.org/projects/ddl/wiki/Contributors
 
 As always, the project is open to critique, criticism and contributions. 
  Feel free to post here, on the project forum or even in the project 
 wiki.  My mailbox is also open for all of the above.
 
 http://www.dsource.org/projects/ddl/wiki/Community
 
 - Pragma
 
 ---------------
 So what is DDL?
 ---------------
 
 DDL stands for "D Dynamic Libraries" and as the name implies, provides 
 dynamic library loading for the D Language. It can be used as a plugin 
 architecture, a replacment for DLL files, an interface for dynamic 
 reflection, or as a means for working with intermediate files.
 
 More information in the project FAQ:
 
 http://www.dsource.org/projects/ddl/wiki/FAQ
 
 ----------
 An Example
 ----------
 
 (A better formatted example can be found here: 
 http://www.dsource.org/projects/ddl/wiki/Tutorial/UsingDDL/Quick)
 
 /////////////////
 // plugin.d
 module plugin;
 
 char[] helloWorld(){
     return "hello world";
 }
 /////////////////
 
 /////////////////
 // example.d
 import ddl.DefaultRegistry;
 import ddl.Linker;
 
 import mango.io.Stdout;
 
 void main(){
     auto linker = new Linker(new DefaultRegistry());
     linker.loadAndRegister("example.map");
 
     auto plugin = linker.loadAndLink("plugin.obj");
 
     auto helloWorld = plugin.getDExport!(char[] 
 function(),"plugin.helloWorld")();
 
     Stdout.put(helloWorld());
     Stdout.put(CR);
 }
 /////////////////
Sep 05 2006
prev sibling next sibling parent Kyle Furlong <kylefurlong gmail.com> writes:
pragma wrote:
 All,
 
   After much work, DDL 1.2 Beta is ready for public consumption.  The 
 library interface is complete, the OMF loader works well, and the 
 runtime linker performs as designed.  As such, I've labeled this as RC1 
 for the project.
 
 http://www.dsource.org/projects/ddl
 http://www.dsource.org/projects/ddl/wiki/Downloads
 http://www.dsource.org/projects/ddl/wiki/Tutorial/Installation
 
 This beta release features OMF object support that is stable and works 
 very well with the Win32 version of DMD.  Linux support, completed 
 documentation and tutorials are all still pending completion in the next 
 few months.
 
 Special thanks to the project contributors who made getting this far a 
 reality.
 
 http://www.dsource.org/projects/ddl/wiki/Contributors
 
 As always, the project is open to critique, criticism and contributions. 
  Feel free to post here, on the project forum or even in the project 
 wiki.  My mailbox is also open for all of the above.
 
 http://www.dsource.org/projects/ddl/wiki/Community
 
 - Pragma
 
 ---------------
 So what is DDL?
 ---------------
 
 DDL stands for "D Dynamic Libraries" and as the name implies, provides 
 dynamic library loading for the D Language. It can be used as a plugin 
 architecture, a replacment for DLL files, an interface for dynamic 
 reflection, or as a means for working with intermediate files.
 
 More information in the project FAQ:
 
 http://www.dsource.org/projects/ddl/wiki/FAQ
 
 ----------
 An Example
 ----------
 
 (A better formatted example can be found here: 
 http://www.dsource.org/projects/ddl/wiki/Tutorial/UsingDDL/Quick)
 
 /////////////////
 // plugin.d
 module plugin;
 
 char[] helloWorld(){
     return "hello world";
 }
 /////////////////
 
 /////////////////
 // example.d
 import ddl.DefaultRegistry;
 import ddl.Linker;
 
 import mango.io.Stdout;
 
 void main(){
     auto linker = new Linker(new DefaultRegistry());
     linker.loadAndRegister("example.map");
 
     auto plugin = linker.loadAndLink("plugin.obj");
 
     auto helloWorld = plugin.getDExport!(char[] 
 function(),"plugin.helloWorld")();
 
     Stdout.put(helloWorld());
     Stdout.put(CR);
 }
 /////////////////
Wonderful News! Like others, I've been eagerly awaiting this arrival. Well Done! Now I can get my plugin based game engine underway! -- Kyle Furlong // Physics Undergrad, UCSB "D is going wherever the D community wants it to go." - Walter Bright
Sep 05 2006
prev sibling next sibling parent reply "Craig Black" <cblack ara.com> writes:
Nice work!  Does DDL do dynamic class loading?

-Craig 
Sep 07 2006
parent Pragma <ericanderton yahoo.removeme.com> writes:
Craig Black wrote:
 Nice work!  Does DDL do dynamic class loading?
 
 -Craig 
 
 
Yes, but not in the Java sense of the word - at least not yet. ;) At the moment, DDL operates that the module/library level. Once you have that loaded (.obj, .lib, .o, or what have you) and linked, then you interrogate it for what symbols it provides. So it's operating a slightly lower level than we'd prefer. However, this is a level at which Java is clear as mud, so I'd like to think that this approach is much more modifiable and extensible. In the case of finding class information, you can use the template methods exposed on the DynamicLibrary class to find a particular ctor or ClassInfo, or use the ExportClass template for a more well-honed approach. I'll take the opportunity here to note one other important difference between Java and D/DDL. Due to D's design as a statically compiled language, one cannot achieve lazy class loading at every call to 'new'. Instead, every external reference that a given module has, must be resolved during a link pass before that library can be safely used. In essence: The same drawbacks that exist at "compile-and-link time" are the same as at "run-and-link time". Anyway, the Linker class helps with the above - any call to a link() method will result in an Exception if the library in question cannot be fully resolved. -- - EricAnderton at yahoo
Sep 07 2006
prev sibling parent reply BLS <nanali wanadoo.fr> writes:
pragma schrieb:

 ---------------
 So what is DDL?
 ---------------
 
 DDL stands for "D Dynamic Libraries"  ..... an interface for dynamic 
 reflection ....
??? Please explain. What the heck is dynamic reflection. A more concrete question. How DDL could help to implement f.i. a plugin architecture for, let's say, an IDE. Thanks in advance. Björn
Sep 08 2006
next sibling parent reply Tom S <h3r3tic remove.mat.uni.torun.pl> writes:
BLS wrote:
 pragma schrieb:
 
 ---------------
 So what is DDL?
 ---------------

 DDL stands for "D Dynamic Libraries"  ..... an interface for dynamic 
 reflection ....
??? Please explain. What the heck is dynamic reflection.
http://en.wikipedia.org/wiki/Reflection_(computer_science)
 A more concrete question. How DDL could help to implement f.i. a plugin 
 architecture for, let's say, an IDE.
 Thanks in advance.
 Björn
http://www.dsource.org/projects/ddl/wiki/AboutDDL ^ at the bottom of the page, in the 'No more DLL Files ?' section.
Sep 08 2006
parent BLS <nanali wanadoo.fr> writes:
Thanks Tom,
still have some problems to understand (the sense of) dynamic relection, 
but anyway thanks for the links.
Björn
Make it as simple as possible, but not simpler! Niklaus Wirth
Sep 09 2006
prev sibling parent reply pragma <ericanderton yahoo.com> writes:
BLS wrote:
 A more concrete question. How DDL could help to implement f.i. a plugin 
 architecture for, let's say, an IDE.
 Thanks in advance.
 Björn
To exapand on what Tom said, I can see DDL helping an IDE's design in a few innovative ways. First of all, DDL can put an IDE directly in touch with the compiler's output. This means that the .obj files from a build pass can be loaded back into the IDE and parsed for type information, which then can then be used for intellisence. Once DDL is expanded to include debug information and line numbers, one could allow a developer to click on a symbol and go to where it is defined. Another thing is that DDL can be used for a plugin architecture. As a D IDE is already "compiler aware", plugins could be coded from within the IDE itself in a manner indistinguishable from using a scripting language. The environment would simply compile the plugin "scripts" once they're saved and pull the .obj files directly into the runtime in one step. - Eric
Sep 09 2006
next sibling parent BLS <nanali wanadoo.fr> writes:
Hi Eric,


 First of all, DDL can put an IDE directly in touch with the compiler's
 output.  This means that the .obj files from a build pass can be
 loaded  back into the IDE and parsed for type information, which then 
 can then be used for intellisence.
 Once DDL is expanded to include debug information and line numbers,
 one  could allow a developer to click on a symbol and go to where it 
> defined. This simply means: DDL will probabely enable all IDE guys to create : Not invented here, not yet seen (tm) IDEs. <vbg>
 The environment would simply compile the plugin "scripts"
 once they're saved and pull the .obj files directly into the runtime
 in  one step.
I can't await your "Advanced Usage tutorials". I hope that you will include a simple sample showing how to implement a plugin-architecture using DDL. Especially "Dynamically Linking a Class" would be very interresting. ( An : Enhancing a class form within a DDL module would be IMO the most interesting part !) Kind regards, Björn
Sep 09 2006
prev sibling parent reply BLS <nanali wanadoo.fr> writes:
pragma schrieb:
 This means that the .obj files from a build pass can be
 loaded  back into the IDE and parsed for type information, which then 
 can then be used for intellisence.
Do you have any plans to make an example, or at least some general instructions available ? Thanks in advance , Björn
Sep 09 2006
parent reply pragma <ericanderton yahoo.com> writes:
BLS wrote:
 pragma schrieb:
  > This means that the .obj files from a build pass can be
  > loaded  back into the IDE and parsed for type information, which then 
  > can then be used for intellisence.
 
 Do you have any plans to make an example, or at least some general 
 instructions  available ?
 Thanks in advance ,
 Björn
I sincerely apologize for the lack of documentation at this stage. I'm working as quickly as I can to get things put together so you can move along - this goes especially for the advanced stuff. For now, I can say that the very heart of the system is the DynamicLibrary class, and the template methods provided there. Follow that, and the basic tutorials on the site and you have about 90% of the whole concept. Everything else is really to help with various use strategies: performance, deployment, and complex linking schemes. As far as the concept goes for my last post, it's more a matter of looking at a given .lib or .obj file as a symbol table, instead of just a way to dynamically load code. You wouldn't even need to use the Linker - just load the file directly via the LoaderRegistry and ask it some questions. For an example of this, take a look at ddlinfo (and it's sourcecode). Or, just download the binary and run it against a few .obj files you have lying around for an idea of the potential here. - Eric
Sep 09 2006
parent BLS <nanali wanadoo.fr> writes:
Thanks, i guess this will allready help a lot. I  suggest to  place the 
DDLInfo hint on the DDL frontpage.

Björn
Sep 09 2006