Re: Value objects: roll your own?

2014-01-12 Thread Andrea Giammarchi
the so what is an unordered require of modules but probably those two gonna be aware of each other regardless so it might be a no-real-world issue/problem/error. Cheers On Sun, Jan 12, 2014 at 10:26 PM, Brendan Eich wrote: > Andrea Giammarchi wrote: > >> what I meant is that you require('

Re: Value objects: roll your own?

2014-01-12 Thread Brendan Eich
Andrea Giammarchi wrote: what I meant is that you require('point3d') before requiring point2d .. is that a concern? Is that like the point4d coming along unexpectedly? I don't know what you mean, but in the error example, whichever loads second results in the early error. So what? /be __

Re: Value objects: roll your own?

2014-01-12 Thread Andrea Giammarchi
OK, you actually don't have to reply those question ... I am very looking forward to put my hands on operators overloads. It feels to me almost as exciting as binary data ... I'll be waiting patiently until it's shaped and usable in some engine. Thanks for all infos so far though, Cheers On Su

Re: Value objects: roll your own?

2014-01-12 Thread Andrea Giammarchi
what I meant is that you require('point3d') before requiring point2d .. is that a concern? Is that like the point4d coming along unexpectedly? Thanks On Sun, Jan 12, 2014 at 10:04 PM, Brendan Eich wrote: > Andrea Giammarchi wrote: > >> "the call is ambiguous and an error is thrown" .. that's O

Re: Value objects: roll your own?

2014-01-12 Thread Brendan Eich
Andrea Giammarchi wrote: "the call is ambiguous and an error is thrown" .. that's OK, but this is assuming you know upfront all libraries in the game, right? No, this is just a matter of loading point2d's value class declaration, then point3d's. It's fine to have methods defined for various

Re: Value objects: roll your own?

2014-01-12 Thread Andrea Giammarchi
"the call is ambiguous and an error is thrown" .. that's OK, but this is assuming you know upfront all libraries in the game, right? Now, how about modules? Would this approach cause unknown possible conflicts all over? I understand the Python approach might not solve this neither, but I am reall

Re: Value objects: roll your own?

2014-01-12 Thread Brendan Eich
We're not abusing guard :: syntax, are you trying to get my goat? :-P Andrea Giammarchi wrote: recap ... in class point3d ```javascript function + (a :: point2d, b :: point3d) { return point3d(a.x + b.x, a.y + b.y, b.z); } ``` in class point2d ```javascript function + (a :: p

Re: Enumerability

2014-01-12 Thread Andrea Giammarchi
classes do not exist today and your example was about direct object, not inherited from classes as they are meant in ES6. I see from both here and Twitter you took this in a very wrong way while I was asking rationale from those Allen's quotes you actually rephrased so I just stop here. All good,

Re: Enumerability

2014-01-12 Thread Rick Waldron
On Sun, Jan 12, 2014 at 11:57 PM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > Recap: it seems we agree classes properties and methods should not show up > in a for/in ... > No we don't agree, because that's inconsistent with the behaviour that exists today. Rick ___

Re: Enumerability

2014-01-12 Thread Rick Waldron
On Sun, Jan 12, 2014 at 11:45 PM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > Rick, what you wrote has _nothing_ to do with inheritance, right? So why > should "classes" methods be part of a for/in of an instance, which is not > what you wrote, again? > Sometimes I find you incredib

Re: Enumerability

2014-01-12 Thread Andrea Giammarchi
Recap: it seems we agree classes properties and methods should not show up in a for/in ... which I believe is the eldorado JS developers looked for since ever, hating that only native classes had that privilege ... so, once again why on earth classes methods and properties show up in a for/in since

Re: Enumerability

2014-01-12 Thread Andrea Giammarchi
Rick, what you wrote has _nothing_ to do with inheritance, right? So why should "classes" methods be part of a for/in of an instance, which is not what you wrote, again? Thanks On Sun, Jan 12, 2014 at 8:21 PM, Rick Waldron wrote: > > > > On Sat, Jan 11, 2014 at 12:57 PM, Andrea Giammarchi < > an

Re: Enumerability

2014-01-12 Thread Rick Waldron
On Sat, Jan 11, 2014 at 12:57 PM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > Thanks Allen, makes sense ... but still no example where enumerability of > properties and method defined in a "class" prototype is useful for ... > something I cannot imagine right now. > > Again, that was

Re: Enumerability

2014-01-12 Thread Rick Waldron
On Sat, Jan 11, 2014 at 12:24 PM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > I would like to see some Rick or David example about the "expected to be > enumerable". > > If that's about knowing if a class is native or not, looping with a for/in > its prototype or any instance does no

Re: Value objects: roll your own?

2014-01-12 Thread Andrea Giammarchi
recap ... in class point3d ```javascript function + (a :: point2d, b :: point3d) { return point3d(a.x + b.x, a.y + b.y, b.z); } ``` in class point2d ```javascript function + (a :: point2d, b :: point3d) { return point2d(a.x + b.x, a.y + b.y); // ignore b.z // or

Re: Value objects: roll your own?

2014-01-12 Thread Andrea Giammarchi
not sure I understand that ... what if both point2d and point3d specify the `+` ? is that possible ? talking about ```javascript function + (a :: point2d, b :: point3d) { return point3d(a.x + b.x, a.y + b.y, b.z); } ``` specified differently in both point2d and point3d classes

Re: Value objects: roll your own?

2014-01-12 Thread Brendan Eich
Andrea Giammarchi wrote: I had same thoughts on being defined inside the class ... it's quite common out there but here I see it's very easy to create conflicts between classes. What if a generic point2d + point3d is defined in both point2d class and point3d one ? The definitions need to be

Re: Value objects: roll your own?

2014-01-12 Thread Brendan Eich
Axel Rauschmayer wrote: Nice! Should the operator (case) definitions really be inside the class? E.g., conceptually, number + point2d does not belong to a single class, it belongs to both. Or to neither. Still there's an advantage in using the class as the locus of multimethod definitions: al

Re: ecmascript should support multi-threads

2014-01-12 Thread Brendan Eich
Quildreen Motta wrote: The idea of having shared mutable state in a language is a horrifying one. I'm glad JavaScript isn't heading in that direction. Remember, threads suck . /be ___ es-discuss mailing

Re: Code compilation alternative to Function()

2014-01-12 Thread Boris Zbarsky
On 1/12/14 6:58 PM, Gustavs Tēbergs wrote: I see what you mean. I will investigate why I see long running times with parser generators. If you can post a link to a testcase, I'm happy to look into this on the SpiderMonkey end. -Boris ___ es-discus

Re: Code compilation alternative to Function()

2014-01-12 Thread Gustavs Tēbergs
I see what you mean. I will investigate why I see long running times with parser generators. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Code compilation alternative to Function()

2014-01-12 Thread Gustavs Tēbergs
On 12 January 2014 08:54, Brendan Eich wrote: > Not on the (gzipped) wire: > http://mozakai.blogspot.com/2011/11/code-size-when-compiling-to-javascript.html I am not worried about the compressed size but the latency caused by decompressing and parsing the contents. Actually I am not worried at a

Re: Code compilation alternative to Function()

2014-01-12 Thread Gustavs Tēbergs
On 12 January 2014 07:48, Sean Silva wrote: > Can you provide some measurements where concatenating a string and parsing it > is a bottleneck? I would not call it a bottleneck because the concatenating in most use cases only happens once at startup, that's why I used the word "latency". If you w

Re: ecmascript should support multi-threads

2014-01-12 Thread Quildreen Motta
The idea of having shared mutable state in a language is a horrifying one. I'm glad JavaScript isn't heading in that direction. We *do not* need threads for parallelism, and scaling in to use multiple cores. In Browsers, we can already have isolated parallelism through WebWorkers, which means that

Re: Value objects: roll your own?

2014-01-12 Thread Andrea Giammarchi
I had same thoughts on being defined inside the class ... it's quite common out there but here I see it's very easy to create conflicts between classes. What if a generic point2d + point3d is defined in both point2d class and point3d one ? IIRC Python just consider it's own representation during

Re: Code compilation alternative to Function()

2014-01-12 Thread Andrea Giammarchi
beside what Sean and Brendan said, I think it makes sense to ask for a "code generator/compositor" under CSP. Actually I never understood why CSP does not allow Function since everything that could be done inside Function can be basically done programmatically too (parsing manually the string or s

Re: ecmascript should support multi-threads

2014-01-12 Thread Andrea Giammarchi
if you are talking about node.js there have been recent improvements to the cluster module. I've used cluster even in Cubieboard2 and it works quite well using as many resources as possible if specified. Maybe that won't make JS like Java (thank Gosh!) but combined with linear and async callbacks

ecmascript should support multi-threads

2014-01-12 Thread ????
hello, now javascript engine don't support multi-threads , because it's nouseful in brower. but, if engine in server, like node.js , it's will be need. although, we can use non-blocking API to do it, but it can't support multi cpu env well good. so , if javascript add SYNCHRONIZED keyword in

Re: Value objects: roll your own?

2014-01-12 Thread Axel Rauschmayer
> That is out of date compared to > > http://www.slideshare.net/BrendanEich/js-resp Thanks! > specifically slide 15: > > http://image.slidesharecdn.com/jsresp-130914140214-phpapp02/95/slide-15-638.jpg?1379296961 > > which has: > > value class point2d { // implies typeof “point2d” > construct