Re: Minimalist Classes

2011-11-03 Thread Brendan Eich
What is "super-intuitive" about running 'class C' up against an arbitrary expression, which is then evaluated and *copied* (details fuzzy here) as the class prototype? Arguments about feelings and intuition are not that helpful. Saying why you need to construct a class that way, where no such o

Re: Minimalist Classes

2011-11-03 Thread Kam Kasravi
I noticed the absence of setter's, getter's. Would this be valid syntax? set health(value) { if (value < 0) { throw new Error("Health must be non-negative."); } @health = value; } On Nov 3, 2011, at 12:17 AM, Brendan Eich wrote: > What is "super-intuitive" about running

Re: Globalization API working draft

2011-11-03 Thread Andreas Rossberg
On 3 November 2011 01:12, David Herman wrote: > ES6 modules are not extensible, for a number of reasons including > compile-time variable checking. But of course API evolution is critical, and > it works; it just works differently. Monkey-patching says "let the polyfill > add the module exports

Re: Loyal Opposition to Const, Private, Freeze, Non-Configurable, Non-Writable...

2011-11-03 Thread Claus Reinke
I'm not just talking about implementors, either. Some users will want to know d.m isn't going to change. They may not want to know that it's b.m, mind you -- they simply won't want that c.m assignment to be legal, or else if they do support such a thing, they don't want it to affect d's "vtable

Re: Minimalist Classes

2011-11-03 Thread Matthew Tretter
Sorry, I'll try to be more clear. What's "super-intuitive" isn't *that* you use the form "class name expr", it's how you interact with that form once you know what it does. The reason is self-evident—people know how to work with object literals and functions. This is not true of the Leather f

Re: Minimalist Classes

2011-11-03 Thread Russell Leggett
> > > There are many more, I'm sure, but the point is this: a syntax that makes > use of the elements already in the language (instead of providing > alternates) is going to be more familiar and therefore objectively more > intuitive. Yes, the class keyword brings some new wrinkles, but that will >

Re: Loyal Opposition to Const, Private, Freeze, Non-Configurable, Non-Writable...

2011-11-03 Thread Quildreen Motta
I think Claus summarizes nicely what I've been thinking about this thread, and the opposition-for-the-sake-of-opposition that has been spreading through the JavaScript community. Though most of that seems to be based on "JavaScript should be kept simple." I'd argue there doesn't need to be conflict

Re: Minimalist Classes

2011-11-03 Thread Brendan Eich
On Nov 3, 2011, at 1:23 AM, Kam Kasravi wrote: > I noticed the absence of setter's, getter's. Would this be valid syntax? Yes, that's already in object literal syntax. My gist is a fork of Jeremy's, he didn't add 'em so I didn't either. At this point they are context, assumed. They're in ES5!

Yet another class declaration proposal

2011-11-03 Thread Axel Rauschmayer
FWIW: I’ve picked what I like from the various proposals. https://gist.github.com/1336846 -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org h

Re: Yet another class declaration proposal

2011-11-03 Thread Jake Verbaten
I like this one mainly for the line class declarations and object literals should have the same features However if they have the same features then why bother with class at all. Why not just have let Monster = Being <| { ... } This way we don't introduce the class keyword which is confusing a

Re: Yet another class declaration proposal

2011-11-03 Thread Axel Rauschmayer
I agree 100%. I still hope that object exemplars will become part of the language. However they *are* introducing a completely new way of implementing types (or rather, of naming exemplars). That is bound to be a deal-breaker for many. Thus, if I can’t have object exemplars, I’ll settle for the

Re: Yet another class declaration proposal

2011-11-03 Thread Allen Wirfs-Brock
+1,000,000 Minor quibbles get rid of [incAge]: ... just make it @incAge we don't need both [propname] and @propname in property declarations and @propname has a narrower meaning (which is good). Also, I don't want to unnecessarily couple object/class declaration syntax with [ ] semantic

Re: Yet another class declaration proposal

2011-11-03 Thread Axel Rauschmayer
I’ve updated the gist with (most of) your suggestions and rationales for the decisions. > Minor quibbles > > get rid of > [incAge]: ... > just make it > @incAge > > we don't need both [propname] and @propname in property declarations and > @propname has a narrower meaning (which is good).

Re: Globalization API working draft

2011-11-03 Thread David Herman
Yes, good point about loaders. I would like a standard HTML way of specifying a loader to use, so you could simply say: and from then on your clients don't have to change a thing. Dave On Nov 3, 2011, at 2:00 AM, Andreas Rossberg wrote: > On 3 November 2011 01:12, David Herman wrote: >>

Re: Yet another class declaration proposal

2011-11-03 Thread Russell Leggett
> > > I know this will be controversial, but I would prefer only having the > expression form. The reason is that > > let Monster = Being <| mylib.mixin(Evil, Scary) <| class {...} > > is an important usecase and it is harder to make the syntax work with a > pure class declaration. > > I'm not su

Re: Globalization API working draft

2011-11-03 Thread Axel Rauschmayer
Can loaders be composed (e.g. to use several polyfills at the same time)? One might be able to chain them in some fashion. > Yes, good point about loaders. I would like a standard HTML way of specifying > a loader to use, so you could simply say: > > > > and from then on your clients don't

Re: Minimalist Classes

2011-11-03 Thread Brendan Eich
On Nov 3, 2011, at 6:53 AM, Matthew Tretter wrote: > Sorry, I'll try to be more clear. > > What's "super-intuitive" isn't *that* you use the form "class name expr", > it's how you interact with that form once you know what it does. The reason > is self-evident—people know how to work with obje

Re: Globalization API working draft

2011-11-03 Thread David Herman
Possibly, although it could be tough; I'll keep this in mind as we nail down the API details. Dave On Nov 3, 2011, at 11:18 AM, Axel Rauschmayer wrote: > Can loaders be composed (e.g. to use several polyfills at the same time)? One > might be able to chain them in some fashion. > >> Yes, good

Re: Globalization API working draft

2011-11-03 Thread Axel Rauschmayer
Alternative for polyfills: A loader that maps module names to alternate implementations. This reminds me of dependency injection. Potential problem: The path of a (non-built-in) library might not always be a good ID (one module loads a minified version, another doesn’t). Maybe we need some kind

Lecture series on SES and capability-based security by Mark Miller

2011-11-03 Thread Tom Van Cutsem
Hi, Last month, Mark Miller gave a series of talks at the University of Brussels on SES and capability-based security. The videos of the talks have now been made fully available on Youtube. I think this may be of interest to some on this list. As many of you know, Mark uses ECMAScript 5 as a found

Re: Loyal Opposition to Const, Private, Freeze, Non-Configurable, Non-Writable...

2011-11-03 Thread Harutyun Amirjanyan
> "freedom" includes my ability to fence my yard. yep, but that fence can't be removed ever after. and if there are irremovable fences, it's important to make sure, they do not rise by themselves. e.g. requiring "public" (thanks for not doing that:) freezing module scope. adding better syntax for

Re: Lecture series on SES and capability-based security by Mark Miller

2011-11-03 Thread John J Barton
On Thu, Nov 3, 2011 at 12:52 PM, Tom Van Cutsem wrote: >. Also, I heartily recommend the talks to > those not entirely convinced of the necessity of private/const/frozen > features. Mark makes a pretty good case for encapsulation as a necessary > building block for ocap-based security If I unders

Re: decoupling [ ] and property access for collections

2011-11-03 Thread Waldemar Horwat
We had this in ES4, together with the provision that you could have multiple arguments between the [], so you could define data structures that can be addressed as: matrix2d[x, y] As in here, this would default to the ES5 semantics on objects that don't have the new [] proxy handler. Overa

Re: Why isn't FunctionExpression a PrimaryExpression?

2011-11-03 Thread Waldemar Horwat
On 10/19/2011 08:16 AM, Allen Wirfs-Brock wrote: Does anybody know or see a good reason why FunctionExpressionshouldn't be move as a RHS of PrimaryExpression? MemberExpressionis the only occurrence of either PrimaryExpressionor FunctionExpressionon the RHS of a grammar rule. As you note, the

Re: Minimalist Classes

2011-11-03 Thread Waldemar Horwat
On 11/02/2011 04:10 AM, David Bruant wrote: Another topic: - class Monster { private name, health; sameName(other) { return @name === other@name; } } - I am under this impression that you are accessing the private property ("other@name") of an instance which isn't you (other !== this)

Re: Lecture series on SES and capability-based security by Mark Miller

2011-11-03 Thread Mark S. Miller
On Thu, Nov 3, 2011 at 2:10 PM, John J Barton wrote: > On Thu, Nov 3, 2011 at 12:52 PM, Tom Van Cutsem > wrote: > >. Also, I heartily recommend the talks to > > those not entirely convinced of the necessity of private/const/frozen > > features. Mark makes a pretty good case for encapsulation as a

Re: Loyal Opposition to Const, Private, Freeze, Non-Configurable, Non-Writable...

2011-11-03 Thread Brendan Eich
On Nov 3, 2011, at 1:56 PM, Harutyun Amirjanyan wrote: >> "freedom" includes my ability to fence my yard. > yep, but that fence can't be removed ever after. > and if there are irremovable fences, it's important to make sure, they > do not rise by themselves. That's completely false. If my "fence"

Re: Re: Lecture series on SES and capability-based security by Mark Miller

2011-11-03 Thread Douglas Crockford
On 11:59 AM, Mark S. Miller wrote: Note that I don't see any realistic way to fix problem #3 in the ES.next language. My point is only that defensive programming is tricky even after you've gotten all the formal properties you need. As ES.next introduces various new abstraction mechanisms, whet

js-tools (mailing list for Javascript developer tools and tool development)

2011-11-03 Thread Axel Rauschmayer
[I’m sending this email for Claus Reinke, because when he sends it, es-discuss blocks it] There is a new mailing list for Javascript tool developers, intended to complement the es-discuss list's language design and specification topics: http://groups.google.com/group/js-tools Please see the a

Status of script loading in ecmascript

2011-11-03 Thread John J Barton
Is there a summary of the current status of standardized dependency based script loading somewhere? Since the sync and async camps of commonJS were unable to agree, we left with two sets of incompatible JS libs and a few gymnastic boilerplate adapters to bridge them. Perhaps a standard could do no

Re: Status of script loading in ecmascript

2011-11-03 Thread Axel Rauschmayer
> Is there a summary of the current status of standardized dependency > based script loading somewhere? Since the sync and async camps of > commonJS were unable to agree, we left with two sets of incompatible > JS libs and a few gymnastic boilerplate adapters to bridge them. > Perhaps a standard co

Re: Status of script loading in ecmascript

2011-11-03 Thread John J Barton
On Thu, Nov 3, 2011 at 7:43 PM, Axel Rauschmayer wrote: >> Is there a summary of the current status of standardized dependency >> based script loading somewhere? Since the sync and async camps of >> commonJS were unable to agree, we left with two sets of incompatible >> JS libs and a few gymnastic

Re: Status of script loading in ecmascript

2011-11-03 Thread Brendan Eich
On Nov 3, 2011, at 7:53 PM, John J Barton wrote: >> ES.next: >> http://wiki.ecmascript.org/doku.php?id=harmony:modules > > I guess you meant: > http://wiki.ecmascript.org/doku.php?id=harmony:module_loaders > but my question was more about whether this had any forward momentum, > implementations e