Coolest D features
sean at f4.ca
Wed Dec 27 13:11:59 PST 2006
Jeff Nowakowski wrote:
> Walter Bright wrote:
>> I think the problem is that Java is just lacking in some needed
>> features - like a full set of basic types, simple aggregates, out
>> parameters, etc. The alternatives are computationally expensive, and
>> so the optimizer has a lot of work to do to reverse engineer them and
>> figure out that all the programmer was doing was a workaround for a
>> POD stack aggregate.
> Could you expand on the above items? What basic types are missing? Does
> a "simple aggregate" refer to structs/tuples? What does POD stand for,
> and what is a POD stack aggregate?
POD = Plain Old Data. In D, a struct is a POD stack aggregate. And I'm
not sure what Walter meant about basic types, but I've been occasionally
annoyed at the lack of unsigned primitives in Java. The out parameter
issue (or a lack of tuples) is another one. It's really not uncommon to
want to return/alter two values in a function call, particularly in the
case of recursion. That said, it's obviously possible to re-engineer a
design to account for this, but the elegant approach often seems to
sacrifice some degree of efficiency.
More information about the Digitalmars-d