Precedence of yield operator

Bruno Jouhier bjouhier at gmail.com
Sun Jun 16 10:47:19 PDT 2013


Hi Mark,

Thanks a lot for the pointers and for taking the time to debrief me on the
proposal. I had stumbled on the concurrency paper a while ago but never
took the time to read it thoroughly. I surely will!

It is good to see that the problem is being attacked from a generic angle
with an eye on a concise and efficient syntax. I like a lot the idea of
putting async on an equal footing with sync.

Bruno.

2013/6/16 Mark S. Miller <erights at google.com>

> Hi Bruno, yes the idea is to use the infix ! for async calls, but not in
> quite the way you mean. Have you seen <
> http://wiki.ecmascript.org/doku.php?id=strawman:concurrency> and <
> http://research.google.com/pubs/pub40673.html> ?
>
> The basic idea is that without syntactic support, today in Q to send an
> asynchronous message, you'd say
>
>     Q(p).send('foo', a,b)
>
> In what has been codified of DOM promises, you'd say
>
>     Promises.accept(p).then(o => o.foo(a,b))
>
> which wouldn't even work distributed, since there is no local o on which
> to do a local ".". Both of these are so much heavier than
>
>     p.foo(a,b)
>
> as to make asynchronous and distributed programming remain second class
> compared to local synchronous programming. So the full proposal is that
>
>     p ! foo(a,b)
>
> would mean to eventually send the message on the right to the receiver
> designated on the left. Likewise for
>
>     p ! (a,b) // asynchronous function call
>     p ! foo // asynchronous get
>     p ! foo = x // asynchronous put
>     delete p ! foo // asynchronous delete
>
> and the computed forms of all these
>
>     p ! [name] (a,b)
>     p ! [name]
>     p ! [name] = x
>     delete p [name]
>
> Over a RESTful transport <http://waterken.sourceforge.net/web_send/>,
> these would turn into POST, GET, PUT, and DELETE. Fortunately or
> unfortunately, because of CORS and UMP (something they agreed on), I expect
> RESTful PUT and DELETE to wither away and die in browser-to-server traffic.
> Our recent electronic rights paper uses only POST and GET, even though it
> uses only server-to-server traffic. If it can't practically be used
> browser-to-server, I expect it won't be used much server-to-server.
> Nevertheless, we should keep these forms of "!" in the language.
>
>
>
>
> On Sun, Jun 16, 2013 at 2:26 AM, Bruno Jouhier <bjouhier at gmail.com> wrote:
>
>> Why not use the ! marker both for function declarations and function
>> calls then:
>>
>>   function! foo(a, b) { }
>>   var v = foo!(a, b);
>>
>> Of, for better symmetry:
>>
>>   function foo!(a, b) { }
>>   var v = foo!(a, b);
>>
>> When you have a lot of code sitting on top of async APIs, you end up
>> with  a high proportion of async calls. So a discreet marker is better than
>> a heavy keyword like await.
>> --
>>
>>>     Cheers,
>>>     --MarkM
>>>
>>
>>
>
>
> --
>     Cheers,
>     --MarkM
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130616/e265a1e6/attachment.html>


More information about the es-discuss mailing list