<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>The point of M3 is not be different than some other language, the point is for it to be safe, and, as a side effect, easy to use. Making a language safe is hard becuase you have to consider every possible usage and outcome becuase the language guarantees that it will not produce an "unchecked" error for the safe subset of the language, that is, it will do something random no matter how use use the language. So we have to consider all changes very carefully.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR><DIV><DIV>On 11/08/2007, at 4:26 PM, j k wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; ">I know, like, the point of Modula-3 is to not be like C or C++ and to revisit everything in them, but..really?</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; ">Windows programming in C and C++ has had this solved reasonable for MANY YEARS.</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; ">Other folks solved it similarly even longer ago, though I would claim Windows's</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; ">approach has been successfully applied to more code -- that is, all of Windows, and then some.</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; ">Windows C/C++ is flawed here, but not in a too terrible way.</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; ">In particular, Windows C/C++ has too many names for the same types, with various</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; ">flimsy rationale, mostly "style" and "history".</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; ">All you need is the following:</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> signed and unsigned integer types that are exactly 8 bits in size</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> signed and unsigned integer types that are exactly 16 bits in size</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> signed and unsigned integer types that are exactly 32 bits in size</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> signed and unsigned integer types that are exactly 64 bits in size</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> signed and unsigned integer types that are exactly the size of a pointer</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> 10 integer types total, named something like:</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, size_t or UINT_PTR, ptrdiff_t or INT_PTR </SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> The types "int" and "long" and unsigned thereof NEVER changed size.</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> Where people were using them for pointer sized things, you would do a simple transform to port to 64 bit: </SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> int => INT => INT_PTR </SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> unsigned => UINT => UINT_PTR </SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> DWORD => DWORD_PTR </SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> convert to the upper case types if not there, and append "_PTR" </SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> The existing types size_t and ptrdiff_t did change size.</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> If someone really needed 32 bit types there, you'd have to change your code.</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> </SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> Windows has more than that for historical and stylistics reasons -- upper case types,</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> lowercase types, types that "favor" being unsigned int or unsigned long.</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> Some of it is C's fault -- the "short" and "long" stuff seems all unnecessary.</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> </SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> C 9x adds in "fast" and "small" types</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> types that are the smallest type that is at least a certain size, I think </SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> types that are the fastest type that are at least a certain size, I think</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> the idea here being that if 64 bit integers are "faster" than 32 bit integers, then "fast32" might be 64 bits</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> In reality, I think the 10 types are confusing enough, but necessary, C9x multiplies out</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> beyond necessity. Yeah, obviously, they seem like maybe you might want them, but</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> it's just too many times imho. Imho 8, 16, and 32 bit integers must remain efficient</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> to use on all forseeable processors, since tons of code uses them, and people should not</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> will not be pushed to widen everything across the board. Yeah, 64K and 4GB limits are</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> mostly stupid these days and they very often should be widened, but folks can do that</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> "slowly" on their own, managing compatibilit themselves -- like where binary file i/o is used.</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> Why has this been so hard in Modula-3?</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> Is it that "Word" is widely used and has been pointer sized? </SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> Or that INTEGER has been widely used and sometimes assumed to be pointer sized? </SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> Is it that Sparc64 (?) and 64 bit Alpha have existed for a long time but</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> weren't done right and there is some legacy we are stuck with??</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> Do "subrange" types make it all confusing? </SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> Or merely the assignment rules among the non subrange integer types? </SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> I have not paid particularly close attention; it just has always surprised me</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> that it was difficult to work out what to do.</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> I guess it is all moot now, the issues have been worked out and the feature is there. Good.</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> I am skeptical that the name "LONGINT" is good. I am skeptical that the slightly</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> abstracted C names "short", "int", "long" are a useful abstraction.</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> I think you really want the 10 base types I first listed.</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> </SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; ">btw, even the types that are same size as a pointer are overused in C/C++.</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; ">You don't need them for as much pointer arithmetic as people use. You can use "char*" for that.</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; ">They are useful for array indices though, the result of wcslen, sizeof(), etc.</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> </SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; ">File sizes should always be UINT64..</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "> - Jay</SPAN><BR style="font-family: Tahoma; font-size: 13.3333px; "><BR style="font-family: Tahoma; font-size: 13.3333px; "><HR style="font-family: Tahoma; font-size: 13.3333px; "><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; ">Recharge--play some free games. Win cool prizes too! </SPAN><A href="http://club.live.com/home.aspx?icid=CLUB_wlmailtextlink" target="_new"><SPAN class="Apple-style-span" style="color: rgb(0, 0, 238); font-family: Tahoma; font-size: 13.3333px; -khtml-text-decorations-in-effect: underline; ">Play It!</SPAN></A><SPAN class="Apple-style-span" style="font-family: Tahoma; font-size: 13.3333px; "></SPAN></SPAN></BLOCKQUOTE></DIV><BR></BODY></HTML>