You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Lingfeng Zhuang <zl...@gmail.com> on 2012/05/06 17:36:07 UTC

Support array

Hi all,

Does thrift support array datatype like double[]? I know it support
list<double>, but I prefer double[] in some cases.

Regards

zlf

Re: Support array

Posted by David Nadlinger <co...@klickverbot.at>.
On 6 May 2012, at 17:36, Lingfeng Zhuang wrote:
> Does thrift support array datatype like double[]? I know it support
> list<double>, but I prefer double[] in some cases.

list<> in Thrift does not imply a linked list (or another container with 
sequential access), but just represents a general (ordered) list of 
elements. It e.g. translates to a std::vector<> in C++ or a built-in 
array in D – which target language are you interested in?

David

Re: Support array

Posted by Mark Slee <ms...@fb.com>.
It is also worth just quickly noting that native arrays in C++ present a
few nontrivial hurdles:

- Their length needs to be separately maintained
- If they are on the stack, all the object storage is on the stack (as
opposed to STL)
- If they are dynamic, you now need to manage new/delete calls across
Thrift call-boundaries

Native arrays in Java are more achievable, but the lack of parity with the
other container types and Java idioms does not feel worth it.

Cheers,
mcslee

On 5/7/12 12:23 PM, "Bryan Duxbury" <br...@rapleaf.com> wrote:

>I do not foresee us offering array datatypes.
>
>On Sun, May 6, 2012 at 8:36 AM, Lingfeng Zhuang <zl...@gmail.com> wrote:
>
>> Hi all,
>>
>> Does thrift support array datatype like double[]? I know it support
>> list<double>, but I prefer double[] in some cases.
>>
>> Regards
>>
>> zlf
>>


Re: Support array

Posted by Bryan Duxbury <br...@rapleaf.com>.
I do not foresee us offering array datatypes.

On Sun, May 6, 2012 at 8:36 AM, Lingfeng Zhuang <zl...@gmail.com> wrote:

> Hi all,
>
> Does thrift support array datatype like double[]? I know it support
> list<double>, but I prefer double[] in some cases.
>
> Regards
>
> zlf
>