Live data from Hacker News

A Complete Course of the Raku programming language

course.raku.org

91–100 of 110 posts

Re: A Complete Course of the Raku programming language

#91
post #20

Raku seems to be stuck in a "we'll optimise that later" dead-end, especially with string processing. Parse a large log file with a regex and compare Raku with Perl5. Raku has a long way to go.

> Raku has a long way to go.

Agreed that both Raku (the language, community, and ecosystem) and Rakudo (the compiler) have a long way to go.

But whose who know them well know that there's still lots of low hanging fruit and it's "just" a matter of continuous improvement, year by year.

> stuck in a "we'll optimise that later" dead-end

That's a bit like saying Java (or rather the JVM) seemed to be stuck in being dog slow based on its dog slow performance in the first few years of its official existence. It paints a false picture.

In reality JVMs got faster each year, sometimes by big jumps, and 10 years after Java's first official release it was still slow, but no longer dog slow. (And nowadays Java is no longer considered slow.)

What matters is whether there is sustained love and continuous significant improvement of a PL, and an implementation. Raku has demonstrated that it has that for 20 years, and Rakudo for 10.

There is good reason to look forward to that continuing for both Raku and Rakudo until well beyond the point at which its raw string processing performance has become respectable.

And this will be in addition to what's remarkable about Raku's string handling, namely its world leading Unicode support and O(1) string indexing. Presuming that will finally pay off, and I see no reason to think it won't, it will seriously pay off.

Re: A Complete Course of the Raku programming language

#92
post #20

Raku seems to be stuck in a "we'll optimise that later" dead-end, especially with string processing. Parse a large log file with a regex and compare Raku with Perl5. Raku has a long way to go.

Raku also suffers from a lack of ecosystem. Perl5 and Node have huge advantages there.

I think Raku's Inline approach will one day eliminate that suffering and replace it with the even larger advantage that Raku's ecosystem will trend toward being the sum of other PL's existing ecosystems.

Consider the Perl modules on CPAN. Raku's ability to just use many of these existing Perl modules, including ones that use XS, completely unmodified, running via standard perl binaries, and thus running exactly the same as they would be if run standalone instead of within the Inline harness; and using standard Raku syntax, as if Perl modules were native Raku modules; all of that, done well, is an extraordinary breakthrough.

Stefan Seifert did remarkable and respected work for a decade on some of the most important Inlines that Perl folk use; imo his 5 years of work on the Raku evolution of that notion are far more remarkable in terms of the long term implications I see as I watch the maturing of the Perl Inline and look forward to the anticipated redo of the Inlines for other langs to catch up with the Perl Inline.

Re: A Complete Course of the Raku programming language

#93

Earlier quoted context omitted.

I'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 prof…

As 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 lang…

> 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 created a couple PRs for the grammar debugger, one that fixed a bug, another that dramatically sped it up, but neither were merged. But imo that was appropriate; spending time on that debugger wasn't a good use of his time.

And now jnthn's work on grammar debugging in Comma is so vastly superior to the old debugger that it would imo be especially silly of him to use up his limited time continuing to pay attention to the old code. I'm curious whether you agree with that?

> Raku is different, and it deserves to see top caliber core development. It doesn't have that yet, and that's sad.

I agree it needs more than jnthn, but surely you agree that jnthn is top caliber?

He has a degree in CS, specializing in PLs, compilers, and VMs, so exactly the right focus for his core dev work. And the university he did his degree at was Cambridge, one of the world's top universities, especially in CS. And he was awarded the degree with honors.

In addition, he is a highly successful, highly paid enterprise systems consultant whose work on Rakudo in his limited spare time, in recent years augmented by occasional grant supported projects that pay less way less than his commercial rate, has always struck me as extraordinarily good.

I've always thought it would be wonderful to have two jnthns, but that we have to respect and appreciate what resources we do have, and let him work at a pace that doesn't burn him out while he continues to mentor the other core devs, as he has now for many years.

Would you say I'm missing something?

Re: A Complete Course of the Raku programming language

#94
post #75

Earlier quoted context omitted.

There 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 i…

Scala 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-expres...

For 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.

Re: A Complete Course of the Raku programming language

#95
post #8

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.

I'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 prof…

Imo, 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/849a4a9d8875542fb86df2b2eda892...

[1] https://thenewstack.io/larry-walls-quest-100-year-programmin...

Re: A Complete Course of the Raku programming language

#96

Earlier quoted context omitted.

Does that mean, “does it have threads and culturally emphasize their use over await or callback hell type arrangements?”

Not sure why I’m getting downvoted? The linked article goes at length saying callback hell is terrible, await is a partial solution, and languages that are free to use threads have it best. Author upholds that, “Goroutines in Go, coroutines in Lua, and fibers in Ruby are perfectly adequate.”

I don't know why you got downvoted. Then again, I'm not quite sure what you meant by "await is a partial solution" and "languages that are free to use threads have it best".

As far as your quote goes, I'll add:

> Or, more precisely: multiple independent callstacks that can be switched between. It isn’t strictly necessary for them to be operating system threads.

(Quoting the same paragraph you quoted.)

Standard Raku provides support for OS threads; green threads; coroutines; multiple independent callstacks that can be switched between; an `await` that doesn't require function coloring and is cooperative, supporting work stealing of its thread when it's waiting; multiple other constructs for concurrency, multiple others for asynchrony, multiple others for parallelism; and is an extensible PL anyway.

If you could briefly put your comment into that context, so that I (and perhaps other later readers) could better understand it, that would be helpful to me. I plan to upvote both your above comment and any below if what you're saying then makes sense to me. TIA if you have time to reply.

Re: A Complete Course of the Raku programming language

#97
post #32

Earlier quoted context omitted.

Rational numbers instead of floating point as the default real type.

That's not exactly a new innovation though; Lisp has had a whole numeric tower for a few decades now…

I was taught in school that `0.1` is rational. Afaik it isn't in any lisps. I think that's the point the GP was making.

That said, while making `0.1 + 0.2 - 0.3` come out as exactly zero, with a clean and principled way to avoid things going pathological when the denominator gets large, is nice, it's hardly one of Raku's "main contributions to the programming language design space that I probably haven't seen elsewhere?"! :)

Re: A Complete Course of the Raku programming language

#98
post #7

Over the years I have learned and dipped my toes in many programming languages, and I'd need some kind of reason to look into yet another language. What are Raku's main contributions to the programming language design space that I probably haven't seen elsewhere?

It's core concept cake (like a "concrete turing machine model" counterpart to lisp 1.5's half page of lambda calculus definition) combined with the mutable braid of mutable PLs icing.[0]

[0] https://gist.github.com/raiph/849a4a9d8875542fb86df2b2eda892...

Re: A Complete Course of the Raku programming language

#99

Is perl or "Raku" still used in serious new applications these days? I'm not talking about gluing stuff together with scripts - I mean a large project operating wholly under it

I don't know much about Perl but am aware of Tau Station, which was launched a few months ago. I recall reading somewhere that it includes a new Perl codebase with approaching a million lines of well written modern code.[0]

Raku is a different language, a very young one that has its adoption-for-serious-applications curve mostly ahead of it. Thus you get articles like the advent one from a few weeks ago that seriously documents a serious Raku application in a notably unserious way.[1] It's apparently only 7K or 13K lines of code, depending how you count, but well written Raku code is typically a fraction of the length of well written Perl code, so there is that.[2]

[0] https://taustation.space/blog/category/technology/ [1] https://raku-advent.blog/2020/12/20/day-20-a-raku-in-the-wil... [2] https://p6steve.wordpress.com/2020/04/17/raku-vs-perl-save-7...

Re: A Complete Course of the Raku programming language

#100

When I saw that f 5, 6; is interpreted as equivalent to f(5, 6); something inside me just snapped.. if you don't have parenthesis, you don't have clear delineation of parameters vs functions, especially when things get nested, or need to be read years later.

Then just write it as `f(5, 6);`. That works too.

Tail nesting doesn't need parens, but otherwise you're right, use parens to nest.

As for reading code, rest assured that "buy food" rather than "buy(food)" is something the vast majority of English readers find easy to read, even years later.

That said, if such things make you snap, perhaps it's time to relax and ignore posts about programming languages you don't know. :)

Post reply on HN