1 Date: Thu, 8 Feb 2001 14:31:05 -0600 (CST)
2 From: Chris Lattner <sabre@nondot.org>
3 To: Vikram S. Adve <vadve@cs.uiuc.edu>
4 Subject: RE: Type notation debate...
6 > Arrays (without and with size):
7 > type ::= '[' type ']' | '[' INT ',' type ']'.
9 > The arrays with size lists the dimensions and the type in a single list.
10 > That is just too confusing:
13 > This seems to be a 3-D array where the third dimension is something strange.
14 > It is too confusing to have a list of 3 things, some of which are dimensions
17 The above grammar indicates that there is only one integer parameter, ie
18 the upper bound. The lower bound is always implied to be zero, for
21 * As a low level VM, we want to expose addressing computations
22 explicitly. Since the lower bound must always be known in a high level
23 language statically, the language front end can do the translation
25 * This fits more closely with what Java needs, ie what we need in the
26 short term. Java arrays are always zero based.
28 If a two element list is too confusing, I would recommend an alternate
31 type ::= '[' type ']' | '[' INT 'x' type ']'.
38 Which is syntactically nicer, and more explicit.
40 > Either of the following would be better:
41 > array [10, 40] of int
43 I considered this approach for arrays in general (ie array of int/ array
44 of 12 int), but found that it made declarations WAY too long. Remember
45 that because of the nature of llvm, you get a lot of types strewn all over
46 the program, and using the 'typedef' like facility is not a wonderful
47 option, because then types aren't explicit anymore.
49 I find this email interesting, because you contradict the previous email
50 you sent, where you recommend that we stick to C syntax....