News for hackers. Stuff that matters.
Re:Larry Wall has approved renaming Perl 6 to Raku by vaer-k on Friday October 11, 2019 @05:09PM (#21228501)
Why should first-class concurrency needs be required to script in Elixir? This question seems to imply that Python is somehow a default language and special requirements must be needed to justify writing in something else. Elixir is general-use and pleasant to write scripts in so seems reasonable to me for someone to do so if that's their thing.
Re:Larry Wall has approved renaming Perl 6 to Raku by weff_ on Friday October 11, 2019 @05:51PM (#21228814)
Ovid2 said Perl6 has a good concurrency model

lliamander replied that Elixir does too and it's worth a look

To that, 7thaccount replied that Perl6 and Elixir fill different niches.

So far, it seems Perl6 fills a niche that requires scripting and first-class concurrency. My question then is: what is this niche that requires very solid concurrency but also scripting. In other words, what does Perl6 have in terms of concurrency that Python does not (given they are both scripting languages)?

Re:Larry Wall has approved renaming Perl 6 to Raku by lliamander on Friday October 11, 2019 @07:07PM (#21229254)
A fair question.

I don't know of many instances where scripting and concurrency would be needed in the same application. But if you wanted to use single language both for scripting tasks and applications that require concurrency, then Raku or Elixir would work.

One instance I can actually think of, that would be specific to Erlang/Elixir, is if you have a long running service that you sometimes run batch jobs against (like importing data from a CSV). An Elixir script can hook directly into an Elixir/Erlang service and interact with it using message passing. It's a heck of a lot simpler than RMI, and avoids the need to expose new HTTP endpoints specifically for such tasks.

Re:Larry Wall has approved renaming Perl 6 to Raku by weff_ on Friday October 11, 2019 @08:19PM (#21229577)
Is that like the relationship between C# and PowerShell?
Re:Larry Wall has approved renaming Perl 6 to Raku by lliamander on Friday October 11, 2019 @08:34PM (#21229640)
I think so, at least in some ways. I've shipped a project using PowerShell to script Windows Server/Hyper-V, and it was a pretty pleasant experience. Having a scripting language that not only does typical scripting stuff (wrangling text, etc.) and understands your application's objects is excellent.

Some differences:

* You can actually write your whole application in Elixir, whereas I could not see doing that with PowerShell

* In Erlang/Elixir, instead of objects you have processes. Think of your application as a microservice architecture on steroids, using the Erlang RPC protocol as a means for inter-process communication.

Because each process just sends and receives messages, your script can just send messages to any of the processes that make up your application, as if they were your own service. All you have to do is connect to the remote application using the Erlang Distribution Protocol (to connect different runtimes over the network).

Re:Larry Wall has approved renaming Perl 6 to Raku by weff_ on Friday October 11, 2019 @08:43PM (#21229698)
I heard so much about the actor model, I should really try it in its intended glory one day.
Re:Larry Wall has approved renaming Perl 6 to Raku by lliamander on Friday October 11, 2019 @08:45PM (#21229713)
It's a trip, and it took me a little while to wrap my head around. However, I now much prefer it to working with other concurrency abstractions (such as callbacks).
Re:Larry Wall has approved renaming Perl 6 to Raku by Ultimatt on Saturday October 12, 2019 @06:17PM (#21236764)
Jonathan Worthington (Rakudo Compiler Architect). Keynote: Perl 6 Concurrency

https://www.youtube.com/watch?v=hGyzsviI48M

Re:Larry Wall has approved renaming Perl 6 to Raku by labster on Friday October 11, 2019 @06:56PM (#21229206)
Does Python 3 have any operators that transform ordinary method calls into concurrent method calls? Perl 6/Raku does.
Re:Larry Wall has approved renaming Perl 6 to Raku by dragonwriter on Saturday October 12, 2019 @01:45AM (#21230941)
More to the point, does Python 3 have operators that transform sequential operations into operations that are both concurrent and parallelizable, and, in the case of iteration, provide control of parallelism parameters and whether results are constrained to be in-order or not.

To which the answer is “not only does Python not have them, but with the GIL CPython couldn't do much with them even if the language had them.”

Re:Larry Wall has approved renaming Perl 6 to Raku by weff_ on Friday October 11, 2019 @07:42PM (#21229406)
Is that a bit like Go's `go` keyword?

edit: that is, as far as I can tell, after a quick Google, it's not too different from Python's Thread object.

Re:Larry Wall has approved renaming Perl 6 to Raku by b2gills on Wednesday October 16, 2019 @12:20AM (#21267007)
The `start` statement prefix operator is a bit like Go's `go` keyword.

(In that when I translate Go into Raku, I usually replace `go` with `start`.)

    my Channel \input .= new;
    my Channel \output .= new;

    start for input -> \message { output.send(message) }

    start for output -> \message { say message }

    input.send(5);
But what he was really talking about is something more like the following.

    sub foo () {
      sleep 10;
      42
    }

    #                     ___
    #                    V   V
    my $delayed-result = start foo();

    say 'Hello World'; # Hello World

    say $delayed-result.status; # Planned

    say await $delayed-result; # 42
Re:Larry Wall has approved renaming Perl 6 to Raku by pmezard on Saturday October 12, 2019 @01:00AM (#21230788)
It is, python Threads are system threads.
Re:Larry Wall has approved renaming Perl 6 to Raku by maksimum on Friday October 11, 2019 @10:17PM (#21230174)
Re:Larry Wall has approved renaming Perl 6 to Raku by Grinnz on Friday October 11, 2019 @05:16PM (#21228562)
Which is a similar response to the comments asking "why Perl over Python?" I ask, why not (both)?
Re:Larry Wall has approved renaming Perl 6 to Raku by b2gills on Wednesday October 16, 2019 @12:27AM (#21267035)
Especially since you can use the Inline::Python module.
Re:Larry Wall has approved renaming Perl 6 to Raku by greggman2 on Friday October 11, 2019 @11:37PM (#21230485)
I'm embarrased to say I write scripts in node :P I used to write scripts in python but I've been writing so much JS that it's just easier for me in node. Plus, node defaults to locally installed deps so I don't have to deal with virutal environments.
Re:Larry Wall has approved renaming Perl 6 to Raku by tekknik on Saturday October 12, 2019 @12:00AM (#21230568)
Why do you think this is embarrassing? Javascript is great for small scripts. Largr codebases then sure