RE: Adoption of the Typed Array Specification

> From: Kenneth Russell [mailto:kbr@google.com]
> Out of curiosity what are the implications of the word "buffer"?

The usage isn't absolute, but the term "buffer" is often used to for areas of memory that hold transient data.  Often data that is being moved from one place or representation to another.  See, for example, the definitions  at http://www.cheap56k.com/glossary/Buffer.html and http://www.techweb.com/encyclopedia/defineterm.jhtml?term=buffer .

In the TypedArray proposal, ArrayBuffers are not necessarily used in such a transient manner.  They can be used to implement such buffers, but they may also be used to implement other storage use cases.  Such usage decisions are really in the domain of the application design, not the core library design.  To me, that raises a flag about the use of the term "Buffer" in that context.

The use of "Array" also seems inappropriate.  In the TypedArrayProposal, ArrayBuffer isn't even used exclusively as the backing store for view objects that provide Array-like access.  It is also used as the backing store for DataView that provides heterogeneous data access.  In addition, ArrayBuffer (as currently spec'ed) doesn't directly provide any JavaScript array-like behaviors, so use of "Array" in its name also seems misleading for that reason.

That's why I would generally prefer an application and access neutral name such as Blob, BinaryData, ByteBlob, etc.

Allen



> -----Original Message-----
> From: Kenneth Russell [mailto:kbr@google.com]
> Sent: Monday, May 17, 2010 5:10 PM
> To: Allen Wirfs-Brock
> Cc: Chris Marrin; Alex Russell; arun@mozilla.com; es-discuss@mozilla.org;
> public-script-coord@w3.org; Erik Arvidsson
> Subject: Re: Adoption of the Typed Array Specification
> 
> On Fri, May 14, 2010 at 9:28 AM, Allen Wirfs-Brock <Allen.Wirfs-
> Brock@microsoft.com> wrote:
> > Name is important.  As a stawman I suggest replacing the name ArrayBuffer
> with BinaryBlob  (Binary is redundant in this context but I'd be worried about
> name conflicts with just Blob).  BinaryBuffer would also work but the word
> buffer may carry implications for some people that do really apply here.
> 
> Out of curiosity what are the implications of the word "buffer"?
> 
> Out of the naming suggestions proposed here I still prefer "ArrayBuffer". It
> meshes with the name of the spec -- TypedArrays -- and indicates that it's the
> buffer which backs the various views.
> 
> -Ken
> 
> > Allen
> >
> >> -----Original Message-----
> >> From: es-discuss-bounces@mozilla.org [mailto:es-discuss-
> >> bounces@mozilla.org] On Behalf Of Chris Marrin
> >> Sent: Friday, May 14, 2010 7:27 AM
> >> To: Alex Russell
> >> Cc: arun@mozilla.com; public-script-coord@w3.org; Erik Arvidsson; es-
> >> discuss@mozilla.org
> >> Subject: Re: Adoption of the Typed Array Specification
> >>
> >>
> >> On May 13, 2010, at 10:21 PM, Alex Russell wrote:
> >>
> >> > On May 13, 2010, at 5:15 PM, Vladimir Vukicevic wrote:
> >> >
> >> >> This is difficult to do, given the goals of typed arrays -- they
> >> >> wouldn't behave
> >> like normal Arrays in most meaningful ways.
> >> >
> >> > Sounds like a bug to be fixed ;-)
> >> >
> >> >> At the core, an ArrayBuffer is of fixed size, and it doesn't make
> >> >> sense to index
> >> an ArrayBuffer directly (because there's no indication of what format
> >> the data should be accessed in). Making the array view types
> >> instances of Array might work, but again given that they're fixed
> >> length, there's a significant difference there.
> >> >
> >> >
> >> > That the length property of a particular array subclass leaves the
> >> > constructor
> >> non-configurable and read-only isn't much of a trick in ES5. That
> >> said, why
> >> *doesn't* TypedArray spec a mutable variant? Surely it'd be useful.
> >>
> >> One of the important aspects of ArrayBuffer is its fixed length. As I
> >> mentioned before, perhaps the issue here is the poor naming (using
> >> "Array" in the names of objects that don't behave in the same way as
> >> the ES Array object). The names can be changed but I think we need
> >> the concept of a fixed length buffer with fixed views into it.
> >> _______________________________________________
> >> es-discuss mailing list
> >> es-discuss@mozilla.org
> >> https://mail.mozilla.org/listinfo/es-discuss
> >
> > _______________________________________________
> > es-discuss mailing list
> > es-discuss@mozilla.org
> > https://mail.mozilla.org/listinfo/es-discuss
> >

Received on Wednesday, 19 May 2010 01:14:21 UTC