
Raku vs. Perl - lizmat
https://p6steve.wordpress.com/2020/04/17/raku-vs-perl-save-70/
======
codesections
> by getting the whole parser onto a single screen, I find that I can get the
> whole problem into my brain’s working memory and avoid burning cycles
> scrolling up and down to pin down butterflies bugs.

This is an excellent point, and one that not enough programmers pay attention
to (well, outside of the APL family of languages, anyway!)

~~~
neutronicus
As a C++ programmer, I've grown so sick of

    
    
                        }
                    } // not
                } // a single
            } // fucking else
            // implicit else
            // return nullptr
            return result;
        }
    

A deeply-indented scope should mean "shit is complicated, think deeply about
it," not "there were five times I tried something and elected to punt and
return null if it failed." The LLVM style guide has the right idea; if you're
gonna punt, early-return.

As a side-note, I really wish the C++ community would take a page out of
Lisp's book and stop giving closing braces their own lines. But that'll never
happen.

~~~
aldanor
In Python, it's even worse, since there's no braces and not returning anything
implicitly returns None.

~~~
deckiedan
I always take this as Python's way of strongly discouraging deeply nested and
overly long functions... ( I realise this might be Stockholm syndrome...)

------
qalmakka
The main issue I have with swapping Perl with Raku is that a major strength of
Perl is its ubiquitousness. Except on Windows, it's almost certainly installed
on 90% of the systems I have ever used. Meanwhile, rakudo is not even in the
repositories of most distributions. It's not very encouraging, if I have to be
honest.

~~~
kqr
I'm the same way. I'd love to use Raku over Perl, because it looks like an
improvement in many ways. Alas, the use case I have for Perl is whipping up a
script on any server for some ad hoc analysis or data massaging or as a UI to
something. If I first have to install Raku, I'm more likely to write a shell
script or Python code -- both of which tend to execute out of the box.

This is also why I'm not as enthusiastic about CPAN as I could be. It's great
that the modules are available for when you want to write real applications,
but that's not what I do with Perl and one-off scripts really don't seem like
it's worth pulling in external dependencies for.

------
hestefisk
Out of interest: anyone in here using Perl 6 / Raku for anything in
production?

~~~
lizmat
On the #raku channel on Freenode, several users are using Raku in production.

------
wodenokoto
Can someone give a little more background why a unit conversion library needs
a parser?

Like an ELI5 for someone not into neither Perl or Raku and haven’t met the
units library before.

~~~
riffraff
you would define values like

    
    
       weight = unit("10 kg")
       speed = unit("2.5 furlong per week")

~~~
wodenokoto
My imaginary units library would have been like

    
    
        Unit(float, unit_as_string)
    

The free text version is pretty cool though

~~~
choward
I would parse the free text version into something like your version. It could
be used for user input from a text input field or the command line.

------
xupybd
So is Perl never going to go past version 5 now?

~~~
Symbiote
I thought the point of the rename was Perl 5 can now release Perl 6 or 7, with
Raku being independent.

~~~
lilSebastian
> I thought the point of the rename was Perl 5 can now release Perl 6

I think that would only add to the confusion, since Perl 6 was already a
thing, albeit totally different from Perl 5

~~~
gus_massa
They should skip "Perl 6" and go directly to "Perl 7", like Windows that skip
"Windows 9" to avoid confussion.

~~~
lizmat
Unfortunately, "Perl 7" was a "thing" in the discussions before the name
change. IMO, going to "Perl 32" makes more sense, as it actually reflects the
current version numbering scheme. Or refer to the year: Perl 2020.

~~~
zimpenfish
"Perl 32? But I have a 64 bit processor!"

------
bmn__
> Yes – a recursive descent parser written from scratch in perl5 – pay dirt!

What made the author write this in the first place? He could use one of the
many many parsing libraries, and then at least the comparison with Raku
grammars would be honest and fair.

~~~
hedora
I’d prefer to write a hundred or so lines of code to adding a dependency. I
can usually get those 100 lines of code right in an afternoon, but keeping up
with the dependency is ongoing maintenance.

The dependency could break compatibility or add a bug a year from now.

------
earthboundkid
ISTM that a grammar parser is a library feature, not a language feature, per
se. Any reason you couldn’t port the parser back to Perl 5 and get a similar
savings in line count?

~~~
lizmat
In Raku, grammars are an integral part of the language. This is necessary, as
the language _itself_ uses a grammar to compile Raku code.

~~~
rurban
But the grammar parsing and processing is not something which is done with
core-only features. Later hopefully, but currently it's very dumb, and can
easily be done as library. Only longest token matching is needed.

------
ZhuanXia
Not a Perl guy. What are the semicolons in that if statement all about?

~~~
cygx
It's a C idiom. Some people prefer `for(;;)` over `while(1)` to create
infinite loops.

~~~
ZhuanXia
I see. Just a c-style loop absent conditions. I find it kind of ugly for some
reason.

~~~
tadzik_
Weird, since Raku has `loop { }` that means exactly that. I guess the author
was not aware of it (or just doesn't like it).

EDIT: Oh, that's in the Perl (5) code. Nevermind then.

In C-like it kind of makes sense – it's 1 character shorter, and on some
ancient crappy compilers it may actually run faster than while(1) since it
doesn't have to check the condition every time ;)

~~~
jandrese
I thought it was just some old weird hate on the while() construct. I remember
a long time ago people advocating for using for() always for looping because
that way the language was more regular. I thought it was a weird argument.

------
zerr
Perl 6 name maybe was a bad choice back then, but we all got used to it -
there was no need changing it nowadays.

~~~
awestroke
I disagree. It's a completely different language.

Try reading some of this: [https://github.com/Raku/problem-
solving/issues/81](https://github.com/Raku/problem-solving/issues/81)

~~~
zerr
Yes, but I mean we all got used that "Perl 6" is a different language.

~~~
lizmat
Indeed, everybody got used to the idea that "Perl 6" was a different language.
But a vocal part of prominent Perl community members, preferred for "Perl 6"
not to be named "Perl" anymore. As well as a part of the "Perl 6" community.

In the end it felt better to stop wasting all those emocycles and suggest a
rename.

~~~
lilSebastian
Had viewers of Police academy 6 been treated to a brutal crime drama, rather
than a continuation of the farce found in the series to date, you'd expect
them to just get used to it, rather than accept that naming as the next
version of something vastly different is a dumb idea.

Edit* I make no criticism of the language, simply the argument that a
different language should have been named as the incremental release of
another.

~~~
hedora
Highlander 2: Scotts from Space would have been a better comparison than
Police Academy 6.

They both got 0% on rotten tomatoes, but I don’t think Police Academy 6 tried
to switch genres.

~~~
lilSebastian
That is my point. "Perl" didn't try to change genres, something different came
along and called itself "Perl 6". No disrespect to either language, but
linguistically this is has a negative impact for both Perl 5 and "Perl 6".
Maintaining that certain people got "used to" the idea proves that it was
never a wise move.

Also, note what chromatic has to say:

[https://perlmonks.com/?node_id=1220578](https://perlmonks.com/?node_id=1220578)

[https://perlmonks.com/?node_id=11105180](https://perlmonks.com/?node_id=11105180)

And so on.

~~~
lizmat
> something different came along and called itself "Perl 6"

You appear to forget that the "Perl 6" initiative originally came from the
Perl 5 Porters. It did not just come along and called itself "Perl 6": the
"Perl 6" name was used because originally it _was_ intended as the successor
of Perl 5.

That it didn't materialize in time, that it became something much different,
is something that happened later. But even with Pugs around 2005, Perl 6 was
still the successor to Perl 5. Only around 2010, when the sister language
concept was introduced, was Perl 6 considered to be a different language.

~~~
lilSebastian
The concept of perl 6, at some stage shifted from being the next incremental
release of the Perl language, sure. For around 10 or so years the Perl 6 crew
knew this was going to be a different language, yet held onto the name for
this period of time and even made arguments in public that Perl 6 should
remain the name, given all the facts, as recently as last year. This sort of
thing can cause problems in communities, and nobody on the outside of the
inner clan really cares, beyond the point that all the slight of hand and
infighting pushes good folk away.

Bullying Isn't Effective Advocacy:
[https://perlmonks.com/?node_id=1221390](https://perlmonks.com/?node_id=1221390)

Also, when it was known Perl 6 was going to be a different language, they were
several year away from a release

