www.digitalmars.com         C & C++   DMDScript  

D - D Interfaces: An Expose

reply "Kris" <someidiot earthlink.dot.dot.dot.net> writes:
I believe it's time to do something positive about the state of Interfaces
as implemented in D. To this end, I've written a small document detailing
what I feel are the issues at hand. It's attached as an MS Word document,
and I apologize to those who can't access it because of that.

As noted in the document, it is absolutely not my intent to give Walter a
hard time, or to discredit D as a viable and useful language. My goal is
simple: resolve some of the real issues surrounding D Interfaces before it
goes mainstream with v1.0, such that it will be seen as a serious contender
by the commercial-development-sector and avoid being categorized as some
pet-project.

Some will say that I'm being unfair to Walter; that he's just one guy
working on this thing. While that may be a reasonable argument, the solution
would be to delay the v1.0 release.

Take a read, and reach your own conclusions.

With respect,

- Kris
Apr 06 2004
next sibling parent reply C <dont respond.com> writes:
Very good points, but fails to address how to handle COM capability, whi=
ch =

I think is important to Walter, and many others.  I think commercial =

vendors will be as quick to dismiss D without COM ability as without =

adequate 'interface' support.  I like lary's idea of having the interfac=
es =

as they are now re-named for COM interfaces, and then implementing the =

interfaces as you envision them.
I don't see how we could unify them without losing something on either =

side .

Ideas ?

C


On Tue, 6 Apr 2004 12:14:40 -0800, Kris =

<someidiot earthlink.dot.dot.dot.net> wrote:

 I believe it's time to do something positive about the state of =

 Interfaces
 as implemented in D. To this end, I've written a small document detail=

 what I feel are the issues at hand. It's attached as an MS Word docume=

 and I apologize to those who can't access it because of that.

 As noted in the document, it is absolutely not my intent to give Walte=

 hard time, or to discredit D as a viable and useful language. My goal =

 simple: resolve some of the real issues surrounding D Interfaces befor=

 it
 goes mainstream with v1.0, such that it will be seen as a serious =

 contender
 by the commercial-development-sector and avoid being categorized as so=

 pet-project.

 Some will say that I'm being unfair to Walter; that he's just one guy
 working on this thing. While that may be a reasonable argument, the =

 solution
 would be to delay the v1.0 release.

 Take a read, and reach your own conclusions.

 With respect,

 - Kris

-- = D Newsgroup.
Apr 06 2004
parent reply "Derek Parnell" <not available.com> writes:
"C" <dont respond.com> wrote in message news:opr5148ozvehmtou localhost...
Very good points, but fails to address how to handle COM capability, which
I think is important to Walter, and many others.  I think commercial
vendors will be as quick to dismiss D without COM ability as without
adequate 'interface' support.  I like lary's idea of having the interfaces
as they are now re-named for COM interfaces, and then implementing the
interfaces as you envision them.
I don't see how we could unify them without losing something on either
side .

Ideas ?

Even though I haven't really understood yet what is actually meant by the technical term 'interface', I can see that there is at least two flavours being discussed here. If both are important and useful, then a simple qualifying keyword should be all that's needed to let the D compiler know what the code author is referring to. Something like ... ms_com interface ABC{ . . . } and native interface DEF{ . . . } Slightly off-topic, how does Microsoft's .NET vision change the future usage of COM/ActiveX components and D? Does this also imply that D needs to support a .NET type of interface? -- Derek
Apr 06 2004
parent reply Patrick Down <Patrick_member pathlink.com> writes:
In article <c4v7k8$8p0$1 digitaldaemon.com>, Derek Parnell says...

Even though I haven't really understood yet what is actually meant by the
technical term 'interface', I can see that there is at least two flavours
being discussed here. If both are important and useful, then a simple
qualifying keyword should be all that's needed to let the D compiler know
what the code author is referring to. Something like ...

   ms_com interface ABC{ . . . }

and

   native interface DEF{ . . . }

I would suggest the existing pragma attribute would be good considering that COM interfaces are a OS dependant feature. pragma(com_interface) interface ABC { } http://www.digitalmars.com/d/pragma.html
Apr 06 2004
next sibling parent Ilya Minkov <minkov cs.tum.edu> writes:
Patrick Down schrieb:

 I would suggest the existing pragma attribute would be good considering 
 that COM interfaces are a OS dependant feature.
 
 pragma(com_interface) interface ABC { }
 
 http://www.digitalmars.com/d/pragma.html

Another idea which does not requiere to change syntax: COM interface is built upon a "pure interface" by library means, just as XPCOM interface, and other interfaces which conflict with "D object interface". "D object interface", ie an interface supporting backcasting to D object, can be built from a pure interface by compiler means. I propose that whenever an interface ihnerits from "ObjectInterface", which may be a half-bogus interface reserving VTable space for requiered methods, these methods would be implemented for each class descendant of it automatically. A syntax may always be bound for all interfaces to ObjectInterface method calls (ie assume they are there), which would allow to implement similar behaviours in library, and would correctly give errors when you try such a syntax (ie backcasting) on an interface which does not support it. -eye
Apr 06 2004
prev sibling parent reply C <dont respond.com> writes:
Hmm, I think COM is ( supposedly ) OS independent though right ?  Thats =

the claim, though I rarely see it in practice on non MS-OS's.  I still =

think the pragma is smooth looking , and since we maybe shouldn't but =

technology specific items in the language itself it probably still fits =

under pragma.

It would also be cool if we could get pragma(link,mylib.lib) , I always =

liked that C++ feature :).


C

On Tue, 6 Apr 2004 22:17:31 +0000 (UTC), Patrick Down =

<Patrick_member pathlink.com> wrote:

 In article <c4v7k8$8p0$1 digitaldaemon.com>, Derek Parnell says...

 Even though I haven't really understood yet what is actually meant by=


 the
 technical term 'interface', I can see that there is at least two =


 flavours
 being discussed here. If both are important and useful, then a simple=


 qualifying keyword should be all that's needed to let the D compiler =


 know
 what the code author is referring to. Something like ...

   ms_com interface ABC{ . . . }

 and

   native interface DEF{ . . . }

I would suggest the existing pragma attribute would be good considerin=

 that COM interfaces are a OS dependant feature.

 pragma(com_interface) interface ABC { }

 http://www.digitalmars.com/d/pragma.html

-- = D Newsgroup.
Apr 07 2004
next sibling parent reply C <dont respond.com> writes:
Anyone seen Matthew lately , haven't seen any recent posts ?

C


On Wed, 07 Apr 2004 08:29:30 -0700, C <dont respond.com> wrote:

 Hmm, I think COM is ( supposedly ) OS independent though right ?  That=

 the claim, though I rarely see it in practice on non MS-OS's.  I still=

 think the pragma is smooth looking , and since we maybe shouldn't but =

 technology specific items in the language itself it probably still fit=

 under pragma.

 It would also be cool if we could get pragma(link,mylib.lib) , I alway=

 liked that C++ feature :).


 C

 On Tue, 6 Apr 2004 22:17:31 +0000 (UTC), Patrick Down =

 <Patrick_member pathlink.com> wrote:

 In article <c4v7k8$8p0$1 digitaldaemon.com>, Derek Parnell says...

 Even though I haven't really understood yet what is actually meant b=



 the
 technical term 'interface', I can see that there is at least two =



 flavours
 being discussed here. If both are important and useful, then a simpl=



 qualifying keyword should be all that's needed to let the D compiler=



 know
 what the code author is referring to. Something like ...

   ms_com interface ABC{ . . . }

 and

   native interface DEF{ . . . }

I would suggest the existing pragma attribute would be good consideri=


 that COM interfaces are a OS dependant feature.

 pragma(com_interface) interface ABC { }

 http://www.digitalmars.com/d/pragma.html


-- = D Newsgroup.
Apr 07 2004
parent reply John Reimer <jjreimer telus.net> writes:
C wrote:
 Anyone seen Matthew lately , haven't seen any recent posts ?
 
 C
 

Yeah, I'm hoping the fellow didn't get a second bout of a nasty flu. I got 3 consecutive bugs in a row this last month. I guess my immune system was so knocked down that I wasn't able to fend off the next ones.
Apr 07 2004
parent reply Dave Sieber <dsieber spamnot.sbcglobal.net> writes:
John Reimer <jjreimer telus.net> wrote:

 Yeah, I'm hoping the fellow didn't get a second bout of a nasty flu.  I 
 got 3 consecutive bugs in a row this last month.  I guess my immune 
 system was so knocked down that I wasn't able to fend off the next ones.

Hey, that's not so bad -- I usually get 3 or 4 bugs every DAY :-) -- dave
Apr 07 2004
parent John Reimer <jjreimer telus.net> writes:
Yeah, I'm hoping the fellow didn't get a second bout of a nasty flu.  I 
got 3 consecutive bugs in a row this last month.  I guess my immune 
system was so knocked down that I wasn't able to fend off the next ones.

Hey, that's not so bad -- I usually get 3 or 4 bugs every DAY :-)

Hmm.... My half-witted brain tells me we aren't talking about the same kinda bugs. :-)
Apr 08 2004
prev sibling parent Golan <Golan_member pathlink.com> writes:
How about putting COM support in as a library along the lines of the Java2COM
bi-directional bridge
http://www.nevaobject.com/_docs/_java2com/java2com.htm

Golan

In article <opr53engglehmtou localhost>, C says...
Hmm, I think COM is ( supposedly ) OS independent though right ?  Thats =

the claim, though I rarely see it in practice on non MS-OS's.  I still =

think the pragma is smooth looking , and since we maybe shouldn't but =

technology specific items in the language itself it probably still fits =

under pragma.

It would also be cool if we could get pragma(link,mylib.lib) , I always =

liked that C++ feature :).


C

On Tue, 6 Apr 2004 22:17:31 +0000 (UTC), Patrick Down =

<Patrick_member pathlink.com> wrote:

 In article <c4v7k8$8p0$1 digitaldaemon.com>, Derek Parnell says...

 Even though I haven't really understood yet what is actually meant by=


 the
 technical term 'interface', I can see that there is at least two =


 flavours
 being discussed here. If both are important and useful, then a simple=


 qualifying keyword should be all that's needed to let the D compiler =


 know
 what the code author is referring to. Something like ...

   ms_com interface ABC{ . . . }

 and

   native interface DEF{ . . . }

I would suggest the existing pragma attribute would be good considerin=

 that COM interfaces are a OS dependant feature.

 pragma(com_interface) interface ABC { }

 http://www.digitalmars.com/d/pragma.html

-- = D Newsgroup.

Apr 08 2004
prev sibling next sibling parent reply kinghajj <kinghajj_member pathlink.com> writes:
In article <c4v2lm$1cg$1 digitaldaemon.com>, Kris says...
I believe it's time to do something positive about the state of Interfaces
as implemented in D. To this end, I've written a small document detailing
what I feel are the issues at hand. It's attached as an MS Word document,
and I apologize to those who can't access it because of that.

As noted in the document, it is absolutely not my intent to give Walter a
hard time, or to discredit D as a viable and useful language. My goal is
simple: resolve some of the real issues surrounding D Interfaces before it
goes mainstream with v1.0, such that it will be seen as a serious contender
by the commercial-development-sector and avoid being categorized as some
pet-project.

Some will say that I'm being unfair to Walter; that he's just one guy
working on this thing. While that may be a reasonable argument, the solution
would be to delay the v1.0 release.

Take a read, and reach your own conclusions.

I don't even understand the point of interfaces: it seems to me that all they do is require a class implement something, which seems pointless.
Apr 06 2004
parent J C Calvarese <jcc7 cox.net> writes:
kinghajj wrote:
 In article <c4v2lm$1cg$1 digitaldaemon.com>, Kris says...
 
I believe it's time to do something positive about the state of Interfaces
as implemented in D. To this end, I've written a small document detailing
what I feel are the issues at hand. It's attached as an MS Word document,
and I apologize to those who can't access it because of that.

As noted in the document, it is absolutely not my intent to give Walter a
hard time, or to discredit D as a viable and useful language. My goal is
simple: resolve some of the real issues surrounding D Interfaces before it
goes mainstream with v1.0, such that it will be seen as a serious contender
by the commercial-development-sector and avoid being categorized as some
pet-project.

Some will say that I'm being unfair to Walter; that he's just one guy
working on this thing. While that may be a reasonable argument, the solution
would be to delay the v1.0 release.

Take a read, and reach your own conclusions.

I don't even understand the point of interfaces: it seems to me that all they do is require a class implement something, which seems pointless.

I don't really understand the concept of interfaces either. I think right now interfaces are intended to carry two different roles (maybe that's why this controversy has erupted). 1) Capability to features built-in to Windows Example: IShellLink (creating Windows shortcuts) http://www.dsource.org/tutorials/index.php?show_example=31 2) Facilitates advanced object-oriented techniques Exampe: Multiple Inheritance with template 'bolt-ins' http://www.dsource.org/tutorials/index.php?show_example=55 Perhaps these two goals are incompatible. We could split these roles into separate abstractions: interface and cominterface. Or maybe all we need is a extern(cominterface) for COM interfaces (or an extern(D) for these fancy new D-style interfaces that Kris has in mind). Perhaps D only needs to hide a pointer to InterfaceInfo after the "visible" vtbl entries. (It seems to me that it'd be possible for the compiler to secretly tack another pointer after the end of the structure. But I might be delusional.) -- Justin http://jcc_7.tripod.com/d/
Apr 06 2004
prev sibling next sibling parent reply Ant <Ant_member pathlink.com> writes:
In article <c4v2lm$1cg$1 digitaldaemon.com>, Kris says...
I believe it's time to do something positive about the state of Interfaces
as implemented in D. To this end, I've written a small document detailing
what I feel are the issues at hand. It's attached as an MS Word document,
and I apologize to those who can't access it because of that.

(just download open office if you can't - it's big though)
As noted in the document, it is absolutely not my intent to give Walter a
hard time, or to discredit D as a viable and useful language.

I can't see how anybody would think that. I thought interfaces on D were just broken or incomplete, never occured to me that the limitations were by design. I hope we all (I mean you) can move Walter on this issue. (the one contributor that Walter listens to is a C++ man I don't believe he can help us here.) Ant
Apr 06 2004
parent John Reimer <jjreimer telus.net> writes:
Ant wrote:
 In article <c4v2lm$1cg$1 digitaldaemon.com>, Kris says...
 
I believe it's time to do something positive about the state of Interfaces
as implemented in D. To this end, I've written a small document detailing
what I feel are the issues at hand. It's attached as an MS Word document,
and I apologize to those who can't access it because of that.

(just download open office if you can't - it's big though)

Or Abiword which also is free but MUCH smaller (about 4.8 MB). http://www.abisource.com/download/
Apr 06 2004
prev sibling next sibling parent reply J C Calvarese <jcc7 cox.net> writes:
Kris wrote:
 I believe it's time to do something positive about the state of Interfaces
 as implemented in D. To this end, I've written a small document detailing
 what I feel are the issues at hand. It's attached as an MS Word document,
 and I apologize to those who can't access it because of that.

"In short, D interfaces are nothing but a shill for Microsoft’s COM, and a thinly veiled marketing tool for those who actually use Interfaces in real-world scenarios." (Did anyone else perceive irony that this statement was in a Microsoft Word document? ;) ) I've posted a PDF version of this in the files/documentation section at http://groups.yahoo.com/group/d_lab/. OpenOffice (www.openoffice.org) can easily make PDF files - even from Word documents. I haven't studied the document yet, but it looks like a very thorough statement of your perspective. I'm unclear whether you see any need to use existing Microsoft-style interfaces, but that ability is a MUST in my opinion. I'm much more interested in using IShellLink, IPicture, DAO, and ADO than in creating my interfaces.
 As noted in the document, it is absolutely not my intent to give Walter a
 hard time, or to discredit D as a viable and useful language. My goal is
 simple: resolve some of the real issues surrounding D Interfaces before it
 goes mainstream with v1.0, such that it will be seen as a serious contender
 by the commercial-development-sector and avoid being categorized as some
 pet-project.
 
 Some will say that I'm being unfair to Walter; that he's just one guy
 working on this thing. While that may be a reasonable argument, the solution
 would be to delay the v1.0 release.
 
 Take a read, and reach your own conclusions.
 
 With respect,
 
 - Kris

-- Justin http://jcc_7.tripod.com/d/
Apr 06 2004
next sibling parent "Kris" <someidiot earthlink.dot.dot.dot.net> writes:
"J C Calvarese" <jcc7 cox.net> wrote in message
news:c4vf64$klq$1 digitaldaemon.com...
 (Did anyone else perceive irony that this statement was in a Microsoft
 Word document? ;) )

I do! :-) I realize in hindsight that I failed miserably to differentiate between COM interface and OO Interface. For the record, I have no issue with the former whatsover; it's the "claims" regarding the latter that my document was explicitly oriented toward. That isolated sentence should have said "OO Interfaces", as should many others, so as to be clear. It was certainly not my intention to suggest COM programmers are somehow not involved with "real world" scenarios. I do apologize over the confusion, and hope my obviously unfettered frustration within the last few paragraphs does not distract too much from the real meat. I'm also of the opinion that Walter is more than capable of bringing forth an elegant solution that is compatible with DOM, whilst fully supporting the OO Interface paradigm. It's perhaps a question of motivation more than anything else. - Kris (Personally, I like the pragma() approach suggested by Patrick Down: he makes a really good point about COM support being OS dependent, and hence a pragma candidate.)
Apr 07 2004
prev sibling next sibling parent reply "Kris" <someidiot earthlink.dot.dot.dot.net> writes:
"J C Calvarese" <jcc7 cox.net> wrote in message
news:c4vf64$klq$1 digitaldaemon.com...
 I've posted a PDF version of this in the files/documentation section at
 http://groups.yahoo.com/group/d_lab/.

Justin; I've updated that document to (a) be explicit about which Interface mechanism is under scrutiny and (b) to tone down my frustration level somewhat. I'd very much appreciate it if you'd replace the version you posted to the yahoo group -- frankly, It didn't cross my mind that this would go beyond the NG. How naive of me. - Kris
Apr 07 2004
parent J C Calvarese <jcc7 cox.net> writes:
Kris wrote:
 "J C Calvarese" <jcc7 cox.net> wrote in message
 news:c4vf64$klq$1 digitaldaemon.com...
 
I've posted a PDF version of this in the files/documentation section at
http://groups.yahoo.com/group/d_lab/.

Justin; I've updated that document to (a) be explicit about which Interface mechanism is under scrutiny and (b) to tone down my frustration level somewhat. I'd very much appreciate it if you'd replace the version you posted to the yahoo group -- frankly, It didn't cross my mind that this would go beyond the NG. How naive of me. - Kris

I replaced that file with a PDF of version 3 (D/27196). -- Justin http://jcc_7.tripod.com/d/
Apr 07 2004
prev sibling parent "Kris" <someidiot earthlink.dot.dot.dot.net> writes:
Ack!

Somebody shoot me .. I mis-typed COM as DOM. What a fool.

"J C Calvarese" <jcc7 cox.net> wrote in message
news:c4vf64$klq$1 digitaldaemon.com...
 I've posted a PDF version of this in the files/documentation section at
 http://groups.yahoo.com/group/d_lab/.

Apr 07 2004
prev sibling parent "Kris" <someidiot earthlink.dot.dot.dot.net> writes:
I'd like to point out that this topic is now null-and-void. There is an
update over at: D/27291

- Kris
Apr 09 2004