<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">But we *do* have explicit types in Modula-3.  Subranges and BITS FOR let us pretty much do everything we want (the current implementation restrictions are in using underlying in-memory representations for subranges that round to the nearest byte size).<div><br></div><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; 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; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><font class="Apple-style-span" color="#0000FF"><font class="Apple-style-span" face="Gill Sans"><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Antony Hosking</span></span></font></font><font class="Apple-style-span" face="Gill Sans"><span class="Apple-style-span" style="font-family: 'Gill Sans'; "><span class="Apple-style-span" style="font-family: 'Gill Sans'; "><span class="Apple-converted-space"> </span>|<span class="Apple-converted-space"> </span></span></span><span class="Apple-style-span" style="font-family: 'Gill Sans'; "><span class="Apple-style-span" style="font-family: 'Gill Sans'; ">Associate Professor</span></span><span class="Apple-style-span" style="font-family: 'Gill Sans'; "><span class="Apple-style-span" style="font-family: 'Gill Sans'; "> | Computer Science | Purdue University</span></span></font></div><div><font class="Apple-style-span" face="GillSans-Light"><span class="Apple-style-span" style="font-family: GillSans-Light; ">305 N. University Street | West Lafayette | IN 47907 | USA</span></font></div><div><font class="Apple-style-span" color="#0000FF" face="Gill Sans"><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Office</span></span></font><font class="Apple-style-span" face="GillSans-Light"><span class="Apple-style-span" style="font-family: GillSans-Light; "><span class="Apple-style-span" style="font-family: GillSans-Light; "> +1 765 494 6001 |<span class="Apple-converted-space"> </span></span></span></font><font class="Apple-style-span" color="#0000FF" face="Gill Sans"><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Mobile</span></span></font><font class="Apple-style-span" face="GillSans-Light"><span class="Apple-style-span" style="font-family: GillSans-Light; "><span class="Apple-style-span" style="font-family: GillSans-Light; "><span class="Apple-converted-space"> </span>+1 765 427 5484</span></span></font></div><div><font class="Apple-style-span" face="GillSans-Light"><br class="khtml-block-placeholder"></font></div></span></span></span></span></span></span></span><br class="Apple-interchange-newline"></span></div></span></span><br class="Apple-interchange-newline">
</div>
<br><div><div>On 17 Dec 2009, at 11:18, Peter Eiserloh wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi Tony,<br><br>Both Jay, and yourself have valid points.<br><br>One can classify the two kinds of types, as implicit, and <br>explicit.  <br><br>More specifically, INTEGER is implicit, and is useful for<br>in-memory representation.  This was especially important <br>when machine registers were very different between machines.<br>Very few remember the days of 18-bit words, with 9-bit <br>bytes (thank you!).  An implicit type is very useful, <br>when you are not worried about external representation<br>and all one needs is the logical behavior of the type,<br>independent of the particular machine on which one may<br>currently be.<br><br>Explicit types are much more useful, if not imperative, <br>when defining data types for external storage (in files, <br>or network protocols).<br><br>For binary file IO many people take a naive approach, and<br>simply overlay a data structure onto the file stream.  <br>This ignores the potential difference in sizes of implicit<br>types, and their endianess.   A more careful method of<br>doing binary files, is to distinguish the external from<br>the internal representation, and have procedures to do<br>the IO a field at a time.  See binIO.<br><br>Back in the late 1980's, and early 1990s, I had an Amiga <br>computer, and had two different "C" compilers: Aztec, C<br>and SAS/C.  The Aztec compiler int was 16-bits, whereas <br>the SAS/C int was 32 bits.  As you can imagine this caused <br>all sorts of havoc.  The Amiga system includes were <br>rewritten with somewhat more explicit types. These were <br>macros such as ULONG, SLONG, USHORT, SSHORT, UBYTE, and <br>SBYTE. <br><br>This illustrates the importance of explicit types.<br>Both implicit and explicit types have their place.<br><br><br>Peter<br><br><br><br>Date: Wed, 16 Dec 2009 20:10:14 -0500<br>From: Tony Hosking <<a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a>><br>Subject: Re: [M3devel] Oops, forgot to ask<br>To: Jay K <<a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a>><br>Cc: m3devel <<a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a>><br>Message-ID: <<a href="mailto:EF60618E-7AE3-4FF9-A805-5B8B83B369E2@cs.purdue.edu">EF60618E-7AE3-4FF9-A805-5B8B83B369E2@cs.purdue.edu</a>><br>Content-Type: text/plain; charset="us-ascii"<br><br><blockquote type="cite">On 16 Dec 2009, at 19:52, Jay K wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">"0..LAST(LONGINT)" having varying meaning...like when INTEGER is > 64 <br></blockquote></blockquote><blockquote type="cite">bits, then LONGINT=INTEGER, and we anticipate 128 bit INTEGER?<br></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">See..LONGINT is only useful in this brief period where we still have 32bit INTEGER.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">(Actually it would have been useful long ago.)<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">LONGINT could be 128 bits for all its definition cares.  It is just <br></blockquote><blockquote type="cite">something usually (not always) bigger than an INTEGER.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite"> I really think "long" is a dumb name..<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">There should be INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, <br></blockquote></blockquote><blockquote type="cite">UINT64, and unsigned and signed integers the same size of a pointer, <br></blockquote><blockquote type="cite">possibly called INT and UINT, or size_t and ptrdiff_t..<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Now these are dumb names because they wire in the size of the value.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">In Modula-3 INTEGER is a natural (i.e., word-size) value.<br></blockquote><br><br>+--------------------------------------------------------+<br>| Peter P. Eiserloh                                      |<br>+--------------------------------------------------------+<br><br><br><br></div></blockquote></div><br></div></body></html>