typed array strawman proposal

2010-02-05 Thread Kenneth Russell
Apologies for not replying to the thread properly; just joined the list. The typed array proposal Vlad sent out covers the WebGL use case and others which assemble data on the CPU to be handed to, for example, a graphics or audio subsystem. I've seen some feedback that the proposal misses an impo

Re: typed array strawman proposal

2010-01-27 Thread Brendan Eich
On Jan 27, 2010, at 10:56 AM, Vladimir Vukicevic wrote: new Uint8Array(origArray.buffer, origArray.byteOffset + startIndex, endIndex - startIndex); And assuming range(), a real slice() would be: new Uint8Array(origArray.slice(start, end)); Confirmed with Vlad that the last line's bit to

Re: typed array strawman proposal

2010-01-27 Thread Vladimir Vukicevic
On 1/26/2010 11:25 PM, Kris Kowal wrote: On Tue, Jan 26, 2010 at 10:43 AM, Vladimir Vukicevic wrote: Howdy, At Brendan's request, I've just added a new strawman proposal for ES typed arrays to the wiki. This proposal comes from the WebGL group, which needed a way of efficient access to a

Re: typed array strawman proposal

2010-01-27 Thread Brendan Eich
On Jan 27, 2010, at 10:41 AM, Brendan Eich wrote: Only native code can do this currently, whether generated by a C++ compiler or even a crazy pattern-matching compiler that tries to recognize bitwise ops clamping doubles stored in JS Arrays. The latter, besides being crazy, does not prevent

Re: typed array strawman proposal

2010-01-27 Thread Brendan Eich
On Jan 27, 2010, at 10:36 AM, P T Withington wrote: On 2010-01-27, at 13:17, Brendan Eich wrote: On Jan 27, 2010, at 10:15 AM, P T Withington wrote: On 2010-01-27, at 13:06, Brendan Eich wrote: Anyway, we do not want to require exotic techniques. We want to allow C++ implementations, whic

Re: typed array strawman proposal

2010-01-27 Thread P T Withington
On 2010-01-27, at 13:17, Brendan Eich wrote: > On Jan 27, 2010, at 10:15 AM, P T Withington wrote: > >> On 2010-01-27, at 13:06, Brendan Eich wrote: >> >>> Anyway, we do not want to require exotic techniques. We want to allow C++ >>> implementations, which require constants to avoid obvious per

Re: typed array strawman proposal

2010-01-27 Thread Brendan Eich
On Jan 27, 2010, at 10:15 AM, P T Withington wrote: On 2010-01-27, at 13:06, Brendan Eich wrote: Anyway, we do not want to require exotic techniques. We want to allow C++ implementations, which require constants to avoid obvious performance hits for no good reason. Competition will kill any

Re: typed array strawman proposal

2010-01-27 Thread P T Withington
On 2010-01-27, at 13:06, Brendan Eich wrote: > Anyway, we do not want to require exotic techniques. We want to allow C++ > implementations, which require constants to avoid obvious performance hits > for no good reason. Competition will kill any browser foolish enough to take > such hits. That

Re: typed array strawman proposal

2010-01-27 Thread Brendan Eich
On Jan 27, 2010, at 9:32 AM, P T Withington wrote: On 2010-01-27, at 12:17, Brendan Eich wrote: On Jan 27, 2010, at 8:16 AM, Peter van der Zee wrote: new ArrayMapping(arrBuf, intBits, intStart, intFinish); The WebGL use-case cannot tolerate scaling by a variable "intBits" element width.

Re: typed array strawman proposal

2010-01-27 Thread P T Withington
On 2010-01-27, at 12:17, Brendan Eich wrote: > On Jan 27, 2010, at 8:16 AM, Peter van der Zee wrote: > >> new ArrayMapping(arrBuf, intBits, intStart, intFinish); > > The WebGL use-case cannot tolerate scaling by a variable "intBits" element > width. It wants constant (compile-time) element size

Re: typed array strawman proposal

2010-01-27 Thread Brendan Eich
On Jan 27, 2010, at 8:16 AM, Peter van der Zee wrote: new ArrayMapping(arrBuf, intBits, intStart, intFinish); The WebGL use-case cannot tolerate scaling by a variable "intBits" element width. It wants constant (compile-time) element size. Moreover, what you propose is strictly less usable

Re: typed array strawman proposal

2010-01-27 Thread Brendan Eich
On Jan 27, 2010, at 12:20 AM, Michael Daumling wrote: I am unsure about the intent of JS ByteArrays. To me, the proposal looks like an Array implementation, where all elements are guaranteed to be of the same type. If this is the intent, then fine. But if the intent is to offer wrappers aro

RE: typed array strawman proposal

2010-01-27 Thread Peter van der Zee
@mozilla.org] On Behalf Of Kris Kowal > Sent: Tuesday, January 26, 2010 11:26 PM > To: Vladimir Vukicevic > Cc: es-discuss@mozilla.org > Subject: Re: typed array strawman proposal > > On Tue, Jan 26, 2010 at 10:43 AM, Vladimir Vukicevic > wrote: > >> Howdy, >> >

RE: typed array strawman proposal

2010-01-27 Thread Michael Daumling
-boun...@mozilla.org [mailto:es-discuss-boun...@mozilla.org] On Behalf Of Kris Kowal Sent: Tuesday, January 26, 2010 11:26 PM To: Vladimir Vukicevic Cc: es-discuss@mozilla.org Subject: Re: typed array strawman proposal On Tue, Jan 26, 2010 at 10:43 AM, Vladimir Vukicevic wrote: > Howdy, >

Re: typed array strawman proposal

2010-01-26 Thread Kris Kowal
On Tue, Jan 26, 2010 at 10:43 AM, Vladimir Vukicevic wrote: > Howdy, > > At Brendan's request, I've just added a new strawman proposal for ES typed > arrays to the wiki.  This proposal comes from the WebGL group, which needed > a way of efficient access to and manipulation of native machine-type a

Re: typed array strawman proposal

2010-01-26 Thread P T Withington
On 2010-01-26, at 13:43, Vladimir Vukicevic wrote: > Howdy, > > At Brendan's request, I've just added a new strawman proposal for ES typed > arrays to the wiki. This proposal comes from the WebGL group, which needed a > way of efficient access to and manipulation of native machine-type arrays;

typed array strawman proposal

2010-01-26 Thread Vladimir Vukicevic
Howdy, At Brendan's request, I've just added a new strawman proposal for ES typed arrays to the wiki. This proposal comes from the WebGL group, which needed a way of efficient access to and manipulation of native machine-type arrays; once we came up with a reasonable baseline API, it looked