<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
I believe our layout endeavors to be C compatible.<br>For some supposedly typical C behavior.<br>It is, I am pretty certain, endian-dependent.<br>I would like to remove that actually -- the frontend at this point knows very little<br>about each target, and I'd like to see if it can know even less.<br>It knows:<br> word size<br> endianness<br> jmpbuf size<br><br><br>not much more.<br>jmpbuf size I know we can remove, but I had trouble when tried to fix that, about a year ago.<br>I've had much less time to work on  Modula-3 the past year or so. :(<br><br><br>(then again -- endian-knowledge can be used to make ntohl/htonl highly optimized.)<br><br><br>I know it's a little wierd what I say -- C is impelementation-dependent and we try<br>to be C compatible. And m3core/libm3 used to have some dependency<br>on this C compatibility, e.g. the waitpid stuff. But I believe I removed all<br>such dependency.<br><br><br> - Jay<br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">From: dragisha@m3w.org<br>Date: Thu, 19 Jan 2012 18:47:39 +0100<br>To: jay.krell@cornell.edu<br>CC: m3devel@elegosoft.com<br>Subject: Re: [M3devel] packing problem… how exactly does modula-3 pack data into records??<br><br>
<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">Why wouldn't it be portable? What endiannes has to do with bit strings?<div><br></div><div>I don't think it is wrong to make it left-to-right-until-spent… As it's implementation dependent… ok… Why would not our implementation be left-to-….? :)</div><div><br></div><div>I think it's totally reasonable to expect from implementation exactly what I am expecting here and now.</div><div><br></div><div>As for C… I know several ways to implement this… And good ones. What I would like is to have cm3 doing it in obvious, intuitive way.</div><div><br></div><div>TIA<br><div><br><div><div>On Jan 19, 2012, at 5:28 AM, Jay K wrote:</div><br class="ecxApple-interchange-newline"><blockquote><span class="ecxApple-style-span" style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;font-size:medium"><span class="ecxApple-style-span" style="font-family:Tahoma;font-size:13px"><pre> > packing data into record about packing bits left-right-until-spent?</pre><br>It is not portable.<br>In particular, there is endianness variation.<br>The C spec leaves things up to implementation.<br><br>If you can, I recommend copying the data from C to a more portable less dense Modula-3 representation.<br>Like what is now done throughout m3core/libm3 -- i.e. we don't interface with C at all through bitfields, nor do we try to line up with struct stat or any other struct, roughly speaking.<br>(Maybe still a few, like struct linger).</span></span></blockquote></div><br></div></div></div>                                    </div></body>
</html>