[comp.lang.c] D Wishlist

dsill@NSWC-OAS.arpa (Dave Sill) (03/05/88)

The following is a list of the changes that people have said they'd
like to see in D, the hypothetical "improved C".  I'm sure there are
more.  I'm sure we could spend terabytes arguing over the details.
Instead, I suggest sending comments to me for summarization.
Remember, this is comp.lang.c/INFO-C...

There are surprisingly few contradictory wishes.  I plan to describe
each item in more detail; and perhaps include possible syntaxes.


* Better support for multidimensional arrays.

* Make arrays first-class objects.

* Require prototype-style function declarations.

* Better support for objects smaller than a byte.

* Make control statements control something other than single statements.

* Make case selection fallthrough an option, not default.

* Add inline functions.

* Re-evaluate the need for a preprocessor.

* Stop automatic termination of string constants with nul.

* Make "null" a keyword.

* Re-evaluate assignment and logical-equivalence operators

* Stop initializing static variables to 0.

* Require function prototypes to be within scope.

* Add a general aggregate constructor mechanism.

* Make libraries a part of the language.

* Consider some "asm" mechanism versus adding more operators.

* Better support for variadic functions.

* Support operator overloading.

* Remove distinction between expressions and statements.

* Add "pure" functions (output is a function of input, no side effects).

* Better integral types (range determined).

* Add a true Boolean type.

* Clean up declaration syntax.

* Make unions tagged.

* Add case ranges for switch and conditional statements.

* Add an "->" OP= operator.

* Make braces mandatory in control statements.

* Provide a more general macro facility.

henry@utzoo.uucp (Henry Spencer) (03/06/88)

This sort of wishlist is the wrong way to go about it, assuming that what
is wanted is a language that will actually be widely implemented and widely
used.  If that is to happen, the new language must be either (a) virtually
completely upward-compatible with C and significantly better, or (b) *LOTS*
better than C in at least one area.  Most of the things on this wishlist
are incompatible but unimportant.  (Not trivial, necessarily, and in the
abstract I agree with many of them, but that isn't the issue.)  Unless some
truly major improvement can be had somewhere else, a language designed from
this wishlist may receive critical acclaim but will never be popular.

Remember also that the competition is not just C.  C++ is both upward
compatible *and* a major improvement in certain areas.

I used to be very enthusiastic about designing better languages.  But I
can no longer work up much enthusiasm for lost causes.  I could easily
design a language that would be noticeably better than C.  However, I don't
know how to design a language that is *enough* better than C++ for it to
be worth the trouble.
-- 
Those who do not understand Unix are |  Henry Spencer @ U of Toronto Zoology
condemned to reinvent it, poorly.    | {allegra,ihnp4,decvax,utai}!utzoo!henry