[ 
https://issues.apache.org/jira/browse/THRIFT-2457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13980918#comment-13980918
 ] 

Andrew Cox commented on THRIFT-2457:
------------------------------------

In binary, float and i32 are both 4 bytes, so you could try to encode float 
into an i32, but not in compact...

I kind of like this new idea of encoding the size into new types... here are my 
thoughs:
- There are already >15 existing basic types, so maybe it should be 3-bits + 
5-bits, instead of reserving one?
- 7 combinations (instead of 8) is actually perfect, since you need to leave 
'000' open for the existing types...
- You seem to be describing size in the 3-bit size field, but also relating 
float to i32 based on size. I see no reason to tie new types to existing types 
based on size if we are already adding a size description... maybe just make 
size=000 mean the bottom 5 bits are the original type space, and size!=000 
means the new type space where bottom 5 bits have no historical meaning...

Another separate idea I had, was we could in the future sort serialized fields 
by type id, and only adding new fields type #s at the end of the list, then if 
you hit a type you don't understand you would know you read all you could from 
the message, but in order to skip "the rest of the message", this would still 
require message size become part of the protocol (basically built-in framing).

> fbthrift float
> --------------
>
>                 Key: THRIFT-2457
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2457
>             Project: Thrift
>          Issue Type: Sub-task
>          Components: Build Process, C++ - Compiler, C++ - Library, Test Suite
>            Reporter: Roger Meier
>            Priority: Minor
>             Fix For: 1.0
>
>
> I'm interested into the fbthrift FLOAT data type.
> Which languages are supported?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to