October 21, 2008
Bill Baxter wrote:
> But there's more to it than that.
> 
> There's an object.d in src/phobos with a prototype for a print() function.
> But the object.di in src/druntime/import does not have a print() function.
> 
> So maybe the phobos.lib included was built using the old object.d
> instead of the new one from druntime?

I see the problem. The phobos.lib was built correctly, but I'd forgotten to remove the old object.d. If you simply delete /dmd/src/phobos/object.d, it should work.
October 21, 2008
Bill Baxter wrote:
> On Tue, Oct 21, 2008 at 10:59 AM, dsimcha <dsimcha@yahoo.com> wrote:
>>
>> Seriously, though, Walter, thank you very much for this release.  You have done a
>> tremendous job bringing us a better language.  Merging the Phobos and Tango
>> runtime is a monumental task (Sean, thank you, too) and a few bumps along the road
>> are definitely understandable.
> 
> Hmm, first off it looks like druntime.lib doesn't exist in the D2 download.
> I was able to build it by running build-dmd.bat in one of the druntime
> subdirectories.
> 
> But there's more to it than that.
> 
> There's an object.d in src/phobos with a prototype for a print() function.
> But the object.di in src/druntime/import does not have a print() function.
> 
> So maybe the phobos.lib included was built using the old object.d
> instead of the new one from druntime?

I have family visiting and haven't been online much the past few days as a result.  But from a quick perusal these are some issues with the current release:

* ship druntime.lib in dmd/lib
* remove object.d and errno.c from phobos/
* modify DFLAGS to reference the druntime import path

Also, something will have to be done about druntime including a 'std' package in its import directory.  I'd say just remove it for now, but hopefully at some point it won't be necessary to retain it at all (the reasons for it being there are somewhat weird).  This shouldn't affect use of the current release, though you may have to place the phobos directory first in your import path list.

Finally, I still need to look over the core.memory.GC.xxxHandle() routines, which were added by necessity just prior to release.  The basic functionality will remain, but names may be changed to protect the innocent, etc.

If anyone runs across any other issues, please submit a ticket on dsource or the puremagic site as appropriate, or simply post them here.

By the way... thank you all for testing this out.  I know the initial release is a bit rough, but hopefully things will be smoothed out soon.  Once DMD is sorted I'll be porting the GDC runtime as well.  I just wanted to get one distro sorted out first before dealing with the others.


Sean
October 21, 2008
Walter Bright wrote:
> I see the problem. The phobos.lib was built correctly, but I'd forgotten to remove the old object.d. If you simply delete /dmd/src/phobos/object.d, it should work.

I removed them from the zip file.
October 21, 2008
On Mon, Oct 20, 2008 at 10:40 PM, bearophile <bearophileHUGS@lycos.com> wrote:
> Thank you Walter, this step improves D2 significantly :-)
>
> I have seen that's there's an improvement in the AAs in D1 too, I'll do few benchmarks.
>
> I have also seen this nasty bug fixed in D2:
> http://d.puremagic.com/issues/show_bug.cgi?id=2333
> Can't it be fixed in D1 too?
>
> Bye,
> bearophile
>

As far as I know that bug exists only in D2.  I remember being confused about this before; it works fine in D1.
October 21, 2008
Jarrett Billingsley:
> As far as I know that bug exists only in D2.  I remember being confused about this before; it works fine in D1.

Ah, I see. Sorry for bothering then.

A note: 1.036 has compiled successfully all my code :-)

Bye,
bearophile
October 21, 2008
Walter Bright Wrote:

> 
> http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.036.zip
> 
> The 2.0 version splits phobos into druntime and phobos libraries (thanks to Sean Kelly). This will enable both Tango and Phobos to share a common core library.
> 
> http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.020.zip
> 
> There are a lot of structural changes that go along with this, so expect some rough patches with this release. It may take a followup release to file them down. There's also some renaming of imports and function names, as a compromise with Tango names.

Great news! thank you Sean And Walter for this important first step. I hope the rest of the tango/phobos issue will be sorted out as well..

October 21, 2008
Yigal Chripun wrote:
> Walter Bright Wrote:
> 
>> http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.036.zip
>> 
>> The 2.0 version splits phobos into druntime and phobos libraries
>> (thanks to Sean Kelly). This will enable both Tango and Phobos to
>> share a common core library.
>> 
>> http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.020.zip
>> 
>> There are a lot of structural changes that go along with this, so
>> expect some rough patches with this release. It may take a followup
>> release to file them down. There's also some renaming of imports
>> and function names, as a compromise with Tango names.
> 
> Great news! thank you Sean And Walter for this important first step.
> I hope the rest of the tango/phobos issue will be sorted out as
> well..

I was hoping there is no more issue. The common runtime levels the ground for library interoperability.

Andrei

October 21, 2008
Reply to Walter,

> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.036.zip
> The 2.0 version splits phobos into druntime and phobos libraries
> (thanks to Sean Kelly). This will enable both Tango and Phobos to
> share a common core library.
> 
> http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.020.zip
> There are a lot of structural changes that go along with this, so
> expect some rough patches with this release. It may take a followup
> release to file them down. There's also some renaming of imports and
> function names, as a compromise with Tango names.
> 

I have been ignoring the tango/phobos stuff for the most part because it's not something I have time for. :(

Will D1.0 ever get the same fix-up?


October 21, 2008
On Tue, Oct 21, 2008 at 8:29 AM, Walter Bright <newshound1@digitalmars.com> wrote:
>
> http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.036.zip
>
> The 2.0 version splits phobos into druntime and phobos libraries (thanks to Sean Kelly). This will enable both Tango and Phobos to share a common core library.
>
> http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.020.zip
>
> There are a lot of structural changes that go along with this, so expect some rough patches with this release. It may take a followup release to file them down. There's also some renaming of imports and function names, as a compromise with Tango names.

Wao!  Missed this at first:

class Foo
{
    ref int getref() {
        return m_int;
    }
private:
    int m_int = 23;
}

void main() {
    auto foo = new Foo;

    writefln(foo.getref);
    foo.getref() = 7;
    writefln(foo.getref);
}
//Outputs:
//23
//7

It works!  This is maybe even bigger news than cure for TangoPhobia!

But I think maybe more documentation is needed in the Ref returns section regarding how this affects opIndex.

class Foo
{
    this() {
        m_arr.length = 10;
        foreach(i, ref a; m_arr) { a=i;}
    }
    int[] array() {
        return m_arr;
    }
    ref int opIndex(size_t idx) {
        return m_arr[idx];
    }

private:
    int[] m_arr;
}

void main() {
    auto foo = new Foo;
    foo[3] = -99;
//hello.d(44): Error: operator [] assignment overload with opIndex(i,
value) illegal, use opIndexAssign(value, i)
//hello.d(44): function hello.Foo.opIndex (uint idx) does not match
parameter types (int,int)
//hello.d(44): Error: expected 1 arguments, not 2
}

Apparently using opIndex with ref return is not allowed as a way to
set an index.
This works though:

    *(&foo[3]) = -99;

Is there a good reason why it shouldn't be possible to use opAssign as a replacement for opIndexAssign?

--bb
October 21, 2008
Andrei Alexandrescu wrote:
> Yigal Chripun wrote:
>> Walter Bright Wrote:
>>
>>> http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.036.zip
>>>
>>> The 2.0 version splits phobos into druntime and phobos libraries (thanks to Sean Kelly). This will enable both Tango and Phobos to share a common core library.
>>>
>>> http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.020.zip
>>>
>>> There are a lot of structural changes that go along with this, so expect some rough patches with this release. It may take a followup release to file them down. There's also some renaming of imports and function names, as a compromise with Tango names.
>>
>> Great news! thank you Sean And Walter for this important first step. I hope the rest of the tango/phobos issue will be sorted out as well..
> 
> I was hoping there is no more issue. The common runtime levels the ground for library interoperability.
> 
> Andrei
> 

What I meant was that now that the runtime is unified the next step
would be to unify the user APIs.
You've posted in the NG your intention to re-implement several key
modules in phobos including IO and algorithm, I'm hoping that instead of
two separate IO systems (tango and phobos) you could use the Tango IO
and implement your Range proposal on top of it. Others already suggested
that on this NG.
I know that there are license issues with this which I don't understand.
 both Tango and Phobos use very liberal open-source licenses so all is
needed to use Tango code legally in the future unified standard library
is to comply with the restrictions which IIRC require only
acknowledgment. IANAL but all those differences between open source
licenses shouldn't be a big deal.