<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-15">
<META content="MSHTML 6.00.6000.16608" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>Sorry, but I've never checked to see how pickles represent "BITS FOR".</DIV>
<DIV>I've used BITS FOR only on rare occasion.</DIV>
<DIV> </DIV>
<DIV>My concern about "breaking" is that if a change is made to the encoding of pickles, then all other programs that use pickles would need to be rebuilt in order to remain compatible. I seem to recall that there is a version number that is put into the encoding to help with compatibility and of course we already have pickle, pickle2, netobj, and netobj2. Perhaps your change could be structured in such a way as to still understand the older variants for compatibility.</DIV>
<DIV> </DIV>
<DIV>Here is a scenario: Suppose I have a program that uses pickles and/or netobj. A version is built and put into an embedded system. This system shares pickles/netobj with another client program. After the embedded system is fielded, a change is made to the encoding of pickles. New features are added to the client program and it is rebuilt. Now the client program can't share pickles with the embedded system.</DIV>
<DIV> </DIV>
<DIV>Scenario2: A program uses pickles to store data in files. If the pickle structure is changed, the program will no longer be able to read its old files without some sort of transformation function on all the files.</DIV>
<DIV> </DIV>
<DIV>Regards,</DIV>
<DIV>Randy<BR><BR>>>> "Darko" <darko@darko.org> 2/18/2008 8:44 PM >>><BR>Actually rather than compilain rather grumpily, maybe I can just make the<BR>changes required to RTTipe and do the work to reomve the pragma. I can<BR>work with Randy to ensure it doesn't break pickles, there is no reason why<BR>it should.<BR><BR>On tha subject Randy, I assume pickles encode the number of BITS FOR<BR>for a field? If not it should.<BR><BR><BR>> We seem to be going through these same point several times. I'm not sure<BR>> what the difficulty is, I'm just repeating myself.<BR>><BR>> Keep in mind this applies *only* to packed structures, ie BIT FOR or bit<BR>> fields.<BR>><BR>> The change I put in libralised the *M3* alignment rules so that BITS FOR<BR>> fields in structures would align on byte boundries if possible instead of<BR>> restricting them to word alignment generally. GCC happily generates code<BR>> for this. There may be restrictions in GCC's C as to how you can arrange<BR>> bit fields but I don't see what they have to do with M3.<BR>><BR>> This is absolutely essentail for using the native APIs on Mac OS X and its<BR>> removal would make M3 pointless for use on the Mac, at least more me.<BR>><BR>> This should be the default behviour. If you are using BITS FOR it's<BR>> becuase you want to arrange the fields in a record in particular way. Why<BR>> then arbitrarliy pad out the fields? If performance is an issue, the user<BR>> should be using appropriate field bit sizes. The implementation rule for<BR>> BITS FOR in M3 is implementation dependent, there are no language issues.<BR>><BR>> The LAZYALIGN pragma (that is, the prgama itself) is something Olaf<BR>> created and had nothing to do with me. I diagreed with it and never used<BR>> it in the version of the compiler I ran. I support its removal.<BR>><BR>><BR>><BR>>> On Feb 18, 2008, at 3:01 PM, Darko wrote:<BR>>><BR>>>> The alignment behaviour is absolutely crucial to programming<BR>>>> natively in Mac OS X and should be kept. I have a great need for it.<BR>>>><BR>>>> The PRGAMA is of no use and can be removed.<BR>>>><BR>>>> Does anyone have any objections to making this alignment behaviour<BR>>>> standard?<BR>>><BR>>> What do you mean make LAZYALIGN standard? Why wouldn't we go with<BR>>> the standard gcc-backend alignment? Perhaps I don't understand what<BR>>> it is you are doing or trying to do. Again, please remind me what it<BR>>> is that LAZYALIGN does and why it is needed.<BR>>><BR>>>> On 19/02/2008, at 4:36 AM, Tony Hosking wrote:<BR>>>><BR>>>>> Can someone remind me again why we need LAZYALIGN? I concur with<BR>>>>> Randy that if it is rarely used and moreso breaks things I would<BR>>>>> argue to abandon it.<BR>>>>><BR>>>>> On Feb 18, 2008, at 10:56 AM, Randy Coleburn wrote:<BR>>>>><BR>>>>>> I use pickles extensively and they are used also by network objects.<BR>>>>>> I've never used LAZYALIGN.<BR>>>>>> My vote is that we don't break something (pickles/netobj) to add<BR>>>>>> support for something that is rarely used.<BR>>>>>> Regards,<BR>>>>>> Randy<BR>>>>>><BR>>>>>> >>> "Rodney M. Bates" <rodney.bates@wichita.edu> 2/15/2008 5:06<BR>>>>>> PM >>><BR>>>>>> I'll put it in comments in the code. I am sure I can fix it to<BR>>>>>> handle LAZYALIGN too, just not sure whether I can do it without<BR>>>>>> requiring existing pickle files to be regenerated and/or existing<BR>>>>>> code that reads/writes pickles to need recompilation.<BR>>>>>><BR>>>>>> Anybody on this list who has code that might be affected if pickles<BR>>>>>> or compiled code were invalidated by a change?<BR>>>>>><BR>>>>>> I do propose we change the way of telling the compiler to do<BR>>>>>> LAZYALIGN so that it is a property of a type and affects all<BR>>>>>> variables of that type.<BR>>>>>><BR>>>>>> Olaf Wagner wrote:<BR>>>>>> > Perhaps we should check-in this description somewhere near the<BR>>>>>> > actual code? Or is there enough documentation already?<BR>>>>>> ><BR>>>>>> > Olaf<BR>>>>>> ><BR>>>>>> > PS: Based on your description, I'd say we should abandon<BR>>>>>> LAZYALIGN.<BR>>>>>> > Or at least put a big sticker on that it will break pickles.<BR>>>>>> ><BR>>>>>> > Quoting "Rodney M. Bates" <rodney.bates@wichita.edu>:<BR>>>>>> ><BR>>>>>> >> The word "Packing" in RTPacking is perhaps misleading. Using<BR>>>>>> BITSIZE,<BR>>>>>> >> etc. only works for getting object layouts as on the machine<BR>>>>>> executing<BR>>>>>> >> the code, which is all that is needed when writing a pickle.<BR>>>>>> >><BR>>>>>> >> When reading, Pickle code needs to know the layouts of a type<BR>>>>>> both as<BR>>>>>> >> it is on the reading machine and as it was on the machine that<BR>>>>>> wrote<BR>>>>>> >> the pickle. The type description that the compiler generates is<BR>>>>>> >> excerpted and contains no field displacements, just lists of<BR>>>>>> field<BR>>>>>> >> types (which are either recursive type descriptions or builtin<BR>>>>>> types).<BR>>>>>> >> So it is independent of word sizes, etc.<BR>>>>>> >><BR>>>>>> >> Pickles regenerates the displacements using the few target<BR>>>>>> machine<BR>>>>>> >> characteristics in a RTPacking.T It traverses a type<BR>>>>>> description and<BR>>>>>> >> simultaneously computes two sets of field displacements, both<BR>>>>>> as they<BR>>>>>> >> are on the reading machine and on the writing machine. For<BR>>>>>> the latter,<BR>>>>>> >> the value of RTPacking.T is (after a compact bit encoding)<BR>>>>>> stored in the<BR>>>>>> >> header of the pickle file. For the former, it's gotten by<BR>>>>>> techniques<BR>>>>>> >> like<BR>>>>>> >> using BITSIZE. This is actually all done in RTTipe, part of<BR>>>>>> m3core, and<BR>>>>>> >> called by Pickle code.<BR>>>>>> >><BR>>>>>> >> This is very fragile. RTTipe has to duplicate the compiler's<BR>>>>>> layout<BR>>>>>> >> behavior. There is no shared code. Making it common would<BR>>>>>> involve<BR>>>>>> >> quite a bit of rework, as the two use substantially different<BR>>>>>> data<BR>>>>>> >> structure and code organization. It will be obvious what kind<BR>>>>>> of bit<BR>>>>>> >> damage could occur if the two algorithms didn't agree.<BR>>>>>> >><BR>>>>>> >> This is why I am obsessing over LAZYALIGN. I have been<BR>>>>>> comparing the<BR>>>>>> >> field displacement computations in RTTipe and in the<BR>>>>>> compiler. The<BR>>>>>> >> former is oblivious to LAZYALIGN.<BR>>>>>> >><BR>>>>>> >> Note that all this is required even without any packing of<BR>>>>>> small fields<BR>>>>>> >> within words. E.G., a record with two INTEGER fields, pickled<BR>>>>>> on a<BR>>>>>> >> 32-bit machine and unpickled on a 64.<BR>>>>>> >><BR>>>>>> >> Tony Hosking wrote:<BR>>>>>> >><BR>>>>>> >>> Rodney,<BR>>>>>> >>><BR>>>>>> >>> Why does there need to be an entry for LONGINT in RTPacking? I<BR>>>>>> >>> would have thought all packing is done on word-sized units<BR>>>>>> anyway.<BR>>>>>> >>> Each side of the connection can check BITSIZE(LONGINT) to<BR>>>>>> figure<BR>>>>>> >>> out what to do presumably no differently from the way<BR>>>>>> INTEGER is<BR>>>>>> >>> communicated between 32-bit and 64-bit machines. Am I missing<BR>>>>>> >>> something?<BR>>>>>> >>><BR>>>>>> >>> -- Tony<BR>>>>>> >>><BR>>>>>> >>> On Feb 15, 2008, at 10:51 AM, Tony Hosking wrote:<BR>>>>>> >>><BR>>>>>> >>>> Ah, OK. I don't much delve in pickle-land. Anything I can<BR>>>>>> help with?<BR>>>>>> >>>><BR>>>>>> >>>> On Feb 14, 2008, at 11:02 PM, Rodney M. Bates wrote:<BR>>>>>> >>>><BR>>>>>> >>>>> 1) RTPacking.T and needs to have a separate size for LONGINT,<BR>>>>>> >>>>> (which can vary independently of the size of INTEGER).<BR>>>>>> >>>>> 2) Variable length values of subrange bounds found in type<BR>>>>>> >>>>> descriptions (in TipeDesc.i3) can now have values beyond<BR>>>>>> >>>>> what the native word size can represent.<BR>>>>>> >>>>> 3) RTType.Kind.Longint (which I presume you, Tony, added<BR>>>>>> recently)<BR>>>>>> >>>>> is not handled by Pickles.<BR>>>>>> >>>>><BR>>>>>> >>>>> I have done some coding on this, but have been interrupted.<BR>>>>>> >>>>><BR>>>>>> >>>>> Tony Hosking wrote:<BR>>>>>> >>>>><BR>>>>>> >>>>>> Why is LONGINT for pickles not yet supported?<BR>>>>>> >>>>><BR>>>>>> >>>>><BR>>>>>> >>>>><BR>>>>>> >>>>> --<BR>>>>>> >>>>> -------------------------------------------------------------<BR>>>>>> >>>>> Rodney M. Bates, retired assistant professor<BR>>>>>> >>>>> Dept. of Computer Science, Wichita State University<BR>>>>>> >>>>> Wichita, KS 67260-0083<BR>>>>>> >>>>> 316-978-3922<BR>>>>>> >>>>> rodney.bates@wichita.edu<BR>>>>>> >>><BR>>>>>> >>><BR>>>>>> >>><BR>>>>>> >>><BR>>>>>> >><BR>>>>>> >> --<BR>>>>>> >> -------------------------------------------------------------<BR>>>>>> >> Rodney M. Bates, retired assistant professor<BR>>>>>> >> Dept. of Computer Science, Wichita State University<BR>>>>>> >> Wichita, KS 67260-0083<BR>>>>>> >> 316-978-3922<BR>>>>>> >> rodney.bates@wichita.edu<BR>>>>>> ><BR>>>>>> ><BR>>>>>> ><BR>>>>>> ><BR>>>>>><BR>>>>>> --<BR>>>>>> -------------------------------------------------------------<BR>>>>>> Rodney M. Bates, retired assistant professor<BR>>>>>> Dept. of Computer Science, Wichita State University<BR>>>>>> Wichita, KS 67260-0083<BR>>>>>> 316-978-3922<BR>>>>>> rodney.bates@wichita.edu<BR>>>>>><BR>>>>><BR>>><BR>>><BR>><BR>><BR>><BR><BR><BR><BR></DIV></BODY></HTML>