Harmony - proxies | asynchronous

2011-09-02 Thread Xavier MONTILLET
Hi, I'm just a lambda JavaScript programmer who loves building black boxes with the smallest APIs possible and a couple of hours ago, I found out Proxys existed and since then, I've been watching talks and reading articles about them. And it sure looks awesome. But there's one thing I didn't

Re: Harmony - proxies | asynchronous

2011-09-02 Thread Mikeal Rogers
We've talked about the problems that would come from this a lot in node.js. One of the best comments I thought was from Jeremy Ashkenas (creator of coffeescript). http://groups.google.com/group/nodejs/browse_thread/thread/c334947643c80968/9533c06d486c10e6?lnk=gstq=jashkenas#9533c06d486c10e6

Re: Harmony - proxies | asynchronous

2011-09-02 Thread Juan Ignacio Dopazo
There is already a Node module that uses Proxies as a way of enforcing promises: https://github.com/sam-mccall/node-plate It allows your to write: var pfs = plate(fs); pfs.writeFile('/etc/passwd.bak', pfs.readFile('/etc/passwd')); pfs.end(function(err) { if(err) throw err; console.log(It's

Re: Harmony - proxies | asynchronous

2011-09-02 Thread Dmitry Soshnikov
Besides, IIRC, there is a module for Node called node-fibers, which introduces possibility of `yiled` for V8 (though, the implementation differs from (standard) `yield` from SpiderMonkey). And for the topic starter -- in ES6 it's planned to standardize `yield` feature which will allow to have

Re: __doc__ for functions, classes, objects etc.

2011-09-02 Thread Dmitry Soshnikov
On 01.09.2011 22:28, Dmitry A. Soshnikov wrote: On 31.08.2011 18:38, Allen Wirfs-Brock wrote: On Aug 31, 2011, at 1:57 AM, Dmitry A. Soshnikov wrote: On 30.08.2011 20:39, Allen Wirfs-Brock wrote: On Aug 30, 2011, at 12:39 AM, Dmitry A. Soshnikov wrote: OK, let's up the topic. Seems there

Re: Harmony - proxies | asynchronous

2011-09-02 Thread Mikeal Rogers
fibers turns node.js in to something the core team doesn't really view as being node.js any longer. we believe that it's more important to have assurances that your state can't mutate between anything but a callback and that breaking that means you're basically breaking node. -Mikeal On Sep

__doc__ for functions, classes, objects etc.

2011-09-02 Thread Irakli Gozalishvili
I also prototyped this idea mainly for node. Also, I figured out a hack with a label, that make it work for spidermonkey. Regards -- Irakli Gozalishvili Web: http://www.jeditoolkit.com/ Address: 29 Rue Saint-Georges, 75009 Paris, France http://goo.gl/maps/3CHu On Thursday, 2011-09-01 at 20:28 ,

Re: Harmony - proxies | asynchronous

2011-09-02 Thread Brendan Eich
On Sep 2, 2011, at 9:08 AM, Mikeal Rogers wrote: fibers turns node.js in to something the core team doesn't really view as being node.js any longer. we believe that it's more important to have assurances that your state can't mutate between anything but a callback and that breaking that

Re: Harmony - proxies | asynchronous

2011-09-02 Thread Mikeal Rogers
We have no control over what v8 adds or what happens in Harmony. We do have control over what we use in node.js core and the patterns we drive forward in the community. We already don't use a lot of the features in the language and we're happy with that. -Mikeal On Sep 2, 2011, at September

Re: Harmony - proxies | asynchronous

2011-09-02 Thread Brendan Eich
On Sep 2, 2011, at 1:45 PM, Mikeal Rogers wrote: We have no control over what v8 adds or what happens in Harmony. We do have control over what we use in node.js core and the patterns we drive forward in the community. We already don't use a lot of the features in the language and we're

Subject: Re: Harmony - proxies | asynchronous

2011-09-02 Thread John J Barton
I'm pretty puzzled by this discussion and I'm guessing other folks might be puzzled as well. Since I understood node fibers as thread for Node, the discussion I read is: /be: You can have threads! Mikeal: We don't want threads! If I'm on the right track, then I should understand how this

Re: Subject: Re: Harmony - proxies | asynchronous

2011-09-02 Thread Dmitry Soshnikov
On 03.09.2011 1:26, John J Barton wrote: I'm pretty puzzled by this discussion and I'm guessing other folks might be puzzled as well. Since I understood node fibers as thread for Node, the discussion I read is: /be: You can have threads! Mikeal: We don't want threads! If I'm on the

Subject: Re: Harmony - proxies | asynchronous

2011-09-02 Thread Bradley Meck
Node has shared memory between actors, having multiple async code flows executed on shared memory that appear to be sync by design is very hard to do. This leads to implementation specific behavior unless we standardize edit resolution. Most people who complain about nested callbacks generally

Re: __doc__ for functions, classes, objects etc.

2011-09-02 Thread Brendan Eich
On Sep 2, 2011, at 3:29 PM, Irakli Gozalishvili wrote: On Friday, 2011-09-02 at 22:28 , Brendan Eich wrote: Can you show your label hack for SpiderMonkey to es-discuss? Ahh sorry I did not realized I forgot to post link: https://github.com/Gozala/doc Cool! Permit me to cite some of

Re: Object.{getPropertyDescriptor,getPropertyNames}

2011-09-02 Thread David Herman
Duly chastised. :) Dave On Sep 2, 2011, at 3:39 PM, Brendan Eich wrote: Already in harmony: namespace on the wiki: http://wiki.ecmascript.org/doku.php?id=harmony:extended_object_apis=object+getpropertydescriptor (note the s=... query part shows I found this by searching -- worked!)

Re: Subject: Re: Harmony - proxies | asynchronous

2011-09-02 Thread Brendan Eich
On Sep 2, 2011, at 2:26 PM, John J Barton wrote: I'm pretty puzzled by this discussion and I'm guessing other folks might be puzzled as well. Since I understood node fibers as thread for Node, the discussion I read is: /be: You can have threads! I did not say that. Remember, threads

Re: __doc__ for functions, classes, objects etc.

2011-09-02 Thread Oliver Hunt
On Sep 2, 2011, at 3:41 PM, Brendan Eich wrote: On Sep 2, 2011, at 3:29 PM, Irakli Gozalishvili wrote: On Friday, 2011-09-02 at 22:28 , Brendan Eich wrote: Can you show your label hack for SpiderMonkey to es-discuss? Ahh sorry I did not realized I forgot to post link:

Re: __doc__ for functions, classes, objects etc.

2011-09-02 Thread Rick Waldron
While we're sharing... I've also written an implementation, albiet much simpler in form then Dmitry's or Irakli's, but this will work in ES today as is, using old-time multi-line and single line comments. https://gist.github.com/1160879 Rick On Fri, Sep 2, 2011 at 6:41 PM, Brendan Eich

Re: __doc__ for functions, classes, objects etc.

2011-09-02 Thread Rick Waldron
Also, mine will suffer from the same downfall noted in Oliver's comments.. Function.toString isn't standardised, and I recall that in the past SM did elide dead code On Fri, Sep 2, 2011 at 6:56 PM, Rick Waldron waldron.r...@gmail.com wrote: While we're sharing... I've also written an

Re: __doc__ for functions, classes, objects etc.

2011-09-02 Thread Brendan Eich
On Sep 2, 2011, at 3:55 PM, Oliver Hunt wrote: Function.toString isn't standardised, and I recall that in the past SM did elide dead code, multiple engines reformat code, so in general this doesnt seem reliable at a library level. It also doesn't work for builtin functions, and I feel

Re: __doc__ for functions, classes, objects etc.

2011-09-02 Thread Irakli Gozalishvili
On Saturday, 2011-09-03 at 24:55 , Oliver Hunt wrote: On Sep 2, 2011, at 3:41 PM, Brendan Eich wrote: On Sep 2, 2011, at 3:29 PM, Irakli Gozalishvili wrote: On Friday, 2011-09-02 at 22:28 , Brendan Eich wrote: Can you show your label hack for SpiderMonkey to es-discuss?

Re: Subject: Re: Harmony - proxies | asynchronous

2011-09-02 Thread John J Barton
On Fri, Sep 2, 2011 at 3:48 PM, Brendan Eich bren...@mozilla.com wrote: On Sep 2, 2011, at 2:26 PM, John J Barton wrote: I'm pretty puzzled by this discussion and I'm guessing other folks might be puzzled as well. Since I understood node fibers as thread for Node, the discussion I read is:

Re: Subject: Re: Harmony - proxies | asynchronous

2011-09-02 Thread Brendan Eich
On Sep 2, 2011, at 4:15 PM, John J Barton wrote: Ok I hope someone creates more tutorial information about generators. I read about them and played around with some examples, but I did not come away thinking positive. You might start with Dave Herman's async library, task.js:

Re: Subject: Re: Harmony - proxies | asynchronous

2011-09-02 Thread Irakli Gozalishvili
In case someone is interested I've experimented with proxy sugared promises (it was long time ago some few things might require updates): https://github.com/Gozala/meta-promise Regards -- Irakli Gozalishvili Web: http://www.jeditoolkit.com/ Address: 29 Rue Saint-Georges, 75009 Paris, France

Re: Subject: Re: Harmony - proxies | asynchronous

2011-09-02 Thread Mikeal Rogers
As for the application, reasoning about code that looks like hash-table lookup but acts very different may not be better than reasoning about code that looks like spaghetti but acts like you expect. The two are not easy to trade off. Spaghetti is the bigger problem, IMHO, since you can

Re: Subject: Re: Harmony - proxies | asynchronous

2011-09-02 Thread Brendan Eich
On Sep 2, 2011, at 5:16 PM, Mikeal Rogers wrote: Ok, my b.s. detector is going off. You used actors in the first para about Node, but Node is JS and JS (or Mikeal's favorite subset used in Node built-in and approved libraries) is not an Actor language. My ability to dictate style in