May 21, 2009
Bill Baxter Wrote:

> On Wed, May 20, 2009 at 4:03 PM, dsimcha <dsimcha@yahoo.com> wrote:
> > == Quote from Jason House (jason.james.house@gmail.com)'s article
> >> IMHO, D should have a type with low size and function call overhead > like a
> > struct as well as reference semantics like a class.
> >
> > What's wrong with a pointer to a heap-allocated struct?  I sometimes need what you describe, too, and I've never seen a case where this doesn't do the job.
> 
> And you can alias Foo_* Foo, so that it doesn't even look like you're passing around a pointer.  :-)
> 
> 
> --bb

Interesting thought. Wouldn't calls to new still require use of Foo__?
May 21, 2009
== Quote from Jason House (jason.james.house@gmail.com)'s article
> dsimcha Wrote:
> > == Quote from Jason House (jason.james.house@gmail.com)'s article
> > > IMHO, D should have a type with low size and function call overhead > like a
> > struct as well as reference semantics like a class.
> >
> > What's wrong with a pointer to a heap-allocated struct?  I sometimes need what you describe, too, and I've never seen a case where this doesn't do the job.
> That does the job, but it looks ugly ;) I think it's also not allowed in safe d.

Well then that argues more for a generic reference type than for a whole new aggregate type different from both classes and structs.  IIRC, Ref was supposed to be coming to std.typecons soon.  Also, if you don't care about the few bytes of overhead for vtbl and monitor, there's always final classes.  The bottom line is that I can see where what you're asking for could be useful, but the cases where neither a final class nor a pointer to a heap-allocated struct cut it are way too few and far between to justify a whole new aggregate type.
May 21, 2009
On Wed, May 20, 2009 at 5:11 PM, Jason House <jason.james.house@gmail.com> wrote:
> Bill Baxter Wrote:
>
>> On Wed, May 20, 2009 at 4:03 PM, dsimcha <dsimcha@yahoo.com> wrote:
>> > == Quote from Jason House (jason.james.house@gmail.com)'s article
>> >> IMHO, D should have a type with low size and function call overhead > like a
>> > struct as well as reference semantics like a class.
>> >
>> > What's wrong with a pointer to a heap-allocated struct?  I sometimes need what you describe, too, and I've never seen a case where this doesn't do the job.
>>
>> And you can alias Foo_* Foo, so that it doesn't even look like you're passing around a pointer.  :-)
>>
>>
>> --bb
>
> Interesting thought. Wouldn't calls to new still require use of Foo__?

Yes.  Also if you're creating 'em on the stack.

--bb
May 21, 2009
dsimcha Wrote:

> == Quote from Jason House (jason.james.house@gmail.com)'s article
> > dsimcha Wrote:
> > > == Quote from Jason House (jason.james.house@gmail.com)'s article
> > > > IMHO, D should have a type with low size and function call overhead > like a
> > > struct as well as reference semantics like a class.
> > >
> > > What's wrong with a pointer to a heap-allocated struct?  I sometimes need what you describe, too, and I've never seen a case where this doesn't do the job.
> > That does the job, but it looks ugly ;) I think it's also not allowed in safe d.
> 
> Well then that argues more for a generic reference type than for a whole new aggregate type different from both classes and structs.  IIRC, Ref was supposed to be coming to std.typecons soon.  Also, if you don't care about the few bytes of overhead for vtbl and monitor, there's always final classes.  The bottom line is that I can see where what you're asking for could be useful, but the cases where neither a final class nor a pointer to a heap-allocated struct cut it are way too few and far between to justify a whole new aggregate type.

Maybe I'm a bit cynical, but I never expect my posts to cause a change in D, or for my bug reports to even get a comment. My long posts with well thought out ideas either get no response or a reaction like Andrei's recent switch range thread. I no longer try to work out the details and merely hope my efforts plant a seed for thought. It's far less frustrating that way.

As far as a struct-like reference type, my only goal was to point out a gap that is effecting users. Your suggestion about a library implementation sounds reasonable. Personally, I use final classes and don't care about the extra overhead. I used to not worry about making classes final, especially since the D "spec" says a compiler can be smart enough to detect when they're appropriate. I can't help but wonder if struct pointers are in my future as I continue to push for performance. What would irk me most about doing that is if such a decision causes a ripple of changes throughout my code base.
May 22, 2009
Jason House wrote:
> Maybe I'm a bit cynical, but I never expect my posts to cause a
> change in D, or for my bug reports to even get a comment.

For that, I must confess you've got a more mature attitude than most participants.

> My long posts with well thought out ideas either get no response or a
> reaction like Andrei's recent switch range thread.

(Not familiar with the particular post/response, but believe me, I've been there, and so have scores of other regulars here.)

For such situations, I've decided to Presume: either the post was ill positioned (maybe down in a thread, maybe posted at the same time some of the Celebrities Dropped a Bomb in the Pond), or then simply at a wrong moment. (Discourcially, temporally, psychologically, or socially.)

> I no longer try to work out the details and merely hope my efforts
> plant a seed for thought. It's far less frustrating that way.

Sadly, ( /thoroughly/ sadly), this is like a party group. If you really want exposure, your first post should be no longer than 3 lines long. Then, on the 4th level of the thread, you might piecemeal start exposing the details of what you really wanted to say, in the first post. Hell, our current celebrities do that, and the success, you undoubtedly see.

> What would irk me most about doing that is if such a
> decision causes a ripple of changes throughout my code base.

Life's  not fair, especially in the fast lane, and definitely not with D2.0.

OTOH, with D1.x, if "things change" there /will/ be a riot. (Actually, there _should_ be War!)
May 22, 2009
Georg Wrede Wrote:

> Jason House wrote:
> > I no longer try to work out the details and merely hope my efforts plant a seed for thought. It's far less frustrating that way.
> 
> Sadly, ( /thoroughly/ sadly), this is like a party group. If you really want exposure, your first post should be no longer than 3 lines long. Then, on the 4th level of the thread, you might piecemeal start exposing the details of what you really wanted to say, in the first post. Hell, our current celebrities do that, and the success, you undoubtedly see.

Who do you consider to be a celebrity that doesn't have commit access to Phobos? I take people like Walter, Andrei, and Sean because they usually mean pending changes to the language or libraries.

I won't say our celebrities don't deserve their status. All I'm saying is that celebrity status gives a lot of leeway for how to share info.
May 22, 2009
Jason House wrote:
> Georg Wrede Wrote:
>> Jason House wrote:  
>>> I no longer try to work out the details and merely hope my efforts
>>> plant a seed for thought. It's far less frustrating that way.
>>
>> Sadly, ( /thoroughly/ sadly), this is like a party group. If you really want exposure, your first post should be no longer than 3 lines long. Then, on the 4th level of the thread, you might piecemeal start exposing the details of what you really wanted to say, in the first post. Hell, our current celebrities do that, and the success, you undoubtedly see.
> 
> Who do you consider to be a celebrity that doesn't have commit access
> to Phobos? I take people like Walter, Andrei, and Sean because they
> usually mean pending changes to the language or libraries.

Well, it's not that simple. Andrei was a celebrity from day one, although (I think) he got write access only later. Same thing with Don. Matthew Wilson never had write access, and he enjoyed celebrity status.

For all I know, there may be several people with write access who don't even appear on this newsgroup. (I have no idea, but I suspect.)

And then, of course, everybody's list of celebrities is different.

> I won't say our celebrities don't deserve their status. All I'm
> saying is that celebrity status gives a lot of leeway for how to
> share info.

Sure.
1 2 3 4
Next ›   Last »