jove
Member
Hello,
Is Apple or Metro planning on creating D compilers? I have read incomplete tidbits on D here and there. Some of the articles are so Visual C++ oriented that they made incorrect comparisons to C++. Anyways, these are some of my thoughts and questions.
There seems to be some great ideas.
1) No need for forward declarations.
2) Contracts - validation code segments that can be attached to methods and objects.
3) In, Out designation on parameters. This denotes intention much better than const, references and pointers.
4) Garbage collection, YES!
5) Structures with properties. myObject.size and myArray.upperBound
6) Elimination of -> operand. The compiler is smart enough to know if something is a pointer or not. There are no stack objects as well. If D provides enough facilities for interface propagation, then I wont be upset that the overridable -> operator is gone.
Items that have me concerned
1) No header files. C++ didn't do it very well but there is a need to specify a public interface to a class in a separate file for distribution. C++ has the overhead of bridge classes.
2) No preprocessor. Macros as functions are bad. Macros as constants are bad. Macros as well documented text placements are handy to reduce maintenance. Macros to eliminate code from being complied and linked in are necessary (cross-platform code, demo mode...). Does D have a counterpart?
3) No multiple inheritance. There is a time for has-a relationships, a time for is-a relationships. The best design may have a single class adopting multiple interfaces. And an interface may have to have some logic (besides prototyping) attached to it. Is there multiple abstract inheritance? Is there interface delegation?
4) Does it have default parameters?
5) No stack based objects - everything heap. Stack based objects are handy to quickly save/alter/restore states. Heap objects seem like a lot of overhead for that purpose.
6) Does it have templates or overridable class methods?
7) The parameter list is not part of the function signature. You can no longer create two methods with the same name within a class. I understand the argument that this isnt necessary (but creates more maintainable code). Unfortunately this eliminates the possibility for templated methods.
If anybody has any thoughts or clarification, that would be great.
Is Apple or Metro planning on creating D compilers? I have read incomplete tidbits on D here and there. Some of the articles are so Visual C++ oriented that they made incorrect comparisons to C++. Anyways, these are some of my thoughts and questions.
There seems to be some great ideas.
1) No need for forward declarations.
2) Contracts - validation code segments that can be attached to methods and objects.
3) In, Out designation on parameters. This denotes intention much better than const, references and pointers.
4) Garbage collection, YES!
5) Structures with properties. myObject.size and myArray.upperBound
6) Elimination of -> operand. The compiler is smart enough to know if something is a pointer or not. There are no stack objects as well. If D provides enough facilities for interface propagation, then I wont be upset that the overridable -> operator is gone.
Items that have me concerned
1) No header files. C++ didn't do it very well but there is a need to specify a public interface to a class in a separate file for distribution. C++ has the overhead of bridge classes.
2) No preprocessor. Macros as functions are bad. Macros as constants are bad. Macros as well documented text placements are handy to reduce maintenance. Macros to eliminate code from being complied and linked in are necessary (cross-platform code, demo mode...). Does D have a counterpart?
3) No multiple inheritance. There is a time for has-a relationships, a time for is-a relationships. The best design may have a single class adopting multiple interfaces. And an interface may have to have some logic (besides prototyping) attached to it. Is there multiple abstract inheritance? Is there interface delegation?
4) Does it have default parameters?
5) No stack based objects - everything heap. Stack based objects are handy to quickly save/alter/restore states. Heap objects seem like a lot of overhead for that purpose.
6) Does it have templates or overridable class methods?
7) The parameter list is not part of the function signature. You can no longer create two methods with the same name within a class. I understand the argument that this isnt necessary (but creates more maintainable code). Unfortunately this eliminates the possibility for templated methods.
If anybody has any thoughts or clarification, that would be great.