I love coding in Raku - and I am sure that Gleam is nice too. But I get the feeling that Raku is underappreciated / dismissed by many due to the perl5 / perl6 history. So my thinking is, when I see a new language showcase an example on their website, presumably a carefully chosen snippet that showcases their language at its best, I like to see how Raku compares to that.
You know the take-aways from the comparison are quite instructive:
- do I need to import the io lib? (shouldn't this just be included)
- do I need a main() in every script? (does this rule out one liners like `> raku -e "say 'hi'"`)
- is `io.println` quite an awkward way to spell `print`?
I am not making the case that these are right or wrong language design decisions, but I do think that they are instructive of the goals of the designers. In the case of raku its "batteries included" and a push for "baby raku" to be as gentle on new coders as eg. Python.
The differences you mentioned are advantageous for Gleam depending on what you want. Like, having to namespace symbols instead of implicitly importing symbols makes it explicit where things come from which is good. Needing main, same thing. But the big differences are that Gleam is both functional, so everything is immutable, and fully typed safe. Completely the opposite of Perl/Haku so comparing these languages makes zero sense. If you don’t need types or functional programming you probably would just never use Gleam.
> But I get the feeling that Raku is underappreciated / dismissed by many due to the perl5 / perl6 history.
Yes that would be me! If you like making these comparisons, can you write the following pattern matching in Raku?