<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><blockquote type="cite" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); "><div class="">I don’t know what the static limit is on an array literal.<br class=""></div></blockquote><div><div class=""><br></div></div><div class=""><br></div><div class="">I suspect all sizes and offsets are limited to bit counts stored INTEGER.</div><div>So any field or type can be 512mb-1 max on 32bit hosted compiler and 2^56-1 for 64bit hosted compiler.</div><div><br></div><div><br></div><div>How about a syntax that omits the end of the range?</div><div>Type t = array [0..] of char?</div><div><br></div><br> - Jay</div><div><br>On Jun 3, 2015, at 5:03 PM, Antony Hosking <<a href="mailto:hosking@purdue.edu">hosking@purdue.edu</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=windows-1252">It would not make sense to store an entire blueray movie as a literal…better to structure it.<div class="">I don’t know what the static limit is on an array literal.<br class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 3, 2015, at 7:14 PM, Jay K <<a href="mailto:jay.krell@cornell.edu" class="">jay.krell@cornell.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="">sorry, I missed that it is literals...so I can convert a blueray movie into a source file containing the data all in a text? Far fetched.</div><div class="">An array of chars? Probably has same problem.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Can I/we please LONGINT-ize the compiler now, for all type sizes and field offsets?</div><div class=""><br class=""></div><div class=""> - Jay<br class=""><br class=""><br class=""><br class=""></div><div class=""><hr id="stopSpelling" class="">Subject: Re: [M3devel] 32bit host 64bit target TextLiteral recurring problem<br class="">From: <a href="mailto:hosking@purdue.edu" class="">hosking@purdue.edu</a><br class="">Date: Wed, 3 Jun 2015 14:07:02 -0400<br class="">CC: <a href="mailto:m3devel@elegosoft.com" class="">m3devel@elegosoft.com</a><br class="">To: <a href="mailto:jay.krell@cornell.edu" class="">jay.krell@cornell.edu</a><br class=""><br class=""><div class="">It’s only TEXT<span class="Apple-converted-space"> </span><i class="">literals</i> that are limited here. As in, what appears in a source program.</div><br class=""><div class=""><blockquote class=""><div class="">On Jun 3, 2015, at 1:49 PM, Jay K <<a href="mailto:jay.krell@cornell.edu" class="">jay.krell@cornell.edu</a>> wrote:</div><br class="ecxApple-interchange-newline"><div class=""><div dir="ltr" style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; line-height: normal; font-family: Calibri; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal;" class=""><div class="">I don't have any, but should we have such artificial limits?<br class="">I'm always nervous about "640k is plenty", "2gig is plenty", "4gb is plenty".<br class="">Thus -- size_t: "4gb is plenty for a 32bit host, but 64bit is unlimited."<br class="">And even that isn't right -- 4bg is often not lenty for a 32bit host.<br class="">File sizes exceed that long ago.</div><div class="">But "4gb is plenty for 32bit, 64bit is limited" is generally easy to code and I rest there.</div><div class=""><br class=""></div><div class=""><br class="">Given that a blueray movie is an array of bytes, is a text inappropriate?</div><div class=""><br class=""></div><div class=""><br class="">The actual diff presented just adjusts the limit by 8 bytes.<br class="">Ok?<br class="">Or must preserve pickles and can't do this w/o some other change?<br class="">This isn't a more general problem? Or usually pickles<br class="">are 32/64-compatible, but this is a most unusual case?</div><div class=""><br class=""></div><div class=""><br class="">Thanks,<br class=""> - Jay<br class=""><br class=""><br class=""><br class=""><br class=""></div><div class=""><hr id="ecxstopSpelling" class="">Subject: Re: [M3devel] 32bit host 64bit target TextLiteral recurring problem<br class="">From:<span class="Apple-converted-space"> </span><a href="mailto:hosking@purdue.edu" class="">hosking@purdue.edu</a><br class="">Date: Wed, 3 Jun 2015 13:24:36 -0400<br class="">CC:<span class="Apple-converted-space"> </span><a href="mailto:m3devel@elegosoft.com" class="">m3devel@elegosoft.com</a><br class="">To:<span class="Apple-converted-space"> </span><a href="mailto:jay.krell@cornell.edu" class="">jay.krell@cornell.edu</a><br class=""><br class=""><div class=""><div class="">Why would you ever want a TEXT literal that is so large?</div><div class="">By the way, yes TextLiteral is an unsafe interface because of the need to index up to the MaxBytes bound, but the unsafe code is confined to the implementation of the interface.</div><div class="">A type can be neither unsafe nor safe. It is code that is unsafe or safe. Any code that can see the revealed definition of TextLiteral.T must be unsafe since the interface is unsafe.</div><div class=""><br class=""><blockquote class=""><div class="">On Jun 3, 2015, at 12:36 PM, Jay <<a href="mailto:jay.krell@cornell.edu" class="">jay.krell@cornell.edu</a>> wrote:</div><br class="ecxApple-interchange-newline"><div class=""><div style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal;" class="">I do this. I shouldn't have to make local edits each time. It isn't meant to only be once. I should be able to long-term use a 32bit toolset to target 32bit & 64bit.</div><div style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal;" class=""><br class=""> - Jay</div><div style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal;" class=""><br class="">On Jun 3, 2015, at 5:16 AM, Antony Hosking <<a href="mailto:hosking@purdue.edu" class="">hosking@purdue.edu</a>> wrote:<br class=""><br class=""></div><blockquote style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal;" class=""><div class=""><div class="">Other than cross-compile from 32 to 64 bit what purpose does this serve?<br class=""><br class="">Sent from my iPad</div><div class=""><br class="">On Jun 2, 2015, at 9:58 PM, Jay K <<a href="mailto:jay.krell@cornell.edu" class="">jay.krell@cornell.edu</a>> wrote:<br class=""><br class=""></div><blockquote class=""><div class=""><div dir="ltr" class=""><div class="">We cannot cross from 32bit host to 64bit target.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Ok to commit this?</div><div class=""><br class=""></div><div class="">diff --git a/m3-libs/m3core/src/text/TextLiteral.i3 b/m3-libs/m3core/src/text/TextLiteral.i3</div><div class="">index fa72589..37bf238 100644</div><div class="">--- a/m3-libs/m3core/src/text/TextLiteral.i3</div><div class="">+++ b/m3-libs/m3core/src/text/TextLiteral.i3</div><div class="">@@ -12,9 +12,16 @@ UNSAFE INTERFACE TextLiteral;</div><div class=""> IMPORT RTHooks, TextClass;</div><div class=""> </div><div class=""> CONST</div><div class="">- (* DIV BITSIZE should not be here! *)</div><div class="">+(* When cm3 uses TInt and when pickle special cases this, it should be approx:</div><div class="">+ MaxBytes = LAST (INTEGER) - BITSIZE (INTEGER) * 2 *)</div><div class="">+(* This fails for 32bit host and 64bit target:</div><div class="">+ MaxBytes = 16_7FFFFFFF DIV BITSIZE (Byte) - 7; *)</div><div class="">+(* Until/unless unpickling special cases this, it must not be sizeof(INTEGER)</div><div class="">+ dependent. *)</div><div class="">+ (* DIV BITSIZE should not be here -- compiler limitation due to</div><div class="">+ non-use of TInt. *)</div><div class=""> (* MaxBytes = LAST (INTEGER) DIV BITSIZE (Byte) - 7 - 8 * ORD(BITSIZE(INTEGER) = 64); *)</div><div class="">- MaxBytes = 16_7FFFFFFF DIV BITSIZE (Byte) - 7; </div><div class="">+ MaxBytes = 16_7FFFFFFF DIV BITSIZE (Byte) - 15;</div><div class=""> (* - 8 * ORD(BITSIZE(INTEGER) = 64) *) </div><div class=""> (* Do not adjust this for INTEGER size. It makes T have different </div><div class=""> fingerprints on 32- and 64-bit machines, which undermines pickling/</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Yes I know TEXT pickles will be broken.</div><div class="">I propose that unpickle should special case a few values here.</div><div class="">Or, isn't the brand supposed to help?</div><div class="">Or, can we encode this in a better way, w/o an upper bound?</div><div class="">I know if you put in 0..0 or 0..-1 you incur range violations at runtime.</div><div class="">Which makes me wonder -- are TEXTs unsafe?</div><div class=""><br class=""></div><div class="">Should we support a syntax something like:</div><div class=""><br class=""></div><div class=""><div class=""> cnt : INTEGER;</div><div class=""> buf : ARRAY [0..cnt - 1] OF Byte;</div></div><div class="">?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""> - Jay</div></div></div></blockquote></div></blockquote></div></blockquote></div></div></div></div></div></blockquote></div></div></div></div></blockquote></div><br class=""></div></div></div></blockquote></body></html>