Re: Dynamic loading, D all the way (dmd 64bit 2.060/Ubuntu 64bit 12.04/x86_64)

2012-08-24 Thread Jacob Carlborg
On 2012-08-24 00:26, Philip Daniels wrote: But wouldn't that require you to link everything together at, err, compile time? What I'm getting at is, would it be possible to port a DI/IoC tool such as StructureMap (http://docs.structuremap.net/index.html) or Spring to D? This can handle tasks suc

Re: Dynamic loading, D all the way (dmd 64bit 2.060/Ubuntu 64bit 12.04/x86_64)

2012-08-23 Thread Philip Daniels
On Wednesday, 22 August 2012 at 16:57:26 UTC, Paulo Pinto wrote: On Wednesday, 22 August 2012 at 15:51:05 UTC, Philip Daniels wrote: snip< If we had dynamic loading, would we be able to do dependency injection in D? Dependency injection does not require dynamic loading per se. It is all abo

Re: Dynamic loading, D all the way (dmd 64bit 2.060/Ubuntu 64bit 12.04/x86_64)

2012-08-22 Thread Paulo Pinto
On Wednesday, 22 August 2012 at 15:51:05 UTC, Philip Daniels wrote: snip< If we had dynamic loading, would we be able to do dependency injection in D? Dependency injection does not require dynamic loading per se. It is all about using interfaces instead of classes, and initializing the corr

Re: Dynamic loading, D all the way (dmd 64bit 2.060/Ubuntu 64bit 12.04/x86_64)

2012-08-22 Thread Philip Daniels
snip< If we had dynamic loading, would we be able to do dependency injection in D?

Re: Dynamic loading, D all the way (dmd 64bit 2.060/Ubuntu 64bit 12.04/x86_64)

2012-08-20 Thread Jacob Carlborg
On 2012-08-20 17:16, Carl Sturtivant wrote: I'm not sure I'm following what you exactly have done here but in general this is what needs to be done to make dynamic libraries properly work in D : * Initialize module infos (module constructors and similar) * Add TLS variables * Add exception ha

Re: Dynamic loading, D all the way (dmd 64bit 2.060/Ubuntu 64bit 12.04/x86_64)

2012-08-20 Thread Carl Sturtivant
I'm not sure I'm following what you exactly have done here but in general this is what needs to be done to make dynamic libraries properly work in D : * Initialize module infos (module constructors and similar) * Add TLS variables * Add exception handling tables * Add GC roots The above fo

Re: Dynamic loading, D all the way (dmd 64bit 2.060/Ubuntu 64bit 12.04/x86_64)

2012-08-20 Thread Jacob Carlborg
On 2012-08-20 16:22, Paulo Pinto wrote: Ah ok, from your explanation I understood as something we are required to do manually. I just explained what changes need to be done in order for it to work. So we need to modify druntime to do what I listed above. -- /Jacob Carlborg

Re: Dynamic loading, D all the way (dmd 64bit 2.060/Ubuntu 64bit 12.04/x86_64)

2012-08-20 Thread Paulo Pinto
On Monday, 20 August 2012 at 12:15:28 UTC, Jacob Carlborg wrote: On 2012-08-20 13:38, Paulo Pinto wrote: Should this be made automatically by the compiler? This would be my expectation based on my experience with dynamic libraries in Turbo Pascal/Delphi. This should be handled automaticall

Re: Dynamic loading, D all the way (dmd 64bit 2.060/Ubuntu 64bit 12.04/x86_64)

2012-08-20 Thread Jacob Carlborg
On 2012-08-20 13:38, Paulo Pinto wrote: Should this be made automatically by the compiler? This would be my expectation based on my experience with dynamic libraries in Turbo Pascal/Delphi. This should be handled automatically by the runtime. -- /Jacob Carlborg

Re: Dynamic loading, D all the way (dmd 64bit 2.060/Ubuntu 64bit 12.04/x86_64)

2012-08-20 Thread Paulo Pinto
On Monday, 20 August 2012 at 07:26:40 UTC, Jacob Carlborg wrote: On 2012-08-20 05:40, Carl Sturtivant wrote: (By dynamic loading I mean using something like the C library function dlopen to explicitly load a shared object at runtime. I do not mean dynamic linking in the usual passive sense.)

Re: Dynamic loading, D all the way (dmd 64bit 2.060/Ubuntu 64bit 12.04/x86_64)

2012-08-20 Thread Jacob Carlborg
On 2012-08-20 05:40, Carl Sturtivant wrote: (By dynamic loading I mean using something like the C library function dlopen to explicitly load a shared object at runtime. I do not mean dynamic linking in the usual passive sense.) I just successfully got working a toy example of dynamically loading

Dynamic loading, D all the way (dmd 64bit 2.060/Ubuntu 64bit 12.04/x86_64)

2012-08-19 Thread Carl Sturtivant
(By dynamic loading I mean using something like the C library function dlopen to explicitly load a shared object at runtime. I do not mean dynamic linking in the usual passive sense.) I just successfully got working a toy example of dynamically loading (from a D program) a D shared object and then