4 ms·
I'm so glad they renamed Perl 6, having it dangling for decades like a Sword of Damocles hurt Perl more than anything else could. At least both languages are no
by qalmakka 6y ago
I'm so glad they renamed Perl 6, having it dangling for decades like a Sword of Damocles hurt Perl more than anything else could. At least both languages are now able to progress in their separated ways, and I must say Raku is a really pleasant language, and a joy to use.
- sigzero 6y agoAgreed. Now both projects can more forward for whatever someone's definition of forward means. I am just glad it happened.
- wolco5 6y agoNot sure Raku was the best choice. I initially thought this was about the programming language for roku and was a little disappointed it was about perl 6 changing names.
- giancarlostoro 6y agoI'm going to butcher my question so my apologies, I've heard Perl described as a sort of linguist / grammatical type of language, where you can solve the same problem using multiple approaches and syntax. Is this something Raku is drifting from or embracing? I think Raku is kind of interesting and I did try it out a few times whilst it was called Perl 6, but I'm not sure what its niche is. I mostly do Python for professional projects but don't mind experimenting with other languages. I guess what I'm trying to ask is what are the major fundamental differences between the two languages? Features aside, although if some features are part of the answer thats fine.
- donaldihunter 6y agoRaku definitely embraces multiple approaches and syntax, continuing the “There is more than one way to do it” motto of Perl. In addition, Raku aims for consistency and composability while introducing new language constructs like laziness, gather/take, async/await, hyper operators, grammars and more.
- codesections 6y ago> I've heard Perl described as a sort of linguist / grammatical type of language, where you can solve the same problem using multiple approaches and syntax. Is this something Raku is drifting from or embracing? Very much embracing – "turning up to 11" might be a better way to put it. I recently wrote a three-part blog series[0] about what Raku's primary values, and the more-than-one-way-to-do-it idea features prominently in that list. [0]: https://www.codesections.com/blog/raku-manifesto/ https://www.codesections.com/blog/raku-manifesto/
- atweiden 6y agoAs someone who wrote a limited amount of Perl 5 before writing a not insignificant amount of Perl 6 (now Raku), I find Raku syntax to be deeply Perlish while also being more modern and internally consistent than Perl 5. IMO Raku has three standout features: 1. Grammars in the stdlib [1] 2. The absolute most flexible multi-dispatch system of any programming language [2] 3. The best regex syntax of any programming language [3] In 2015, I had to write a DSL for a double-entry accounting system. That's when I discovered @jnthn's Perl 6 grammar debugger [4], which allowed stepping through a Perl 6 grammar line by line and visually seeing how the grammar was consuming a string. At that time I had very little programming experience, which made Perl 6 far and away the easiest way to write a custom DSL parser. If you enjoy Erlang/Elixir multi dispatch, e.g. def format({:ok, %HTTPoison.Response{body: body, status_code: 200}}) do body |> Meeseeks.parse(:xml) |> Meeseeks.all(xpath("/*")) |> Enum.map(&Meeseeks.tree/1) |> _format end defp _format([{"current_observation", _version, current_observation}]) do current_observation |> Enum.map(&_format/1) |> Enum.filter(& &1) |> Enum.into(Map.new()) |> Poison.encode!() end defp _format({"credit", _, [credit]}) do {:credit, credit} end defp _format({"credit_URL", _, [credit_url]}) do {:credit_url, credit_url} end Raku does that in an even more flexible manner, destructuring included. I love how declarative it makes the code read. However, I must say I've left the honeymoon phase of Raku far behind me now. In my experience, Raku grammars are insanely slow: at least as of many years ago, it was taking ~40 minutes to parse a ledger-style accounting format log file that wasn't even very big. When jnthn's grammar debugger got really buggy and less actively maintained, that defeated one of the biggest reasons I had to use the language. I've also experienced numerous bugs with Raku's type system, and just in general wouldn't write many things in Raku. But to your question — I would write even less things in Perl 5. I have no use for Perl 5 now that Raku exists, and don't know why anyone would write Perl 5 in the modern day given how many other compelling options exist in its niche. Raku is different, and it deserves to see top caliber core development. It doesn't have that yet, and that's sad. Frankly Raku isn't capable of replacing really any mature programming language for anything but informal scripting tasks where you don't care about speed, and where you don't need an “academic” tier type system. For those tasks, it is quite a fun language. I remain optimistic about Raku's future, and would seriously question the conventional wisdom of using Python or JS in its place for many, many things. [1]: https://github.com/atweiden/config-toml/blob/master/lib/Config/TOML/Parser/Grammar.pm6 https://github.com/atweiden/config-toml/blob/master/lib/Conf... [2]: https://github.com/atweiden/txn-remarshal/blob/master/lib/TXN/Remarshal.pm6 https://github.com/atweiden/txn-remarshal/blob/master/lib/TX... [3]: https://docs.raku.org/language/regexes https://docs.raku.org/language/regexes [4]: https://github.com/jnthn/grammar-debugger https://github.com/jnthn/grammar-debugger [4]: https://vimeo.com/32044632 https://vimeo.com/32044632
- agumonkey 6y agoa few years ago damian conway made a few talks about the raku first-class grammar objects, it kinda signals no departure from the linguistic interests of that community.
- awwaiid 6y agoThere are a TON of experiments and language mash-ups in Raku. Let's see here.... Types can include guard clauses that are evaluated at runtime. Typed multi-dispatch on top of that. In addition to normal "sets" it has "junctions", like some sort of funky quantum superposition or something. In theory those can be made parallel at some point. Stuff like that. One that is particularly funky is the "whatever-star". This is a "" char that can be used in a few places to mean more or less... whatever. For example: <4 5 6 7>.map(-> $x { $x + 7 }) # result: (11 12 13 14) That stabby inline lambda there can be sugared down in a lot of ways, including with the whatever-star: <4 5 6 7>.map(* + 7) # result: (11 12 13 14) ... I've not seen anything quite like that in other languages, not sure if it is a new invention or if only nobody else is crazy enough to try it. And yes, you can use multiplication next to it to make it look crazier: <4 5 6 7>.map(* * 7) # result: (28 35 42 49) (also yes, ( * *) will take two inputs and multiply them.) I will note though that dwelling on these crazy/fun edge cases is amusing, but programs can look quite a bit more like a basic ruby app (with sigils) if you so desire.
- codesections 6y agoNote that HN's formatting ate several of the * in the comment above, which makes it much harder to follow. > (also yes, (* * *) will take two inputs and multiply them.) That's true, but Raku also supports non-Unicode math operators, so the more idiomatic way to write that would be (* × *) which, in isolation, still isn't that clear. But it usually is in context. And, if it isn't – well, that's why there's more than one way to do it!
- dangerbird2 6y agoScala has something similar with "placeholder syntax for anonymous functions", where _.methodname() or _ + 1 is equivalent to x => x.methodname() or x => x + 1 https://www.scala-lang.org/files/archive/spec/2.13/06-expressions.html#placeholder-syntax-for-anonymous-functions https://www.scala-lang.org/files/archive/spec/2.13/06-expres...
- raiph 6y agoFor single placeholders I prefer the look of either the `_` syntax or the alternative some PLs have of `.`. But otoh, Raku nicely stretches the approach to both zero and multiple placeholders: * The zero placeholder `.methodname` in Raku is the same as Scala's `_.methodname` * Any number of placeholders are allowed, so one can write eg `* + *` as an anonymous binary add function.
- raiph 6y agoImo, while both Perl and Raku are exemplars of extensible PLs in their own ways, Perl's approach is essentially a tower of hacks built on the wrong foundation while Raku's core concept[0] is built to last for decades, if not a century[1]. [0] https://gist.github.com/raiph/849a4a9d8875542fb86df2b2eda89296 https://gist.github.com/raiph/849a4a9d8875542fb86df2b2eda892... [1] https://thenewstack.io/larry-walls-quest-100-year-programming-language/ https://thenewstack.io/larry-walls-quest-100-year-programmin...