Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: The D Programming Language (was: Still more new operators) Message-ID: <1988Feb25.202237.8688@utzoo.uucp> Organization: U of Toronto Zoology References: <11702@brl-adm.ARPA> <243@eagle_snax.UUCP> <2245@geac.UUCP>, <2718@mmintl.UUCP> Date: Thu, 25 Feb 88 20:22:37 GMT > ... An undeclared variable should be an error, not an int. Um, perhaps you should learn C before you start designing D...? An undeclared variable *is* an error. > Another thing that should go is the assumption that the unit of storage is > the byte. The base unit of storage is the bit, and sizeof should return the > number of bits in the object. This enables to treat objects smaller than a > byte as first class objects. Here we have a key decision: is D to share C's emphasis on generation of efficient code? (Bearing in mind that this had a lot to do with C's success.) If so, then trying to forget that bytes exist is a serious mistake. Most machines cannot handle bits with anywhere near the efficiency with which they handle bytes; the appropriate base unit for efficient code *is* the byte. > ... In keeping with the spirit of C, we avoid > superfluous words, and keep the ones we do use short. > > With these changes, the {} statement delimiters become much less useful. I > would probably drop them, and add a "begin ... end;" construct... Please explain how avoiding superfluous words and keeping necessary ones short is consistent with changing {/} to begin/end for no particular reason. > To get even more radical -- with typedefs, enums, const declarations, and > (if we add them) inline functions, do we really need the pre-processor any > more? ... The C++ people claim that the answer is "not much", given inline functions in particular. They do still use it for some specialized problems, though. > I would omit the automatic insertion of a null byte at the end of character > constants. If you want nul terminated strings, write the nul. If you want > strings with counts, the language should not get in your way. Pray tell, how do you write a counted-string constant? I would suggest that "abc" should mean a length-3 string with any necessary terminator, regardless of what flavor of string is in use. That way you get a choice, without recoding all your string constants. -- Those who do not understand Unix are | Henry Spencer @ U of Toronto Zoology condemned to reinvent it, poorly. | {allegra,ihnp4,decvax,utai}!utzoo!henry