Re: Proposal for exact matching and matching at a position in RegExp

2010-01-27 Thread Andy Chu
(The original message was held up in spam moderation for awhile) Here is an addendum, after it was pointed out to me that this issue has come up before: http://andychu.net/ecmascript/RegExp-Enhancements-2.html Basically the proposal is to add parameters which can override the internal state of t

Proposal for exact matching and matching at a position in RegExp

2010-01-27 Thread Andy Chu
Here is a very simple proposal. If I can get access to the wiki I could copy it in, but for now it's here: http://andychu.net/ecmascript/RegExp-Enhancements.html Comments appreciated. thanks, Andy ___ es-discuss mailing list es-discuss@mozilla.org htt

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
Rather than an arbitrary subset of sizes (Int32Array, etc) I would rather see some kind of generic ArrayMapping or ArrayVector that takes another array and the size of each cell (position of the array) in bits as an argument. So.. new ArrayMapping(arrBuf, intBits, intStart, intFinish); That way y

RE: typed array strawman proposal

2010-01-27 Thread Michael Daumling
For this proposal, I would not use the term ByteArray. It may lead to confusion with existing definitions of ByteArray, such as in ActionScript, where a ByteArray is a wrapper around arbitrary binary data. The ActionScript ByteArray APIs are file oriented, with members like readInt() or writeUTF