<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-19315</id>
	<title>Nabble - Mozilla - ECMAScript 4 discussion</title>
	<updated>2009-11-09T21:17:21Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/Mozilla---ECMAScript-4-discussion-f19315.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Mozilla---ECMAScript-4-discussion-f19315.html" />
	<subtitle type="html"></subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26278457</id>
	<title>Re: Function.prototype, [[Call]] and [[Construct]]</title>
	<published>2009-11-09T21:17:21Z</published>
	<updated>2009-11-09T21:17:21Z</updated>
	<author>
		<name>Juriy Zaytsev</name>
	</author>
	<content type="html">&lt;br&gt;On Nov 10, 2009, at 12:10 AM, Garrett Smith wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Mon, Nov 9, 2009 at 8:05 PM, Juriy Zaytsev &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26278457&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kangax.dev@...&lt;/a&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; On Nov 9, 2009, at 6:50 PM, Garrett Smith wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; [[Construct]] of Function.prototype is not standardized.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; [...]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; If you look into Section 15 — Native ECMAScript Objects, you'll see &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; this
&lt;br&gt;&amp;gt;&amp;gt; rather clear explanation:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;quot;[...] None of the built-in functions described in this section shall
&lt;br&gt;&amp;gt;&amp;gt; implement the internal [[Construct]] method unless otherwise &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; specified in
&lt;br&gt;&amp;gt;&amp;gt; the description of a particular function. None of the built-in &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; functions
&lt;br&gt;&amp;gt;&amp;gt; described in this section shall initially have a prototype property &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; unless
&lt;br&gt;&amp;gt;&amp;gt; otherwise specified in the description of a particular function. &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; [...]&amp;quot;
&lt;/div&gt;&lt;br&gt;[...]
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So Function.prototype should not implement [[Construct]].
&lt;br&gt;&lt;br&gt;As far as I can see, no, it shouldn't.
&lt;br&gt;&lt;br&gt;WebKit (nightly) and Opera (10) conform here, throwing TypeError on &amp;nbsp;
&lt;br&gt;`new Function.prototype`, but Firefox (at least 3.5) erroneously &amp;nbsp;
&lt;br&gt;creates an object.
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Garrett
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;kangax
&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26278457&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Function.prototype%2C---Call---and---Construct---tp26275940p26278457.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26278407</id>
	<title>Re: Function.prototype, [[Call]] and [[Construct]]</title>
	<published>2009-11-09T21:10:22Z</published>
	<updated>2009-11-09T21:10:22Z</updated>
	<author>
		<name>Garrett</name>
	</author>
	<content type="html">On Mon, Nov 9, 2009 at 8:05 PM, Juriy Zaytsev &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26278407&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kangax.dev@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; On Nov 9, 2009, at 6:50 PM, Garrett Smith wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; [[Construct]] of Function.prototype is not standardized.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&lt;br&gt;[...]
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If you look into Section 15 — Native ECMAScript Objects, you'll see this
&lt;br&gt;&amp;gt; rather clear explanation:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;quot;[...] None of the built-in functions described in this section shall
&lt;br&gt;&amp;gt; implement the internal [[Construct]] method unless otherwise specified in
&lt;br&gt;&amp;gt; the description of a particular function. None of the built-in functions
&lt;br&gt;&amp;gt; described in this section shall initially have a prototype property unless
&lt;br&gt;&amp;gt; otherwise specified in the description of a particular function. [...]&amp;quot;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;That's pretty clear. I had interpreted that as meaning the global
&lt;br&gt;functions (eval, parseInt), but now I see that that text applies to
&lt;br&gt;the whole section 15, not just the function properties (as I had
&lt;br&gt;misread it).
&lt;br&gt;&lt;br&gt;&amp;gt; In fact, I mentioned this exact phrase when writing about bugs in various
&lt;br&gt;&amp;gt; browsers, revealed through Sputniktests web runner
&lt;br&gt;&amp;gt; (&lt;a href=&quot;http://thinkweb2.com/projects/prototype/sputniktests-web-runner/#construct-and-prototype-of-builtins&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://thinkweb2.com/projects/prototype/sputniktests-web-runner/#construct-and-prototype-of-builtins&lt;/a&gt;).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; And as I said in a post, Firefox and Chrome, for example, fail a whole bunch
&lt;br&gt;&amp;gt; of tests due to most of built-in methods (like `Array.prototype.toString`,
&lt;br&gt;&amp;gt; `parseInt` or `String.prototype.slice`) implementing [[Construct]] and
&lt;br&gt;&amp;gt; having .prototype properties.
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;So Function.prototype should not implement [[Construct]].
&lt;br&gt;&lt;br&gt;Garrett
&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26278407&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Function.prototype%2C---Call---and---Construct---tp26275940p26278407.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26278002</id>
	<title>Re: Function.prototype, [[Call]] and [[Construct]]</title>
	<published>2009-11-09T20:05:11Z</published>
	<updated>2009-11-09T20:05:11Z</updated>
	<author>
		<name>Juriy Zaytsev</name>
	</author>
	<content type="html">On Nov 9, 2009, at 6:50 PM, Garrett Smith wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; [[Construct]] of Function.prototype is not standardized.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The definition of Function.prototype does not define the expected
&lt;br&gt;&amp;gt; behavior for [[Call]] or [[Construct]]. Instead, there is a
&lt;br&gt;&amp;gt; description of what happens when it is invoked:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; | 15.3.4 Properties of the Function Prototype Object
&lt;br&gt;&amp;gt; | &amp;nbsp;The Function prototype object is itself a Function
&lt;br&gt;&amp;gt; | object (its [[Class]] is &amp;quot;Function&amp;quot;) that, when
&lt;br&gt;&amp;gt; | invoked, accepts any arguments and returns undefined.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Should Function.prototype implement [[Construct]]? Either way, the
&lt;br&gt;&amp;gt; specification should state the outcome.
&lt;/div&gt;&lt;br&gt;Yes, it's a slightly tricky one :) I was wading through Sputniktests &amp;nbsp;
&lt;br&gt;suite couple of days ago (when finishing web runner — &lt;a href=&quot;http://thinkweb2.com/projects/prototype/sputniktests-web-runner/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://thinkweb2.com/projects/prototype/sputniktests-web-runner/&lt;/a&gt;&amp;nbsp;
&lt;br&gt;) and noticed that there were assertions for exactly this kind of &amp;nbsp;
&lt;br&gt;compliance.
&lt;br&gt;&lt;br&gt;I even filed a bug with Sputniktests, thinking that they make &amp;nbsp;
&lt;br&gt;incorrect assumptions — &lt;a href=&quot;http://code.google.com/p/sputniktests/issues/detail?id=11&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/p/sputniktests/issues/detail?id=11&lt;/a&gt;&lt;br&gt;&lt;br&gt;However, then I realized that specs do in fact mention this &amp;nbsp;
&lt;br&gt;explicitly, although not directly under these specific sections.
&lt;br&gt;&lt;br&gt;If you look into Section 15 — Native ECMAScript Objects, you'll see &amp;nbsp;
&lt;br&gt;this rather clear explanation:
&lt;br&gt;&lt;br&gt;&amp;quot;[...] None of the built-in functions described in this section shall &amp;nbsp;
&lt;br&gt;implement the internal [[Construct]] method unless otherwise specified &amp;nbsp;
&lt;br&gt;in the description of a particular function. None of the built-in &amp;nbsp;
&lt;br&gt;functions described in this section shall initially have a prototype &amp;nbsp;
&lt;br&gt;property unless otherwise specified in the description of a particular &amp;nbsp;
&lt;br&gt;function. [...]&amp;quot;
&lt;br&gt;&lt;br&gt;In fact, I mentioned this exact phrase when writing about bugs in &amp;nbsp;
&lt;br&gt;various browsers, revealed through Sputniktests web runner (&lt;a href=&quot;http://thinkweb2.com/projects/prototype/sputniktests-web-runner/#construct-and-prototype-of-builtins&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://thinkweb2.com/projects/prototype/sputniktests-web-runner/#construct-and-prototype-of-builtins&lt;/a&gt;&amp;nbsp;
&lt;br&gt;).
&lt;br&gt;&lt;br&gt;And as I said in a post, Firefox and Chrome, for example, fail a whole &amp;nbsp;
&lt;br&gt;bunch of tests due to most of built-in methods (like &amp;nbsp;
&lt;br&gt;`Array.prototype.toString`, `parseInt` or `String.prototype.slice`) &amp;nbsp;
&lt;br&gt;implementing [[Construct]] and having .prototype properties.
&lt;br&gt;&lt;br&gt;[...]
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;kangax
&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26278002&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Function.prototype%2C---Call---and---Construct---tp26275940p26278002.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26275940</id>
	<title>Function.prototype, [[Call]] and [[Construct]]</title>
	<published>2009-11-09T15:50:24Z</published>
	<updated>2009-11-09T15:50:24Z</updated>
	<author>
		<name>Garrett</name>
	</author>
	<content type="html">[[Construct]] of Function.prototype is not standardized.
&lt;br&gt;&lt;br&gt;The definition of Function.prototype does not define the expected
&lt;br&gt;behavior for [[Call]] or [[Construct]]. Instead, there is a
&lt;br&gt;description of what happens when it is invoked:
&lt;br&gt;&lt;br&gt;| 15.3.4 Properties of the Function Prototype Object
&lt;br&gt;| &amp;nbsp;The Function prototype object is itself a Function
&lt;br&gt;| object (its [[Class]] is &amp;quot;Function&amp;quot;) that, when
&lt;br&gt;| invoked, accepts any arguments and returns undefined.
&lt;br&gt;&lt;br&gt;Should Function.prototype implement [[Construct]]? Either way, the
&lt;br&gt;specification should state the outcome.
&lt;br&gt;&lt;br&gt;Trying it out:
&lt;br&gt;&lt;br&gt;javascript: alert( new Function.prototype );
&lt;br&gt;&lt;br&gt;IE 6-8:
&lt;br&gt;Error: Object doesn't support this action
&lt;br&gt;&lt;br&gt;Other browsers tested return an Object, indicating the [[Construct]]
&lt;br&gt;is implemented.
&lt;br&gt;&lt;br&gt;The specification should state whether or not Function.prototype
&lt;br&gt;implements [[Construct]], to clarify expected outcome, and to
&lt;br&gt;encourage consistent implementations.
&lt;br&gt;&lt;br&gt;Garrett
&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26275940&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Function.prototype%2C---Call---and---Construct---tp26275940p26275940.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26260570</id>
	<title>Re: Binary Data - possible topic for joint session</title>
	<published>2009-11-08T18:54:29Z</published>
	<updated>2009-11-08T18:54:29Z</updated>
	<author>
		<name>Daniel Friesen-4</name>
	</author>
	<content type="html">Maciej Stachowiak wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Nov 7, 2009, at 5:39 AM, Ash Berlin wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; On 6 Nov 2009, at 19:24, Brendan Eich wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; On Nov 6, 2009, at 10:44 AM, Dean Landolt wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Just in case some of you weren't aware, the CommonJS group has done 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; quite a bit of work and (bikeshedding) on this topic. Here's a link 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; to the wiki:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://wiki.commonjs.org/wiki/Binary&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://wiki.commonjs.org/wiki/Binary&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ...
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Binary/B is the closest of the three proposals to mine, in that it has 
&lt;br&gt;&amp;gt; both mutable and immutable binary data containers. Here are a few key 
&lt;br&gt;&amp;gt; differences:
&lt;br&gt;&amp;gt; ...
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Maciej
&lt;/div&gt;One note, Binary/C also originally had a mutable and an immutable type. 
&lt;br&gt;The mutable type was moved to IO/B/Buffer 
&lt;br&gt;(&lt;a href=&quot;http://wiki.commonjs.org/wiki/IO/B/Buffer&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://wiki.commonjs.org/wiki/IO/B/Buffer&lt;/a&gt;), when comparing to Binary/B, 
&lt;br&gt;Binary/C together with IO/B/Buffer is more equivalent a comparison.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;~Daniel Friesen (Dantman, Nadir-Seen-Fire) [&lt;a href=&quot;http://daniel.friesen.name&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://daniel.friesen.name&lt;/a&gt;]
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26260570&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Binary-Data---possible-topic-for-joint-session-tp26229087p26260570.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26250705</id>
	<title>Re: Binary Data - possible topic for joint session</title>
	<published>2009-11-07T19:17:48Z</published>
	<updated>2009-11-07T19:17:48Z</updated>
	<author>
		<name>Maciej Stachowiak</name>
	</author>
	<content type="html">&lt;html&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;br&gt;&lt;div&gt;&lt;div&gt;On Nov 7, 2009, at 6:53 PM, Ash Berlin wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;br&gt;&lt;div&gt;&lt;div&gt;On 8 Nov 2009, at 02:21, Maciej Stachowiak wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;br&gt;&lt;div&gt;&lt;div&gt;On Nov 7, 2009, at 5:39 AM, Ash Berlin wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;On 6 Nov 2009, at 19:24, Brendan Eich wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;div&gt;On Nov 6, 2009, at 10:44 AM, Dean Landolt wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;a href=&quot;http://wiki.commonjs.org/wiki/Binary&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://wiki.commonjs.org/wiki/Binary&lt;/a&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;div&gt;[snip]&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;[snip]&lt;/div&gt;&lt;div&gt;As a community (CommonJS) we'd be more than happy to go forward with a binary spec that came from (or at least has the blessing of) the ES groups&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;div&gt;Binary/B is the closest of the three proposals to mine, in that it has both mutable and immutable binary data containers. Here are a few key differences:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;(1) Binary/B does not have a cheap way to convert from the immutable representation (ByteString) to the mutable representation (ByteArray)&lt;/div&gt;&lt;div&gt;(2) In Binary/B, Array-like index access to ByteString gives back one-byte ByteStrings instead of bytes, likely an over-literal copying of String&lt;/div&gt;&lt;div&gt;(3) There are some seemingly needless differences in the interfaces to ByteString and ByteArray that follow from modeling on String and Array&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;div&gt;(4) Binary/B has many more operations available in the base proposal (including charset transcoding and a generous selection of String and Array methods)&lt;/div&gt;&lt;div&gt;(5) Different names - Data/DataBuilder vs. ByteString/ByteArray&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;On (1): cheap conversion from mutable to immutable (DataBuilder.prototype.release() in my proposal) lets binary data objects be built up with a convenient mutation-based idiom, but then passed around as immutable objects thereafter. &lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Mutable to immutable or immutable to mutable? Assuming the former, how do you handle the differences in API/behaviour? each function checks wether it is now immutable?&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Mutable to immutable. Immutable to mutable has to copy (or at least copy-on-write).&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;My proposal does it like this (where DataBuilder is the mutable variant and Data is the immutable):&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;DataBuilder.prototype.release()&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Return a new Data with the same length and the same byte values as the DataBuilder passed as the this value. At the same time, the DataBuilder is reset to length 0.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Because the DataBuilder is reset to empty, the implementation can &quot;steal&quot; its underlying buffer for the new Data object, thus converting to immutable without a full copy. This matches the common pattern of assembling a new piece of binary data with mutation, then handing it out to possibly multiple other pieces of code as immutable.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;On (2): I don't think a one-byte ByteString is ever useful, indexing to get the byte value would be much more helpful. &lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Couldn't agree more with you here - if for whatever reason you do want a one-byte ByteString, there is always substr/substring. This is something that came up recently in IRC and prompted me to start looking at making changes to the proposal - I was going to do that next week, so this coming up now is very good timing.&lt;/div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;On (3), I think it's good for the mutable interface to be a strict superset of the the immutable interface.&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Seems like a reasonable thing to do.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I'm glad we agree on these two points.&lt;/div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;(4) and (5) are all points where perhaps neither proposal is at the optimum yet. On (4), I suspect the sweet spot is somewhere between my spartan set of built-in operations and the very generous set in Binary/B.&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Agreed - this was the other thing i noticed - e.g. sorting a ByteArray isn't really an operation that makes a whole lot of sense to my mind.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Yep. I'm not even sure things like map(), filter() or reduce() are likely to work well. My own preference is to start the API very small, and add incrementally based on demonstrated need and clearly articulated use cases.&lt;/div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt; On (5), I'm not sure either set of names is the best possible, and I'm certainly not stuck on my own proposed names.&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I'm not really bothered either way on this front, although 'Data' is much more likely to clash with existing code.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Yes, Brendan made this point and presented some good evidence in that direction. I think 'Data' doesn't work but 'Binary' or 'BinData' might.&lt;/div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Something worth bearing in mind is that Binary/B is implemented in 2 or 3 CommonJS platforms already, but I don't think any one is particularly attached to the behaviour so long as what comes out isn't wildly different.&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;div&gt;What kind of differences do you think they would tolerate? Renaming the classes? Dropping/changing some methods?&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Regards,&lt;/div&gt;&lt;div&gt;Maciej&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26250705&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Binary-Data---possible-topic-for-joint-session-tp26229087p26250705.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26250602</id>
	<title>Re: Binary Data - possible topic for joint session</title>
	<published>2009-11-07T18:53:59Z</published>
	<updated>2009-11-07T18:53:59Z</updated>
	<author>
		<name>Ash Berlin-5</name>
	</author>
	<content type="html">&lt;html&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;br&gt;&lt;div&gt;&lt;div&gt;On 8 Nov 2009, at 02:21, Maciej Stachowiak wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;br&gt;&lt;div&gt;&lt;div&gt;On Nov 7, 2009, at 5:39 AM, Ash Berlin wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;On 6 Nov 2009, at 19:24, Brendan Eich wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;div&gt;On Nov 6, 2009, at 10:44 AM, Dean Landolt wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;a href=&quot;http://wiki.commonjs.org/wiki/Binary&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://wiki.commonjs.org/wiki/Binary&lt;/a&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;div&gt;[snip]&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;[snip]&lt;/div&gt;&lt;div&gt;As a community (CommonJS) we'd be more than happy to go forward with a binary spec that came from (or at least has the blessing of) the ES groups&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;div&gt;Binary/B is the closest of the three proposals to mine, in that it has both mutable and immutable binary data containers. Here are a few key differences:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;(1) Binary/B does not have a cheap way to convert from the immutable representation (ByteString) to the mutable representation (ByteArray)&lt;/div&gt;&lt;div&gt;(2) In Binary/B, Array-like index access to ByteString gives back one-byte ByteStrings instead of bytes, likely an over-literal copying of String&lt;/div&gt;&lt;div&gt;(3) There are some seemingly needless differences in the interfaces to ByteString and ByteArray that follow from modeling on String and Array&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;div&gt;(4) Binary/B has many more operations available in the base proposal (including charset transcoding and a generous selection of String and Array methods)&lt;/div&gt;&lt;div&gt;(5) Different names - Data/DataBuilder vs. ByteString/ByteArray&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;On (1): cheap conversion from mutable to immutable (DataBuilder.prototype.release() in my proposal) lets binary data objects be built up with a convenient mutation-based idiom, but then passed around as immutable objects thereafter. &lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Mutable to immutable or immutable to mutable? Assuming the former, how do you handle the differences in API/behaviour? each function checks wether it is now immutable?&lt;/div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;On (2): I don't think a one-byte ByteString is ever useful, indexing to get the byte value would be much more helpful. &lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Couldn't agree more with you here - if for whatever reason you do want a one-byte ByteString, there is always substr/substring. This is something that came up recently in IRC and prompted me to start looking at making changes to the proposal - I was going to do that next week, so this coming up now is very good timing.&lt;/div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;On (3), I think it's good for the mutable interface to be a strict superset of the the immutable interface.&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Seems like a reasonable thing to do.&lt;/div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;(4) and (5) are all points where perhaps neither proposal is at the optimum yet. On (4), I suspect the sweet spot is somewhere between my spartan set of built-in operations and the very generous set in Binary/B.&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Agreed - this was the other thing i noticed - e.g. sorting a ByteArray isn't really an operation that makes a whole lot of sense to my mind.&amp;nbsp;&lt;/div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt; On (5), I'm not sure either set of names is the best possible, and I'm certainly not stuck on my own proposed names.&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I'm not really bothered either way on this front, although 'Data' is much more likely to clash with existing code.&lt;/div&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Regards,&lt;/div&gt;&lt;div&gt;Maciej&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;div&gt;Something worth bearing in mind is that Binary/B is implemented in 2 or 3 CommonJS platforms already, but I don't think any one is particularly attached to the behaviour so long as what comes out isn't wildly different.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;-ash&amp;nbsp;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26250602&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Binary-Data---possible-topic-for-joint-session-tp26229087p26250602.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26250476</id>
	<title>Re: Binary Data - possible topic for joint session</title>
	<published>2009-11-07T18:21:17Z</published>
	<updated>2009-11-07T18:21:17Z</updated>
	<author>
		<name>Maciej Stachowiak</name>
	</author>
	<content type="html">&lt;html&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;br&gt;&lt;div&gt;&lt;div&gt;On Nov 7, 2009, at 5:39 AM, Ash Berlin wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;br&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;On 6 Nov 2009, at 19:24, Brendan Eich wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;div&gt;On Nov 6, 2009, at 10:44 AM, Dean Landolt wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;Just in case some of you weren't aware, the CommonJS group has done quite a bit of work and (bikeshedding) on this topic. Here's a link to the wiki:&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://wiki.commonjs.org/wiki/Binary&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://wiki.commonjs.org/wiki/Binary&lt;/a&gt;&lt;br&gt;&lt;br&gt;If nothing else there's quite a bit of prior art collected which should inform the conversation. I know the Binary/B proposal has the implementation momentum, but I don't know exactly what the status is. I haven't been closely following the evolution of these binary specs too closely but since it seems that nearly everyone else from the group is off to jsconf.eu I figured I ought to toss this out there.&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;div&gt;Thanks, I had forgotten about commonjs.org, having once paid better attention.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Kris did a good job with Binary/B (although I do not see the point of the .get method additions) -- I didn't look at the other proposals yet.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;/be&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Binary/B feels largely right, but it has a few too many methods from Array simply because Array had them for my taste, specifically things like sort, reduce, shift, unshift etc.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Conceptually: why would you want to sort an array of bytes? There are certainly classes of operations that I think should just be done via b.toArray().X rather than directly on the blob.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;As a community (CommonJS) we'd be more than happy to go forward with a binary spec that came from (or at least has the blessing of) the ES groups&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;div&gt;Binary/B is the closest of the three proposals to mine, in that it has both mutable and immutable binary data containers. Here are a few key differences:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;(1) Binary/B does not have a cheap way to convert from the immutable representation (ByteString) to the mutable representation (ByteArray)&lt;/div&gt;&lt;div&gt;(2) In Binary/B, Array-like index access to ByteString gives back one-byte ByteStrings instead of bytes, likely an over-literal copying of String&lt;/div&gt;&lt;div&gt;(3) There are some seemingly needless differences in the interfaces to ByteString and ByteArray that follow from modeling on String and Array&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;div&gt;(4) Binary/B has many more operations available in the base proposal (including charset transcoding and a generous selection of String and Array methods)&lt;/div&gt;&lt;div&gt;(5) Different names - Data/DataBuilder vs. ByteString/ByteArray&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;My initial impression is that (1), (2) and (3) are all points on which my proposal is better. On (1): cheap conversion from mutable to immutable (DataBuilder.prototype.release() in my proposal) lets binary data objects be built up with a convenient mutation-based idiom, but then passed around as immutable objects thereafter. On (2): I don't think a one-byte ByteString is ever useful, indexing to get the byte value would be much more helpful. On (3), I think it's good for the mutable interface to be a strict superset of the the immutable interface.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;(4) and (5) are all points where perhaps neither proposal is at the optimum yet. On (4), I suspect the sweet spot is somewhere between my spartan set of built-in operations and the very generous set in Binary/B. On (5), I'm not sure either set of names is the best possible, and I'm certainly not stuck on my own proposed names.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Regards,&lt;/div&gt;&lt;div&gt;Maciej&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26250476&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Binary-Data---possible-topic-for-joint-session-tp26229087p26250476.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26247811</id>
	<title>Re: Presentation on modules</title>
	<published>2009-11-07T11:27:19Z</published>
	<updated>2009-11-07T11:27:19Z</updated>
	<author>
		<name>ihab.awad</name>
	</author>
	<content type="html">On Sat, Nov 7, 2009 at 11:10 AM, Brendan Eich &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26247811&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;brendan@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; The alternative for Harmony is a syntactic special form, an import directive
&lt;br&gt;&amp;gt; for example, that can be analyzed when the program is parsed ...
&lt;br&gt;&lt;br&gt;+1. In Caja, we were loath to introduce new syntax _per se_, and we
&lt;br&gt;are already compiling, so ours is a bit of a special case. Were there
&lt;br&gt;some standard syntax the semantics of which we could implement, our
&lt;br&gt;lives would be far easier.
&lt;br&gt;&lt;br&gt;Ihab
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Ihab A.B. Awad, Palo Alto, CA
&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26247811&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Presentation-on-modules-tp26246317p26247811.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26247661</id>
	<title>Re: Presentation on modules</title>
	<published>2009-11-07T11:10:21Z</published>
	<updated>2009-11-07T11:10:21Z</updated>
	<author>
		<name>Brendan Eich-3</name>
	</author>
	<content type="html">&lt;html&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;So (as was clarified at the meeting) the Caja work is quite informative, but we are not looking at any Harmony module system that &lt;i&gt;requires&lt;/i&gt; ahead-of-time code analysis and transformation before code reaches the browser.&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The alternative for Harmony is a syntactic special form, an import directive for example, that can be analyzed when the program is parsed (not executed), so the implementation can preload all dependencies before execution to avoid blocking on an import (or a later data dependency), or else an awkward non-blocking import to preserve JS's run-to-completion execution model.&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Async (non-blocking) import functionality (a runtime API) is good too but it should not be the only way, or the common way.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;There's more to say about modules but I'll let others speak up.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;/be&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;div&gt;&lt;div&gt;On Nov 7, 2009, at 9:03 AM, &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26247661&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ihab.awad@...&lt;/a&gt; wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div&gt;On Sat, Nov 7, 2009 at 8:34 AM, Ash Berlin &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26247661&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ash_js@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;Slide 10 says &quot;Sync, arg must be a string literal&quot;. 1) why a string&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;*literal*, ...&lt;br&gt;&lt;/blockquote&gt;&lt;br&gt;It's the simplest form of statically determinable identifier. We could&lt;br&gt;say, &quot;arg must be an expression that statically evaluates to a&lt;br&gt;string&quot;, like:&lt;br&gt;&lt;br&gt; &amp;nbsp;'f' + 'oo'&lt;br&gt;&lt;br&gt;but we chose the simplest interpretation.&lt;br&gt;&lt;br&gt;Essentially, we are making 'load' a special form.&lt;br&gt;&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;... and 2) how can that be enforced?&lt;br&gt;&lt;/blockquote&gt;&lt;br&gt;The Caja system is a compiler. :)&lt;br&gt;&lt;br&gt;Ihab&lt;br&gt;&lt;br&gt;-- &lt;br&gt;Ihab A.B. Awad, Palo Alto, CA&lt;br&gt;_______________________________________________&lt;br&gt;es-discuss mailing list&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26247661&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;&lt;br&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;br&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26247661&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Presentation-on-modules-tp26246317p26247661.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26246629</id>
	<title>Re: Presentation on modules</title>
	<published>2009-11-07T09:03:58Z</published>
	<updated>2009-11-07T09:03:58Z</updated>
	<author>
		<name>ihab.awad</name>
	</author>
	<content type="html">On Sat, Nov 7, 2009 at 8:34 AM, Ash Berlin &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26246629&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ash_js@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Slide 10 says &amp;quot;Sync, arg must be a string literal&amp;quot;. 1) why a string
&lt;br&gt;&amp;gt; *literal*, ...
&lt;br&gt;&lt;br&gt;It's the simplest form of statically determinable identifier. We could
&lt;br&gt;say, &amp;quot;arg must be an expression that statically evaluates to a
&lt;br&gt;string&amp;quot;, like:
&lt;br&gt;&lt;br&gt;&amp;nbsp; 'f' + 'oo'
&lt;br&gt;&lt;br&gt;but we chose the simplest interpretation.
&lt;br&gt;&lt;br&gt;Essentially, we are making 'load' a special form.
&lt;br&gt;&lt;br&gt;&amp;gt; ... and 2) how can that be enforced?
&lt;br&gt;&lt;br&gt;The Caja system is a compiler. :)
&lt;br&gt;&lt;br&gt;Ihab
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Ihab A.B. Awad, Palo Alto, CA
&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26246629&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Presentation-on-modules-tp26246317p26246629.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26246368</id>
	<title>Re: Presentation on modules</title>
	<published>2009-11-07T08:34:47Z</published>
	<updated>2009-11-07T08:34:47Z</updated>
	<author>
		<name>Ash Berlin-5</name>
	</author>
	<content type="html">&lt;br&gt;On 7 Nov 2009, at 16:28, &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26246368&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ihab.awad@...&lt;/a&gt; wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi folks,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Here is a link to the presentation on modules I gave during the TC39
&lt;br&gt;&amp;gt; meeting in Santa Clara, CA yesterday.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&lt;a href=&quot;http://sites.google.com/site/ihabawad/Home/es5Modules-2009-11-06.pdf&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sites.google.com/site/ihabawad/Home/es5Modules-2009-11-06.pdf&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Cheers and regards,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Ihab
&lt;/div&gt;&lt;br&gt;Slide 10 says &amp;quot;Sync, arg must be a string literal&amp;quot;. 1) why a string &amp;nbsp;
&lt;br&gt;*literal*, and 2) how can that be enforced?
&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26246368&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Presentation-on-modules-tp26246317p26246368.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26246317</id>
	<title>Presentation on modules</title>
	<published>2009-11-07T08:28:32Z</published>
	<updated>2009-11-07T08:28:32Z</updated>
	<author>
		<name>ihab.awad</name>
	</author>
	<content type="html">Hi folks,
&lt;br&gt;&lt;br&gt;Here is a link to the presentation on modules I gave during the TC39
&lt;br&gt;meeting in Santa Clara, CA yesterday.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &lt;a href=&quot;http://sites.google.com/site/ihabawad/Home/es5Modules-2009-11-06.pdf&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sites.google.com/site/ihabawad/Home/es5Modules-2009-11-06.pdf&lt;/a&gt;&lt;br&gt;&lt;br&gt;Cheers and regards,
&lt;br&gt;&lt;br&gt;Ihab
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Ihab A.B. Awad, Palo Alto, CA
&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26246317&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Presentation-on-modules-tp26246317p26246317.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26244891</id>
	<title>Re: Binary Data - possible topic for joint session</title>
	<published>2009-11-07T05:39:35Z</published>
	<updated>2009-11-07T05:39:35Z</updated>
	<author>
		<name>Ash Berlin-5</name>
	</author>
	<content type="html">&lt;html&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;br&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;On 6 Nov 2009, at 19:24, Brendan Eich wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;div&gt;On Nov 6, 2009, at 10:44 AM, Dean Landolt wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;Just in case some of you weren't aware, the CommonJS group has done quite a bit of work and (bikeshedding) on this topic. Here's a link to the wiki:&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://wiki.commonjs.org/wiki/Binary&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://wiki.commonjs.org/wiki/Binary&lt;/a&gt;&lt;br&gt;&lt;br&gt;If nothing else there's quite a bit of prior art collected which should inform the conversation. I know the Binary/B proposal has the implementation momentum, but I don't know exactly what the status is. I haven't been closely following the evolution of these binary specs too closely but since it seems that nearly everyone else from the group is off to jsconf.eu I figured I ought to toss this out there.&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;div&gt;Thanks, I had forgotten about commonjs.org, having once paid better attention.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Kris did a good job with Binary/B (although I do not see the point of the .get method additions) -- I didn't look at the other proposals yet.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;/be&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Binary/B feels largely right, but it has a few too many methods from Array simply because Array had them for my taste, specifically things like sort, reduce, shift, unshift etc.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Conceptually: why would you want to sort an array of bytes? There are certainly classes of operations that I think should just be done via b.toArray().X rather than directly on the blob.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;As a community (CommonJS) we'd be more than happy to go forward with a binary spec that came from (or at least has the blessing of) the ES groups&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;-ash&lt;/div&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26244891&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Binary-Data---possible-topic-for-joint-session-tp26229087p26244891.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26240363</id>
	<title>Re: Binary data (ByteArray/ByteVector) proposal on public-script-coord</title>
	<published>2009-11-06T15:39:37Z</published>
	<updated>2009-11-06T15:39:37Z</updated>
	<author>
		<name>Maciej Stachowiak</name>
	</author>
	<content type="html">&lt;br&gt;On Nov 6, 2009, at 1:39 PM, Alex Russell wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Nov 6, 2009, at 11:30 AM, Maciej Stachowiak wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; On Nov 6, 2009, at 5:43 AM, P T Withington wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; On 2009-11-05, at 19:42, Maciej Stachowiak wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; My claim is that Data is not much like these things. I believe it &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; is more like String. It happens to be a sequence (of a very &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; specific type), but it's specialized enough to be worth treating &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; differently. Do people often regret that String is not an Array?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Data is like an 8-bit &amp;quot;null encoded&amp;quot; String. &amp;nbsp;Which makes me &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; wonder if you really just want to extend String to allow different &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; encodings. &amp;nbsp;But I also regret String not being and Array. &amp;nbsp;Others &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; must have too, because at one point I'm sure there was a proposal &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; to make [] on string mean charAt?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; ES5 does have bracket index access to the individual characters. &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; But it does not make String inherit from Array.prototype, or add &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; all of the Array methods. To make it more concrete, have you ever &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; wished you could use methods like map(), filter(), reduce() or &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; join() on a String?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; join's an oddball since it's effectively a no-op, but map() and &amp;nbsp;
&lt;br&gt;&amp;gt; filter(), absolutely.
&lt;/div&gt;&lt;br&gt;Can you give specific use cases for these, maybe with hypothetical &amp;nbsp;
&lt;br&gt;code examples?
&lt;br&gt;&lt;br&gt;Join would not be a no-op, and indeed you can use Array.prototype.join &amp;nbsp;
&lt;br&gt;on a String today:
&lt;br&gt;&lt;br&gt;javascript:alert(Array.prototype.join.call(&amp;quot;abcde&amp;quot;, &amp;quot;123&amp;quot;)) ==&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;quot;a123b123c123d123e&amp;quot;
&lt;br&gt;&lt;br&gt;Not a no-op but I'm not sure it's useful.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Maciej
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26240363&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Binary-data-%28ByteArray-ByteVector%29-proposal-on-public-script-coord-tp26223706p26240363.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26239053</id>
	<title>Re: Binary data (ByteArray/ByteVector) proposal on  public-script-coord</title>
	<published>2009-11-06T13:43:37Z</published>
	<updated>2009-11-06T13:43:37Z</updated>
	<author>
		<name>Mike Shaver</name>
	</author>
	<content type="html">On Fri, Nov 6, 2009 at 4:39 PM, Alex Russell &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26239053&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alex@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; On Nov 6, 2009, at 11:30 AM, Maciej Stachowiak wrote:
&lt;br&gt;&amp;gt;&amp;gt; ES5 does have bracket index access to the individual characters. But it
&lt;br&gt;&amp;gt;&amp;gt; does not make String inherit from Array.prototype, or add all of the Array
&lt;br&gt;&amp;gt;&amp;gt; methods. To make it more concrete, have you ever wished you could use
&lt;br&gt;&amp;gt;&amp;gt; methods like map(), filter(), reduce() or join() on a String?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; join's an oddball since it's effectively a no-op, but map() and filter(),
&lt;br&gt;&amp;gt; absolutely.
&lt;br&gt;&lt;br&gt;I've used join too (though not with an empty separator, indeed), and
&lt;br&gt;map/filter for various string pack and encode operations, but I don't
&lt;br&gt;think that I would mind too much having to say
&lt;br&gt;&lt;br&gt;Array.join(strOrDataThing, &amp;quot;\n&amp;quot;);
&lt;br&gt;&lt;br&gt;instead of
&lt;br&gt;&lt;br&gt;strOrData.filter(function (v) { return v.charCodeAt(0) &amp;lt; 128; });
&lt;br&gt;&lt;br&gt;Mike
&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26239053&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Binary-data-%28ByteArray-ByteVector%29-proposal-on-public-script-coord-tp26223706p26239053.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26239002</id>
	<title>Re: Binary data (ByteArray/ByteVector) proposal on public-script-coord</title>
	<published>2009-11-06T13:39:06Z</published>
	<updated>2009-11-06T13:39:06Z</updated>
	<author>
		<name>Alex Russell</name>
	</author>
	<content type="html">On Nov 6, 2009, at 11:30 AM, Maciej Stachowiak wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Nov 6, 2009, at 5:43 AM, P T Withington wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; On 2009-11-05, at 19:42, Maciej Stachowiak wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; My claim is that Data is not much like these things. I believe it &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; is more like String. It happens to be a sequence (of a very &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; specific type), but it's specialized enough to be worth treating &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; differently. Do people often regret that String is not an Array?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Data is like an 8-bit &amp;quot;null encoded&amp;quot; String. &amp;nbsp;Which makes me wonder &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; if you really just want to extend String to allow different &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; encodings. &amp;nbsp;But I also regret String not being and Array. &amp;nbsp;Others &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; must have too, because at one point I'm sure there was a proposal &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; to make [] on string mean charAt?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ES5 does have bracket index access to the individual characters. But &amp;nbsp;
&lt;br&gt;&amp;gt; it does not make String inherit from Array.prototype, or add all of &amp;nbsp;
&lt;br&gt;&amp;gt; the Array methods. To make it more concrete, have you ever wished &amp;nbsp;
&lt;br&gt;&amp;gt; you could use methods like map(), filter(), reduce() or join() on a &amp;nbsp;
&lt;br&gt;&amp;gt; String?
&lt;/div&gt;&lt;br&gt;join's an oddball since it's effectively a no-op, but map() and &amp;nbsp;
&lt;br&gt;filter(), absolutely.
&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26239002&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Binary-data-%28ByteArray-ByteVector%29-proposal-on-public-script-coord-tp26223706p26239002.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26237735</id>
	<title>Re: Binary data (ByteArray/ByteVector) proposal on public-script-coord</title>
	<published>2009-11-06T11:51:23Z</published>
	<updated>2009-11-06T11:51:23Z</updated>
	<author>
		<name>Alex Russell</name>
	</author>
	<content type="html">&lt;br&gt;On Nov 5, 2009, at 11:03 PM, David-Sarah Hopwood wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Oliver Hunt wrote:
&lt;br&gt;&amp;gt;&amp;gt; On Nov 5, 2009, at 10:14 PM, David-Sarah Hopwood wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Oliver Hunt wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I disagree here -- i believe mutable vs. immutable data is &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; different
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; from unfrozen and frozen objects [...]
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Why? What would the hypothetical Data.prototype.freeze do that &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; would be
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; different to applying Object.freeze to a Data object?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; (though i agree that the function names
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; freeze and frozen are just asking for problems in conjunction &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; with ES5
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; :D ). &amp;nbsp;There are plenty of times where I would want to provide &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; immutable
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; data (the UA sharing content, etc), but i may still want to &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; modify the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; object itself.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Oh, you mean that you want *read-only* Data objects backed by a &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; mutable
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; array. That is not the same thing as an immutable (or &amp;quot;frozen&amp;quot;) Data
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; object.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; No, the issue here is that Charles has conflated object freezing with
&lt;br&gt;&amp;gt;&amp;gt; immutable data,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; That isn't conflation; they're the same.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; frozen objects and immutable data are not the same thing
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You are mistaken. This is a case where terminology across languages is
&lt;br&gt;&amp;gt; quite consistent, and is as I've described it. &amp;quot;Frozen&amp;quot; means &amp;nbsp;
&lt;br&gt;&amp;gt; exactly the
&lt;br&gt;&amp;gt; same thing as &amp;quot;immutable&amp;quot;, and implies that the state of the object &amp;nbsp;
&lt;br&gt;&amp;gt; will
&lt;br&gt;&amp;gt; never be observed to change [*]. An object is &amp;quot;read-only&amp;quot; if there &amp;nbsp;
&lt;br&gt;&amp;gt; is no
&lt;br&gt;&amp;gt; means to directly change its state via a reference to it, which does &amp;nbsp;
&lt;br&gt;&amp;gt; not
&lt;br&gt;&amp;gt; necessarily imply that its state cannot be observed to change.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; -- for instance in the DOM I cannot set indices of a NodeList, but &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; the
&lt;br&gt;&amp;gt;&amp;gt; NodeList does not need to be frozen.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; NodeList objects are read-only.
&lt;/div&gt;&lt;br&gt;This is an artifact of the way they can be created today (no exposed &amp;nbsp;
&lt;br&gt;ctor for them, no exposed prototype, only alien functions can generate &amp;nbsp;
&lt;br&gt;them, etc.). It should not be held up as a desireable design point or &amp;nbsp;
&lt;br&gt;a counter to something else. Mutable NodeList's which implement Array &amp;nbsp;
&lt;br&gt;semantics and mutability would be extremely useful.
&lt;br&gt;&lt;br&gt;Regards
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; [*] It is ambiguous whether indirectly referenced state can change; if
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;it is important that it cannot, say &amp;quot;deep-frozen&amp;quot; or &amp;quot;deeply &amp;nbsp;
&lt;br&gt;&amp;gt; immutable&amp;quot;.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt; David-Sarah Hopwood &amp;nbsp;⚥ &amp;nbsp;&lt;a href=&quot;http://davidsarah.livejournal.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://davidsarah.livejournal.com&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; es-discuss mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26237735&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;/div&gt;&lt;br&gt;--
&lt;br&gt;Alex Russell
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26237735&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;slightlyoff@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26237735&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alex@...&lt;/a&gt; BE03 E88D EABB 2116 CC49 8259 CF78 E242 59C3 9723
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26237735&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Binary-data-%28ByteArray-ByteVector%29-proposal-on-public-script-coord-tp26223706p26237735.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26237530</id>
	<title>[] on String [Was: Binary data (ByteArray/ByteVector) proposal on public-script-coord]</title>
	<published>2009-11-06T11:35:34Z</published>
	<updated>2009-11-06T11:35:34Z</updated>
	<author>
		<name>P T Withington</name>
	</author>
	<content type="html">&lt;br&gt;On 2009-11-06, at 13:47, Brendan Eich wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; On Nov 6, 2009, at 5:43 AM, P T Withington wrote:
&lt;br&gt;&lt;br&gt;[...]
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; But I also regret String not being and Array.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I agree with Maciej that having mutating methods be no-ops or &amp;nbsp;
&lt;br&gt;&amp;gt; throwers strongly suggests we not mix Array and String directly. &amp;nbsp;
&lt;br&gt;&amp;gt; Being able to apply non-mutating Array methods to string (primitive, &amp;nbsp;
&lt;br&gt;&amp;gt; even) arguments is ok. Splitting a string into an Array and &amp;nbsp;
&lt;br&gt;&amp;gt; mutating, then joining -- very ok. But I don't see why you want &amp;nbsp;
&lt;br&gt;&amp;gt; String to *be* (is-a) an Array.
&lt;br&gt;&lt;br&gt;It must be my Lisp/Dylan upbringing bleeding through: &amp;nbsp;&lt;a href=&quot;http://bit.ly/4DEIjL&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://bit.ly/4DEIjL&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; Others must have too, because at one point I'm sure there was a &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; proposal to make [] on string mean charAt?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; David Flanagan beat me to it: in ES5 and most browsers.
&lt;br&gt;&lt;br&gt;And I thanked him privately. &amp;nbsp;I thought it was, but failed to make the &amp;nbsp;
&lt;br&gt;conceptual leap from [] to [[GetOwnProperty]] when searching in the &amp;nbsp;
&lt;br&gt;spec.
&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26237530&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Binary-data-%28ByteArray-ByteVector%29-proposal-on-public-script-coord-tp26223706p26237530.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26237473</id>
	<title>Re: Binary data (ByteArray/ByteVector) proposal on public-script-coord</title>
	<published>2009-11-06T11:30:26Z</published>
	<updated>2009-11-06T11:30:26Z</updated>
	<author>
		<name>Maciej Stachowiak</name>
	</author>
	<content type="html">&lt;br&gt;On Nov 6, 2009, at 5:43 AM, P T Withington wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On 2009-11-05, at 19:42, Maciej Stachowiak wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; My claim is that Data is not much like these things. I believe it &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; is more like String. It happens to be a sequence (of a very &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; specific type), but it's specialized enough to be worth treating &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; differently. Do people often regret that String is not an Array?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Data is like an 8-bit &amp;quot;null encoded&amp;quot; String. &amp;nbsp;Which makes me wonder &amp;nbsp;
&lt;br&gt;&amp;gt; if you really just want to extend String to allow different &amp;nbsp;
&lt;br&gt;&amp;gt; encodings. &amp;nbsp;But I also regret String not being and Array. &amp;nbsp;Others &amp;nbsp;
&lt;br&gt;&amp;gt; must have too, because at one point I'm sure there was a proposal to &amp;nbsp;
&lt;br&gt;&amp;gt; make [] on string mean charAt?
&lt;/div&gt;&lt;br&gt;ES5 does have bracket index access to the individual characters. But &amp;nbsp;
&lt;br&gt;it does not make String inherit from Array.prototype, or add all of &amp;nbsp;
&lt;br&gt;the Array methods. To make it more concrete, have you ever wished you &amp;nbsp;
&lt;br&gt;could use methods like map(), filter(), reduce() or join() on a String?
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Maciej
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26237473&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Binary-data-%28ByteArray-ByteVector%29-proposal-on-public-script-coord-tp26223706p26237473.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26237386</id>
	<title>Re: Binary Data - possible topic for joint session</title>
	<published>2009-11-06T11:24:39Z</published>
	<updated>2009-11-06T11:24:39Z</updated>
	<author>
		<name>Brendan Eich-3</name>
	</author>
	<content type="html">&lt;html&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;div&gt;On Nov 6, 2009, at 10:44 AM, Dean Landolt wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;Just in case some of you weren't aware, the CommonJS group has done quite a bit of work and (bikeshedding) on this topic. Here's a link to the wiki:&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://wiki.commonjs.org/wiki/Binary&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://wiki.commonjs.org/wiki/Binary&lt;/a&gt;&lt;br&gt; &lt;br&gt;If nothing else there's quite a bit of prior art collected which should inform the conversation. I know the Binary/B proposal has the implementation momentum, but I don't know exactly what the status is. I haven't been closely following the evolution of these binary specs too closely but since it seems that nearly everyone else from the group is off to jsconf.eu I figured I ought to toss this out there.&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;div&gt;Thanks, I had forgotten about commonjs.org, having once paid better attention.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Kris did a good job with Binary/B (although I do not see the point of the .get method additions) -- I didn't look at the other proposals yet.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;/be&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26237386&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Binary-Data---possible-topic-for-joint-session-tp26229087p26237386.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26236824</id>
	<title>Re: Binary data (ByteArray/ByteVector) proposal on public-script-coord</title>
	<published>2009-11-06T10:47:58Z</published>
	<updated>2009-11-06T10:47:58Z</updated>
	<author>
		<name>Brendan Eich-3</name>
	</author>
	<content type="html">On Nov 6, 2009, at 5:43 AM, P T Withington wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; On 2009-11-05, at 19:42, Maciej Stachowiak wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; My claim is that Data is not much like these things. I believe it &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; is more like String. It happens to be a sequence (of a very &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; specific type), but it's specialized enough to be worth treating &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; differently. Do people often regret that String is not an Array?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Data is like an 8-bit &amp;quot;null encoded&amp;quot; String. &amp;nbsp;Which makes me wonder &amp;nbsp;
&lt;br&gt;&amp;gt; if you really just want to extend String to allow different encodings.
&lt;br&gt;&lt;br&gt;Not for the Data use-cases.
&lt;br&gt;&lt;br&gt;Strings are used for binary data, which is tying our hands in &amp;nbsp;
&lt;br&gt;supporting UTF-16 properly. Separate issue but we should not &amp;nbsp;
&lt;br&gt;complicate String further IMHO.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp;But I also regret String not being and Array.
&lt;br&gt;&lt;br&gt;I agree with Maciej that having mutating methods be no-ops or throwers &amp;nbsp;
&lt;br&gt;strongly suggests we not mix Array and String directly. Being able to &amp;nbsp;
&lt;br&gt;apply non-mutating Array methods to string (primitive, even) arguments &amp;nbsp;
&lt;br&gt;is ok. Splitting a string into an Array and mutating, then joining -- &amp;nbsp;
&lt;br&gt;very ok. But I don't see why you want String to *be* (is-a) an Array.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; Others must have too, because at one point I'm sure there was a &amp;nbsp;
&lt;br&gt;&amp;gt; proposal to make [] on string mean charAt?
&lt;br&gt;&lt;br&gt;David Flanagan beat me to it: in ES5 and most browsers.
&lt;br&gt;&lt;br&gt;/be
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26236824&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Binary-data-%28ByteArray-ByteVector%29-proposal-on-public-script-coord-tp26223706p26236824.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26236771</id>
	<title>Re: Binary Data - possible topic for joint session</title>
	<published>2009-11-06T10:44:37Z</published>
	<updated>2009-11-06T10:44:37Z</updated>
	<author>
		<name>Dean Landolt</name>
	</author>
	<content type="html">Just in case some of you weren&amp;#39;t aware, the CommonJS group has done
quite a bit of work and (bikeshedding) on this topic. Here&amp;#39;s a link to the
wiki:&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://wiki.commonjs.org/wiki/Binary&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://wiki.commonjs.org/wiki/Binary&lt;/a&gt;&lt;br&gt;
&lt;br&gt;If nothing else there&amp;#39;s quite a bit of prior art collected which
should inform the conversation. I know the Binary/B proposal has the
implementation momentum, but I don&amp;#39;t know exactly what the status is. I
haven&amp;#39;t been closely following the evolution of these binary specs too
closely but since it seems that nearly everyone else from the group is
off to jsconf.eu I figured I ought to toss this out there.
&lt;br /&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26236771&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Binary-Data---possible-topic-for-joint-session-tp26229087p26236771.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26236394</id>
	<title>Re: Binary Data - possible topic for joint session</title>
	<published>2009-11-06T10:21:07Z</published>
	<updated>2009-11-06T10:21:07Z</updated>
	<author>
		<name>Brendan Eich-3</name>
	</author>
	<content type="html">On Nov 6, 2009, at 9:18 AM, Maciej Stachowiak wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; On Nov 6, 2009, at 8:26 AM, Brendan Eich wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Indeed, I'd rather not propose APIs like that in the initial version &amp;nbsp;
&lt;br&gt;&amp;gt; (though I think eventually we may want a way to copy sequences of &amp;nbsp;
&lt;br&gt;&amp;gt; 16-, 32-bit or 64-bit values swapping from network byte order to &amp;nbsp;
&lt;br&gt;&amp;gt; host byte order or vice versa to make it practical to interpret &amp;nbsp;
&lt;br&gt;&amp;gt; popular binary formats.
&lt;br&gt;&lt;br&gt;Could be -- I agree we should defer.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; However, I think a common use case for binary data is to pass it &amp;nbsp;
&lt;br&gt;&amp;gt; around for point A to point B, without unpacking the internals at &amp;nbsp;
&lt;br&gt;&amp;gt; all, just as for strings. For example, you may read a file in binary &amp;nbsp;
&lt;br&gt;&amp;gt; form, pass the binary data off to a Worker, and then have the Worker &amp;nbsp;
&lt;br&gt;&amp;gt; upload it to a server. This is part of why I leaned towards a name &amp;nbsp;
&lt;br&gt;&amp;gt; that does not overly emphasize the byte sequence nature.
&lt;br&gt;&lt;br&gt;Yet the minimal API will give byte-element access, not variable-length &amp;nbsp;
&lt;br&gt;bit string or any other such access. Concrete beats abstract every &amp;nbsp;
&lt;br&gt;time in this level of discourse, in my experience.
&lt;br&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; Therefore I think a concrete name such as ByteVector or ByteArray &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; is better, all else equal.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Moreover a name such as ByteVector is much easier to inject as a &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; global property. No hits for the obvious function and var forms of &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; it, one hit for ByteArray:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=%22function+ByteArray%28%22+lang%3Ajavascript&amp;sbtn=Search&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=%22function+ByteArray%28%22+lang%3Ajavascript&amp;sbtn=Search&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Some other possible names (based in part on some other binary data &amp;nbsp;
&lt;br&gt;&amp;gt; proposals that I've seen):
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; BinaryData
&lt;br&gt;&amp;gt; BinData
&lt;br&gt;&amp;gt; ByteString
&lt;/div&gt;&lt;br&gt;These look free of conflicts from some quick codesearch'ing -- &amp;nbsp;
&lt;br&gt;ByteString is good, better than ByteVector if we do not allow bytes to &amp;nbsp;
&lt;br&gt;be mutated.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; Binary
&lt;br&gt;&lt;br&gt;Existing uses:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=%22function+Binary%28%22+lang%3Ajavascript&amp;sbtn=Search&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=%22function+Binary%28%22+lang%3Ajavascript&amp;sbtn=Search&lt;/a&gt;&lt;br&gt;&lt;br&gt;If any of these involve detection, we probably can't use Binary. I did &amp;nbsp;
&lt;br&gt;not look further, but suggest we eliminate candidate names that are &amp;nbsp;
&lt;br&gt;already in use according to Google codesearch.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; Blob
&lt;br&gt;&lt;br&gt;A few hits:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=%22function+Blob%28%22+lang%3Ajavascript&amp;sbtn=Search&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=%22function+Blob%28%22+lang%3Ajavascript&amp;sbtn=Search&lt;/a&gt;&lt;br&gt;&lt;br&gt;/be
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Good topic for in-person discussion maybe?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Maciej
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26236394&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Binary-Data---possible-topic-for-joint-session-tp26229087p26236394.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26236095</id>
	<title>Re: Binary data (ByteArray/ByteVector) proposal on public-script-coord</title>
	<published>2009-11-06T10:00:13Z</published>
	<updated>2009-11-06T10:00:13Z</updated>
	<author>
		<name>David Flanagan</name>
	</author>
	<content type="html">P T Withington wrote:
&lt;br&gt;&amp;gt; I also regret String not being and Array. &amp;nbsp;Others must have too, because 
&lt;br&gt;&amp;gt; at one point I'm sure there was a proposal to make [] on string mean 
&lt;br&gt;&amp;gt; charAt?
&lt;br&gt;&lt;br&gt;This is part of ES5. &amp;nbsp;See 15.5.5.2 in the spec.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; David Flanagan
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26236095&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Binary-data-%28ByteArray-ByteVector%29-proposal-on-public-script-coord-tp26223706p26236095.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26236065</id>
	<title>Re: Binary data (ByteArray/ByteVector) proposal on public-script-coord</title>
	<published>2009-11-06T09:57:53Z</published>
	<updated>2009-11-06T09:57:53Z</updated>
	<author>
		<name>Charles Jolley</name>
	</author>
	<content type="html">&amp;gt; I think the disadvantage of this design is that it puts all the &amp;nbsp;
&lt;br&gt;&amp;gt; mutation methods on immutable instances, where they are serve no &amp;nbsp;
&lt;br&gt;&amp;gt; purpose other than to throw when called. I think it is cleaner &amp;nbsp;
&lt;br&gt;&amp;gt; design for the immutable interface to lack mutation methods, rather &amp;nbsp;
&lt;br&gt;&amp;gt; than have mutation methods that always fail. I think designs where &amp;nbsp;
&lt;br&gt;&amp;gt; part of the normal workflow puts an object in a state where some &amp;nbsp;
&lt;br&gt;&amp;gt; methods always throw is poor OO design.
&lt;br&gt;&lt;br&gt;Well, let me argue this for a second...
&lt;br&gt;&lt;br&gt;Well designed systems often have objects with an internal state. &amp;nbsp; 
&lt;br&gt;Features become available or unavailable on that object based on the &amp;nbsp;
&lt;br&gt;state. &amp;nbsp;If you try to use a feature while the object is in the wrong &amp;nbsp;
&lt;br&gt;state, the object should throw an error. &amp;nbsp;This is good API. &amp;nbsp;It makes &amp;nbsp;
&lt;br&gt;it clear to the developer when they try to use the object in the wrong &amp;nbsp;
&lt;br&gt;way.
&lt;br&gt;&lt;br&gt;The API I'm arguing for envisions the Data object having some internal &amp;nbsp;
&lt;br&gt;state [i.e. isEditable] and a part of the API is available or not &amp;nbsp;
&lt;br&gt;depending on that state.
&lt;br&gt;&lt;br&gt;Additionally, JavaScript often uses the duck-typing pattern [i.e. &amp;nbsp;
&lt;br&gt;ignore the &amp;quot;inheritance&amp;quot; of an object and just check its capabilities &amp;nbsp;
&lt;br&gt;before acting on it]. &amp;nbsp;This pattern vastly simplifies JS code as you &amp;nbsp;
&lt;br&gt;don't have to shuffle references around so often and can reduce memory &amp;nbsp;
&lt;br&gt;allocs.
&lt;br&gt;&lt;br&gt;That said, I will acknowledge there are many cases where methods that &amp;nbsp;
&lt;br&gt;throw are often indicative of bad OO design. &amp;nbsp;I see this mostly in C++ &amp;nbsp;
&lt;br&gt;and Java where devs define abstract base classes with lots of methods &amp;nbsp;
&lt;br&gt;that do nothing but throw. &amp;nbsp;This is the opposite of what we want. &amp;nbsp; 
&lt;br&gt;It's ugly and leads to code bloat.
&lt;br&gt;&lt;br&gt;In this case though, I would argue that a few if() statements at the &amp;nbsp;
&lt;br&gt;front of a primitive or two would actually reduce the amount of code &amp;nbsp;
&lt;br&gt;in regular running applications and means you only need to implement &amp;nbsp;
&lt;br&gt;one object.
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It's true that ECMAScript has not historically had mutable/immutable &amp;nbsp;
&lt;br&gt;&amp;gt; pairs of types, but this is a common pattern in other languages, &amp;nbsp;
&lt;br&gt;&amp;gt; such as Objective-C (NSString vs. NSMutableString), Java (String vs. &amp;nbsp;
&lt;br&gt;&amp;gt; StringBuilder), various recent Lisp dialects (where there are often &amp;nbsp;
&lt;br&gt;&amp;gt; both mutable and immutable lists) and arguably event C++ (const &amp;nbsp;
&lt;br&gt;&amp;gt; string and string expose different sets of method).
&lt;br&gt;&lt;br&gt;Most of the examples you give here, are statically-types [to various &amp;nbsp;
&lt;br&gt;degrees] class-based languages where inheritance chains are integral &amp;nbsp;
&lt;br&gt;to the design. &amp;nbsp;This is not the case with JavaScript.
&lt;br&gt;&lt;br&gt;The two-class pattern is more important in those cases than it is here.
&lt;br&gt;&lt;br&gt;&amp;gt; That being said, I can see how there is some value to aligning with &amp;nbsp;
&lt;br&gt;&amp;gt; the evolving ECMAScript pattern. Personally I think of Object.freeze &amp;nbsp;
&lt;br&gt;&amp;gt; as a tool for building new types that are meant to be immutable, or &amp;nbsp;
&lt;br&gt;&amp;gt; for exporting partially restricted facade interfaces, not as &amp;nbsp;
&lt;br&gt;&amp;gt; something one should be doing to random objects in the course of &amp;nbsp;
&lt;br&gt;&amp;gt; normal programming.
&lt;br&gt;&lt;br&gt;Allow me to withdraw my previous suggestion of freeze(). &amp;nbsp;It's not the &amp;nbsp;
&lt;br&gt;right tool for this job. &amp;nbsp;The general pattern though is well &amp;nbsp;
&lt;br&gt;established for freeze(), seal() and extensible. &amp;nbsp;I think it would &amp;nbsp;
&lt;br&gt;work well here too.
&lt;br&gt;&lt;br&gt;-Charles
&lt;br&gt;&lt;br&gt;PS. I'm happy to have data object support at all; this isn't really &amp;nbsp;
&lt;br&gt;critical to the feature IMO just an argument about which API would be &amp;nbsp;
&lt;br&gt;most useful to developers. &amp;nbsp;I think both proposed models would be &amp;nbsp;
&lt;br&gt;acceptable.
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26236065&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Binary-data-%28ByteArray-ByteVector%29-proposal-on-public-script-coord-tp26223706p26236065.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26235711</id>
	<title>Re: Binary data (ByteArray/ByteVector) proposal on	public-script-coord</title>
	<published>2009-11-06T09:34:10Z</published>
	<updated>2009-11-06T09:34:10Z</updated>
	<author>
		<name>Maciej Stachowiak</name>
	</author>
	<content type="html">&lt;br&gt;On Nov 6, 2009, at 7:13 AM, Mike Shaver wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Fri, Nov 6, 2009 at 9:31 AM, Breton Slivka &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26235711&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;zen@...&lt;/a&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; I think the C language has
&lt;br&gt;&amp;gt;&amp;gt; possibly biased us into thinking of data as a sequence of 8-bit &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; bytes,
&lt;br&gt;&amp;gt;&amp;gt; when that is just what happened to be convenient for C.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; For types called ByteArray and ByteVector, I think a byte orientation
&lt;br&gt;&amp;gt; is appropriate. &amp;nbsp;Doing things other than bytes brings endianness into
&lt;br&gt;&amp;gt; play (ask the WebGL guys, if you know any)
&lt;/div&gt;&lt;br&gt;At some point, if we want to make it easy and efficient for ECMAScript &amp;nbsp;
&lt;br&gt;to do something like decode a GIF, we may want to provide facilities &amp;nbsp;
&lt;br&gt;for converting between host and network byte order. My recommendation &amp;nbsp;
&lt;br&gt;would be to leave that out of the v1 API though.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; My question is (since nobody seems to have brought it up yet) is how
&lt;br&gt;&amp;gt;&amp;gt; does this proposal fit into the html5 canvas data api? (not the data
&lt;br&gt;&amp;gt;&amp;gt; URI api).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I would expect that there would be some harmonization desired there, &amp;nbsp;
&lt;br&gt;&amp;gt; but:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; If you call canvascontext.getImageData(0,0,width,height), you get an
&lt;br&gt;&amp;gt;&amp;gt; object with some mutable properties, and a data property holding what
&lt;br&gt;&amp;gt;&amp;gt; looks like an array of numbers between 0 and 255. The data property
&lt;br&gt;&amp;gt;&amp;gt; supposedly has an efficient implementation.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Using that data property may be more efficient than using an Array,
&lt;br&gt;&amp;gt; but that depends a bunch on the implementation choices for the JS
&lt;br&gt;&amp;gt; engine and Canvas implementation.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It was also proposed, though I don't know if it is generally accepted,
&lt;br&gt;&amp;gt; that the Canvas Data object clamp its values to 255 on set, so if
&lt;br&gt;&amp;gt; people feel that's a necessary behaviour (I personally don't, but my
&lt;br&gt;&amp;gt; opinion carries less than the mean weight in these discussions) then
&lt;br&gt;&amp;gt; ByteArray might not be suitable.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The Canvas Data object is also sort of half-mutable: you can change
&lt;br&gt;&amp;gt; the values of the data elements, but can't change the size of the
&lt;br&gt;&amp;gt; &amp;quot;array&amp;quot;. &amp;nbsp;That could turn out to be a useful property for optimized
&lt;br&gt;&amp;gt; access to it, since you can amortize length checks quite well.
&lt;/div&gt;&lt;br&gt;CanvasPixelArray seems close enough to a mutable general-purpose &amp;nbsp;
&lt;br&gt;binary data container that maybe it's worth considering whether to &amp;nbsp;
&lt;br&gt;specifically serve this case (fixed length, mutable contents) at the &amp;nbsp;
&lt;br&gt;ECMAScript level. It would then likely be possible to change &amp;nbsp;
&lt;br&gt;CanvasPixelArray to inherit from a general-purpose binary data &amp;nbsp;
&lt;br&gt;container without breaking compat.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Maciej
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26235711&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Binary-data-%28ByteArray-ByteVector%29-proposal-on-public-script-coord-tp26223706p26235711.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26235542</id>
	<title>Re: Binary Data - possible topic for joint session</title>
	<published>2009-11-06T09:18:38Z</published>
	<updated>2009-11-06T09:18:38Z</updated>
	<author>
		<name>Maciej Stachowiak</name>
	</author>
	<content type="html">&lt;br&gt;On Nov 6, 2009, at 8:26 AM, Brendan Eich wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Nov 6, 2009, at 1:34 AM, Maciej Stachowiak wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; = Issues for the binary data API:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; Name (potential bikeshed):
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; ByteArray
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; ByteVector
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; BinaryData
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Data
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This isn't just rank bikeshedding:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 1. Data is so common a name that we can't confidently inject it into &amp;nbsp;
&lt;br&gt;&amp;gt; the global object without fear of breaking something. JSON, in spite &amp;nbsp;
&lt;br&gt;&amp;gt; of json2.js precedent, was implemented incompatibly and object- 
&lt;br&gt;&amp;gt; detected insufficiently, although this was corrected by the &amp;nbsp;
&lt;br&gt;&amp;gt; implementors (Facebook folks, much appreciated). Google codesearch &amp;nbsp;
&lt;br&gt;&amp;gt; results:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.google.com/codesearch?as_q=%22function+Data%28%22&amp;btnG=Search+Code&amp;hl=en&amp;as_lang=javascript&amp;as_case=y&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/codesearch?as_q=%22function+Data%28%22&amp;btnG=Search+Code&amp;hl=en&amp;as_lang=javascript&amp;as_case=y&lt;/a&gt;&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.google.com/codesearch?as_q=%22var+Data;%22&amp;btnG=Search+Code&amp;hl=en&amp;as_lang=javascript&amp;as_case=y&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/codesearch?as_q=%22var+Data;%22&amp;btnG=Search+Code&amp;hl=en&amp;as_lang=javascript&amp;as_case=y&lt;/a&gt;&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.google.com/codesearch?as_q=%22var+Data%20=%22&amp;btnG=Search+Code&amp;hl=en&amp;as_lang=javascript&amp;as_case=y&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/codesearch?as_q=%22var+Data%20=%22&amp;btnG=Search+Code&amp;hl=en&amp;as_lang=javascript&amp;as_case=y&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 2. Data is annoyingly close to Date.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 3. Data is technically plural, and usage sometimes treats it as &amp;nbsp;
&lt;br&gt;&amp;gt; plural (ok, this is almost bikeshedding, I admit). For a String &amp;nbsp;
&lt;br&gt;&amp;gt; analogue this is awkward.
&lt;/div&gt;&lt;br&gt;You're right that there are some objective factors which may rule out &amp;nbsp;
&lt;br&gt;certain names, in addition to subjective taste concerns. I tried not &amp;nbsp;
&lt;br&gt;to think too hard about the name in making the original proposal, &amp;nbsp;
&lt;br&gt;since I figured there would be a range of opinion. Your stated reasons &amp;nbsp;
&lt;br&gt;against Data seem decent.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I like &amp;quot;Data&amp;quot; and similar names. Objective-C has NSData as a &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; distinct type for chunks of binary data - it's not treated as a &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; type of array. I think this makes sense. Often the fact that a &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; chunk of binary data can be treated as an octet sequence is &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; incidental.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It's not incidental unless you provide wider-than-byte element &amp;nbsp;
&lt;br&gt;&amp;gt; access and address byte order. Let's not, in the interest of serving &amp;nbsp;
&lt;br&gt;&amp;gt; API simplicity and common octet-sequence use-cases first and only &amp;nbsp;
&lt;br&gt;&amp;gt; (if we can hold this line).
&lt;/div&gt;&lt;br&gt;Indeed, I'd rather not propose APIs like that in the initial version &amp;nbsp;
&lt;br&gt;(though I think eventually we may want a way to copy sequences of 16-, &amp;nbsp;
&lt;br&gt;32-bit or 64-bit values swapping from network byte order to host byte &amp;nbsp;
&lt;br&gt;order or vice versa to make it practical to interpret popular binary &amp;nbsp;
&lt;br&gt;formats.
&lt;br&gt;&lt;br&gt;However, I think a common use case for binary data is to pass it &amp;nbsp;
&lt;br&gt;around for point A to point B, without unpacking the internals at all, &amp;nbsp;
&lt;br&gt;just as for strings. For example, you may read a file in binary form, &amp;nbsp;
&lt;br&gt;pass the binary data off to a Worker, and then have the Worker upload &amp;nbsp;
&lt;br&gt;it to a server. This is part of why I leaned towards a name that does &amp;nbsp;
&lt;br&gt;not overly emphasize the byte sequence nature.
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Therefore I think a concrete name such as ByteVector or ByteArray is &amp;nbsp;
&lt;br&gt;&amp;gt; better, all else equal.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Moreover a name such as ByteVector is much easier to inject as a &amp;nbsp;
&lt;br&gt;&amp;gt; global property. No hits for the obvious function and var forms of &amp;nbsp;
&lt;br&gt;&amp;gt; it, one hit for ByteArray:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=%22function+ByteArray%28%22+lang%3Ajavascript&amp;sbtn=Search&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=%22function+ByteArray%28%22+lang%3Ajavascript&amp;sbtn=Search&lt;/a&gt;&lt;br&gt;&lt;br&gt;Some other possible names (based in part on some other binary data &amp;nbsp;
&lt;br&gt;proposals that I've seen):
&lt;br&gt;&lt;br&gt;BinaryData
&lt;br&gt;BinData
&lt;br&gt;ByteString
&lt;br&gt;Binary
&lt;br&gt;Blob
&lt;br&gt;&lt;br&gt;Good topic for in-person discussion maybe?
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Maciej
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26235542&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Binary-Data---possible-topic-for-joint-session-tp26229087p26235542.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26234781</id>
	<title>Re: Binary Data - possible topic for joint session</title>
	<published>2009-11-06T08:26:45Z</published>
	<updated>2009-11-06T08:26:45Z</updated>
	<author>
		<name>Brendan Eich-3</name>
	</author>
	<content type="html">On Nov 6, 2009, at 1:34 AM, Maciej Stachowiak wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; = Issues for the binary data API:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Name (potential bikeshed):
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ByteArray
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ByteVector
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BinaryData
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Data
&lt;br&gt;&lt;br&gt;This isn't just rank bikeshedding:
&lt;br&gt;&lt;br&gt;1. Data is so common a name that we can't confidently inject it into &amp;nbsp;
&lt;br&gt;the global object without fear of breaking something. JSON, in spite &amp;nbsp;
&lt;br&gt;of json2.js precedent, was implemented incompatibly and object- 
&lt;br&gt;detected insufficiently, although this was corrected by the &amp;nbsp;
&lt;br&gt;implementors (Facebook folks, much appreciated). Google codesearch &amp;nbsp;
&lt;br&gt;results:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.google.com/codesearch?as_q=%22function+Data%28%22&amp;btnG=Search+Code&amp;hl=en&amp;as_lang=javascript&amp;as_case=y&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/codesearch?as_q=%22function+Data%28%22&amp;btnG=Search+Code&amp;hl=en&amp;as_lang=javascript&amp;as_case=y&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.google.com/codesearch?as_q=%22var+Data;%22&amp;btnG=Search+Code&amp;hl=en&amp;as_lang=javascript&amp;as_case=y&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/codesearch?as_q=%22var+Data;%22&amp;btnG=Search+Code&amp;hl=en&amp;as_lang=javascript&amp;as_case=y&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.google.com/codesearch?as_q=%22var+Data%20=%22&amp;btnG=Search+Code&amp;hl=en&amp;as_lang=javascript&amp;as_case=y&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/codesearch?as_q=%22var+Data%20=%22&amp;btnG=Search+Code&amp;hl=en&amp;as_lang=javascript&amp;as_case=y&lt;/a&gt;&lt;br&gt;&lt;br&gt;2. Data is annoyingly close to Date.
&lt;br&gt;&lt;br&gt;3. Data is technically plural, and usage sometimes treats it as plural &amp;nbsp;
&lt;br&gt;(ok, this is almost bikeshedding, I admit). For a String analogue this &amp;nbsp;
&lt;br&gt;is awkward.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; I like &amp;quot;Data&amp;quot; and similar names. Objective-C has NSData as a &amp;nbsp;
&lt;br&gt;&amp;gt; distinct type for chunks of binary data - it's not treated as a type &amp;nbsp;
&lt;br&gt;&amp;gt; of array. I think this makes sense. Often the fact that a chunk of &amp;nbsp;
&lt;br&gt;&amp;gt; binary data can be treated as an octet sequence is incidental.
&lt;br&gt;&lt;br&gt;It's not incidental unless you provide wider-than-byte element access &amp;nbsp;
&lt;br&gt;and address byte order. Let's not, in the interest of serving API &amp;nbsp;
&lt;br&gt;simplicity and common octet-sequence use-cases first and only (if we &amp;nbsp;
&lt;br&gt;can hold this line).
&lt;br&gt;&lt;br&gt;Therefore I think a concrete name such as ByteVector or ByteArray is &amp;nbsp;
&lt;br&gt;better, all else equal.
&lt;br&gt;&lt;br&gt;Moreover a name such as ByteVector is much easier to inject as a &amp;nbsp;
&lt;br&gt;global property. No hits for the obvious function and var forms of it, &amp;nbsp;
&lt;br&gt;one hit for ByteArray:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=%22function+ByteArray%28%22+lang%3Ajavascript&amp;sbtn=Search&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=%22function+ByteArray%28%22+lang%3Ajavascript&amp;sbtn=Search&lt;/a&gt;&lt;br&gt;&lt;br&gt;/be
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26234781&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Binary-Data---possible-topic-for-joint-session-tp26229087p26234781.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26233569</id>
	<title>Re: Binary data (ByteArray/ByteVector) proposal on  public-script-coord</title>
	<published>2009-11-06T07:13:27Z</published>
	<updated>2009-11-06T07:13:27Z</updated>
	<author>
		<name>Mike Shaver</name>
	</author>
	<content type="html">On Fri, Nov 6, 2009 at 9:31 AM, Breton Slivka &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26233569&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;zen@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;I think the C language has
&lt;br&gt;&amp;gt; possibly biased us into thinking of data as a sequence of 8-bit bytes,
&lt;br&gt;&amp;gt; when that is just what happened to be convenient for C.
&lt;br&gt;&lt;br&gt;For types called ByteArray and ByteVector, I think a byte orientation
&lt;br&gt;is appropriate. &amp;nbsp;Doing things other than bytes brings endianness into
&lt;br&gt;play (ask the WebGL guys, if you know any)
&lt;br&gt;&lt;br&gt;&amp;gt; My question is (since nobody seems to have brought it up yet) is how
&lt;br&gt;&amp;gt; does this proposal fit into the html5 canvas data api? (not the data
&lt;br&gt;&amp;gt; URI api).
&lt;br&gt;&lt;br&gt;I would expect that there would be some harmonization desired there, but:
&lt;br&gt;&lt;br&gt;&amp;gt; If you call canvascontext.getImageData(0,0,width,height), you get an
&lt;br&gt;&amp;gt; object with some mutable properties, and a data property holding what
&lt;br&gt;&amp;gt; looks like an array of numbers between 0 and 255. The data property
&lt;br&gt;&amp;gt; supposedly has an efficient implementation.
&lt;br&gt;&lt;br&gt;Using that data property may be more efficient than using an Array,
&lt;br&gt;but that depends a bunch on the implementation choices for the JS
&lt;br&gt;engine and Canvas implementation.
&lt;br&gt;&lt;br&gt;It was also proposed, though I don't know if it is generally accepted,
&lt;br&gt;that the Canvas Data object clamp its values to 255 on set, so if
&lt;br&gt;people feel that's a necessary behaviour (I personally don't, but my
&lt;br&gt;opinion carries less than the mean weight in these discussions) then
&lt;br&gt;ByteArray might not be suitable.
&lt;br&gt;&lt;br&gt;The Canvas Data object is also sort of half-mutable: you can change
&lt;br&gt;the values of the data elements, but can't change the size of the
&lt;br&gt;&amp;quot;array&amp;quot;. &amp;nbsp;That could turn out to be a useful property for optimized
&lt;br&gt;access to it, since you can amortize length checks quite well.
&lt;br&gt;&lt;br&gt;Mike
&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26233569&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Binary-data-%28ByteArray-ByteVector%29-proposal-on-public-script-coord-tp26223706p26233569.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26232919</id>
	<title>Re: Binary data (ByteArray/ByteVector) proposal on  public-script-coord</title>
	<published>2009-11-06T06:31:50Z</published>
	<updated>2009-11-06T06:31:50Z</updated>
	<author>
		<name>Breton Slivka</name>
	</author>
	<content type="html">On Sat, Nov 7, 2009 at 12:43 AM, P T Withington &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26232919&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ptw@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On 2009-11-05, at 19:42, Maciej Stachowiak wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; My claim is that Data is not much like these things. I believe it is more
&lt;br&gt;&amp;gt;&amp;gt; like String. It happens to be a sequence (of a very specific type), but it's
&lt;br&gt;&amp;gt;&amp;gt; specialized enough to be worth treating differently. Do people often regret
&lt;br&gt;&amp;gt;&amp;gt; that String is not an Array?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Data is like an 8-bit &amp;quot;null encoded&amp;quot; String. &amp;nbsp;Which makes me wonder if you
&lt;br&gt;&amp;gt; really just want to extend String to allow different encodings. &amp;nbsp;But I also
&lt;br&gt;&amp;gt; regret String not being and Array. &amp;nbsp;Others must have too, because at one
&lt;br&gt;&amp;gt; point I'm sure there was a proposal to make [] on string mean charAt?
&lt;/div&gt;&lt;br&gt;Sorry to get philisophical here, but data is anything you happen to
&lt;br&gt;interpret it as, it's not any particular thing. It could be an image,
&lt;br&gt;it could be a string, it could be machine instructions, it could be a
&lt;br&gt;sequence of octets, it could be hexidecimal. Asking what data is like
&lt;br&gt;is a little bit useless. The question to ask is what kind of api makes
&lt;br&gt;the most sense for conveniently manipulating data on a low level, and
&lt;br&gt;in a way that isn't unfeasably slow, or awkward. What kind of api will
&lt;br&gt;allow the programmer to efficiently interpret that data as things
&lt;br&gt;other than what are built into the browser. I think the C language has
&lt;br&gt;possibly biased us into thinking of data as a sequence of 8-bit bytes,
&lt;br&gt;when that is just what happened to be convenient for C. There are
&lt;br&gt;other ways to think about data: even within C you can define a struct,
&lt;br&gt;point it at some area of memory, and the struct magically interprets
&lt;br&gt;that data as an object like thing. Or you can even scanf. These
&lt;br&gt;concepts do not depend on a byte stream, or &amp;quot;string&amp;quot; interpretation of
&lt;br&gt;data.
&lt;br&gt;&lt;br&gt;&lt;br&gt;By the way, it might not be standard, but &amp;quot;hello world&amp;quot;[0] returns &amp;quot;h&amp;quot;
&lt;br&gt;on anything but IE, so far as I've tried.
&lt;br&gt;&lt;br&gt;My question is (since nobody seems to have brought it up yet) is how
&lt;br&gt;does this proposal fit into the html5 canvas data api? (not the data
&lt;br&gt;URI api).
&lt;br&gt;&lt;br&gt;If you call canvascontext.getImageData(0,0,width,height), you get an
&lt;br&gt;object with some mutable properties, and a data property holding what
&lt;br&gt;looks like an array of numbers between 0 and 255. The data property
&lt;br&gt;supposedly has an efficient implementation. There is also a
&lt;br&gt;putImageData function which accepts a data object, but not an array
&lt;br&gt;object, and a constructor, context.createImageData(width,height);
&lt;br&gt;&lt;br&gt;This is already in browsers, and is in the process of being
&lt;br&gt;standardised in html5. I just wonder what happens if ecmascript then
&lt;br&gt;adds its own data object, how would it interact with the canvas data
&lt;br&gt;apis?
&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26232919&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Binary-data-%28ByteArray-ByteVector%29-proposal-on-public-script-coord-tp26223706p26232919.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26232224</id>
	<title>Re: Binary data (ByteArray/ByteVector) proposal on public-script-coord</title>
	<published>2009-11-06T05:43:56Z</published>
	<updated>2009-11-06T05:43:56Z</updated>
	<author>
		<name>P T Withington</name>
	</author>
	<content type="html">On 2009-11-05, at 19:42, Maciej Stachowiak wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; My claim is that Data is not much like these things. I believe it is &amp;nbsp;
&lt;br&gt;&amp;gt; more like String. It happens to be a sequence (of a very specific &amp;nbsp;
&lt;br&gt;&amp;gt; type), but it's specialized enough to be worth treating differently. &amp;nbsp;
&lt;br&gt;&amp;gt; Do people often regret that String is not an Array?
&lt;br&gt;&lt;br&gt;Data is like an 8-bit &amp;quot;null encoded&amp;quot; String. &amp;nbsp;Which makes me wonder if &amp;nbsp;
&lt;br&gt;you really just want to extend String to allow different encodings. &amp;nbsp; 
&lt;br&gt;But I also regret String not being and Array. &amp;nbsp;Others must have too, &amp;nbsp;
&lt;br&gt;because at one point I'm sure there was a proposal to make [] on &amp;nbsp;
&lt;br&gt;string mean charAt?
&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26232224&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Binary-data-%28ByteArray-ByteVector%29-proposal-on-public-script-coord-tp26223706p26232224.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26229087</id>
	<title>Re: Binary Data - possible topic for joint session</title>
	<published>2009-11-06T01:34:16Z</published>
	<updated>2009-11-06T01:34:16Z</updated>
	<author>
		<name>Maciej Stachowiak</name>
	</author>
	<content type="html">+ es-discuss (since posting there seems to have piqued more interest)
&lt;br&gt;&lt;br&gt;&amp;nbsp;From reading over other proposals for binary data, I should mention &amp;nbsp;
&lt;br&gt;the following operations that seem to be of interest to some &amp;nbsp;
&lt;br&gt;communities but are not directly provided in this proposal (with ones &amp;nbsp;
&lt;br&gt;I think are most appropriate for v1 first):
&lt;br&gt;&lt;br&gt;- Subrange/subdata/substring (get a Data that's a range from another's &amp;nbsp;
&lt;br&gt;buffer - perhaps this could be optimized not to copy)
&lt;br&gt;- Concatenation (specifically the ability to concatenate two immutable &amp;nbsp;
&lt;br&gt;Data objects and get a new one back without having to go through the &amp;nbsp;
&lt;br&gt;mutable type).
&lt;br&gt;- Ability to convert to/from strings (with some hardcoded encoding or &amp;nbsp;
&lt;br&gt;choice of encoding)
&lt;br&gt;- Some or all of the operations of Array
&lt;br&gt;- Base64 encode/decode
&lt;br&gt;- Methods to compute various cryptographic hashes
&lt;br&gt;- Find first or last occurrence of a byte or byte sequence (from a &amp;nbsp;
&lt;br&gt;given offset)
&lt;br&gt;- Split on a byte or byte sequence
&lt;br&gt;&lt;br&gt;I think it is possible to implement all of these with the primitives &amp;nbsp;
&lt;br&gt;in my proposal, and in many cases the utility seems dubious (do you &amp;nbsp;
&lt;br&gt;really want to map() or reduce() binary data one byte at a time?). &amp;nbsp;
&lt;br&gt;Thus, I lean towards keeping the API relatively minimal, at least for &amp;nbsp;
&lt;br&gt;starters.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Maciej
&lt;br&gt;&lt;br&gt;On Nov 4, 2009, at 4:26 PM, Maciej Stachowiak wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Many APIs being developed for the Web platform would benefit from a &amp;nbsp;
&lt;br&gt;&amp;gt; good way to store binary data. It would be useful for this to be &amp;nbsp;
&lt;br&gt;&amp;gt; specified as part of the ECMAScript language, but it's also &amp;nbsp;
&lt;br&gt;&amp;gt; plausible to make this a W3C spec that's only intended for use with &amp;nbsp;
&lt;br&gt;&amp;gt; Web platform APIs. Here is an overview of some of the APIs that &amp;nbsp;
&lt;br&gt;&amp;gt; could use such a data type, some notes on requirements and design &amp;nbsp;
&lt;br&gt;&amp;gt; alternatives, and a strawman proposal.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; = If there's time, I'd like to discuss this at the joint TC-39/HTML &amp;nbsp;
&lt;br&gt;&amp;gt; WG/Web Apps WG session.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Some APIs that could use this:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;XMLHttpRequest v2 - to receive and send binary data
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;WebSocket - to receive and send binary packets
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;File API - to read binary files
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Canvas - to get image data in the binary form of an image format &amp;nbsp;
&lt;br&gt;&amp;gt; (avoiding inefficiency of data: URLs)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;various storage APIs - to store and retrieve binary data (in &amp;nbsp;
&lt;br&gt;&amp;gt; combination with other APIs)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;postMessage - to send binary data cross-window and cross-thread &amp;nbsp;
&lt;br&gt;&amp;gt; (to Workers) efficiently
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I suspect there's more I am not thinking of. A convenient and &amp;nbsp;
&lt;br&gt;&amp;gt; efficient way to represent binary data could also be useful for pure &amp;nbsp;
&lt;br&gt;&amp;gt; ES programs.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; = Current de facto ways for Web apps to deal with binary data:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Array of numbers with one byte per entry
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;String with one byte stored per UTF-16 code unit
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;String with two bytes stored per UTF-16 code unit
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I hope it is obvious why these approaches are not great so I won't &amp;nbsp;
&lt;br&gt;&amp;gt; go into detail.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; = Issues for the binary data API:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Name (potential bikeshed):
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ByteArray
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ByteVector
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BinaryData
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Data
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I like &amp;quot;Data&amp;quot; and similar names. Objective-C has NSData as a &amp;nbsp;
&lt;br&gt;&amp;gt; distinct type for chunks of binary data - it's not treated as a type &amp;nbsp;
&lt;br&gt;&amp;gt; of array. I think this makes sense. Often the fact that a chunk of &amp;nbsp;
&lt;br&gt;&amp;gt; binary data can be treated as an octet sequence is incidental.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; == &amp;nbsp;Mutable or Immutable (or both?)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Immutable has a number of advantages:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;- Can share backing store with chunks of binary data that the UA &amp;nbsp;
&lt;br&gt;&amp;gt; already holds (e.g. in the network cache) without requiring copy-on- 
&lt;br&gt;&amp;gt; write
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;- Can be passed cross-thread without copying, and without &amp;nbsp;
&lt;br&gt;&amp;gt; breaking shared-nothing semantics
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;- Has the right semantics for passing cross-window (can make a &amp;nbsp;
&lt;br&gt;&amp;gt; copy in cross-process case, but avoid it in same-process case; or &amp;nbsp;
&lt;br&gt;&amp;gt; use shared memory in cross-process case without worrying about &amp;nbsp;
&lt;br&gt;&amp;gt; locking or races)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;- Follows the approach of ES strings, which are immutable
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; But there's some significant disadvantages too:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;- What if you actually want to mutate some piece of binary data &amp;nbsp;
&lt;br&gt;&amp;gt; you got before passing it along? How to do this efficiently?
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;- What if you want to build a new binary data item from scratch?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; With strings, the answer to both building and mutation is to extract &amp;nbsp;
&lt;br&gt;&amp;gt; pieces and build a new string by concatenation. But that's probably &amp;nbsp;
&lt;br&gt;&amp;gt; not efficient or convenient enough for the binary data case.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Possible solution: provide immutable Data, but have a DataBuilder &amp;nbsp;
&lt;br&gt;&amp;gt; class to allow creating new data items or mutating copies of &amp;nbsp;
&lt;br&gt;&amp;gt; existing ones, which can then give a final immutable product.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; == What Operations?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Operation set could be a full set of array-like operations, &amp;nbsp;
&lt;br&gt;&amp;gt; absolutely minimal (just accessors for individual bytes), or middle &amp;nbsp;
&lt;br&gt;&amp;gt; ground (byte-level accessors plus a few bulk operations like the &amp;nbsp;
&lt;br&gt;&amp;gt; equivalent of memcpy). I like the middle ground.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; == Rough API Proposal
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Here's a sketch of a binary data API that's immutable (with mutable &amp;nbsp;
&lt;br&gt;&amp;gt; builder class), and provides a middle-ground set of operations. The &amp;nbsp;
&lt;br&gt;&amp;gt; basic idea is that binary data should be considered a first-class &amp;nbsp;
&lt;br&gt;&amp;gt; datatype in its own right, just as strings are, rather than being &amp;nbsp;
&lt;br&gt;&amp;gt; thought of as a kind of array.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Data -- global constructor
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;When called or invoked as a constructor with a number parameter, &amp;nbsp;
&lt;br&gt;&amp;gt; return a new Data object of the specified size, filled with all zero &amp;nbsp;
&lt;br&gt;&amp;gt; bytes.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Data.prototype -- the initial Data prototype
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Data.prototype.builderCopy()
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;When called with a Data instance as the this parameter, return a &amp;nbsp;
&lt;br&gt;&amp;gt; new DataBuilder object starting with the same size and a copy of the &amp;nbsp;
&lt;br&gt;&amp;gt; bytes in this Data object.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Data instance properties:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;length - size of the Data object - read-only
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;index properties - individual bytes of the Data (similar to array &amp;nbsp;
&lt;br&gt;&amp;gt; access) - read-only
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; DataBuilder -- global constructor
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;When called or invoked as a constructor with a number parameter, &amp;nbsp;
&lt;br&gt;&amp;gt; return a new DataBuilder object of the specified size, filled with &amp;nbsp;
&lt;br&gt;&amp;gt; all zero bytes.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; DataBuilder.prototype.builderCopy()
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;When called with a DataBuilder instance as the this parameter, &amp;nbsp;
&lt;br&gt;&amp;gt; return a new DataBuilder object starting with the same size and a &amp;nbsp;
&lt;br&gt;&amp;gt; copy of the bytes in this Data object.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; DataBuilder.prototype.copyRange(dstStart, srcObject, srcStart, srcEnd)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;When called with a DataBuilder instance as the this parameter, &amp;nbsp;
&lt;br&gt;&amp;gt; copy bytes from srcObject starting at offset srcStart up to offset &amp;nbsp;
&lt;br&gt;&amp;gt; srcEnd. srcObject can be a Data or a DataBuilder, and can be the &amp;nbsp;
&lt;br&gt;&amp;gt; same as the &amp;quot;this&amp;quot; object. Overlapping ranges are guaranteed to be &amp;nbsp;
&lt;br&gt;&amp;gt; copied correctly. dstStart is the offset in this DataBuilder at &amp;nbsp;
&lt;br&gt;&amp;gt; which to provide writing.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; DataBuilder.prototype.fill(byte, dstStart, dstEnd)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; Fill with &amp;quot;byte&amp;quot; from dstStart to dstEnd.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; DataBuilder.prototype release()
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; Return a Data object of the same size and containing the same &amp;nbsp;
&lt;br&gt;&amp;gt; bytes as this DataBuilder, and at the same time reset this &amp;nbsp;
&lt;br&gt;&amp;gt; DataBuilder to 0 length. This is so that the new Data object can &amp;nbsp;
&lt;br&gt;&amp;gt; adopt the buffer of this DataBuilder without copying, which is what &amp;nbsp;
&lt;br&gt;&amp;gt; is commonly desired.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; DataBuilder instance properties:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;length - size of the Data object - read-write
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;index properties - individual bytes of the DataBuilder (similar &amp;nbsp;
&lt;br&gt;&amp;gt; to array access) - read-write
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Rationale:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; - copyRange() and fill() are the only higher-level operations &amp;nbsp;
&lt;br&gt;&amp;gt; provided, because they can be implemented much more efficiently for &amp;nbsp;
&lt;br&gt;&amp;gt; large ranges in native code than in ECMAScript.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; - Data would be returned and taken by all Web APIs, its &amp;nbsp;
&lt;br&gt;&amp;gt; immutability allows binary data to be passed around without copying.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; - DataBuilder allows creation and mutation while minimizing copies &amp;nbsp;
&lt;br&gt;&amp;gt; and letting most of a system maintain the benefits of immutability.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; - DataBuilder.prototype.release() is specifically designed to let &amp;nbsp;
&lt;br&gt;&amp;gt; a program use mutation to build up a chunk of binary data, then pass &amp;nbsp;
&lt;br&gt;&amp;gt; it off to code that should not mutate it or across boundaries with &amp;nbsp;
&lt;br&gt;&amp;gt; shared-nothing semantics (like Workers), without requiring a copy &amp;nbsp;
&lt;br&gt;&amp;gt; after initially building.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Sorry that this is so sketchy, but I thought this would make a good &amp;nbsp;
&lt;br&gt;&amp;gt; starting point for discussion.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Maciej
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26229087&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Binary-Data---possible-topic-for-joint-session-tp26229087p26229087.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26228989</id>
	<title>Re: Binary data (ByteArray/ByteVector) proposal on public-script-coord</title>
	<published>2009-11-06T01:24:06Z</published>
	<updated>2009-11-06T01:24:06Z</updated>
	<author>
		<name>Maciej Stachowiak</name>
	</author>
	<content type="html">&lt;br&gt;On Nov 5, 2009, at 5:14 PM, Charles Jolley wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I hadn't thought about freeze affecting all other values on the &amp;nbsp;
&lt;br&gt;&amp;gt; object. &amp;nbsp;I agree that is not desirable.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Still, having separate object types for mutable and immutable &amp;nbsp;
&lt;br&gt;&amp;gt; objects introduces a new pattern to JS. &amp;nbsp;Why not follow the pattern &amp;nbsp;
&lt;br&gt;&amp;gt; used for freeze(), seal() and preventExtension()? &amp;nbsp;Here's another &amp;nbsp;
&lt;br&gt;&amp;gt; alternative as an example:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Data.preventEdits(foo);
&lt;br&gt;&amp;gt; &amp;nbsp;- makes editable data not editable
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Data.isEditable(foo);
&lt;br&gt;&amp;gt; - returns true if editable
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; foo.copy();
&lt;br&gt;&amp;gt; - returns a copy of foo, matching editable state. &amp;nbsp;If foo is not &amp;nbsp;
&lt;br&gt;&amp;gt; editable, may return foo
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; foo.editableCopy();
&lt;br&gt;&amp;gt; - returns an editable copy of foo, regardless of editable state
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Incidentally this API above could be implemented using separate &amp;nbsp;
&lt;br&gt;&amp;gt; object types as you suggest by making DataBuilder an extension of &amp;nbsp;
&lt;br&gt;&amp;gt; Data. &amp;nbsp;This would be an implementation detail though rather than a &amp;nbsp;
&lt;br&gt;&amp;gt; fundamental part of the API.
&lt;/div&gt;&lt;br&gt;I don't think that would work, unless Data.preventEdits(foo) returns a &amp;nbsp;
&lt;br&gt;new value.
&lt;br&gt;&lt;br&gt;I think the disadvantage of this design is that it puts all the &amp;nbsp;
&lt;br&gt;mutation methods on immutable instances, where they are serve no &amp;nbsp;
&lt;br&gt;purpose other than to throw when called. I think it is cleaner design &amp;nbsp;
&lt;br&gt;for the immutable interface to lack mutation methods, rather than have &amp;nbsp;
&lt;br&gt;mutation methods that always fail. I think designs where part of the &amp;nbsp;
&lt;br&gt;normal workflow puts an object in a state where some methods always &amp;nbsp;
&lt;br&gt;throw is poor OO design.
&lt;br&gt;&lt;br&gt;It's true that ECMAScript has not historically had mutable/immutable &amp;nbsp;
&lt;br&gt;pairs of types, but this is a common pattern in other languages, such &amp;nbsp;
&lt;br&gt;as Objective-C (NSString vs. NSMutableString), Java (String vs. &amp;nbsp;
&lt;br&gt;StringBuilder), various recent Lisp dialects (where there are often &amp;nbsp;
&lt;br&gt;both mutable and immutable lists) and arguably event C++ (const string &amp;nbsp;
&lt;br&gt;and string expose different sets of method).
&lt;br&gt;&lt;br&gt;That being said, I can see how there is some value to aligning with &amp;nbsp;
&lt;br&gt;the evolving ECMAScript pattern. Personally I think of Object.freeze &amp;nbsp;
&lt;br&gt;as a tool for building new types that are meant to be immutable, or &amp;nbsp;
&lt;br&gt;for exporting partially restricted facade interfaces, not as something &amp;nbsp;
&lt;br&gt;one should be doing to random objects in the course of normal &amp;nbsp;
&lt;br&gt;programming.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Maciej
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26228989&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Binary-data-%28ByteArray-ByteVector%29-proposal-on-public-script-coord-tp26223706p26228989.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26228870</id>
	<title>Re: Binary data (ByteArray/ByteVector) proposal on public-script-coord</title>
	<published>2009-11-06T01:14:34Z</published>
	<updated>2009-11-06T01:14:34Z</updated>
	<author>
		<name>Maciej Stachowiak</name>
	</author>
	<content type="html">&lt;html&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;br&gt;&lt;div&gt;&lt;div&gt;On Nov 5, 2009, at 11:03 PM, David-Sarah Hopwood wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div&gt;Oliver Hunt wrote:&lt;br&gt;&lt;font class=&quot;Apple-style-span&quot; color=&quot;#006312&quot;&gt;&lt;br&gt;&lt;/font&gt;&lt;blockquote type=&quot;cite&quot;&gt;-- for instance in the DOM I cannot set indices of a NodeList, but the&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type=&quot;cite&quot;&gt;NodeList does not need to be frozen.&lt;br&gt;&lt;/blockquote&gt;&lt;br&gt;NodeList objects are read-only.&lt;br&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;But the values they return may change over time due to factors other than manipulating the NodeList.&lt;/div&gt;&lt;/div&gt;&lt;br&gt;&lt;div&gt;Regards,&lt;/div&gt;&lt;div&gt;Maciej&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;es-discuss mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26228870&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;es-discuss@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.mozilla.org/listinfo/es-discuss&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.mozilla.org/listinfo/es-discuss&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Binary-data-%28ByteArray-ByteVector%29-proposal-on-public-script-coord-tp26223706p26228870.html" />
</entry>

</feed>
