-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
thicket
•
4d ago
-1 for lack of explanation.
-1 for assuming you know how I think.
-101 for weird-ass punctuation and ugly Perl-isms. That is definitely not how I think.
Maybe some folks will like it. Personally, this is definitely not the way to pitch it to me.
seems a bit harsh ... but we need to listen and improve
u/Whispeeeeeer avatar
Whispeeeeeer
•
4d ago
Who thinks like this?
my @nums = [1,2,3];
say @nums »+» 10; # (11 12 13) [Hyper]
...
well I do, but...
...
sub inner(Int:D $x=0, Num(Rat) $y?, Bool :f(:$flag) --> Str) {
"$x, $y, flag is $flag";
}
Ok what the fuck. I hate complicated syntax. Why are we constantly re-inventing function fn_name(parameter_type parameter_name)?
hmmm ... they have a point here - this is a maximally feature compact contrived example
my @primes = ^∞ .grep: *.is-prime;# Infinite list of primes:
This feels so dense to me.
I want feature density without the syntactical sugar. I'd prefer a more verbose language.
A lot of my complaints are superficial. Seems like a neat addition to the world, if you're into niche language contributions. But I don't see the added benefit of using this language.
It allows programming in different styles, including procedural, functional, object-oriented, and reactive programming
A lot of languages can achieve this in some form or another. Those are paradigms not features. C lacks OOP, but Python, Java, C++, C#, etc. can all be procedural, functional, object-oriented, or reactive if you want. This isn't a selling point for Raku. Maybe Raku has some way of making procedural or functional programming easier, but I am too dense to read the syntax to understand how Raku makes it easier.
normanrockwellesque
•
4d ago
Others are correctly pointing out that some of the syntax seems gnarly and overly terse at first glance. Most of the syntax things that people react to are either 1) really simple to learn once you pick up the language, or 2) not something that you encounter often anyway, they're just included in documentation to illustrate a variety of language features, and Raku is about as full-featured of a language as it gets.
While I do think that Raku documentation/guides lean heavily on some of the language's more unique features (e.g.: Unicode operators and constants, sigils & twigils, the Whatever Star), on the whole it seems like it's well thought-out and I really enjoy writing it. It's become my favorite language for writing personal scripts and automating things at work.
Some of my favorite features include:
Easy CLI creation just by specifying a signature to the MAIN subroutine
sub MAIN(Str $name, Int $num) {...}
# running the script with -h/--help flag will output docs for the script arguments
Gradual static typing, so you can start out with very flexible code and bolster with types where needed
Grammars and Raku's updated Regexes are incredibly powerful. It also provides really flexible string-interpolation features. It was easy in Raku to write a script for complicated restructuring of a Javascript codebase to swap one React module with another one that had a completely separate API.
Really simple reactive code:
react {
whenever 'data-file.csv'.IO.watch {
# code to reprocess/recompile updated data
}
}
normanrockwellesque
•
3d ago
Oh also the multiple dispatch is pretty cool too; makes some things really simple and declarative:
multi sub factorial($n) { $n * factorial($n - 1) }
multi sub factorial(1) { 1 }
^^ I think all of the above is right
BadlyCamouflagedKiwi
•
4d ago
The double-chevron operator seems like a terrible idea. How are you supposed to type that? Most programming languages stick to symbols that are easily entered, for good reason.
I don't think I like many other things about it - I've never liked $ for variables, I'm unclear what the difference here is with @ and I've got no idea what :$^ is about. Nearly all of it seems overly cutesy, terse, or both, and I'm certain that any remotely complex codebase would be unreadable. But untypeable symbols takes the cake for me.
SerdanKK
•
2d ago
That's a lot of weird syntax and complexity just to write map Circle.new radii
What value does Raku's complexity add?
Metadata
Metadata
Assignees
Labels
No labels