Binary data: Structs and ArrayBuffers
jussi.kalliokoski at gmail.com
Mon Dec 3 11:53:28 PST 2012
I was just reading through the binary data proposal  and I have a few
comments / questions:
First of all, how will this integrate with the Typed Arrays? Will a struct
have an intrinsic ArrayBuffer? What about an ArrayType instance? If they
do, how will it react to typeless properties? Are typeless properties
allowed in the first place (IIRC there was a talk I watched where David
Herman or someone else said that this might be)? Will you be able to
extract structs out of an ArrayBuffer?
What about strings? Looking through the binary data related proposals,
there seems to be no good way of extracting strings from binary data.
Should we have, for example StringType(DOMString encoding, uint length,
boolean isPadded=false) for Structs? Or, should DataView have a method for
extracting a string from it? What about storing one?
Pointers. Now it's useful if a struct can contain an array of arbitrary
size, but we don't have pointers. We can't let the struct be of arbitrary
size either. What are the thoughts on this?
Arrays inside structs. Are there plans for this? They're not absolutely
necessary, but often quite handy anyway, for example:
Is way simpler to manage than:
Also, what's the plan with Typed Arrays anyway? Are we going to adopt them
as a part of JS or leave it as an extension?
ultimately we'll get something workable, and would love to see more
discussion around this!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss