D vs C++

"Jérôme M. Berger" jeberger at free.fr
Sun Dec 26 13:44:04 PST 2010


Walter Bright wrote:
> bearophile wrote:
>> One of the few advantages of D over Python is that in D you are able to
>> implement efficient and custom data structures without leaving the D
>> language
>> itself :-)
> 
> few?
> 
> How about:
> 
> 1. scope guard
Agreed

> 2. multithreaded programming (the GIL doesn't count)
Agreed

> 3. inline assembler
I have almost never used inline assembler even in languages that
support it. Of course, this is only a sub-point of your point 6:
using inline assembly in a language as slow as Python would be
completely pointless.

> 4. immutability
> 5. purity
I would not count them as advantages per se. Some of their
consequences might be seen as advantages once we have enough
experience with them.

> 6. far faster performance
Agreed

> 7. RAII
Python has it too (since 2.6 IIRC, see the "with" keyword).
Moreover, Python makes it clear that RAII is happening by requiring
a special syntax at the call point.

> 8. direct interface to C
Cython gives it too: it is as easy to write a Cython interface
module as to write a D interface file for a C library.

> 9. templates
Since Python uses duck typing everywhere, you could argue that
everything in Python is a template.

> 10. CTFE
This is not an advantage per se. It is useful because it allows
generative programming, so see point 11.

> 11. generative programming
Python has that (like most dynamic languages) through "eval".

	Well, that makes it 3 valid points out of 11 still ;)

		Jerome
-- 
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101226/58dbbe42/attachment.pgp>


More information about the Digitalmars-d mailing list