Re: ECMAScript octet representation (was: Re: Bindings spec ready for FPWD?)

> Anne van Kesteren:
> > It would still be very good to have an octet / byte representation in
> > ECMAScript. I'm aware of a couple of implementations of such a thing, but
> > I haven't been able to play with them or figure out how they work exactly
> > myself:

[snip]

> >   2. I heard Adobe Flex has some notion of a byte array to represent files.

<uri:http://livedocs.adobe.com/flex/2/langref/flash/utils/ByteArray.html>


On 28/06/07, Cameron McCormack <cam@mcc.id.au> wrote:
> Does sequence<octet> not cover that?  Would you prefer it to be
> "looser", in that [[Get]]s and [[Put]]s work like an array, but it is
> not an ECMAScript Array object (so that it can have some more efficient
> representation underneath)?

I would prefer that. The ES4 built-ins include a ByteArray object that
sounds promising for this, and as Maciej pointed out to me in a mail
on an entirely different topic ES4 library functionality can be added
to ES3 implementations. (Unless it violates ES3 rules in some way, of
course.) The proposal on the public export ES4 wiki misses some wanted
functionality, but then again considerable time has passed since last
export.

The first prerelease of the reference implementation of ES4 specified
ByteArray fleshes it out some from the public export proposal. (See
attachments...)

Even if you find ByteArray unsuitable for the bindings since ES3
engines don't have it as built-in, I'd like to see it specified in
such a way that ES4 engines are allowed to use the native ByteArray
instead of having either a less performant ES3 Array-based solution or
a second ByteArray-like DOM host object.
-- 
David "liorean" Andersson

Received on Thursday, 28 June 2007 18:39:23 UTC