improving the D spec

Christian Kamm kamm-incasoftware at removethis.de
Mon Jun 29 13:20:29 PDT 2009


In the wake of the recent 'state of D' articles, I've looked at the D1 spec 
bugs on bugzilla and grouped them by topic. I've also separated them into 
issues that probably need compiler changes (+) and bugs that might be 
resolved by a spec change (*).

My plan is to go through the issues and to write up spec patches where the 
resolution is clear. This should cover a fair number of bugs, in particular 
those of the 'missing documentation' kind. If there's doubt as to what 
should be done, I'll assign to Walter and might bring the discussion to the 
newsgroup.

To show that this - apart from being useful for compiler developers and 
users alike - is far from boring, I'll present some facts I learned while 
experimenting with template ordering and IFTI in a separate post.

Unfortunately, the list is very long and thus I hope that more people will 
contribute patches. Sure, fixing bugs in the spec doesn't change the 
compiler or add a cool new feature, but I sincerely hope that it will make D 
more mature and simpler to implement.

Here is the list:

major missing documentation
 + 3007 stringof
 * IFTI

grammar & mangles
 * 1466 maximal munch can't lex 1..3 correctly
 * 2734 float literal tokenization
 * 1351 multiple variable declarations with auto
 * 2392 parsing ambiguity: function pointer declaration / function call
 * 1351, 2406
 + 3029 ambiguous array value mangling for template alias args
 + 3043 more ambiguous template mangles

ABI
 * 690 data layout for various interface inheritance
 * 2385 structs are returned in registers on linux
 * 2648 function return ABI exceptions for Windows
 
parameter storage classes
 * 955 parameter storage classes underdocumented
 * 1411 storage classes applied to tuples
 * 1424 manipulating storage classes in tuples
 * 1818 storage classes in tuples discarded for function declarations

property syntax
 + 678 for a function f returning an array, f.ptr sometimes fails
 + 1600 can't call foo(T[]) as array.foo;
 + 2152 opIndex and opIndexAssign on the returned value
 + 2774 can't get mangleof of function

protection
 * 1920 protection and default protection for classes underdocumented
 * 2417 calling protected class member functions
 + 2529 package protection
 + 1441, 2830 protection for type declarations

template ordering
 * 918 alias parameters
 * 2025 variadic templates
 * 1650 spec references 'C++ rules'

no bugzilla:
 * a.foo(...) -> foo(a, ...) transform for a array not documented
 * 'mangleof' can't be member of a struct not documented (other properties?)
 * what operations call the gc?

other
 * 52 auto fp = &overloaded_foo
 * 603 scopes in switch statements
 * 632 typedef/enum promotions
 * 869 precedence for is, !is
 * 996 error in example, ptr = array
 * 1351 non-terminals should be links
 * 2179 imports in class scopes
 * 1418 tupleof on nested classes
 * 1521 documentation on scope classes ambiguous
 * 1528 cannot overload functions and template functions
 * 1563 cast(C)v for class C only performs a dynamic cast for certain
        types of v
 * 1626 what exactly does if(v) do for various types of v?
 * 2017 explain common use of literal[] to get a dynamic array
 * 2201 end of line in string literals
 * 2351 empty enums
 * 2382 what can be a global/static initializer?
 * 2387 definition of 'static array'
 * 2395 struct forward declarations
 * 2497 deleting null
 * 2522 result type of binary operators
 * 2554 pragma(lib,...) must be declaration
 * 2616 part-explicit IFTI
 * 3093 Object.factory
 * 1142 stringof performs semantic analysis
 * 2482 magic struct operator overloads
 * 2028 module and package lookup
 * 2093 arrays and slices and lengths
 * 2106 export and classes
 * 2486 taking address of slice rvalues is valid
 + 302 contract inheritance
 + 502 reimplement interface functions with aliases
 + 671 overloading class opAssign allows initialization with it but
       generates useless code
 + 1429 associative array ==, !=
 + 2358 offsetof property usage inconsistent between structs and classes
 + 2477 trailing commas in array literals
 + 2524 final override + interface
 + 2543 foreach index refness
 + 2632 operations on invalid arrays
 + 2701 opAssign for struct initialization
 + 2716 'auto' still has meaning of 'scope' sometimes
 + 2733 semantics of template value parameters
 + 2894 abstract functions
 + 3005 for statement allows more than declarations in first arg
 + 3066 array operations as initializers
 + 3085 cannot index tuple in declaration

as intended?
 * 1715 convertibility vs. equality in template specializations
 * 1012 cannot instantiate template with no parameters or default parameters
        without !()





More information about the Digitalmars-d mailing list