Re: traits feedback

2011-10-11 Thread Tom Van Cutsem
2011/10/10 Dean Landolt d...@deanlandolt.com On Mon, Oct 10, 2011 at 4:13 PM, John J Barton johnjbar...@johnjbarton.com wrote: On Mon, Oct 10, 2011 at 11:59 AM, Tom Van Cutsem tomvc...@gmail.comwrote: The traits philosophy is that, when merging objects, you want to see name clashes

Re: Instance constructors

2011-10-11 Thread David Bruant
Le 11/10/2011 05:48, Cameron McCormack a écrit : On 24/09/11 8:35 AM, Allen Wirfs-Brock wrote: Regarding, WebIDL. It seems to me, that it just needs an extended attribute to specifies which attributes are instance attributes rather than prototype attributes. I think it only makes sense to

Re: Instance constructors

2011-10-11 Thread Mark S. Miller
On Tue, Oct 11, 2011 at 11:43 AM, David Bruant david.bru...@labri.frwrote: It gives me an idea for a proxy library which would be to pass a custom field in a data descriptor indicating the type. The proxy would enforce the type under the hood and either coerce silently or throw if the type is

Re: Instance constructors

2011-10-11 Thread Tom Van Cutsem
2011/10/11 Mark S. Miller erig...@google.com On Tue, Oct 11, 2011 at 11:43 AM, David Bruant david.bru...@labri.frwrote: It gives me an idea for a proxy library which would be to pass a custom field in a data descriptor indicating the type. The proxy would enforce the type under the hood and

Harmony transpilers

2011-10-11 Thread Juan Ignacio Dopazo
Hi! Is there anyone working on a Harmony transpiler besides Traceur? It'd be really useful to have a transpiler that justs desugars (what's possible to desugar) without using a library like Closure, the way CoffeeScript is working nowadays. Thanks, Juan

Re: Harmony transpilers

2011-10-11 Thread Mark S. Miller
Caja http://code.google.com/p/google-caja/ includes an ES5-to-ES3 translator which already includes an emulation of ES-next proxies and a somewhat leaky emulation of WeakMaps. (Non-leaky WeakMaps cannot be practically provided by emulation, but our's are less leaky than you'd expect.) On Tue,

Re: Instance constructors

2011-10-11 Thread Brendan Eich
On Oct 11, 2011, at 5:43 AM, David Bruant wrote: It gives me an idea for a proxy library which would be to pass a custom field in a data descriptor indicating the type. The proxy would enforce the type under the hood and either coerce silently or throw if the type is incorrect. The original

Re: Harmony transpilers

2011-10-11 Thread John J Barton
On Tue, Oct 11, 2011 at 6:41 AM, Juan Ignacio Dopazo dopazo.j...@gmail.comwrote: Hi! Is there anyone working on a Harmony transpiler besides Traceur? I'd like to understand why Traceur is not suitable. As far as I understand it was written to study new directions in JS. jjb It'd be really

Re: Harmony transpilers

2011-10-11 Thread Jake Verbaten
One of the reasons traceur is not suitable is that it's a product of google and thus not neutral. I've actually asked traceur whether they intent to become a full es harmony compliant transpiler but there was no response. And another reason would be that it currently implements some strawmans

Re: Harmony transpilers

2011-10-11 Thread John J Barton
On Tue, Oct 11, 2011 at 9:10 AM, Jake Verbaten rayn...@gmail.com wrote: One of the reasons traceur is not suitable is that it's a product of google and thus not neutral. Traceur is not a product, I think that is pretty obvious. It's just a JS to JS compiler written by some engineers very keen

Re: Harmony transpilers

2011-10-11 Thread Brendan Eich
On Oct 11, 2011, at 12:49 PM, John J Barton wrote: We don't know what the standard will be so we need some why to try out different features. That's not how the committee has worked since 2008, and even before then (pre-Harmony), with a split committee, we still had two groups working on

Re: Harmony transpilers

2011-10-11 Thread Juan Ignacio Dopazo
On Tue, Oct 11, 2011 at 12:42 PM, John J Barton johnjbar...@johnjbarton.com wrote: On Tue, Oct 11, 2011 at 6:41 AM, Juan Ignacio Dopazo dopazo.j...@gmail.com wrote: Hi! Is there anyone working on a Harmony transpiler besides Traceur? I'd like to understand why Traceur is not suitable.

Re: Harmony transpilers

2011-10-11 Thread John J Barton
On Tue, Oct 11, 2011 at 10:08 AM, Brendan Eich bren...@mozilla.com wrote: On Oct 11, 2011, at 12:49 PM, John J Barton wrote: We don't know what the standard will be so we need some why to try out different features. That's not how the committee has worked since 2008, and even before then

Re: Harmony transpilers

2011-10-11 Thread Brendan Eich
On Oct 11, 2011, at 1:47 PM, John J Barton wrote: On Tue, Oct 11, 2011 at 10:08 AM, Brendan Eich bren...@mozilla.com wrote: On Oct 11, 2011, at 12:49 PM, John J Barton wrote: We don't know what the standard will be so we need some why to try out different features. That's not how the

Re: Harmony transpilers

2011-10-11 Thread John J Barton
On Tue, Oct 11, 2011 at 11:14 AM, Brendan Eich bren...@mozilla.com wrote: On Oct 11, 2011, at 1:47 PM, John J Barton wrote: On Tue, Oct 11, 2011 at 10:08 AM, Brendan Eich bren...@mozilla.comwrote: On Oct 11, 2011, at 12:49 PM, John J Barton wrote: We don't know what the standard will be

Re: Harmony transpilers

2011-10-11 Thread Brendan Eich
On Oct 11, 2011, at 2:40 PM, John J Barton wrote: I have quite a lot of first hand experience in picking up where things left off. No question it's hard, but you may get further by building on Traceur rather than starting over. It would be great to get Traceur active again and up to

Re: Minor issues with proxies

2011-10-11 Thread Tom Van Cutsem
Proxy.create{Function} is now present on http://wiki.ecmascript.org/doku.php?id=harmony:proxies_semantics. Let us know if you spot any further holes. Cheers, Tom 2011/10/7 Tom Van Cutsem tomvc...@gmail.com Hi Andreas, - Proxy.create: What if the handler passed is not an object? Should we

Re: Harmony transpilers

2011-10-11 Thread Jake Verbaten
On Tue, Oct 11, 2011 at 7:40 PM, John J Barton johnjbar...@johnjbarton.comwrote: On Tue, Oct 11, 2011 at 11:14 AM, Brendan Eich bren...@mozilla.comwrote: On Oct 11, 2011, at 1:47 PM, John J Barton wrote: On Tue, Oct 11, 2011 at 10:08 AM, Brendan Eich bren...@mozilla.comwrote: On Oct 11,

Re: new Object

2011-10-11 Thread Jake Verbaten
On Tue, Oct 11, 2011 at 8:11 PM, Axel Rauschmayer a...@rauschma.de wrote: *From: *Jake Verbaten rayn...@gmail.com *Subject: **new Object* *Date: *October 11, 2011 20:53:58 GMT+02:00 *To: *es-discuss es-discuss@mozilla.org is there any kind of proposal for syntax that is like: [...] var

JS tools (was: Harmony transpilers)

2011-10-11 Thread Claus Reinke
There is a lot of abandon-ware in open source, .. Too true. And, for JS tools, a development I've been watching with increasing concern (development fragmentation coupled with scarce developer resources leading to project starvation). It is perhaps a necessary learning experience that new JS

Some spec usability issues (navigation, source, common practices)

2011-10-11 Thread Claus Reinke
As a detour from controversial language design issues, I was wondering about opportunities to improve the ES spec usability: - source availability: could the sources please be made available, preferably in easily processed form, on github? For draft standards, that would allow tracking

Re: new Object

2011-10-11 Thread Jake Verbaten
On Tue, Oct 11, 2011 at 8:58 PM, Axel Rauschmayer a...@rauschma.de wrote: I dont think having both new Object and new Function in the language will cause any conflicts. It's the same as claiming that having both declarative class and new Function would cause confusion. I wouldn’t mind

JS tools (was: Harmony transpilers)

2011-10-11 Thread Axel Rauschmayer
From: Claus Reinke claus.rei...@talk21.com Subject: JS tools (was: Harmony transpilers) Date: October 11, 2011 21:53:58 GMT+02:00 To: Brendan Eich bren...@mozilla.com Cc: es-discuss@mozilla.org There is a lot of abandon-ware in open source, .. Too true. And, for JS tools, a

Re: new Object

2011-10-11 Thread Axel Rauschmayer
class literals look the same but literal declaration are a right pain for any kind of meta programming. I can't take an existing object and turn it into a class without using eval. Can you elaborate? Let's say I have object/class A and object/class B, I want a new class that is the

Re: JS tools (was: Harmony transpilers)

2011-10-11 Thread John J Barton
On Tue, Oct 11, 2011 at 1:10 PM, Axel Rauschmayer a...@rauschma.de wrote: *From: *Claus Reinke claus.rei...@talk21.com *Subject: **JS tools (was: Harmony transpilers)* *Date: *October 11, 2011 21:53:58 GMT+02:00 *To: *Brendan Eich bren...@mozilla.com *Cc: *es-discuss@mozilla.org There is

Re: Harmony transpilers

2011-10-11 Thread Erik Arvidsson
Sorry for seeing this thread so late. I am the maintainer of Traceur at the moment. We do want Traceur to align with the ES6 draft and with Harmony proposals. Any missmatch is a bug and both bug reports and patches are welcome. The reason a lot of the generated code depends on a runtime library

Re: new Object

2011-10-11 Thread Jake Verbaten
Yes the prototypes are still there. But that means im just using es3 constructs. Es:harmony class literals only offer declarative sugar. I'm not proposing we change any of the existing Class.prototype.* code. I just propose that rather then throwing an error on new Object we make it work. This

Re: Some spec usability issues (navigation, source, common practices)

2011-10-11 Thread Rick Waldron
http://es5.github.com is a good resource/starting point Rick On Mon, Oct 10, 2011 at 4:41 AM, Claus Reinke claus.rei...@talk21.comwrote: As a detour from controversial language design issues, I was wondering about opportunities to improve the ES spec usability: - source availability: could

Re: Harmony transpilers

2011-10-11 Thread Kam Kasravi
I've implemented several harmony proposals in es.next by expanding the grammar in pegjs (https://github.com/dmajda/pegjs/blob/master/examples/javascript.pegjs). The AST and generator is defined using es.next classes and modules. I was thinking of converting the derived classes in the ast and

Re: new Object

2011-10-11 Thread Allen Wirfs-Brock
On Oct 11, 2011, at 11:53 AM, Jake Verbaten wrote: is there any kind of proposal for syntax that is like : var proto = { method: function() { }, constructor: function(someValue) { this.things = someValue } }; var o = new proto(someValue); Object.getPrototype(o) === proto;

Re: new Object

2011-10-11 Thread Allen Wirfs-Brock
On Oct 11, 2011, at 1:46 PM, Jake Verbaten wrote: Yes the prototypes are still there. But that means im just using es3 constructs. Es:harmony class literals only offer declarative sugar. I'm not proposing we change any of the existing Class.prototype.* code. I just propose that rather

Re: new Object

2011-10-11 Thread Jake Verbaten
Agreed. all of these can live side by side. There is no reason for new Object to compete declarative classe s. I merely caused confusion using the phrase prototypes as classes instead of new Object. as a side note whislt you mentioned .{ and | I would like to have programmatic, non declaritive

Re: new Object

2011-10-11 Thread Axel Rauschmayer
I absolutely love it for its conceptual beauty, but the primary goal should be to establish a single dominant way of doing inheritance in JavaScript. One feature that doesn’t yet fit into my pure OO universe are factory functions/methods (I used frequently used factory methods in Java): 1. They

Re: new Object

2011-10-11 Thread Jake Verbaten
Point.zero = function () { return (new Point).{ x: 0, y: 0 }; } why are factory methods special? they are just methods. On Oct 11, 2011 11:26 PM, Axel Rauschmayer a...@rauschma.de wrote: I absolutely love it for its conceptual beauty, but the primary goal should be to establish a single

Re: new Object

2011-10-11 Thread Axel Rauschmayer
If they are just a different way of initializing, then I love Smalltalk’s approach of separating instantiation and initialization. E.g. new Point.zero() would actually mean (note: in normal JS, I always write parens after a new-invoked function, but here it works well) (new Point).zero() (new

Re: new Object

2011-10-11 Thread Jake Verbaten
As for expression.parse, any constructor or initializer is still a function therefore it can return an object thats not this. This would be a good usecase for overwriting the [[Prototype]] with a new value. I dont know what sugar or syntax other languages with factory methods offer which makes

Re: new Object

2011-10-11 Thread Kevin Reid
On Oct 11, 2011, at 18:29, Jake Verbaten wrote: Point.zero = function () { return (new Point).{ x: 0, y: 0 }; } why are factory methods special? they are just methods. I agree with things should be just methods, but this particular pattern doesn't work for always-frozen types. --

Re: new Object

2011-10-11 Thread Jake Verbaten
So basically your saying that the only function that can alter an object before its frozen is the constructor, thats why we need multiple constructors? You'll have to subclass with another constructor or come up with syntax for multiple constructors. On Oct 11, 2011 11:46 PM, Kevin Reid

Re: new Object

2011-10-11 Thread Kevin Reid
On Oct 11, 2011, at 18:51, Jake Verbaten wrote: On Oct 11, 2011 11:46 PM, Kevin Reid kpr...@switchb.org wrote: On Oct 11, 2011, at 18:29, Jake Verbaten wrote: Point.zero = function () { return (new Point)... I agree with things should be just methods, but this particular pattern doesn't work

Re: new Object

2011-10-11 Thread Allen Wirfs-Brock
On Oct 11, 2011, at 4:03 PM, Kevin Reid wrote: Well, in JavaScript you can always Object.create(Point.prototype, ...). In Java, for example, the ability to have multiple constructors can be very convenient for that type of use case; but it always can be replaced with factory methods

Feedback request: a ES spec. organization experiment

2011-10-11 Thread Allen Wirfs-Brock
The ES6 specification has more complicated language constructs that require more verbose specification language for many constructs. One of the techniques I'm using is to have more semantic functions over grammar productions . The readability of the specification seems to be quite sensitive to

Re: Harmony transpilers

2011-10-11 Thread David Herman
I have some thoughts about how to use Narcissus as a basis for a compiler to ES3 as well. It's obviously not necessary to do separately from Traceur, but it might be interesting to experiment with alternative implementation strategies. I haven't really done anything in earnest yet, including

Re: Harmony transpilers

2011-10-11 Thread Juan Ignacio Dopazo
Thanks for all the answers! On Tue, Oct 11, 2011 at 3:40 PM, John J Barton johnjbar...@johnjbarton.com wrote: I was trying to encourage Jake and Juan to participate in taking it forward. I'd love to, but I'm afraid my interpreter-writing skills are somewhat null if not undefined. I'm

Re: Harmony transpilers

2011-10-11 Thread David Herman
There is a concept of expressiveness in programming languages that has to do with the notion of whether a feature is just sugar. A lightweight feature is one that can be described as a simple, local rewrite into some other feature. For example, the proposed method shorthand syntax: { f(x)