At the same time, there's something to be said for not having this functionality in the runtime system at all. Why should marshaling even be done at a layer that lacks proper type information? What if we wanted to make data representation more efficient by packing booleans together under some circumstances? The marshal code wouldn't be able to handle it because it has no type information. I would much rather see a transition to Core's bin_prot ie. generated, typed code and forget about the marshal module altogether. Yotam On Mon, Sep 16, 2013 at 3:09 PM, Yotam Barnoy wrote: > That's a good point. > > Another relatively easy optimization would be to use a bit from the header > on 64-bit platforms (32-bit platforms have no available bits) to indicate > another form of extension, whereby an extra word is used as a bitmap to > indicate which words are floats. Haskell uses a similar trick to indicate > which words are pointers on the stack. This would remove the indirection of > floats in the majority of cases, except of course in the stack itself. > This shouldn't have an impact on marshaling. > > BTW bits in the 64-bit header should probably have been marked as reserved > rather than making the wo_size field impossibly large. > > Yotam > > > > On Mon, Sep 16, 2013 at 1:14 PM, Markus Mottl wrote: > >> On Mon, Sep 16, 2013 at 12:49 PM, Yotam Barnoy >> wrote: >> > Why do doubles need special handling though, even on a 32-bit system? My >> > suggestion is that the Double_tag be changed to Flat_tag, meaning that >> all >> > non-pointer objects can reside in this tag. The only issue I've found >> so far >> > is that polymorphic <, <=, > and >= would not work. However, these >> operators >> > should not be allowed on a vector anyway since there is no natural >> ordering >> > scheme for vectors. If there are other issues, please let me know. >> >> Here is a problem: If you marshal a float array on a 64-bit platform, >> how is the 32-bit platform supposed to know about the "logical" and >> "physical" size of the array? On 64-bit platforms where everything is >> the same size the distinction wouldn't matter, of course, but on >> 32-bit it does. The header word can only provide one size (but tag >> distinctions). >> >