Re: About actor syntax for Groovy 3

12 views
Skip to first unread message

jim northrop

unread,
Jan 7, 2017, 12:34:45 PM1/7/17
to d...@groovy.apache.org, Russel Winder, GPars Developers
Russel is working on GPars v2.0 so have asked him if this proposed change is do-able.

On 7 January 2017 at 18:28, Andres Almiray <aalm...@gmail.com> wrote:
This is a slippery slope IMHO.

Adding custom syntax support in core for GPars might sound like a good idea given the fact that GPars is bundled with core. OTOH what about Spock, Grails, Ratpack and others? Wouldn't they benefit from custom syntax too? probably yes. Are they bundled with core? no, and they shouldn't.

My recommendation would be to prototype an AST transformation that can support the syntax, just like Spock does it.

One more thing, I would be very sad to see Groovy become a pale shade of Scala. Custom syntax and new operators are pushing Groovy in that direction.

Cheers
Andres

Sent from my primitive Tricorder

> On Jan 7, 2017, at 6:21 PM, Daniel Sun <realb...@hotmail.com> wrote:
>
> class ActorTest  {
>    def counter = new Counter()
>    counter.start()
>
>    for (i in 0 .. 100000) {
>        counter <- i    // send message to the counter actor
>    }
> }
>
> should be modified as:
>
> class ActorTest  {
>    public static void main(String[] args) {
>        def counter = new Counter()
>        counter.start()
>
>        for (i in 0 .. 100000) {
>          counter <- i    // send message to the counter actor
>        }
>    }
> }
>
>
>
> --
> View this message in context: http://groovy.329449.n5.nabble.com/About-actor-syntax-for-Groovy-3-tp5737574p5737575.html
> Sent from the Groovy Dev mailing list archive at Nabble.com.

Russel Winder

unread,
Jan 7, 2017, 2:45:48 PM1/7/17
to jim northrop, d...@groovy.apache.org, GPars Developers
GPars is a library, it can have no special syntax other than what
Groovy provides.

Given Groovy has no <- operator and no way of creating library defined
operators it seems impossible to have this operator. Even though is it
a very Go way of doing message passing.
--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel...@ekiga.net
41 Buckmaster Road m: +44 7770 465 077 xmpp: rus...@winder.org.uk
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Reply all
Reply to author
Forward
0 new messages