www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: scope keyword - a maintenance nightmare?

reply Guenther Brunthaler <gb dont.spam.me.invalid> writes:
Deewiant Wrote:

 http://www.digitalmars.com/d/dcompiler.html#interface_files
 
 Unfortunately, this only separates interface descriptions from object code.
What

Thank you for pointing that out! It's a new feature too which I did not know about yet. It certainly wasn't there when I evaluated the language the first time. Sounds pretty useful. Seems to be more or less what I wanted. However, there is one thing left in the linked web page above like which I still find rather disturbing:
 But they are not required in the way that C++ header files are, and they are
 not part of the D language. They are a feature of the compiler, and serve
 only as an optimization of the build process.

If they are not part of the language, then one is at the mercy of a compiler to provide them! And in fact, every compiler could do it its own way, using a different layout or even a different syntax if it wants to. It therefore seems more like the "precompiled header files" feature of some C/C++ compilers to me: While clearly useful, not all compilers do support it, and precompiled header files are typically not compatible between the different vendor's implementations. So let's hope .di files actually become part of the D language standard in a future revision of the language!
Aug 17 2007
next sibling parent Bill Baxter <dnewsgroup billbaxter.com> writes:
Guenther Brunthaler wrote:
 Deewiant Wrote:
 
 http://www.digitalmars.com/d/dcompiler.html#interface_files

 Unfortunately, this only separates interface descriptions from object code.
What

Thank you for pointing that out! It's a new feature too which I did not know about yet. It certainly wasn't there when I evaluated the language the first time. Sounds pretty useful. Seems to be more or less what I wanted. However, there is one thing left in the linked web page above like which I still find rather disturbing:
 But they are not required in the way that C++ header files are, and they are
 not part of the D language. They are a feature of the compiler, and serve
 only as an optimization of the build process.

If they are not part of the language, then one is at the mercy of a compiler to provide them! And in fact, every compiler could do it its own way, using a different layout or even a different syntax if it wants to. It therefore seems more like the "precompiled header files" feature of some C/C++ compilers to me: While clearly useful, not all compilers do support it, and precompiled header files are typically not compatible between the different vendor's implementations. So let's hope .di files actually become part of the D language standard in a future revision of the language!

Whoa, I hadn't noticed that. Yes I agree. While I'm a big fan of open source, support for hiding implementation is still a very real requirement in the many corners of the corporate world. --bb
Aug 17 2007
prev sibling next sibling parent BCS <ao pathlink.com> writes:
Reply to Guenther,

 Deewiant Wrote:
 
 http://www.digitalmars.com/d/dcompiler.html#interface_files
 
 Unfortunately, this only separates interface descriptions from object
 code. What
 

It's a new feature too which I did not know about yet. It certainly wasn't there when I evaluated the language the first time. Sounds pretty useful. Seems to be more or less what I wanted. However, there is one thing left in the linked web page above like which I still find rather disturbing:
 But they are not required in the way that C++ header files are, and
 they are not part of the D language. They are a feature of the
 compiler, and serve only as an optimization of the build process.
 

compiler to provide them! And in fact, every compiler could do it its own way, using a different layout or even a different syntax if it wants to. It therefore seems more like the "precompiled header files" feature of some C/C++ compilers to me: While clearly useful, not all compilers do support it, and precompiled header files are typically not compatible between the different vendor's implementations. So let's hope .di files actually become part of the D language standard in a future revision of the language!

It isn't quite as good as being part of the language, but .di files are just D code without the function bodies. If you ship object code, and a .di file, then the worst that can happen is that the end user needs to rename the file as a .d file. Heck, even if you use a compiler that doesn't generate .di files, you can still run your code through one that does and then use the files with whatever compiler you want.
Aug 17 2007
prev sibling next sibling parent Lutger <lutger.blijdestijn gmail.com> writes:
Guenther Brunthaler wrote:
...
 However, there is one thing left in the linked web page above like which I
still find rather disturbing:
 
 But they are not required in the way that C++ header files are, and they are
 not part of the D language. They are a feature of the compiler, and serve
 only as an optimization of the build process.

If they are not part of the language, then one is at the mercy of a compiler to provide them! And in fact, every compiler could do it its own way, using a different layout or even a different syntax if it wants to.

Is that really a problem? Practically speaking, it could be done by some tool too. D is far easier to parse than C++ so I don't think this is a difficult thing to achieve. IIRC, in C++ the whole interface / implementation file seperation thing is not standardized either.
Aug 18 2007
prev sibling parent Carlos Santander <csantander619 gmail.com> writes:
Guenther Brunthaler escribió:
 Deewiant Wrote:
 
 http://www.digitalmars.com/d/dcompiler.html#interface_files
 
 Unfortunately, this only separates interface descriptions from object code.
 What

Thank you for pointing that out! It's a new feature too which I did not know about yet. It certainly wasn't there when I evaluated the language the first time. Sounds pretty useful. Seems to be more or less what I wanted. However, there is one thing left in the linked web page above like which I still find rather disturbing:
 But they are not required in the way that C++ header files are, and they
 are not part of the D language. They are a feature of the compiler, and
 serve only as an optimization of the build process.

If they are not part of the language, then one is at the mercy of a compiler to provide them! And in fact, every compiler could do it its own way, using a different layout or even a different syntax if it wants to. It therefore seems more like the "precompiled header files" feature of some C/C++ compilers to me: While clearly useful, not all compilers do support it, and precompiled header files are typically not compatible between the different vendor's implementations. So let's hope .di files actually become part of the D language standard in a future revision of the language!

I'm guessing all it means is that you don't need to provide that feature in order to create a D compiler. As Lutger said, if your compiler doesn't have that feature, you can use an external tool that has it. In fact, I think that's how this feature got implemented in the first place, but I'm not 100% sure. -- Carlos Santander Bernal
Aug 18 2007