The Raku Programming Language
-
I've been having quite a bit of fun with this language. Not fun in the sense that I could actually accomplish something with it, per se. But you occasionally get the strangest impulse to go Google what a flesh-eating disease looks like, and it's that same impulse that leads you to Raku.
This thread will document some of the sheer lunacy that went into this language, in case some of you have never heard of it before or just don't feel like trawling documentation for fun.No better place to start with than string-quoting. Every language gives you
"foo"
. Some use'foo'
as well, either interchangeably or to prevent against interpolation and/or escaping. Perhaps`foo`
for allowing interpolation. Maybe"""foo"""
if"foo"
does not give you newlines, and maybe#"foo"#
or similar to let you use"
without escaping since you have to match the#
s on both sides.In Raku you can use any delimiters you want. Parentheses, braces, quoting constructs in every Unicode lettering system imaginable, in fact every single character possible. This is because the kind of quoting is determined with characters before the opening quote.
"foo"
actually is just short forqq"foo"
, which means that it allows interpolation. And you can just as easily write thatqq【foo】
. In fact, really this is just short forQ:qq⦇foo⦈
- all the forms other thanQ⟅foo⟆
are really just 'adverbs' (more on that later) ofQ⁅foo⁆
. (There really is no limit to the quoting characters - the only rule is that if it's parentheses, or characters valid in identifiers, you have to separate the Q and the opening quote by a space.)Same as
'foo'
is the default for forQ:q
, and"foo"
is the default forQ:qq
, the default forQ
itself is... drumroll...「foo」
. That's right, the default quoting construct of the language is「」
. (The docs strongly recommend you install WinCompose.) There's also variants of:qq
that interpolate only specific things, like:s
for$
-variables, or:c
for closures. Shell command invocation is done as a quoting construct -Q:qx〈echo hi〉
.:w
and:ww
convert string literals to lists of the words inside, which defaults with<>
(I don't think I've seen a single language before use<>
as delimiters for anything other than generics).«»
is, as you might expect, the default for:qq:ww:v
, where what:v
is is left to the reader's imagination. As a final bonus, all of this shit can be used in escapes, e.g.q︽Strings quoted with q have no interpolation, but what about \qq["this".uc]?︾
Let this be an omen of things to come.
-
@pie_flavor said in The Raku Programming Language:
No better place to start with than string-quoting. Every language gives you
"foo"
. Some use'foo'
as well, either interchangeably or to prevent against interpolation and/or escaping. Perhaps`foo`
for allowing interpolation.In Boo it's the opposite. Double-quoted strings have interpolation. Single-quoted strings have no interpolation. Backtick-quoted strings are completely literal (no interpolation and now escaping.)
-
Raku, it should be noted, really enjoys how Unicodey it is.
For example: Atomic operators all start with⚛
. That is, atomic increment is$a⚛++
, atomic assign is$b ⚛= $a
, and atomic reassign is$a ⚛+= 5
.
Sets are no different. What is the point of having Unicode identifiers, if you aren't going to immediately make every possible set operation into an operator? And so you've got∪
and∩
for set union and intersection,⊎
for multiset addition,⊍
for multiset multiplication (bonus points if you can tell the difference without squinting),⊖
for set difference,∈
and∋
for element-of,∉
and∌
as the respective inverses,⊂
and⊃
for subset-of and superset-of,⊄
and⊅
for the inverses, and⊆
,⊇
,⊈
, and⊉
for 'or equal to'.
And, as miscellaneous, you've got∘
for function composition, and≠
,≤
, and≥
as alternatives to!=
,<=
, and>=
.
Some of these have even worse-looking ASCII counterparts, for example(.)
as an alternative to⊍
.
-
Isn't Raku Perl ?
Perl 7 Announced
Perl 7 succeeds Perl 5 due to the Perl 6 initiative previously for what is now known as the Raku programming language.
-
@El_Heffe It used to be Perl 6. And now it is not, because it is wildly unlike Perl 5 in far too many ways. Larry Wall sought to avoid an amplified version of the Python 3 fiasco by renaming it based on the compiler, which was named Rakudo.
-
@pie_flavor not content with being entirely unlike every other language in the Unicode operator sphere, Raku decides to be entirely unlike every other language in the ASCII operator sphere too: it uses single capital Latin letters as operators.
Z
is the zip operator:1..3 Z 4..6
produces((1, 4), (2, 5), (3, 6))
, and it can be used with another operator, for example<a b c> Z~ <x y z>
(~
is the string concatenation operator) produces<ax by cz>
.X
does the same except with a cross-product:<a b c> X~ <x y z>
produces<ax ay az bx by bz cx cy cz>
.ff
andfff
are also both operators, which commit the bonus sin of being stateful:$x ff $y
will produce false until$_ ~~ $x
, at which point it will start producing true until$_ ~~ $y
, at which point it will go back to the first one (the difference betweenff
andfff
being whether, after figuring out that it should flip, it then immediately evaluates the other operand to see if it should flip again).e: Wow, can't believe I almost forgot:
x
is the string repetition operator andxx
is the list repetition operator.
-
Lunacy bite:
Int
means bothInt:D
andInt:U
.Int:D
means an actual int, i.e.5
or something.Int:U
isInt
's type object, which if you've used Java, C#, or JS, are likeClass
,Type
, and sort of likeprototype
, respectively, or the type object of one of its subclasses, which as you can imagine is only useful in metaprogramming. This is the case for all types. So, if you want to take strings, and notStr.WHAT
(not to be confused withStr.HOW
), you can't sayStr
, you have to sayStr:D
. This infects everything.
-
Slightly more bite-y lunacy bite:
"image1.txt"++
produces"image2.txt"
. No, this is not a wacky special case of accidental numeric coercion PHP-style, but explicitly documented and intended behavior of strings.
-
NOPE!!! thread is .
-
@pie_flavor you're a braver person than I am to endure that insanity. I think I'd fail my SAN save after about the first few phrases.
-
Whenever you see all caps in something, you know weirdness is afoot.
We start with the 'stages' of object construction.new
, which is overridable, callsbless
, which is built-in and thus not. If you're familiar with constructors, you'd probably expectnew
to invoke all superclass constructors. Nope! Instead a method namedBUILD
is invoked with all field values bybless
, and that's the one that gets called up the tree. In factnew
is just convention, despite doing OOP-style constructors, andbless
can be called from any method at all.. InBUILD
, you can assign to fields, but you can't see their potential default values. Those aren't available until the next method,TWEAK
, which is where you are supposed to do stuff post-construction. There's alsoCREATE
, which is likebless
but doesn't perform any initialization. Confused yet? good.Then we've got so-called 'phasers', which do a variety of interesting things.
BEGIN { ... }
runs the block when the code is compiled, like a computed constant.CHECK {...}
, on the other hand, runs at compile time, but as late as possible.INIT
andEND
execute their blocks at runtime, as soon and as late as possible respectively.Then there's the phasers that are relevant within other code blocks, like a loop or event handler.
ENTER
andLEAVE
run at the beginning and end of the block respectively, repeating with loops (LEAVE
thus having similar functionality todefer
in Go and Zig) (bonus ducks:LEAVE
runs even if the function was called with the wrong arguments).KEEP
andUNDO
are variations onLEAVE
, only running on successful or unsuccessful block completions respectively.PRE
andPOST
do the same thing asENTER
andLEAVE
, except exceptions thrown in them are not catchable in that block.FIRST
only runs when a loop first starts, beforeENTER
,NEXT
runs when a loop continues normally, likeLEAVE
does for blocks, andLAST
runs when a loop ends normally.CATCH
catches exceptions from the current block.CONTROL
is weird - it catches so-called 'control exceptions', which are basically any kind of control-switching operation. For example, if you sayreturn 5
from a method, thenCONTROL
will run, getting passedCX::Return
, and$_
will be5
. Works for anything that transfers control. Another such very weird phaser isCOMPOSE
, which gets run when a role is applied to a class (roles being essentially OOP interfaces)Then there's
LAST
,QUIT
, andCLOSE
, which run at a successful completion, an unsuccessful completion, and a completion of any kind, respectively, of an asynchronous stream, and finallyDOC
which modifies some other phaser to run when documentation is being generated.Fun! Don't forget, cromulent code is written using phasers whenever it makes sense, so you have to memorize all of these.
-
Lunacy bite:
sub foo(Str:D $x --> Bar)
,sub foo(Str:D $x) returns Bar
,sub foo(Str:D $x) of Bar
, andmy Bar sub foo(Str:D $x)
are all different ways of declaring return values. You know, in case... man, I can't even think of a joke for this one.
-
@pie_flavor said in The Raku Programming Language:
So, if you want to take strings, and not Str.WHAT (not to be confused with Str.HOW), you can't say Str, you have to say Str:D. This infects everything.
Can you explain this one?
Just wondering what you mean with
WHAT
andHOW
. Can you compare it to some feature in C# for example?
-
@pie_flavor said in The Raku Programming Language:
(I don't think I've seen a single language before use <> as delimiters for anything other than generics)
Ignoring the htmlphant in the room.
-
@El_Heffe said in The Raku Programming Language:
Isn't Raku Perl ?
I was wondering: What is this 「Raku」? That lead me to:
Raku is a member of the Perl family of programming languages.[6] Formerly known as Perl 6, it was renamed in October 2019.
-
@pie_flavor said in The Raku Programming Language:
Slightly more bite-y lunacy bite:
"image1.txt"++
produces"image2.txt"
. No, this is not a wacky special case of accidental numeric coercion PHP-style, but explicitly documented and intended behavior of strings.I must say I like that. It does what people expect rather than what computers expect.
-
@Gurth The psychedelic picture of the language mascot seems to fit what we've learned about the language so far.
-
@JBert said in The Raku Programming Language:
@pie_flavor said in The Raku Programming Language:
So, if you want to take strings, and not Str.WHAT (not to be confused with Str.HOW), you can't say Str, you have to say Str:D. This infects everything.
Can you explain this one?
Just wondering what you mean with
WHAT
andHOW
. Can you compare it to some feature in C# for example?.WHAT
is roughly equivalent to C#typeof
..HOW
is roughly equivalent to JS.prototype
. Roughly. The distinction makes no sense most of the time and you can't properly screw around with the metaobject (prototype) either.
-
@pie_flavor said in The Raku Programming Language:
Fun! Don't forget, cromulent code is written using phasers whenever it makes sense, so you have to memorize all of these.
Based on your descriptions, "whenever it makes sense" is surely equivalent to "never". Please tell me I'm right, (er, if I'm right).
-
@pie_flavor said in The Raku Programming Language:
Then we've got so-called 'phasers', which do a variety of interesting things.
-
@pie_flavor said in The Raku Programming Language:
Slightly more bite-y lunacy bite:
"image1.txt"++
produces"image2.txt"
. No, this is not a wacky special case of accidental numeric coercion PHP-style, but explicitly documented and intended behavior of strings.This is what happens to your brain when you've been using string-based languages for too long.
Yes, I'm bashing the Linux shell again.
-
@pie_flavor said in The Raku Programming Language:
Let this be an omen of things to come.
AFAIK Raku is renamed Perl 6. I don't think we should ever worry about it coming
-
@Gąska It being Perl explains its potential for its code being undistinguishable from line noise.
-
@anonymous234 said in The Raku Programming Language:
@pie_flavor said in The Raku Programming Language:
Slightly more bite-y lunacy bite:
"image1.txt"++
produces"image2.txt"
. No, this is not a wacky special case of accidental numeric coercion PHP-style, but explicitly documented and intended behavior of strings.This is what happens to your brain when you've been using string-based languages for too long.
Yes, I'm bashing the Linux shell again.
I wonder what happens when you do
"1x1"++
.
-
@Rhywden oh, you ain't seen nothin' yet.
-
@Gąska said in The Raku Programming Language:
@anonymous234 said in The Raku Programming Language:
@pie_flavor said in The Raku Programming Language:
Slightly more bite-y lunacy bite:
"image1.txt"++
produces"image2.txt"
. No, this is not a wacky special case of accidental numeric coercion PHP-style, but explicitly documented and intended behavior of strings.This is what happens to your brain when you've been using string-based languages for too long.
Yes, I'm bashing the Linux shell again.
I wonder what happens when you do
"1x1"++
.I'm using
succ
because the online version of Raku that I could find saysCannot resolve caller postfix:<++>(Str:D)
.
-
@Gąska said in The Raku Programming Language:
@anonymous234 said in The Raku Programming Language:
@pie_flavor said in The Raku Programming Language:
Slightly more bite-y lunacy bite:
"image1.txt"++
produces"image2.txt"
. No, this is not a wacky special case of accidental numeric coercion PHP-style, but explicitly documented and intended behavior of strings.This is what happens to your brain when you've been using string-based languages for too long.
Yes, I'm bashing the Linux shell again.
I wonder what happens when you do
"1x1"++
.Ends up as
「1x2」
.
But wait, there's more!
「α」++
gives「β」
.
「az」++
gives「ba」
.
「a9」++
gives「b0」
.
Unfortunately it does not manage to convert「1️⃣」
to「2️⃣」
. I should file a PR.
-
@Gurth said in The Raku Programming Language:
@pie_flavor said in The Raku Programming Language:
Slightly more bite-y lunacy bite:
"image1.txt"++
produces"image2.txt"
. No, this is not a wacky special case of accidental numeric coercion PHP-style, but explicitly documented and intended behavior of strings.I must say I like that. It does what people expect rather than what computers expect.
Strongly disagree. It doesn't do what people expect. People expect it to not compile because it's fucking dumb to have
++
for a string. What it does is make a very very specific use case that's already very easy even easier, but in a way that makes the code undecipherable.Literally all you gain is being able to write:
$s++;
instead of
$i++; $s = "image$i.txt";
Is this tiny benefit really worth the s?
-
@Gąska said in The Raku Programming Language:
People expect it to not compile because it's fucking dumb to have ++ for a string
Moreso than usual. Raku takes great care to have Special And Different operators for strings. For example,
+
is only numeric addition, for string concatenation you use~
, so the PHPish auto-convert-to-number behavior is expected wherever it occurs.==
/!=
/≠
is numeric equality andeq
/ne
is for string equality (~~
is for whatever-shut-up equality),>
/<
is for numeric comparison andgt
/lt
is for string comparison (in case you ever really needed string greater-than semantics), etc. This happens even within the operators, e.g. for OR operations,+|
is bitwise for integers,?|
is for bools (differing from||
only by precedence),~|
is for convert-to-encoding-buffer-and-then-pretend-its-a-number bitwise, etc. It is only++
where Str nonsensically shares an operator with Int.
-
@pie_flavor said in The Raku Programming Language:
「a9」++
gives「b0」
.Wait what? Does it mean
"image9"++
gives"imagf0"
? That's way more retarded than I initially thought.
-
@Gąska said in The Raku Programming Language:
@pie_flavor said in The Raku Programming Language:
「a9」++
gives「b0」
.Wait what? Does it mean
"image9"++
gives"imagf0"
? That's way more retarded than I initially thought.Good question!
Signs point to yes!
-
@Gurth said in The Raku Programming Language:
@El_Heffe said in The Raku Programming Language:
Isn't Raku Perl ?
I was wondering: What is this 「Raku」? That lead me to:
Raku is a member of the Perl family of programming languages.[6] Formerly known as Perl 6, it was renamed in October 2019.
Apparently, Perl 6 was so completely different from Perl 5 that they renamed it Raku and consider it an entirely new programming language.
The level of retarded fuckery in that sentence is quite amazing.
-
@pie_flavor I can't fucking believe it. So even the one and only use case this operator would EVER be useful for, has no use of this operator because it's just so fucking retarded.
It's like they intentionally made all the wrong choices possible to make sure nobody in their right mind ever uses it. And you wonder why Perl 5 folks want to forget about its existence.
-
@Gąska said in The Raku Programming Language:
@pie_flavor I can't fucking believe it. So even the one and only use case this operator would EVER be useful for, has no use of this operator because it's just so fucking retarded.
You have got it in one. Just wait until I get into the amazing world of Raku Compatible Regular Expressions, which hopefully will not take the world by quite as much storm as last time.
-
@pie_flavor at least the many weird features of PCRE are there for a reason.
Are Raku regular expressions still type-3 grammar, at least?
-
@pie_flavor In the meantime, more on operators:
There are several variants of the.
operator. Now, Raku being a modern language, one of these is quite sensible:$x.?m
produces$x.m
if$x
has a method namedm
, and nil otherwise. Another that I rather wish Rust had,$x.&m
, executes the free subroutinem
as if it were a method of$x
(the syntax may seem odd but&func
is how you get a function object normally) (nice as it is, the ability to put a lambda expression after the.&
is a bit much). But we are only getting started. First of all there is$x.=m
, which is shorthand for$x = $x.m
. Sort-of-kind-of useful, but not really deserving of its own syntax. Then there's$x.^m
, which is just shorthand for$x.HOW.m($x)
, and$x.:<m>
, which is shorthand form$x
, i.e. prefix operators, e.g. you could sayfunc-returning-bool.:<!>
to chain things further instead of needing to parenthesize. But edging into the stupid is@x».m
, which for each element in@x
, callsm
on it, and produces a list of the outputs, taking care to mention that while the output is in the correct order them
calls may not take place in that order.But boy, have I saved the truly stupid one for last.
$x.*m
and$x.+m
do broadly the same thing. For$x
's class, but also for each of its superclasses, it calls the best candidate form
. For example,"a".+gist
will give the result of thegist
function onStr
, and onCool
, and onAny
, and onMu
, and stick all four answers in a list, and produce that list. The difference between the operators being whether no result produces empty list (.*
) or a method not found exception (.+
).For the life of me I cannot goddamn figure out under what circumstances you would ever do this.
-
@Gąska said in The Raku Programming Language:
@Gąska said in The Raku Programming Language:
@anonymous234 said in The Raku Programming Language:
@pie_flavor said in The Raku Programming Language:
Slightly more bite-y lunacy bite:
"image1.txt"++
produces"image2.txt"
. No, this is not a wacky special case of accidental numeric coercion PHP-style, but explicitly documented and intended behavior of strings.This is what happens to your brain when you've been using string-based languages for too long.
Yes, I'm bashing the Linux shell again.
I wonder what happens when you do
"1x1"++
.So it always interprets the stuff to the right of the
.
as a file extension and increments the bit to the left?> "1x1.txt".succ 1x2.txt > "1x1txt".succ 1x1txu > "1x1.txt.1".succ 1x2.txt.1 > "1x9.txt".succ 1y0.txt > "1x.9.txt".succ 1y.9.txt > "version-9.txt".succ version-10.txt > "version-9β.txt".succ version-9γ.txt > "version-9b.txt".succ version-9c.txt > "version-9z.txt".succ version-10a.txt > "version9.txt".succ versioo0.txt > "z".succ aa > "ω".succ αα > "_".succ _ > "Changelog.3".succ Changeloh.3 > "Changelog_.3".succ Changelog_.3
That looks ... um, putting it charitably ... niche.
-
@Gąska said in The Raku Programming Language:
@pie_flavor said in The Raku Programming Language:
「a9」++
gives「b0」
.Wait what? Does it mean
"image9"++
gives"imagf0"
? That's way more retarded than I initially thought.It's your fault for not adding enough leading zeroes! Obviously, you should have written
"image09"
if you wanted to support more than 9 images.(That actually kind of makes sense once you accept the premise that strings with numerical content should share a data type with non-numerical strings, but magically behave differently depending on the exact contents of the string. There's no way to implement this insane behavior in a sane way.)
-
@pie_flavor said in The Raku Programming Language:
»
Mind you, this works on all the operators.
!« @list-of-bools
,@list-of-ints»++
,@l1 »+» @l2
. For bonus points, see if you can guess what the difference is between»+»
,«+«
,«+»
, and»+«
.
-
Oh fucking hell.
All the esoteric joke languages got steamrolled. Raku has them all beat, and it presumably is an attempt at a serious language to do actual work in.
I did a gig in perl once, and I deeply dislike it ever since. Raku seems to have taken all the worst bits of perl, dialled it up to 11 and slathered LSD all over it.
What the fuck, the language.
-
@pie_flavor said in The Raku Programming Language:
Cool
Almost forgot to mention! What do you do when PHPish behavior is stupid and implicit and you hate things like that, but you also have a mental illness that causes you to put PHP style conversions in your language? You make it fucking object oriented is what you do.
Cool
is the superclass of any type that can implicitly convert toNumeric
orStr
depending on what operators or methods or other contexts you use it with. Explicitly defined and user extensible retarded PHP style numeric conversions.
-
@Gurth said in The Raku Programming Language:
@pie_flavor said in The Raku Programming Language:
Slightly more bite-y lunacy bite:
"image1.txt"++
produces"image2.txt"
. No, this is not a wacky special case of accidental numeric coercion PHP-style, but explicitly documented and intended behavior of strings.I must say I like that. It does what people expect rather than what computers expect.
This is at the core of Perl's "Do What I Mean" philosophy, and it's entirely terrible. What people expect is random and inconsistent between people, full of exceptions and edge cases, and makes for terrible programming rules.
-
@Gąska said in The Raku Programming Language:
but in a way that makes the code undecipherable.
I don't think this applies, all things considered.
The ship hasn't just sailed, it has arrived at its destination, unloaded, taken the trip back, loaded again, and departed again.
-
@pie_flavor said in The Raku Programming Language:
There really is no limit to the quoting characters
This reminds me that C++ has that feature, too.
R"Paula(Bean)Paula"
(E: fixed typo) is the same as"Paula"
. Because while Python's"""
raw strings are good enough for 99.9% of use cases, the C++ committee doesn't consider any feature generic enough until it is Turing complete. Of course it lacks two more things on the way to Raku insanity: It doesn't automatically close Unicode parentheses (the(
and)
are required, anything parentheses-looking in thePaula
part must be repeated exactly, not flipped) and it doesn't have this:qq
stuff. It does have user-defined string literals though.
I'm only mentioning this because I had literally forgotten about it until reading this.All these crazy unicode operators remind me of digraph and trigraph sequences. Looking back you'd be inclined to think "why the fuck do these things exist?", but apparently back then people literally couldn't type things like
{
,}
. So maybe if I now think those operators are insane, a future person would laugh at my inability to type simple characters? But then, I doubt it'll ever be possible to type those with a simple keystroke instead of using a composer and typing the escape sequence anyway.It looks like at least this language was "well designed" in the following sense: They seem to have put a lot of thought into it and designed a powerful and consistent language. All the insane behavior at least seems intentional. Contrast this with bash, where half the functionality was a hacked-on afterthought and the other half are accidental features that were never designed like this in the first place.
The problem being, though, that the goals it was designed with / the features they designed for it seem to be completely insane. What else would you expect from linguist like Larry Wall who thinks TMTOWTDI and having more operators and syntactic features than there are unicode characters make for a sane language. You study crazy (human) languages, apparently you design them too.What was the name again of that hypothetical programming language that, if from your perspective you're looking down on it on the ladder of how "powerful" a language is, it lacks features, but if you're looking up it all looks like useless gimmicks? It's either something different than "foo" or I just cannot google it.
Anyway, looking at all this, I think I'd rather climb even further down the ladder (begrudgingly), than climb up to this madness.By the way, thanks for the write-up @pie_flavor, even if it makes me dizzy.
-
@topspin said in The Raku Programming Language:
@pie_flavor said in The Raku Programming Language:
There really is no limit to the quoting characters
This reminds me that C++ has that feature, too.
R"Paula(Bean)Paul"
is the same as"Paula"
.I couldn't figure out what the logic is behind this so I tested it and got:
prog.cpp:5:13: error: unterminated raw string cout << R"Paula(Bean)Paul"; ^
After changing it to
R"Paula(Bean)Paula"
, the output is:Bean
So what I'd expected to happen, and not all that terrible. Yes, it's very verbose, yes, you won't use it in 99.99% of cases, but the reason people pick C++ over other languages is exactly because you can do that 0.01% that you cannot do in other languages.
-
@JBert said in The Raku Programming Language:
@Gurth The psychedelic picture of the language mascot seems to fit what we've learned about the language so far.
Perl on acid.
-
@HardwareGeek or: Perl, 20 years later.
-
@topspin said in The Raku Programming Language:
All these crazy unicode operators remind me of digraph and trigraph sequences. Looking back you'd be inclined to think "why the fuck do these things exist?", but apparently back then people literally couldn't type things like {, }.
At least trigraphs are gone now, and the inability of some people (victims of IBM, IIRC) to type some special characters gave us the readable
and
,or
andnot
operators, which Microsoft finally decided to support in 2017 (!). (Hidden behind an optional compiler flag, of course, but at least they support it now.)
-
@Gąska looks like I made a typo. Yes, it would be completely unreasonable if that worked.
-
@pie_flavor said in The Raku Programming Language:
the PHPish auto-convert-to-number behavior is expected wherever it occurs.
==
/!=
/≠
is numeric equality andeq
/ne
is for string equality (~~
is for whatever-shut-up equality),>
/<
is for numeric comparison andgt
/lt
is for string comparisonThis (except the
≠
Unicode symbol and the~~
) is all standard Perl from way back when, before I started using Perl.(in case you ever really needed string greater-than semantics)
How would you sort strings without it?
Even the string
++
has existed in Perl prior toPerl 6Raku, although it appears to be significantly weirder in Raku. However, I'm not terribly familiar with its quirks in Perl; I've used it (maybe) once in 20 years.