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.
02:47 frost joined 04:19 human-blip left 04:28 human-blip joined
Nemokosch I thought simple things were indeed pretty simple 06:07
stevied anyone got any ideas on this at all? I've spent an insane amoutn of time on this: www.reddit.com/r/rakulang/comments...;context=3 06:12
i can't get the c code to run a raku callback 06:13
06:21 lizmat_ joined 06:24 lizmat left 07:13 jaguart joined 07:14 Nemokosch joined 07:28 lizmat_ is now known as lizmat 07:58 dakkar joined 11:15 frost left 11:16 frost joined 11:23 frost left
jaguart within a class method, should I be using the accessor $.myattr or the attribute $!myattr for read? Are there side-effect, performances, conventions? 11:25
stevied I think the basic rule of thumb is use $. 11:26
jaguart ok, and reserve $! for internal attribute mutate, and 'is rw' for external update? 11:27
stevied Correct 11:28
jaguart Enjoyed Rockin' with Raku - nth prime number 11:30
stevied You can also change $! attributes from outside if you set up special set methods.
Thanks. Though I guess it has some technical flaws someone pointed out. Gotta revisit it when I get a chance. 11:32
I’m still kind of a newb.
jaguart yeah - I got scared by gfldex - now I'm nervous of Int:D signatures not being enough 11:33
stevied Heh. 11:34
11:55 discord-raku-bot left, discord-raku-bot joined
gfldex jaguart: sorry for your loss :-> 11:56
Int:D() tends to be the right choice. If you want to be pedantic: sub foo(Int:D(Numeric(Cool)) $i) { dd $i; }; foo("42"); 11:59
jaguart gfldex - thanks, I enjoyed your analysis too - makes me realise I need to pay more attention 12:13
you know your too deep in Raku land when you keep typing `repl` on the bash command line 12:16
13:06 frost joined
jaguart what does dd mean by: $["wtf"] 13:25
is it an array containing one element "wtf" ? 13:26
Nemokosch where did you find this? 13:28
oh right
this is a one-element array, in a Scalar container 😛 13:29
jaguart dd on @a.classify: *.Str
was looking for an easy way to do list subtraction while maintaining list order
Nemokosch and where did you get with it? 13:31
jaguart turn list-2 into a hash and then list1.grep 13:32
which works but feels Perlish 13:33
was playing with .classify to create the hash - abandoned that in favour of .map 13:34
Nemokosch hash? what hash? 13:39
jaguart m: say < one two three >.classify: *.Str 13:40
camelia {one => [one], three => [three], two => [two]}
jaguart m: say < one two three >.map: * => 1 13:44
camelia (one => 1 two => 1 three => 1)
Nemokosch I'm still quite clueless what the eventual goal is 13:45
jaguart m: < one two three four> (-) < two three >
camelia WARNINGS for <tmp>:
Useless use of "(-)" in expression "< one two three four> (-) < two three >" in sink context (line 1)
jaguart basically I want to clean up a list by removing elements that I already know about 13:46
so like set subtraction - but retain the list order
m: say < one two three four > (-) < two > 13:47
camelia Set(four one three)
13:47 discord-raku-bot left, discord-raku-bot joined
jaguart I need < one three four > 13:48
Nemokosch do the elements to remove have to be adjacent? 13:49
jaguart no they can be anywhere in the first list 13:52
Nahita you can grep 14:00
```
>>> <one two three four>.grep(* ∉ <two four>)
(one three)
```
perhaps predefining <two four> as a Set fastens this 14:01
jaguart Nahita - thanks, will check 14:05
14:05 saint- joined 14:09 frost left
jaguart Nahita++ - !(elem) works as I need thank you 14:15
Nahita you are welcome 14:20
14:22 saint- left
stevied here's a basic question. if you're a perl developer, why wouldn't you just start using Raku since you still have access to all of cpan? is there some downside to not learning raku? 14:24
here's a basic question. if you're a perl developer, why wouldn't you just start using Raku since you still have access to all of cpan? is there some downside to learning raku for them?
has anyone made a case as to why it's better to just stick with perl?
Nemokosch It seems simple enough. Perl is more supported, faster, has established ways to compile to native (as far as I can tell) 14:30
stevied when you say "more supported," what does that encompass? 14:32
you mean it's baked into a lot of OS distros already?
Nemokosch for example 14:33
also legacy stuff
stevied ok, but doing apt-get isn't a big impediment, right? 14:34
and perl doesn't come on windows, you have to use strawberry perl
Nemokosch there are like two fanatics trying to get stuff like this working on Windows and that's about it 😄 14:35
stevied stuff like what? 14:36
Nemokosch Same for Mac, except Mac users aren't even fanatic enough to sort it out for themselves 14:37
stevied you mean they can't get perl running on windows or raku?
Nemokosch Perl, Raku, or anything vaguely like GNU
stevied i don't know about that. haven't seen anyone say they can't get raku running at all on windows/mac
Nemokosch but you haven't seen many people say that they want to either 😛 14:39
stevied but I'm talking about a person who is currently a perl programmer. who knows how to get raku installed.
Nemokosch let's be real, these languages and tools were never widespread outside of the GNU (occasionally BSD) influence sphere and mainly Linux
stevied what are their reasons for not using Raku?
but I'm talking about a person who is currently a perl programmer and who knows how to get raku installed. 14:41
Nemokosch and someone who uses Perl in particular probably cares quite a lot about backwards compatibility and legacy stuff; even I have to
and then add speed and add the compiler
stevied you can use inline perl module
can you can't do threading with perl
you can't do threading with perl 14:43
Nemokosch I wouldn't know but there are still aspects in which Raku is just too slow still, so you not "can do threading" but pretty much "must rely on threading"
which is about as much a drawback as an advantage
Anyway, I answered your question. If you think I am biased against Raku despite the fact that I picked Raku over Perl and I actually often can't use it for work because of ecosystem constraints, I can't do much 🤷‍♂️ 14:47
stevied i'm just wondering about things. i don't have an opinion one way or the other
14:53 saint- joined
I'm just learning raku because it's basically just a giant puzzle to figure out 14:58
probably about the same motivation as learning to do a 10,000 piece jigsaw puzzle, except I can do useful things with it at the end. 14:59
maybe i'll write a blog post about it from my own perspective 15:06
jaguart I've used Perl since the 90s - learning Raku so that I can decide if it's worth a migration of my private-garden 15:27
stevied yeah, i've also been messing with perl since 90s as well. I never had a huge need to write anything sophisticated with it. but it is the language I'm most familiar with. recently decided I wanted to improve my coding chops. figured I'd go with Raku to help with that. 15:30
didn't seem to make much sense to get a lot better at perl when I could learn Raku and see what a newer language could do out of the gox 15:32
didn't seem to make much sense to get a lot better at perl when I could learn Raku and see what a newer language could do out of the box
jaguart I did some fun things with Perl in financial markets and risk. Rock solid, fast and enough depth for a fairly large code-base 15:33
Now I have more time, I am interested in distributed, parallel and future capable tools 15:34
future - as in promises et al 15:36
16:37 dakkar left 19:22 Nemokosch left 19:33 deadmarshal left 20:04 deadmarshal joined 20:19 saint- left 23:31 jaguart left