News for hackers. Stuff that matters.
Re:TIL the assumption that string length does not change whe... by darrenf on Monday November 22, 2021 @04:59AM (#29304714)
Raku provides explicit methods for #1, #2 and #4 on strings:

   $string.encode('UTF-8').bytes;  #1
   $string.chars;                  #2
   $string.codes;                  #4
https://course.raku.org/essentials/strings/string-length/
Re:TIL the assumption that string length does not change whe... by goldenkey on Monday November 22, 2021 @01:40PM (#29310046)
For those that don't know, Raku is just Perl 6 renamed.
Re:TIL the assumption that string length does not change whe... by lizmat on Tuesday November 23, 2021 @07:50AM (#29317176)
> is just Perl 6 renamed

Though this was technically correct in 2019, meanwhile the Raku Programming Language has continued to evolve, de-emphasizing its heritage more and more. For example, Covid restrictions allowing, 2022 will see the first European Raku Conference.

Re:TIL the assumption that string length does not change whe... by goldenkey on Tuesday November 23, 2021 @09:40AM (#29318307)
Is it a fork..or just a rename for a breaking version tree? I understand that backwards compatibility is not a required goal. So isn't it more like Python 3 rather than an entirely different programming language?
Re:TIL the assumption that string length does not change whe... by raiph on Tuesday November 23, 2021 @09:42PM (#29326432)
It's not a fork any more than C# is a fork of C.

It's not a rename for a breaking version tree any more than a C# compiler is of GCC.

It is backwards compatible. The first strong demonstration of this was using the Catalyst framework, a major Perl package, in Raku programs, 6 years ago.

It's not remotely like Python 3 vs Python 2. Python 3 is a tweak of Python 2 that utterly failed to confront hard problems that desperately needed -- and still need -- to be confronted. For example, Raku sits alongside Swift and Elixir as the only two mainstream PLs yet to properly address character processing in the Unicode era. In contrast, Python 3's doc doesn't even mention graphemes. Rakudo has no GIL; Python is stuck with CPython's. And so on for a long list of truly huge PL problems.

Raku is an entirely different programming language. (This is so despite Raku(do) being able to support backwards compatibility via the same mechanism that allows it to use Python modules as if they were Raku modules. And C libraries, and Ruby ones, and so on.)

Re:TIL the assumption that string length does not change whe... by goldenkey on Wednesday November 24, 2021 @01:48AM (#29327517)
I see, thank you for your comprehensive explanation. I am intrigued and excited to try it out. I used to use Perl and CPAN all the time :-)
Re:TIL the assumption that string length does not change whe... by elcaro on Tuesday November 23, 2021 @07:41PM (#29325608)
> isn't it more like Python 3

Not in the slightest. Python 3 made breaking changes to the CPython code base (yes that's a simplification). There's enough backwards incompatibility to consider them different languages, but I'd guess that there might still be bits and pieces of code that is identical (or largely unchanged) between the Python 2 and 3 implementations.

Raku - on the other hand - does not use any of the Perl code base; it's a completely different runtime written from the ground up.