OSNews article about C++09 degenerates into C++ vs. D discussion

Boris Kolar boris.kolar at globera.com
Mon Nov 20 02:44:48 PST 2006


== Quote from Walter Bright (newshound at digitalmars.com)'s article
> If you talk to the people who actually do real time software, they don't
> use malloc/free precisely because they are not deterministic. They
> preallocate all data.

Preallocating all data is a lot of pain. Please consider adding something
to the language that would solve the problem. Some suggestion involve
opAssign and/or implicit casts. Also take a look at my suggestion for value
classes:
http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=44163

Performance reason: I actually did some benchmarking, comparing
C++ stack allocated classes versus Java classes - C++ was ~30x faster
than Java and Java was ~20x faster than D.

I don't understand why a good RIAA is not already a part of D. C++ has it, so
it obviously can be done. The new 'scoped' keyword is insufficient for me,
because I'd like to make all my classes scoped. I can usually develop
99% of my C++ code without a single 'new' or 'malloc'. Most of my classes
are small (average ~2 fields and ~4 methods) and only used locally, so I'm
really angry when I think about negative performance impact they will have
in D simply because a decent RIAA is missing.



More information about the Digitalmars-d mailing list