Jump to page: 1 218  
Page
Thread overview
Short list with things to finish for D2
Nov 18, 2009
Ellery Newcomer
Nov 19, 2009
Ellery Newcomer
Nov 18, 2009
bearophile
Nov 19, 2009
Travis Boucher
Nov 19, 2009
grauzone
Nov 19, 2009
grauzone
Nov 19, 2009
grauzone
Nov 19, 2009
Travis Boucher
Nov 19, 2009
Leandro Lucarella
Nov 19, 2009
Robert Jacques
Nov 20, 2009
Bill Baxter
Nov 19, 2009
Rainer Deyke
Nov 19, 2009
Travis Boucher
Nov 20, 2009
Bill Baxter
Nov 20, 2009
Pelle Månsson
Nov 19, 2009
Leandro Lucarella
Nov 19, 2009
Bill Baxter
Nov 20, 2009
Leandro Lucarella
Nov 20, 2009
Bill Baxter
Nov 19, 2009
Bill Baxter
Dec 15, 2009
lws
Dec 15, 2009
Jesse Phillips
Dec 16, 2009
KennyTM~
Dec 16, 2009
Jesse Phillips
Dec 18, 2009
Joel C. Salomon
Dec 16, 2009
Robert Clipsham
Nov 19, 2009
Chad J
Nov 19, 2009
grauzone
Nov 19, 2009
grauzone
Nov 20, 2009
Bill Baxter
Nov 20, 2009
Pelle Månsson
Dec 15, 2009
lws
Nov 19, 2009
retard
Nov 19, 2009
Simen kjaeraas
Nov 19, 2009
retard
Nov 19, 2009
KennyTM~
Nov 19, 2009
Gzp
Nov 19, 2009
gzp
Nov 19, 2009
Jesse Phillips
Nov 19, 2009
Jesse Phillips
Nov 19, 2009
dsimcha
Nov 19, 2009
dsimcha
Nov 19, 2009
Kyle
Nov 19, 2009
Bill Baxter
Nov 20, 2009
Lutger
Nov 19, 2009
Kyle
Nov 19, 2009
dsimcha
Nov 19, 2009
dsimcha
Nov 19, 2009
dsimcha
Nov 20, 2009
Pelle Månsson
Nov 19, 2009
Walter Bright
Nov 21, 2009
Walter Bright
Nov 19, 2009
grauzone
Nov 19, 2009
Chad J
Nov 19, 2009
dsimcha
Nov 21, 2009
Lutger
Nov 19, 2009
grauzone
Nov 19, 2009
grauzone
Nov 19, 2009
Walter Bright
Nov 19, 2009
Justin Johansson
Nov 19, 2009
Justin Johansson
Re: D2 Short list -- opSlice
Nov 19, 2009
Don
Nov 19, 2009
Denis Koroskin
Nov 19, 2009
Don
Nov 19, 2009
bearophile
Nov 19, 2009
Don
Nov 20, 2009
Bill Baxter
Nov 19, 2009
Chad J
Nov 19, 2009
dsimcha
Nov 19, 2009
dsimcha
Nov 19, 2009
dsimcha
Nov 19, 2009
dsimcha
Nov 19, 2009
dsimcha
Nov 19, 2009
dsimcha
opIndexLvalue (was: Short list with things to finish for D2)
Nov 19, 2009
dsimcha
Nov 19, 2009
dsimcha
Nov 19, 2009
Leandro Lucarella
Nov 19, 2009
aarti_pl
Nov 19, 2009
aarti_pl
Nov 19, 2009
aarti_pl
Nov 19, 2009
Justin Johansson
Nov 19, 2009
Justin Johansson
Nov 20, 2009
Justin Johansson
Nov 19, 2009
KennyTM~
Nov 19, 2009
bearophile
Nov 19, 2009
aarti_pl
Nov 19, 2009
bearophile
Nov 19, 2009
aarti_pl
Nov 20, 2009
Don
Nov 20, 2009
Simen kjaeraas
Nov 20, 2009
Don
Nov 20, 2009
bearophile
Nov 20, 2009
Stewart Gordon
Nov 20, 2009
Justin Johansson
Nov 21, 2009
Don
Nov 21, 2009
Denis Koroskin
Nov 21, 2009
Stewart Gordon
Nov 21, 2009
Justin Johansson
Nov 21, 2009
Travis Boucher
Nov 24, 2009
Gerrit Wichert
Nov 24, 2009
Denis Koroskin
Nov 24, 2009
Travis Boucher
Nov 25, 2009
Denis Koroskin
Nov 25, 2009
Don
Nov 25, 2009
Ellery Newcomer
Nov 25, 2009
Denis Koroskin
Nov 25, 2009
Pelle Månsson
Nov 28, 2009
Stewart Gordon
Nov 28, 2009
bearophile
Dec 08, 2009
Stewart Gordon
Dec 08, 2009
Ellery Newcomer
Dec 08, 2009
Simen kjaeraas
Dec 11, 2009
Stewart Gordon
Dec 11, 2009
bearophile
Dec 08, 2009
bearophile
Nov 25, 2009
Denis Koroskin
Nov 25, 2009
Ellery Newcomer
Nov 19, 2009
Walter Bright
Nov 19, 2009
KennyTM~
Nov 20, 2009
Bill Baxter
Nov 19, 2009
Adam D. Ruppe
Nov 20, 2009
Walter Bright
Nov 20, 2009
Adam D. Ruppe
Nov 19, 2009
Adam D. Ruppe
Nov 19, 2009
retard
Nov 19, 2009
Bill Baxter
Nov 19, 2009
aarti_pl
Nov 20, 2009
Michel Fortin
Nov 20, 2009
Don
Nov 20, 2009
Walter Bright
Nov 21, 2009
aarti_pl
Nov 22, 2009
Phil Deets
Nov 20, 2009
Travis Boucher
Nov 20, 2009
Pelle Månsson
Nov 20, 2009
Stewart Gordon
November 18, 2009
We're entering the finale of D2 and I want to keep a short list of things that must be done and integrated in the release. It is clearly understood by all of us that there are many things that could and probably should be done.

1. Currently Walter and Don are diligently fixing the problems marked on the current manuscript.

2. User-defined operators must be revamped. Fortunately Don already put in an important piece of functionality (opDollar). What we're looking at is a two-pronged attack motivated by Don's proposal:

http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP7

The two prongs are:

* Encode operators by compile-time strings. For example, instead of the plethora of opAdd, opMul, ..., we'd have this:

T opBinary(string op)(T rhs) { ... }

The string is "+", "*", etc. We need to design what happens with read-modify-write operators like "+=" (should they be dispatch to a different function? etc.) and also what happens with index-and-modify operators like "[]=", "[]+=" etc. Should we go with proxies? Absorb them in opBinary? Define another dedicated method? etc.

* Loop fusion that generalizes array-wise operations. This idea of Walter is, I think, very good because it generalizes and democratizes "magic". The idea is that, if you do

a = b + c;

and b + c does not make sense but b and c are ranges for which a.front = b.front + c.front does make sense, to automatically add the iteration paraphernalia.

3. It was mentioned in this group that if getopt() does not work in SafeD, then SafeD may as well pack and go home. I agree. We need to make it work. Three ideas discussed with Walter:

* Allow taking addresses of locals, but in that case switch allocation from stack to heap, just like with delegates. If we only do that in SafeD, behavior will be different than with regular D. In any case, it's an inefficient proposition, particularly for getopt() which actually does not need to escape the addresses - just fills them up.

* Allow @trusted (and maybe even @safe) functions to receive addresses of locals. Statically check that they never escape an address of a parameter. I think this is very interesting because it enlarges the common ground of D and SafeD.

* Figure out a way to reconcile "ref" with variadics. This is the actual reason why getopt chose to traffic in addresses, and fixing it is the logical choice and my personal favorite.

4. Allow private members inside a template using the eponymous trick:

template wyda(int x) {
   private enum geeba = x / 2;
   alias geeba wyda;
}

The names inside an eponymous template are only accessible to the current instantiation. For example, wyda!5 cannot access wyda!(4).geeba, only its own geeba. That we we elegantly avoid the issue "where is this symbol looked up?"

5. Chain exceptions instead of having a recurrent exception terminate the program. I'll dedicate a separate post to this.

6. There must be many things I forgot to mention, or that cause grief to many of us. Please add to/comment on this list.



Andrei
November 18, 2009
What about the business with signed/unsigned integer comparisons?

November 18, 2009
Andrei Alexandrescu:

> * Encode operators by compile-time strings. For example, instead of the plethora of opAdd, opMul, ..., we'd have this:
> 
> T opBinary(string op)(T rhs) { ... }
> 
> The string is "+", "*", etc.

Can you show an example of defining an operator, like a minus, with that?

In my set data structure I'd like to define "<=" among two sets as "is subset". Can that design allow me to overload just <= and >= ? (opCmp is not enough here).

Bye,
bearophile
November 18, 2009
Ellery Newcomer wrote:
> What about the business with signed/unsigned integer comparisons?

I think that's somewhere in the TDPL non-working snippets, but I added your message to my worklist to make sure.

Andrei
November 18, 2009
bearophile wrote:
> Andrei Alexandrescu:
> 
>> * Encode operators by compile-time strings. For example, instead of
>> the plethora of opAdd, opMul, ..., we'd have this:
>> 
>> T opBinary(string op)(T rhs) { ... }
>> 
>> The string is "+", "*", etc.
> 
> Can you show an example of defining an operator, like a minus, with
> that?

struct BigInt {
   BigInt opBinary(string op)(BigInt rhs) if (op == "-") {
      ...
   }
}

> In my set data structure I'd like to define "<=" among two sets as
> "is subset". Can that design allow me to overload just <= and >= ?
> (opCmp is not enough here).

It could if we decide to deprecate opCmp. I happen to like it; if you define a <= b for inclusion, people will think it's natural to also allow a < b for strict inclusion. But that's up for debate.

I'm not sure what the best way is. Classes have opEquals and opCmp so the question is - do we want structs to be somewhat compatible with classes or not? My personal favorite choice would be to go full bore with compile-time strings.


Andrei
November 19, 2009
bearophile wrote:
> Andrei Alexandrescu:
> 
>> * Encode operators by compile-time strings. For example, instead of the plethora of opAdd, opMul, ..., we'd have this:
>>
>> T opBinary(string op)(T rhs) { ... }
>>
>> The string is "+", "*", etc.
> 
> Can you show an example of defining an operator, like a minus, with that?
>

T opBinary(string op)(T rhs) {
	static if (op == "-") return data - rhs.data;
	static if (op == "+") return data + rhs.data;

	// ... maybe this would work too ...
	mixin("return data " ~ op ~ "rhs.data;");
}

I love this syntax over the tons of different operation functions. Makes it so much nicer, especially when supporting a bunch of different paramater types (vectors are a good example of this).

T opBinary(string op)(T rhs)
T opBinary(string op)(float[3] rhs)
T opBinary(string op)(float rx, ry, rz)
....

> In my set data structure I'd like to define "<=" among two sets as "is subset". Can that design allow me to overload just <= and >= ? (opCmp is not enough here).
> 
> Bye,
> bearophile
November 19, 2009
Andrei Alexandrescu Wrote:

> 6. There must be many things I forgot to mention, or that cause grief to many of us. Please add to/comment on this list.
> 
> Andrei

Well, there is this page on Wiki4D

http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel#FutureDirections

which has what the community is trying to track for changes. It also has some things that haven't got officially declined committed to.
November 19, 2009
Andrei Alexandrescu wrote:
> Ellery Newcomer wrote:
>> What about the business with signed/unsigned integer comparisons?
> 
> I think that's somewhere in the TDPL non-working snippets, but I added your message to my worklist to make sure.
> 
> Andrei

Cool, thanks
November 19, 2009
== Quote from Andrei Alexandrescu (SeeWebsiteForEmail@erdani.org)'s
article
> 6. There must be many things I forgot to mention, or that cause
grief to
> many of us. Please add to/comment on this list.
> Andrei

I assume we're mostly talking about spec stuff, not implementation stuff.  Nonetheless, to the extent that the GC API is considered part of the language spec, I think we need to fix that.

1.  My precise heap scanning patch has some ripple effects into the GC API and could affect what is done with the `new` operator. Therefore, we might not want to postpone this until after D2 is final.

2.  We should probably tighten up the spec to make sure that a moving, fully precise, etc. GC can be implemented at some point in the future without modifying the spec after D2 is declared gold.
November 19, 2009
Travis Boucher wrote:
> bearophile wrote:
>> Andrei Alexandrescu:
>>
>>> * Encode operators by compile-time strings. For example, instead of the plethora of opAdd, opMul, ..., we'd have this:
>>>
>>> T opBinary(string op)(T rhs) { ... }
>>>
>>> The string is "+", "*", etc.
>>
>> Can you show an example of defining an operator, like a minus, with that?
>>
> 
> T opBinary(string op)(T rhs) {
>     static if (op == "-") return data - rhs.data;
>     static if (op == "+") return data + rhs.data;
> 
>     // ... maybe this would work too ...
>     mixin("return data " ~ op ~ "rhs.data;");
> }
> 
> I love this syntax over the tons of different operation functions. Makes it so much nicer, especially when supporting a bunch of different paramater types (vectors are a good example of this).

Indeed, the advantage of this is that you can use string mixins to implement many operations at once, instead of laboriously defining many functions.


Andrei
« First   ‹ Prev
1 2 3 4 5 6 7 8 9 10 11