Hacker News new | ask | show | jobs
by msvan 1987 days ago
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?
9 comments

Gradual / optional type declaration, grammars as a first class language feature, async / parallel programming, rational numbers, lazy evaluation, OOP with classes and roles and an underlying metaobject protocol.
The real bummer about optional typing is that it doesn’t speed up the program. I used it all over thinking that I was “optimizing” or helping the compiler. Really I was creating more work for it.
The goal is definitely that it can enable greater optimisation and I agree that it's not a reality yet. The other benefit is that it constrains types so that you get compile time type checking, which is very useful.
typing, roles/inheritance and multi dispatch together offer a very clean coding model that cuts through the usual if-then-else wool
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?"! :)

Maybe grammars? You'd have to research.

https://docs.raku.org/language/grammars

Hyperoperators by The Damian.
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...

great question @msvan - raku has many ... for me the unique genius of raku is to have stolen all of the best parts of type system, OO, grammars & regex, functional and procedural coding and jammed them into one smoothly integrated syntax
It is Perl
Raku incorporates many of the neatest ideas in languages but retains a perlish flavor. I would almost equate it with Racket, in that there is support for many styles of coding, and your code may look nothing like another's. TMTOWTDI is fundamental to the perl philosophy so if you prefer total consistency, you are probably better off with python or go.