October 06, 2007
Walter Bright wrote:
> Bug fixes. New (and very modest) C++ interface. Library module overhauls by Andrei Alexandrescu. Brad Roberts is working behind the curtain to get phobos development much better organized.
> 
> http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.022.zip
> 
> http://www.digitalmars.com/d/changelog.html http://ftp.digitalmars.com/dmd.2.005.zip

great!

I wrote "C++ constructor/destructor" template for g++ and it works fine!


October 06, 2007
Brad Roberts wrote:
> Bill Baxter wrote:
>> Brad Roberts wrote:
> 
>>> There's a natural consequence of this.  For DMD 1.x (and it's Phobos 1.x), the Phobos vs Tango split is permanent, essentially, unless Tango is changed to sit on top of the Phobos supplied runtime.  I don't think that's likely and from my point of view, that's ok.  As D 2.x (and it's implementation in DMD 2.x) matures and the runtimes converge, Tango can choose to support 2.x and not need to replace the runtime but can instead be a darned useful add-on library.
>>
>> That's not what I was hoping to hear.  Sounds like that puts any kind of hopes for "the one true D" at least 6 months in the future, since it requires D2.0 const getting finished (3 more months?), then undergoing enough hammering that the Tango team feels comfortable porting to it (1 month?), followed by however long it actually takes them to port it (2 months?).
> 
> I expected that sort of response, which is why I felt it worth making clear early on.  Managing expectations is at least as important as managing the changes and releases. :)
> 
> Putting broader changes into the 1.x code line would mean making changes that put it's stability and backwards compatibility at risk.  The very definition of a why the 2.x code line was started is to keep 1.x frozen to allow developers to trust it to remain stable, both from a bug standpoint and an api standpoint.

I'm not sure that bugs are an issue so much as design compatibility, which would be a real problem if strict backwards compatibility were necessary.  Tango moves a number of public Phobos modules into the runtime, and these simply could not be re-exposed.

For what it's worth however, there is already a 1.x implementation of Phobos which is compatible with Tango: Tangobos.  It's even publicly maintained.

> I'm not going to attempt to put a time line on the future.. it's too unclear to try to guess and my time machine is on the fritz this week. Everyone wants convergence, and it will happen, I'm sure.

Yes it will, and likely a bit faster now that Brad is involved in the Phobos side.  But there are a lot of issues to resolve and we've all been short on free time recently, so I don't want to predict how long it will take either.


Sean
October 06, 2007
Bill Baxter wrote:
> Brad Roberts wrote:
> 
>> There's a natural consequence of this.  For DMD 1.x (and it's Phobos 1.x), the Phobos vs Tango split is permanent, essentially, unless Tango is changed to sit on top of the Phobos supplied runtime.  I don't think that's likely and from my point of view, that's ok.  As D 2.x (and it's implementation in DMD 2.x) matures and the runtimes converge, Tango can choose to support 2.x and not need to replace the runtime but can instead be a darned useful add-on library.
> 
> That's not what I was hoping to hear.  Sounds like that puts any kind of hopes for "the one true D" at least 6 months in the future, since it requires D2.0 const getting finished (3 more months?), then undergoing enough hammering that the Tango team feels comfortable porting to it (1 month?), followed by however long it actually takes them to port it (2 months?).

For what it's worth, Tango will never choose to run exclusively on the Phobos runtime.  One of the primary reasons many people choose Tango is for its threading package, and this is a runtime feature.  Therefore, dropping this package to use the Phobos version would be foolish, and I suspect that it would leave a number of Tango users (some developing professional software) in a bit of a lurch.


Sean
October 06, 2007
Reply to Walter,

> Bug fixes. New (and very modest) C++ interface. Library module
> overhauls by Andrei Alexandrescu. Brad Roberts is working behind the
> curtain to get phobos development much better organized.
> 
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.022.zip
> http://www.digitalmars.com/d/changelog.html
> http://ftp.digitalmars.com/dmd.2.005.zip

Now, would anyone be interested in making a dtoh program? (Find all extern c/c++ declaration and make a .h file for them). The name could be shortened to "d'oh".


October 06, 2007
Stewart Gordon wrote:
> I see.  Do they have access to the documentation repository as well?

That came up and is a good idea, it just hasn't been done yet.
October 06, 2007
Sean Kelly wrote:
> For what it's worth, Tango will never choose to run exclusively on the Phobos runtime.  One of the primary reasons many people choose Tango is for its threading package, and this is a runtime feature.  Therefore, dropping this package to use the Phobos version would be foolish, and I suspect that it would leave a number of Tango users (some developing professional software) in a bit of a lurch.

The threading package in Phobos is not very good, as it is based on my very poor understanding of the problem. Drop kicking std.thread is certainly open for discussion for v2. I wouldn't shed a tear for it <g>.

Another thing that needs design work is the shared library issue on Linux. The compiler supports the -fPIC switch, so theoretically, the compiler is there. But the library ain't.
October 06, 2007
Thanks Walter. Good work.

I can finally build my Code with optimizations again, yeeeehaa.

--Extrawurst

Walter Bright schrieb:
> Bug fixes. New (and very modest) C++ interface. Library module overhauls by Andrei Alexandrescu. Brad Roberts is working behind the curtain to get phobos development much better organized.
>
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.022.zip
>
> http://www.digitalmars.com/d/changelog.html
> http://ftp.digitalmars.com/dmd.2.005.zip
October 06, 2007
"Walter Bright" <newshound1@digitalmars.com> wrote in message news:fe8koo$1906$1@digitalmars.com...
> Sean Kelly wrote:
>> For what it's worth, Tango will never choose to run exclusively on the Phobos runtime.  One of the primary reasons many people choose Tango is for its threading package, and this is a runtime feature.  Therefore, dropping this package to use the Phobos version would be foolish, and I suspect that it would leave a number of Tango users (some developing professional software) in a bit of a lurch.
>
> The threading package in Phobos is not very good, as it is based on my very poor understanding of the problem. Drop kicking std.thread is certainly open for discussion for v2. I wouldn't shed a tear for it <g>.
>
> Another thing that needs design work is the shared library issue on Linux. The compiler supports the -fPIC switch, so theoretically, the compiler is there. But the library ain't.

Shared-lib is a thorn on Win32 also, which I understand you have a particular soft-spot for <g>


October 06, 2007
nazo Wrote:

> Walter Bright wrote:
> > Bug fixes. New (and very modest) C++ interface. Library module overhauls by Andrei Alexandrescu. Brad Roberts is working behind the curtain to get phobos development much better organized.
> > 
> > http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.022.zip
> > 
> > http://www.digitalmars.com/d/changelog.html http://ftp.digitalmars.com/dmd.2.005.zip
> 
> great!
> 
> I wrote "C++ constructor/destructor" template for g++ and it works fine!
> 
> #include <iostream>
> using namespace std;
> class D{
>   public:
>     D();
>     ~D();
>     virtual int bar(int i, int j, int k);
> };
> 
> D::D(){
>   printf("start\n");
> }
> 
> D::~D(){
>   printf("end\n");
> }
> 
> int D::bar(int i, int j, int k){
>       cout << "i = " << i << endl;
>       cout << "j = " << j << endl;
>       cout << "k = " << k << endl;
>       return 8;
> };
> 
> import std.metastrings;
> extern (C++){
>   interface D{
>     int bar(int i, int j, int k);
>   }
> }
> 
> extern(C){
>   void* _Znwj(uint);
>   void _ZdlPv(void*);
> }
> 
> template cpp_decl(T){
>   const cpp_decl = "extern(C) extern char* _ZTV"~ToString!(T.stringof.length)~T.stringof~";";
> }
> 
> template cpp_constructor(T, ARGS...){
>   const cpp_constructor = "extern(C) void _ZN"~ToString!(T.stringof.length)~T.stringof~"C1Ev(void*);";//fixme: mangle and type
> }
> 
> template cpp_destructor(T){
>   const cpp_destructor = "extern(C) void _ZN"~ToString!(T.stringof.length)~T.stringof~"D1Ev(void*);";
> }
> 
> T cpp_new(T, ARGS...)(ARGS args){
>   const fn="_ZN"~ToString!(T.stringof.length)~T.stringof~"C1Ev";//fixme: mangle
>   void* rv;
>   rv = _Znwj(T.sizeof);
>   static if(is(typeof(mixin(fn)))){
>     mixin("alias "~fn~" init;");
>     init(rv, args);
>   }else static if(ARGS.length==0){
>     *cast(void**)rv = mixin("&_ZTV"~ToString!(T.stringof.length)~T.stringof)+2;
>   }else static assert(0);
>   return cast(D)rv;
> }
> 
> void cpp_delete(T)(T obj){
>   const fn="_ZN"~ToString!(T.stringof.length)~T.stringof~"D1Ev";
>   static if(is(typeof(mixin(fn)))){
>     mixin("alias "~fn~" term;");
>     term(cast(void*)obj);
>   }
>   _ZdlPv(cast(void*)obj);
> }
> 
> mixin(cpp_decl!(D));
> mixin(cpp_constructor!(D));//if D has constructor
> mixin(cpp_destructor!(D));//if D has destructor
> 
> void main(){
>   D d = cpp_new!(D);
>   d.bar(9,10,11);
>   cpp_delete(d);
> }
> 

Awesome. Just... awesome.

October 07, 2007
Walter Bright wrote:
> Bug fixes. New (and very modest) C++ interface. Library module overhauls by Andrei Alexandrescu. Brad Roberts is working behind the curtain to get phobos development much better organized.
> 
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.022.zip
> 
> http://www.digitalmars.com/d/changelog.html
> http://ftp.digitalmars.com/dmd.2.005.zip

Neat with the C++ linkage stuff.  Now all I have to figure out appropriate places to incorporate D into my C++ projects :)