<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Hi Bert,<br></div><div><br>On Jan 26, 2017, at 2:42 AM, Bert Freudenberg <<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>> wrote:<br><br></div><blockquote type="cite"><div><span></span></div></blockquote><blockquote type="cite"><div><div dir="ltr">Awesome! However ...<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 25, 2017 at 6:22 PM, Eliot Miranda <span dir="ltr"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>The default type for oops in the VM is sqInt (*), which is signed.</div></div></blockquote><div><br></div><div>... since this keeps biting us time and time again, how hard would it be to change? Defaulting to unsigned seems much more reasonable, no? Unless we're dealing with SmallIntegers, which have to be special-cased anyways, we never want unsigned behavior, right?</div></div></div></div></div></blockquote><div><br></div>well, I've wanted to change this for some time but potentially it's a lot of work, as it affects the plugin and platform support code as much as the VM source.  But let's at least discuss it.<div><br></div><div>First, what exactly do we do?  Right now we have sqInt & u<span style="background-color: rgba(255, 255, 255, 0);">sqInt as oop-sized signed and unsigned types.  My list of pros and cons below is off the top of my head, preliminary.  Most of the below share the issue that we have to identify places where signed SmallInteger arithmetic is done and re-type them appropriately.  Do we</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div>- a) change the code generator to use <span style="background-color: rgba(255, 255, 255, 0);">usqInt as the default type in place of sqInt?</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">   pros presumably minimal changes except to code generator and removing pragmas that specify usqInt?</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">   cons rewriting platform support code to use usqInt for at least parameters</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div>- b) add a new default type, e.g. oop_t, which is the same as u<span style="background-color: rgba(255, 255, 255, 0);">sqInt?</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">  pros, see above</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">  cons figuring out which usqInt types apply to oops and which to unsigned values</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="background-color: rgba(255, 255, 255, 0);">- c) change sqInt to be unsigned and add e.g. ssqInt as a signed type</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">   pros don't have to change platform source</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"> </span></div><div><span style="background-color: rgba(255, 255, 255, 0);">- d) add a new default type, e.g. oop_t, which is the same as char *?</span><br><div>   pros oops are pointers </div><div>    cons C allows arithmetic on char *, so this won't fix inappropriate arithmetic on oops</div><div>         It's undefined in C whether pointers to different structures can be compared (but I do not know if an implement ration that refuses to compare pointers as simply addresses)</div><div><br></div><div>- e) use void * instead of char * (too horrible bow to contemplate cuz one can't compare void *)</div><div><br></div><div>- f..z) ?</div><div><br></div><div>Bert, is there a similar analysis for SqueakJS or are the C types irrelevant and ignored?</div><div><br></div><div>Anyway, looks to me like a) or c) are the main contenders.  What d'all think?</div><div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>- Bert -</div><div>(*) fixed the typo<br></div><div><br></div></div></div></div>
</div></blockquote></div></div></body></html>