Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread BCS

Reply to dsimcha,


== Quote from John Reimer ([EMAIL PROTECTED])'s article


Hello Andrei,


I think the entire operator paraphernalia is due for a serious
overhaul.

Andrei


This may not be a popular opinion, but I agree!
-JJR

I'll second that.  D's operator overloading is a bit confusing because
it's kind of grown rather than having been designed.  This should be
fixed now, while breaking changes are still considered acceptable.



Clean it up if you want to. But overall I like the *general* way it work.




Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread dsimcha
== Quote from John Reimer ([EMAIL PROTECTED])'s article
> Hello Andrei,
> > I think the entire operator paraphernalia is due for a serious
> > overhaul.
> >
> > Andrei
> >
> This may not be a popular opinion, but I agree!
> -JJR

I'll second that.  D's operator overloading is a bit confusing because it's kind
of grown rather than having been designed.  This should be fixed now, while
breaking changes are still considered acceptable.


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread John Reimer

Hello Andrei,


I think the entire operator paraphernalia is due for a serious
overhaul.

Andrei




This may not be a popular opinion, but I agree!

-JJR




Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Graham St Jack
On Mon, 20 Oct 2008 16:29:36 -0700, 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.

This is FANTASTIC news. Many thanks to everyone involved, especially Sean 
for all the hard work.


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Andrei Alexandrescu

Jason House wrote:

Bill Baxter Wrote:


On Tue, Oct 21, 2008 at 8:29 AM, Walter Bright
<[EMAIL PROTECTED]> 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


opindexAssign will still be needed when opindex has a non-ref return type.


I think the entire operator paraphernalia is due for a serious overhaul.

Andrei


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Sean Kelly

Bill Baxter wrote:


I also like the idea of renaming the whole project from druntime to
dcore.  Just sounds cooler. :-)


Yeah it does :-)


Sean


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Bill Baxter
On Wed, Oct 22, 2008 at 9:19 AM, Sergey Gromov <[EMAIL PROTECTED]> wrote:
> Tue, 21 Oct 2008 11:04:56 -0700,
> Sean Kelly wrote:
>> Sergey Gromov wrote:
>> > Tue, 21 Oct 2008 09:40:28 -0700,
>> > Sean Kelly wrote:
>> >> Don wrote:
>> >>> We also now have two modules called 'bitmanip', which is somewhat ironic
>> >>> since we brainstormed for ages trying to come up with a better name for
>> >>> it. Modules with duplicate names have caused linking problems in the
>> >>> past -- not sure if that applies here.
>> >> It applies if the modules from both Phobos and druntime end up in the
>> >> same library on *nix.  Windows doesn't appear to have the same issue.
>> >> But I'd love to hear suggestions for alternative names-- I'm not
>> >> terribly good at naming modules :-p.
>> >>
>> >> Also, any I'd like to see how people feel about having three top-level
>> >> packages in druntime vs. one-- an alternative I'd considered was to put
>> >> everything under core.
>> >
>> > I actually was expecting all the runtime stuff to be in core.* and was
>> > surprised to find std and sys there.
>>
>> I didn't even create core until just recently--before that, the modules
>> in core were global, much like object.  So my thoughts on the druntime
>> package layout are still evolving.  I do now think that having a single
>> top-level package would probably be best, but figured I'd solicit
>> opinions before changing anything.
>
> I think the  package should be left for the user.  This also
> gives you an opportunity to use package protection where appropriate.
>

I like core as the package name.  Or maybe even std.core if that's
technically possible.
The stuff in there is going to be kind of rare to import directly,
right?  So doesn't seem like the modules need to be top-level (or even
second level).

I also like the idea of renaming the whole project from druntime to
dcore.  Just sounds cooler. :-)

--bb


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Sergey Gromov
Tue, 21 Oct 2008 11:04:56 -0700,
Sean Kelly wrote:
> Sergey Gromov wrote:
> > Tue, 21 Oct 2008 09:40:28 -0700,
> > Sean Kelly wrote:
> >> Don wrote:
> >>> We also now have two modules called 'bitmanip', which is somewhat ironic 
> >>> since we brainstormed for ages trying to come up with a better name for 
> >>> it. Modules with duplicate names have caused linking problems in the 
> >>> past -- not sure if that applies here.
> >> It applies if the modules from both Phobos and druntime end up in the 
> >> same library on *nix.  Windows doesn't appear to have the same issue. 
> >> But I'd love to hear suggestions for alternative names-- I'm not 
> >> terribly good at naming modules :-p.
> >>
> >> Also, any I'd like to see how people feel about having three top-level 
> >> packages in druntime vs. one-- an alternative I'd considered was to put 
> >> everything under core.
> > 
> > I actually was expecting all the runtime stuff to be in core.* and was 
> > surprised to find std and sys there.
> 
> I didn't even create core until just recently--before that, the modules 
> in core were global, much like object.  So my thoughts on the druntime 
> package layout are still evolving.  I do now think that having a single 
> top-level package would probably be best, but figured I'd solicit 
> opinions before changing anything.

I think the  package should be left for the user.  This also 
gives you an opportunity to use package protection where appropriate.


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Leandro Lucarella
Robert Fraser, el 21 de octubre a las 03:09 me escribiste:
> Thanks to you & Walter for all your hard work.

ditto =)

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/

GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)

El día que falten los niños, que sobren las mujeres y que se prenda
fuego el último árbol, será el Apocalípsis.
-- Ricardo Vaporeso. Camino Negro, 1916.


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Bill Baxter
On Wed, Oct 22, 2008 at 7:01 AM, Jason House
<[EMAIL PROTECTED]> wrote:
> Bill Baxter Wrote:
>
>> Is there a good reason why it shouldn't be possible to use opAssign as
>> a replacement for opIndexAssign?
>>
>> --bb
>
> opindexAssign will still be needed when opindex has a non-ref return type.
>

Yep, definitely shouldn't get rid of opIndexAssign.  It's still a nice
advantage of D over C++ when you want to monitor and control all
modifications to an array-like object.

But if the opIndex does return a ref, and an opIndexAssign has not
been defined then I don't see why that opIndex shouldn't allow users
to say   foo[10] = x.   Instead of *(&foo[10])=x;

--bb


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread bearophile
The change log says:

>Improved performance of AAs by rebalancing trees when rehashing.<

I presume such rehashing is done from time to time when the hash grows up, and 
when the .rehash method is called too.

I have performed some benchmarks, with both string and int keys, and the 
creation (building) of associative arrays in DMD1.036 is about 10-15% slower 
than in DMD1.035 (I can show code if you want, but it's the same code I have 
used in the past).

I have not tested the key retrieval time, I presume it's faster...

Anyway: often performance isn't absolute, usually you have to tune something 
for a specific class of usages. So you want to tune it for the average use 
cases, this means for the most common usages of D AAs. This means that before 
tuning something you collect a statistically significant base of such usages, 
generally from a sizable amount of code. What are the average use cases the 
current performance improvements are based on? Where's the people creating such 
user cases to base the performance tuning on? I think we need to put a little 
more "science" in this tuning business.

Bye,
bearophile


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Jason House
Bill Baxter Wrote:

> On Tue, Oct 21, 2008 at 8:29 AM, Walter Bright
> <[EMAIL PROTECTED]> 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

opindexAssign will still be needed when opindex has a non-ref return type.


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Walter Bright

Steven Schveighoffer wrote:
Yes, I wasn't suggesting it should be done for D1, what I was saying is the 
magical land where Tango and Phobos apps live together in harmony is not 
available yet ;)  Which is part of the reason why several of us Tango devs 
are working on a D2 branch.


Right!


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Extrawurst

Sean Kelly wrote:

Sergey Gromov wrote:

Tue, 21 Oct 2008 09:40:28 -0700,
Sean Kelly wrote:

Don wrote:
We also now have two modules called 'bitmanip', which is somewhat 
ironic since we brainstormed for ages trying to come up with a 
better name for it. Modules with duplicate names have caused linking 
problems in the past -- not sure if that applies here.
It applies if the modules from both Phobos and druntime end up in the 
same library on *nix.  Windows doesn't appear to have the same issue. 
But I'd love to hear suggestions for alternative names-- I'm not 
terribly good at naming modules :-p.


Also, any I'd like to see how people feel about having three 
top-level packages in druntime vs. one-- an alternative I'd 
considered was to put everything under core.


I actually was expecting all the runtime stuff to be in core.* and was 
surprised to find std and sys there.


I didn't even create core until just recently--before that, the modules 
in core were global, much like object.  So my thoughts on the druntime 
package layout are still evolving.  I do now think that having a single 
top-level package would probably be best, but figured I'd solicit 
opinions before changing anything.



Sean


I am all for one toplevel package too.


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Extrawurst

Jason House wrote:

Extrawurst Wrote:


But why is it that since 2.020 i cannot name a package "shared" anymore?

moudle shared.foo;

dmd: "Identifier expected following module"

WTF ?

Because shared is now a keyword.

Ok, what is it for ? Where is it documented ? Or is it another reserved 
keyword like "macro" is ?


There was a long discussion on digitalmars.d about this.  It's definitely 
coming in the short term.  It was on Walter's top 5 a week or so ago... along 
with integrating druntime, ref return values, and implementing immutable.  I 
don't recall the whole list, but he's definitely working on this.

This is part of the change to allow thread local storage and have non-local 
objects marked as shared.  Shared objects would have a number of volatile-like 
properties.  I'm sure I've butchered the whole topic in trying to do a summary 
in a sentence or two, but it should give you the general idea of what it is and 
why the word has become a keyword.


Ok thank you for the summary.


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Brad Roberts
On Tue, 21 Oct 2008, Max Samukha wrote:

> Please add the compiler versions to bugzilla. 

Done.


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Steven Schveighoffer
"Walter Bright" wrote
> Steven Schveighoffer wrote:
>> one big issue:  druntime only supported with phobos using D2.
>
> That's because the druntime support is a breaking change for Phobos users.

Yes, I wasn't suggesting it should be done for D1, what I was saying is the 
magical land where Tango and Phobos apps live together in harmony is not 
available yet ;)  Which is part of the reason why several of us Tango devs 
are working on a D2 branch.

-Steve 




Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Jason House
Extrawurst Wrote:

> >> But why is it that since 2.020 i cannot name a package "shared" anymore?
> >>
> >> moudle shared.foo;
> >>
> >> dmd: "Identifier expected following module"
> >>
> >> WTF ?
> > 
> > Because shared is now a keyword.
> > 
> 
> Ok, what is it for ? Where is it documented ? Or is it another reserved 
> keyword like "macro" is ?

There was a long discussion on digitalmars.d about this.  It's definitely 
coming in the short term.  It was on Walter's top 5 a week or so ago... along 
with integrating druntime, ref return values, and implementing immutable.  I 
don't recall the whole list, but he's definitely working on this.

This is part of the change to allow thread local storage and have non-local 
objects marked as shared.  Shared objects would have a number of volatile-like 
properties.  I'm sure I've butchered the whole topic in trying to do a summary 
in a sentence or two, but it should give you the general idea of what it is and 
why the word has become a keyword.


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Walter Bright

Steven Schveighoffer wrote:

one big issue:  druntime only supported with phobos using D2.


That's because the druntime support is a breaking change for Phobos users.


Thanks for the efforts!


You're welcome!


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Walter Bright

Sergey Gromov wrote:

note the 'd' in 'druntime'


Sigh, I seem to have a hard time getting this right!


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Sean Kelly

Sergey Gromov wrote:

Tue, 21 Oct 2008 09:40:28 -0700,
Sean Kelly wrote:

Don wrote:
We also now have two modules called 'bitmanip', which is somewhat ironic 
since we brainstormed for ages trying to come up with a better name for 
it. Modules with duplicate names have caused linking problems in the 
past -- not sure if that applies here.
It applies if the modules from both Phobos and druntime end up in the 
same library on *nix.  Windows doesn't appear to have the same issue. 
But I'd love to hear suggestions for alternative names-- I'm not 
terribly good at naming modules :-p.


Also, any I'd like to see how people feel about having three top-level 
packages in druntime vs. one-- an alternative I'd considered was to put 
everything under core.


I actually was expecting all the runtime stuff to be in core.* and was 
surprised to find std and sys there.


I didn't even create core until just recently--before that, the modules 
in core were global, much like object.  So my thoughts on the druntime 
package layout are still evolving.  I do now think that having a single 
top-level package would probably be best, but figured I'd solicit 
opinions before changing anything.



Sean


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Max Samukha
On Mon, 20 Oct 2008 16:29:36 -0700, Walter Bright
<[EMAIL PROTECTED]> 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.

Please add the compiler versions to bugzilla. 


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Sergey Gromov
Tue, 21 Oct 2008 09:40:28 -0700,
Sean Kelly wrote:
> Don wrote:
> > 
> > We also now have two modules called 'bitmanip', which is somewhat ironic 
> > since we brainstormed for ages trying to come up with a better name for 
> > it. Modules with duplicate names have caused linking problems in the 
> > past -- not sure if that applies here.
> 
> It applies if the modules from both Phobos and druntime end up in the 
> same library on *nix.  Windows doesn't appear to have the same issue. 
> But I'd love to hear suggestions for alternative names-- I'm not 
> terribly good at naming modules :-p.
> 
> Also, any I'd like to see how people feel about having three top-level 
> packages in druntime vs. one-- an alternative I'd considered was to put 
> everything under core.

I actually was expecting all the runtime stuff to be in core.* and was 
surprised to find std and sys there.


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Sergey Gromov
Mon, 20 Oct 2008 19:56:01 -0700,
Walter Bright wrote:
> 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.

Still a problem in dmd.conf:

  [EMAIL PROTECTED]/../src/runtime/import

should be

  [EMAIL PROTECTED]/../src/druntime/import

note the 'd' in 'druntime'


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Sean Kelly

Don wrote:


We also now have two modules called 'bitmanip', which is somewhat ironic 
since we brainstormed for ages trying to come up with a better name for 
it. Modules with duplicate names have caused linking problems in the 
past -- not sure if that applies here.


It applies if the modules from both Phobos and druntime end up in the 
same library on *nix.  Windows doesn't appear to have the same issue. 
But I'd love to hear suggestions for alternative names-- I'm not 
terribly good at naming modules :-p.


Also, any I'd like to see how people feel about having three top-level 
packages in druntime vs. one-- an alternative I'd considered was to put 
everything under core.



Sean


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Moritz Warning
On Tue, 21 Oct 2008 18:40:04 +0300, Max Samukha wrote:

> On Mon, 20 Oct 2008 16:29:36 -0700, Walter Bright
> <[EMAIL PROTECTED]> 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.
> 
> Thank you!

Nice! Thank you.


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Max Samukha
On Mon, 20 Oct 2008 16:29:36 -0700, Walter Bright
<[EMAIL PROTECTED]> 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.

Thank you!


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Steven Schveighoffer
"KennyTM~" wrote
> Bill Baxter wrote:
>> On Tue, Oct 21, 2008 at 8:29 AM, Walter Bright
>> <[EMAIL PROTECTED]> 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.
>>
>> Hooray for progress on mending the Tango/Phobos schism!
>>
>> One question about the D2 release notes.  This one doesn't look quite 
>> right:
>> OLD NEW
>> import std.array; import core.exception;
>>
>> --bb
>
> But http://www.digitalmars.com/d/2.0/phobos/std_array.html got 404'ed, and 
> std/array.d is really removed.

The comment for the commit is

"Removed std.array. To trap an array bounds error, import 'exception' from 
druntime and catch ArrayBoundsException."

It says nothing about the other functions that were in std.array.  Are those 
replaced by functions elsewhere?

It might have been an oversight by Sean.

-Steve 




MiniD 2 Plans

2008-10-21 Thread Jarrett Billingsley
MiniD 2 has been under development for over a year now, and I think it's 
finally almost ready!  It ended up taking a lot longer than I expected, 
mostly because I got the wild idea to reimplement the whole thing back in 
May.  Until now, it has been in alpha, but I think I'm ready to call it 
_beta_.  Wooo.

Currently there are a few reasons why I'm calling it beta.  They are:

- The binding library is not complete.  It wraps free functions, and that's 
about it.

- There are a few code generation bugs in the compiler (well not "bugs" but 
"fairly big changes") that need to happen.

- There are some additions to the standard library that I feel are 
important.

- The new implementation has not been tested to any appreciable degree.

- I'd really, really like to get shared libraries in for the release.  I 
think DDL is mature enough, I just have to sit down with it.  One issue 
though is Linux, since DDL doesn't yet (?) load ELF, so I don't know if it's 
actually possible right now.

- I want to decide whether the 'int' type should be platform-dependent or 
always 64-bit.

Once those things are sorted out, I think it'll be ready to go gold.  When 
will this be?  I hate making promises about this sort of thing because 
things always seem to come up and eat my time.  The first month and a half 
of school was absolute hell; the calm now only makes me dread how busy it'll 
probably be again in November.  But if I stick to it I think I can get MiniD 
2 to release quality in few weeks or so.  I know, development doesn't move 
nearly as quickly as when I'm out of school.

Once 2.0 is released, though, I plan on making many more maintenance 
releases to MD2 than I did with MD1.  Standard library additions, 
non-breaking language additions, bugfixes (obviously), native API additions 
etc.  The binding library in particular may be very basic upon release and 
would be improved afterwards.

What does this mean for 1.0?  I think it's time to put the thing to rest. 
It's outdated and the implementation is subpar.  MiniD 2 is superior to it 
in almost every way.  As of now, MiniD 1 is no longer being supported.  It 
will be moved into a branch of the SVN repository and MiniD 2 will become 
trunk.

I think that's everything that needs to be said for now.  And as always, the 
main page is at http://www.dsource.org/projects/minid, and the forums are at 
http://www.dsource.org/forums/viewforum.php?f=94. 




Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Andrei Alexandrescu

KennyTM~ wrote:

Bill Baxter wrote:

On Tue, Oct 21, 2008 at 8:29 AM, Walter Bright
<[EMAIL PROTECTED]> 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.


Hooray for progress on mending the Tango/Phobos schism!

One question about the D2 release notes.  This one doesn't look quite 
right:

OLD NEW
import std.array; import core.exception;

--bb


But http://www.digitalmars.com/d/2.0/phobos/std_array.html got 404'ed, 
and std/array.d is really removed.


That's odd. I have a bunch of (uncommitted) stuff in my array.d. Of 
course, if there's any problem with the module name I can gladly change it.


Andrei


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread KennyTM~

Bill Baxter wrote:

On Tue, Oct 21, 2008 at 8:29 AM, Walter Bright
<[EMAIL PROTECTED]> 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.


Hooray for progress on mending the Tango/Phobos schism!

One question about the D2 release notes.  This one doesn't look quite right:
OLD NEW
import std.array;   import core.exception;

--bb


But http://www.digitalmars.com/d/2.0/phobos/std_array.html got 404'ed, 
and std/array.d is really removed.


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Steven Schveighoffer

"Bill Baxter" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> On Tue, Oct 21, 2008 at 8:29 AM, Walter Bright
> <[EMAIL PROTECTED]> 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?

I think it should be a bug.  I believe Andrei fully intended to use it this 
way.

-Steve 




Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Steven Schveighoffer
"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.

one big issue:  druntime only supported with phobos using D2. but Tango only 
supports D1 ;)

But some of us are working to get Tango to compile on D2 (it does currently, 
but Tango is not fully constified yet).

I think I'll wait until some of the dust settles before trying to build 
Tango with D2 druntime.

Thanks for the efforts!

-Steve 




Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread KennyTM~

Extrawurst wrote:

Lars Ivar Igesund wrote:

Extrawurst 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.


Sounds great !

But why is it that since 2.020 i cannot name a package "shared" anymore?

moudle shared.foo;

dmd: "Identifier expected following module"

WTF ?


Because shared is now a keyword.



Ok, what is it for ? Where is it documented ? Or is it another reserved 
keyword like "macro" is ?


shared & unshared memories for parallel computing IIRC.


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Don

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.


Thanks Walter. This is a great day!

One rough patch:
Phobos docs don't include the new 'core' modules, except core.memory 
which appears where std.gc used to be.


We also now have two modules called 'bitmanip', which is somewhat ironic 
since we brainstormed for ages trying to come up with a better name for 
it. Modules with duplicate names have caused linking problems in the 
past -- not sure if that applies here.


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Extrawurst

Lars Ivar Igesund wrote:

Extrawurst 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.


Sounds great !

But why is it that since 2.020 i cannot name a package "shared" anymore?

moudle shared.foo;

dmd: "Identifier expected following module"

WTF ?


Because shared is now a keyword.



Ok, what is it for ? Where is it documented ? Or is it another reserved 
keyword like "macro" is ?


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Yigal Chripun
Lionello Lunesu wrote:
> 
> "Yigal Chripun" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> 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.
> 
> There are good reasons for keeping the IO separate. Phobos is based on
> the C runtime, meaning you can interleave D IO with C IO and everything
> will behave nicely. Tango's IO layer is written from scratch, using OS
> calls. You shouldn't mix Tango IO with IO in a linked-in C library.
> 
> L.

IMHO, Tango's IO is a better default for D exactly because it's written
from scratch specifically for D. the benefits are better performance and
no dependence on the C stdlib.
interleaving D IO with C IO is also possible with tango, with the
relevant stdc modules, but that should IMHO be an opt-in feature.


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Lars Ivar Igesund
Extrawurst 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.
> 
> 
> Sounds great !
> 
> But why is it that since 2.020 i cannot name a package "shared" anymore?
> 
> moudle shared.foo;
> 
> dmd: "Identifier expected following module"
> 
> WTF ?

Because shared is now a keyword.

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource, #d.tango & #D: larsivi
Dancing the Tango


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Extrawurst

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.



Sounds great !

But why is it that since 2.020 i cannot name a package "shared" anymore?

moudle shared.foo;

dmd: "Identifier expected following module"

WTF ?


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Robert Fraser

Sean Kelly wrote:

Bill Baxter wrote:

On Tue, Oct 21, 2008 at 10:59 AM, dsimcha <[EMAIL PROTECTED]> 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


Thanks to you & Walter for all your hard work.


Re: DMD 1.036 and 2.020 releases

2008-10-21 Thread Walter Bright

BCS wrote:

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


No, as there are many changes that break existing code.