This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html
Set by lizmat on 8 June 2022.
01:41 MasterDuke joined 01:47 MasterDuke left 02:01 MasterDuke joined 02:25 teatwo joined 02:26 teatwo left 02:27 teatwo joined 02:28 teatime left 04:33 snonux left, snonux joined
knorrfg hey, I just read two guides, and started to read through the language reference, and found this piece of code: raku my $x = ^Inf .grep: *.is-prime; Can someone explain to me in detail what is happening on the right side of the equal sign? 06:19
nemokosch ^Inf is a range from 0 upwards, it will be enumerated as integers starting from 0 06:39
Now this enumeration happens for filtering the values, using the grep method (the whitespace is probably a trick to lower the precedence compared to the unary ^ operator) 06:42
knorrfg what is the colon behind grep? some syntax that you can apply to any function? if so, what does it mean? If not, what exactly is grep. i.e. what language constructs supports the colon postfix? 06:43
nemokosch This colon simply replaces the parens for method arguments 06:44
This snippet mostly teaches you that the author refuses to use parens 06:45
knorrfg so for a function you can just drop the parens, and for methods you need a colon?
nemokosch (^Inf).grep(*.is-prime)
Exactly 06:46
knorrfg I see. and what about the *.? When is this available?
nemokosch * is the so-called whatever star and for a good lot of operations it is overloaded in such a way that whenever it appears as an apparent operand of an expression, a function is generated with as many parameters as Whatever stars in the expression 06:48
knorrfg i love that name 😄 06:49
nemokosch This is called "Whatever currying" in the documents
knorrfg i see, i'll look into that, thanks a lot for your explanations
nemokosch This is not the most predictable feature ever (*.WHAT for example wouldn't curry, it would just report the type, and for ranges, * already has a custom meaning ±Inf depending on the end) 06:51
But in simple scenarios it can look clean 06:52
knorrfg Ok, I'll keep that in mind
nemokosch + for addition might even look cleaner than &infix:<+> or &[+] 06:53
knorrfg Ok, that is over my horizon ^^. One more question: Perl is old, and maybe not completely dead, but not really that relevant anymore today (at least in my perception). I'm aware that raku is perl 6. How different is this from perl 5, and how much is it really a new language as implied by the name change? 06:55
I'm basically asking with the intention of getting information about "does thing lang have a future?" 06:58
nemokosch The dimensions are akin to C vs C++
knorrfg Ok, that is quite big
nemokosch For the future, frankly that's all on the people who de facto control the direction of the project 06:59
knorrfg yeah it's a hard question. Noone has a functioning crystal ball.
nemokosch Of course the more users come "for free", the more choices 07:00
knorrfg maybe another way to phrase that question: Why did the usage of perl decline so much, and are the reasons for that addressed in raku? 07:01
nemokosch That's not something i could confidently analyse and also many Perl folks will tell you that Perl 6 was at fault all along 07:02
I think the language is much better feature-wise but the same project problems emerged 07:03
I.e retrospectively changing the past to pretend that there has been a coherent design phase and cement bad decisions into bedrock 07:04
knorrfg alright. Thanks. I'll try to research that topic a little. Programming language history is always interesting 😄 07:05
nemokosch On the other hand, it all depends what you want to achieve 07:07
knorrfg currently, I feel like raku might be a strong candidate to replace the chaos of .bat and .bash files in a platform independent manner. I kinda want to be sure though, that they still work in a couple of years from now 07:08
nemokosch Perl has been degraded into "a better shell", of course it has the strategic advantage of being preinstalled on most POSIX systems 07:09
Now Raku is surely an "even better shell" and that's how it mostly interested me always
In this niche I don't think there are competitive alternatives, Python and Node are significantly bulkier, like half of your "shell script" would be boilerplate and modules 07:11
knorrfg yep. that's why there still are .bat and bash files.
python is not good at replacing shell
but if i present raku to my team, someone will come along and say "wait, perls dead right? That seems like a bad idea" 07:12
nemokosch Does being disowned by the Perl community help? xD 07:16
knorrfg maybe 😄 07:17
nemokosch That wouldn't be my primary concern tbh 07:20
The big news were that Raku broke into the top 50 on the TIOBE list 07:21
knorrfg huh, not bad
nemokosch My 2 cents is that there are plenty of people casually curious about Raku, the problem is rather the lack of more serious users - and then we get back to the use cases 07:23
knorrfg I'll try to translate some scripts, see how it goes, and if I like the result present it to my team. Maybe then, there is one more company using it 😄 07:24
08:11 dakkar joined
Anton Antonov It is a bad idea, most likely. As Nemokosch says, depends what are you doing. Scripting is one of the good/great/unique features of Raku. (So, that would mean “good idea”, at least to a point.) I am currently discovering that Raku is not that good in a production level team using “the other” great feature of Raku, grammars. 09:23
lizmat Anton Antonov could you describe what's lacking in grammars to make it more of a production level team USP? 09:25
could it be documentation of the grammar?
or needing to thoroughly grok grammars to begin with ?
Anton Antonov @lizmat Grammars a great — to great actually. 09:26
lizmat
.oO( with great power comes great responsibility )
Anton Antonov Hence “tyrannical” — meaning using them makes Raku indispensable solution. But that does not mean “good” from the manager’s perspective . 09:27
lizmat well, if a manager wants more code monkeys, then that's what they'll get 09:29
in that sense, you will get more large scale IT projects fail 09:30
but not fail enough to not give a large number an unhappy, but well paying livelihood
that's why I think Raku is -Ofun 09:31
Anton Antonov Ah, yes, sure.
Basically, I am trying to “get rid of myself” from the project where Raku is currently involved. Which means “easy” maintenance and extension. So, I am teaching Raku to a few people. They work with Raku “just fine” to a point. It seems to me, though, that they would always need someone who is experienced with Raku, to make things actually working. 09:34
lizmat I think that's true for any programming language 09:35
Anton Antonov Granted, that might be said for any language, or set of languages, use in production.
lizmat Raku is just at a disadvantage because it's "new" in that sense
nemokosch Not only because of that - also because ease of reading has not been a priority 09:40
Anton Antonov This is another angle — how employable those people would be by knowing Raku? Here I am taking the perspective that a software company is a “factory for better programmers.” So, the dilemma is a little bit like university education: do you teach fundamental sciences or you teach know-how, (USA universities almost all go for the latter.)
nemokosch It's not "fun" when a language can trip you up after years of active use, and Raku does have self-serving features that might be net negative for anything to be maintained 09:42
Anton Antonov So, Raku gives a different way of thinking that most of the other programming languages, hence learning it would make you a better programmer. But knowing Raku does not make you “immediately employable.” 09:43
nemokosch Yes, I mean you can learn a lot about the conceptual foundations of language design 09:45
Anton Antonov As lizmat said above: Raku is too new… 09:46
nemokosch For how long will it be "too new"? 09:47
Why is Rust not "too new"?
lizmat well, why? 09:48
nemokosch Because it actually attracts people, it does solve a problem, and even companies joined up in its favor 09:49
Raku is exactly as much "too new" as five years ago, and this is kind of sad
Seeing how much can be achieved in five years 09:50
lizmat 5 years ago it wasn't called Raku
and was dismissed by many because it was considered a failed Perl 09:51
nemokosch So is that the biggest achievement of five years? A half done renaming?
Anton Antonov For me it has not been that, actually. Learning Raku forced me to learn or do things about integrating “a certain programming language” solutions with OS sub-systems or sub-cultures. (Well, UNIX ones…)
nemokosch Like even the renaming wasn't done full throttle up
But okay, then I'll say, 4 years 09:52
For example, people would probably be interested when 6.e is released and/or what it covers 09:53
lizmat 6.e will be released when RakUAST is spectest clean and can compile the core setting 09:56
Anton Antonov @lizmat Thanks for writing the RakuAST early adopter articles! 09:58
10:00 Essai joined
lizmat Anton Antonov you're welcome, more to come about RakuDoc and RakuAST 10:00
10:00 Essai left
nemokosch That's a lot of pressure both time-wise and design-wise 10:10
All in all, good PR is a fair demand/expectation but like it's not for the core people to 100% believe, lol 10:17
lizmat fwiw, PR was discussed at the RCS, but it was also decided that it doesn't make sense until we have a better idea as to when RakuAST is ready 10:20
and for that, we proposed starting to think about that when the number of failing spectest files is < 50
we're at 372 still atm 10:21
nemokosch That's great progress, to be frank 10:24
lizmat yes, there's light at the end of the tunnel 10:26
nemokosch Also, I can imagine that everybody wants to finally harvest the fruits of all this work but please, once it does work de facto, give some considerations to the final design, wrt what you would be content seeing in code in another 5 years 10:27
lizmat I think my "re-design" of Pod6 support in RakuAST shows that 10:30
which will now become RakuDoc
with defined semantics for tags and configs 10:31
hmmm... I miscounted: 472 still but still a log of progress :-) 10:41
11:56 Guest37 joined
Guest37 Greets all. Is there a direct way to convert/expand a Bag to the corresponding list? I create a Bag with my %b = (1,2,1,1).Bag; --> {1 => 3, 2 => 1}, perform operations on %b, then I need the list form again. To do that, I use @blist = %b.kv.map( { $^k xx $^v }).flat; Is there a more direct/concise way to do this? I'm afraid I've missed something 12:08
obvious.
Anton Antonov Another train? 12:09
lizmat Guest37: docs.raku.org/type/Baggy#method_kxxv ?? 12:11
Guest37 Perfect. Thx! 12:15
I should have guessed at it, given the spelling ;) 12:18
12:18 Guest37 left 12:43 lucs left, lucs joined 13:34 teatwo left
Anton Antonov Is there are character class for all dashes -- '_' , '-', etc. -- similar to <:Pd> ? 14:07
lizmat don't think so 14:13
Anton Antonov @lizmat Thanks!
15:38 teatime joined 16:36 dakkar left
librasteve @knorrfg I recently used my raku knowledge to get a job - this taught me two things:- (i) at least to this hiring firm (where PHP and React are the main workloads) the renaming of raku has been a good way to get past the frustrations (they know that raku is perl6 and they are happy that perl did a good job back in the day and wonder why it sank without trace) and (ii) there are firms that value 17:14
productivity and gradualness over political correctness and where Python and Rust do not really add much value since they are not applicable to the day job.
I have used raku to do a number of things in production and I would say it has USPs in command line scripting, grammars, unicode, data munging (XML and so on) and it's ability to easily use a wide range of libraries (from perl5, Python, C) 17:18
knorrfg @librasteve interesting. Thanks for letting me know 17:31
librasteve lol 17:34
17:47 tg57 joined 18:16 tg57 left 18:21 RakuIRCLogger left 20:00 tg57 joined 21:04 p6steve_ joined 22:30 nicole left 22:35 tg57 left