Typed Arrays and Endianness
On Thu, May 20, 2010 at 4:50 PM, Waldemar Horwat <waldemar at google.com> wrote:
Having unspecified endianness in the specification of TypedArrays seems like a show-stopper to me. There are two alternatives here:
If you do any I/O, you want the endianness to be specified. Sending data from one process to another with a different endianness would get you into trouble.
If you don't do any I/O, then the TypedArray is private to ECMAScript. In this case there are programming techniques which will avoid the bulk of the cost of endian switching, so you don't gain much by leaving endianness unspecified in a language like ECMAScript.
Let's defer this discussion until after tomorrow's face-to-face meeting. Use cases such as WebGL and audio APIs require the native endianness of the platform to be used, even though data is sent from ECMAScript to another library or process on the same machine. I'd also like to find out what you mean about programming techniques to avoid the cost of endianness switching.
Having unspecified endianness in the specification of TypedArrays seems like a show-stopper to me. There are two alternatives here:
If you do any I/O, you want the endianness to be specified. Sending data from one process to another with a different endianness would get you into trouble.
If you don't do any I/O, then the TypedArray is private to ECMAScript. In this case there are programming techniques which will avoid the bulk of the cost of endian switching, so you don't gain much by leaving endianness unspecified in a language like ECMAScript.
Waldemar