🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
00:04 aborazmeh joined, aborazmeh left, aborazmeh joined
Doc_Holliwood Dear diary. Today I learned about the repeated function. Please bless() all the good people developing this wonderful language. Amen. 00:06
00:39 thundergnat left 00:43 lucasb left 00:51 Altai-man_ joined 00:52 vrurg left 00:53 sena_kun left 00:58 vrurg joined 01:01 margeas left 01:09 ensamvarg joined 01:19 mowcat left 01:41 wildtrees left 01:45 thowe joined
thowe Hello 01:45
01:48 MasterDuke left, lichtkind left
jdv79 anyone know of any non-core examples of making something that is awaitable? 02:01
02:01 Doc_Holliwood left 02:07 molaf left
leont has build such a thing, actually 02:18
02:19 molaf joined
leont (but apparently hadn't pushed it to github until now) 02:21
02:22 Xliff joined
leont github.com/Leont/raku-actor/blob/m...or.pm6#L45 02:22
Though I guess that's cheating by essentially delegating the awaitableness to a Promise 02:23
jdv79 hmm, yeah - that's just Promise 02:32
thanks anyway. maybe i'll just "try some stuff":) 02:33
leont Implementing Awaitable::Handle doesn't look to hard 02:44
(famous last words)
02:44 Xliff left 02:52 sena_kun joined 02:54 Altai-man_ left 02:58 xelxebar left 02:59 xelxebar joined 03:04 imcsk8 left, leont left 03:06 imcsk8 joined 03:25 ZzZombo_ joined 03:27 ZzZombo left, ZzZombo_ is now known as ZzZombo 03:35 orinthe left 03:54 holyghost left 03:55 holyghost joined 03:57 orinthe joined 04:05 squashable6 left 04:09 squashable6 joined 04:19 aborazmeh left 04:51 Altai-man_ joined 04:53 sena_kun left 05:29 sauvin joined 05:52 molaf left 05:54 Doc_Holliwood joined 06:22 stoned75 joined 06:52 sena_kun joined 06:54 Altai-man_ left 06:56 thowe left
stoned75 hello 06:56
07:11 Doc_Holliwood left 07:15 reach_satori left
moritz hi stoned75 07:25
07:26 stoned75 left 07:27 stoned75 joined 07:28 Sgeo_ joined, ensamvarg left 07:30 Sgeo left 07:34 finanalyst_mobil joined 07:38 finanalyst left 07:52 stoned75 left, finanalyst_mobil left 07:53 finanalyst joined, finanalyst left 08:04 vike left 08:07 dakkar joined, AndyMcD joined
AndyMcD Hello, sirs and madams. 08:07
i have been reading the raku site for information and came across this 08:08
docs.raku.org/language/ --> 403 Forbidden
08:08 sno left
AndyMcD figured to put it here and let someone know. if there is a better way to report it, please let me know and i will do so 08:08
rba AndyMcD: On which page was the dead link? 08:10
AndyMcD docs.raku.org/language/faq#I'm_a_P..._and_Raku? 08:11
then click the link " Language section of the documentation"
rba AndyMcD: btw this is the place to report issues. Do you like to open one or should I? 08:12
AndyMcD if its okay with you, could you do it please? i just started my work day, so i have stuff to get on with. 08:13
apologies for the laziness
rba AndyMcD: Only if you promise me to improve your raku skills today :-) 08:19
08:20 wamba joined 08:24 reach_satori joined
AndyMcD haha :) definitely working on it :) 08:25
08:26 AndyMcD left 08:46 sno joined 08:51 Altai-man_ joined 08:54 sena_kun left 09:01 wamba left 09:02 natrys joined 09:05 wamba joined 09:13 Black_Ribbon left 09:15 vike joined 09:18 reach_satori_ joined, reach_satori left 09:25 vike left 09:31 ufobat joined
lizmat clickbaits rakudoweekly.blog/2020/03/09/2020-...he-videos/ 09:32
09:38 finanalyst joined
[ptc] already took the bait 09:40
tellable6 2015-04-11T14:48:17Z #perl6 <raiph> ptc: www.reddit.com/r/perl6/comments/326...rg/cq8q0yq
2015-04-16T14:44:15Z #perl6 <[TuxCM]> ptc: github.com/travis-ci/travis-ci/issues/2978#
[ptc] lizmat++
lizmat /o [ptc] long time, no see online :-) 09:41
09:43 pecastro joined
[ptc] o/ heh :-) Managed to get back online at G[P&R]W2020. 09:44
moritz lizmat++ 09:45
09:46 abraxxa left, abraxxa joined
lizmat hopes [ptc] will be able to exercise their Raku muscles again 09:47
[ptc] hopes so too! 09:49
I already have ideas from the workshop. Just need some peace and quiet to start implementing them :-)
lizmat orders [ptc] some peace and quiet 09:50
moritz flips a round tuit to [ptc] 09:51
09:52 finanalyst left, tejr left, reach_satori_ left, tejr joined 09:53 reach_satori_ joined
[ptc] hehe 10:01
10:03 vike joined 10:04 abraxxa left, abraxxa joined 10:05 wamba left 10:08 reach_satori_ left, reach_satori_ joined, wamba joined 10:27 finanalyst joined 10:28 mowcat joined 10:31 caterfxo left 10:32 caterfxo joined 10:52 margeas joined, sena_kun joined 10:53 Altai-man_ left 11:13 bdju left 11:14 bdju joined 11:20 finanalyst left 11:31 markoong joined, margeas left 11:44 wamba left
rypervenche When writing my own submethod BUILD, should I be binding or assigning the values to my attributes? I have seen both examples in the docs. 11:51
11:54 Sgeo__ joined
lizmat rypervenche: do you expect to change the values after they've been BUILD ? 11:57
11:57 Sgeo_ left
lizmat if not, then you could use binding 11:57
of you are going to change them, the easiest would be to assign
binding would save you one scalar container from being allocated 11:58
depending on how many times you create an object of such a class, that could be an optimization opportunity
jnthn The huge opportunity for binding is when you have an array or hash 11:59
Especially if it's a big one 12:00
lizmat jnthn: well, that actually hasn't been implemented yet, it only binds for scalars atm
jnthn Since assignment into a hash or array is a copying operation (so O(n)) while binding is O(1)
lizmat my first attempt at binding in those cases, produced some weird errors :-(
jnthn lizmat: He was writing his own submethod BUILD, so is fine :)
uh, if "he", shouldn't assume
lizmat they is easier :-) 12:01
jnthn Indeed.
Somehow my brain parsed "ryan" out of the nick...which isn't there at all...wtf brain
I used such binding in the MoarVM heap profiler to avoid copying many-megabyte native int arrays around 12:02
lizmat even if you know the gender, people unconsciously assign value to gender specifications
12:02 wamba joined
jnthn Which saves vast amounts of time and memory :) 12:02
lizmat m: class Point { has $.x = 0; has $.y = 0 }; Point.new for ^1000000; say now - INIT now # rypervenche 12:03
camelia 0.4616124
lizmat m: class Point { has $.x is built(:bind) = 0; has $.y is built(:bind) = 0 }; Point.new for ^1000000; say now - INIT now # using bound attributes
camelia 0.2738341
rypervenche lizmat: Ahh, no I won't be changing them. Good to know. I need to reread the docs on binding and starting using it in my code where allowed/necessary. 12:16
jnthn: Haha, it's all good. "they" is easier so you don't have to remember. ryper is actually a sort of French slang/pig latin of my name Perry. A fellow beardy guy. 12:19
12:19 llnu joined 12:30 leont joined 12:38 xelxebar left 12:41 xelxebar joined 12:44 lucasb joined 12:51 Altai-man_ joined 12:52 reach_satori_ left 12:54 sena_kun left
SmokeMachine Hi guys! I was trying to use DB::MySQL with no luck… it cant find the dynlib… any advice? 12:55
12:55 cpan-raku left 12:56 cpan-raku joined, cpan-raku left, cpan-raku joined 13:06 Doc_Holliwood joined
El_Che SmokeMachine: install the mysqlclient-dev package or something similarly named? 13:07
rypervenche Is DBIish recommended for databases?
SmokeMachine I tried… (i forgod to mention I was tring to install it on macos)
rypervenche: I recumbent Red… :) 13:08
rypervenche Touché :P
El_Che SmokeMachine: with brew?
SmokeMachine Yes, with brew and from msql site… with no luck... 13:09
El_Che SmokeMachine: when I am on mac, I tend to work with containers 13:13
in order to walk around the mac pain for packages 13:14
13:14 wamba left
SmokeMachine El_Che: I’ll try that when I get back home... 13:14
El_Che SmokeMachine: I meant docker for mac 13:15
tried podman (what I use on Linux), but it was just a docker proxy
docker desktop for mac
SmokeMachine Yes, I know… the mysql server was running on a container… I’ll try to test my code inside a container also... 13:16
El_Che ah, ok 13:17
just checking :)
13:18 wamba joined
El_Che SmokeMachine: tried stuff like export DYLD_LIBRARY_PATH="..." ? 13:18
SmokeMachine yes... 13:19
(Great Minds Fail alike ;) )
rypervenche I was thinking much worse words... 13:20
SmokeMachine and that was happening with both DBIish and DB::MySQL... 13:21
El_Che rypervenche: that's why you can't have nice things
13:22 mowcat left
rypervenche That explains a lot :( 13:24
El_Che :) 13:26
rypervenche Question, I'd like to add a type constraint to a subroutine of an array of objects. I tried doing Classname:D @array, but I get an error: Type check failed in binding to parameter '@array'; expected Positional[Classname] but got Array ($[Classname.new(...)
Is it possible to do what I'm looking for? Or do people not usually put type constraints on arrays? 13:27
13:28 aborazmeh joined, aborazmeh left, aborazmeh joined
El_Che rypervenche: I type arrays, but nothing fancy 13:32
13:33 reach_satori joined
jnthn rypervenche: The array that you pass in also has to have a matching type 13:36
e.g. be declared with that type
13:38 wamba left
SmokeMachine m: sub bla(Int @a) {}; bla Array[Int].new: 1,2,3,4; bla 1,2,3,4 13:41
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling bla(Int, Int, Int, Int) will never work with declared signature (Int @a)
at <tmp>:1
------> 3t @a) {}; bla Array[Int].new: 1,2,3,4; 7⏏5bla 1,2,3,4
SmokeMachine m: sub bla(Int @a) {}; bla Array[Int].new: 1,2,3,4; bla [1,2,3,4]
camelia Type check failed in binding to parameter '@a'; expected Positional[Int] but got Array ($[1, 2, 3, 4])
in sub bla at <tmp> line 1
in block <unit> at <tmp> line 1
SmokeMachine m: sub bla(Int @a) {}; bla Array[Int].new: 1,2,3,4; # bla [1,2,3,4] 13:42
camelia ( no output )
rypervenche jnthn: Ahhh, that did it. Thank you.
I've been wondering how to do that for a while. knowledge++
I have to say, even though Python is seen as one of the easiest programming languages to learn, I had trouble understanding OOP and classes and methods (too many parentheses and "self"). I'm rather surprised and happy that I've picked it up as easily as I have in Raku. The syntax is much easier to understand and OOP finally makes sense to me. 13:44
13:45 Doc_Holliwood left, caterfxo left 13:48 caterfxo joined
moritz rypervenche: that's great to hear, thanks! 13:53
14:19 aborazmeh left 14:31 finanalyst joined 14:41 nightfrog left 14:52 sena_kun joined, rindolf joined 14:54 Altai-man_ left 14:58 domidumont joined 15:00 reach_satori left 15:04 leont left 15:15 Actualeyes left 15:18 Actualeyes joined 15:46 libertas left 16:02 molaf joined
masak in my humble opinion, OOP never really truly "makes sense" :P 16:05
Grinnz the actor model is a good abstraction for it IMO 16:06
it's a thing, that can hold stuff, and do stuff
moritz IMHO there are problems that fit so well into our OO models that I feel it "makes sense" 16:07
and then there are things don't fit at all with our OO modeling techniques 16:08
Grinnz OO certainly has been misused or overused across the years 16:09
lizmat if you have a system in which not everything is an object to begin with, I'd agree :-)
16:12 Doc_Holliwood joined
tadzik I think that part of the misuse and misunderstanding of OO stems from the focus on the syntax in the first place 16:19
people then go "great, I learned classes, that was the next step after variables and functions" and then spam them everywhere because why level up if you don't exercise yuor skills after that 16:20
Grinnz i blame java :)
tadzik I blame C++, perhaps because I learned it first :P
ironically, one of the things that helped me *understand* OO was C, Gtk+ specifically 16:21
it has objects, but it doesn't have classes. You pass structs around, but you never look inside them, and afair the documentation doesn't even tell you what's inside them. You accept that they're opaque and that's iet 16:22
16:29 aborazmeh joined, aborazmeh left, aborazmeh joined 16:36 libertas joined
jdv79 it gets worse when someone learns any "patterns". all of the sudden everything is poorly poured into a "pattern". 16:41
16:45 molaf left
Altreus lizmat: did you have a chance to ponder on my suggestions for ObjectCache? 16:47
16:51 Altai-man_ joined 16:54 sena_kun left 16:57 entonian left, entonian joined 16:59 entonian left 17:00 abraxxa left 17:22 Kaiepi left
kawaii Does Raku compile/work on the Windows Subsystem for Linux? 17:25
I find myself booting into my Windows partition of my laptop more in the evening, would be nice to be able to work too. 17:26
17:26 vike left
Altreus ssh 17:27
17:28 vike joined 17:41 dakkar left 17:42 finanalyst_mobil joined, domidumont left 17:45 aluaces left, finanalyst left 17:46 finanalyst_mobil left 17:47 finanalyst joined 17:52 Ven`` joined
synthmeat is there a way to have lazy reduce? i.e. `[&&] ^1e1000`? 17:57
18:00 sno left 18:01 pecastro left
lizmat Altreus: I'm afraid I missed any ObjectCache suggestions :-( 18:02
18:06 wamba joined 18:10 m_athias left 18:12 aluaces joined, ptrcmd left
Doc_Holliwood kawaii: it does. runs fine 18:13
18:14 ptrcmd joined
Doc_Holliwood synthmeat: I think not. Every reduction needs to culminate in a single value and that by definition cannot be lazy 18:14
18:17 MasterDuke joined
jnthn If you want all the intermediate values, you can do the triangle reduce ([\&&] instead), which is probably lazy 18:25
18:25 sauvin left 18:33 m_athias joined
synthmeat ok, so `[&&] 0..100000` takes a bit, but `[&&] (0..100000).reverse` is basically instant, which is all good. i imagined reduce as `0 && 1 && ... && n)`, but instead it's `(...(0 && 1) && ... && n)`, so that makes sense. right? 18:39
meaning, evaluation of reduce starts from the outermost, which is 100000 in this case? 18:41
moritz m: say &infix:<&&>.assoc 18:43
camelia No such method 'assoc' for invocant of type 'Sub+{Precedence}'
in block <unit> at <tmp> line 1
18:45 aborazmeh left 18:52 ufobat_ joined, sena_kun joined 18:53 Altai-man_ left 18:56 ufobat left 18:57 wamba left, wamba joined 18:59 Doc_Holliwood left 19:05 rindolf left 19:08 pecastro joined 19:12 rindolf joined 19:22 aborazmeh joined, aborazmeh left, aborazmeh joined 19:23 Black_Ribbon joined
synthmeat i don't know. my expectation was for `[&&] 0..100000` to finish fast, and `[&&] (0..100000).reverse` to take a bit. && is left to right, right? 19:26
lizmat synthmeat: (0..N).reverse is I believe statically optimized to N..0 19:29
so shouldn't really have a difference in performance 19:30
19:30 wildtrees joined
lizmat but quite possibly I'm out of date or wrong in that respect 19:30
19:30 Doc_Holliwood joined 19:31 wildtrees left, wildtrees joined
synthmeat no, i mean `0 && 1 && ... && n` will finish fast at `0 &&` already. `n && ... && 1 && 0` has to go through all the way, and that's why it's taking longer. but it appears to work in opposite manner (in repl, anyways) 19:35
(unrelated, any convenient method to time the execution in repl?)
but `[*] 0..100000` is faster than `[*] (0..100000).reverse`, which aligns with my intuition 19:43
i'm not understanding something here badly ^_^
lizmat synthmeat: I don't use the REPL, I use an alias: alias r='time raku -e' 19:44
19:44 pilne joined
lizmat it allows me to run code like: r 'say 42' 19:44
and get timing info at the same time
19:44 sno joined 19:45 [Coke] joined, [Coke] left, [Coke] joined
[Coke] wonders how long his irssi executable has been missing while he was running it. oops 19:47
synthmeat lizmat: and what does `r '[*] 0..100000'` do for you? error over here, something about sink context 19:49
lizmat the r should be outside of the quotes 19:50
[Coke] coming in late, but you have to do something with the result, e.g. "say" it.
lizmat and NOT in the REOLK
[Coke] defers to liz
synthmeat no, `` are conversational quotes here, as i use them 19:51
[Coke] just watched www.video.uni-erlangen.de/clip/id/12901, good to see some people again.
lizmat what [Coke] said :-)
El_Che lizmat: funny to watch you type and waching your presentation at the same time :)
[Coke] m: 3
camelia WARNINGS for <tmp>:
Useless use of constant integer 3 in sink context (line 1)
[Coke] ^^ same error.
synthmeat k
[Coke] basically, if you go to the trouble to do something, and then ignore it, the compiler assumes that's a bug. 19:52
er, not a bug, per se, but something to worry about. :)
synthmeat ok, so `[&&] (0..1000000).reverse` is 10 times slower than `[&&] 0..1000000` 19:53
s/slower/faster 19:54
lizmat is seeing the same 19:55
synthmeat but `[*] 0..1000000` is many magnitudes faster than `[*] (0..1000000).reverse`
lizmat interesting... 19:56
synthmeat and both * and && are left to right and expected to "fail fast" (so i don't abuse "lazy" term)
[Coke] [*] has a range optimization.
m: (0..10000000).^name.say
camelia Range
[Coke] m: (0..10000000.reverse).^name.say 19:57
camelia Seq objects are not valid endpoints for Ranges
in block <unit> at <tmp> line 1
[Coke] m: (0..10000000).reverse.^name.say
camelia Seq
[Coke] ^^ with a Seq, you have to go through the whole thing. with a range, you can cheat (and we do)
(now watch, we're not cheating and I'm remembering something from parrot) 19:59
Doc_Holliwood A company next village is offering a PHP position. Tempting benefits and easy too reach, but frankly, I'd rather jump into an ant pit with my gut sliced open. 20:00
lizmat mental health insurance included ? 20:01
Doc_Holliwood Maybe I should write them anyway, see if they have heard of this promising new language ...
20:01 wamba left 20:02 wamba joined
synthmeat [Coke]: ok, when i convert them both to lists, perf seems exactly the same. that jives (kinda. i'm assuming there's a reason it doesn't stop at first item and just say `0`) 20:04
[Coke] that would be a better cheat! 20:06
20:07 domidumont joined
[Coke] (but would probably slow down the general case if we had to add a compare to each element) 20:07
20:09 domidumont left
rypervenche Nice. I converted my password manager script from Bash to Raku: gist.github.com/rypervenche/234611...ed1788d61f 20:12
20:13 wamba left 20:14 mensvaga left
lizmat rypervenche: if you add "is built(:bind)" to each attribute definition, you can drop the BUILD method completely 20:15
rypervenche Oooh
Before or after the "is required" or does it not matter? 20:16
MasterDuke gist.github.com/rypervenche/234611...ku-L80-L83 could probably be `return @input.first(*.site eq $chosen-entry-name)` if you wanted 20:17
rypervenche Oooh, also a nice shortcut. Thanks.
MasterDuke why are you doing `.lines.join("\n")` here gist.github.com/rypervenche/234611...ku-L88-L92 ? 20:19
rypervenche That....is a good question.... Let me try it without and see what it gets me, but it should be the exact same thing without it... 20:21
Yep, I don't know what I was thinking there. Removed it. 20:23
And cool, looks like order of the "is" parts doesn't matter. 20:24
20:24 Ven`` left
MasterDuke fwiw, i'm not 100% sure if `.lines.join("\n")` will treat windows/mac/*nix newlines all the same as just doing nothing. may depend on what you pass it to whether it matters (if it's not the same) 20:25
rypervenche That's true. I only use Linux and am only writing this for myself, (at last for now). These are also little projects for myself to learn more of the language. 20:26
So thank you very much for the feedback.
MasterDuke np
rypervenche This is really the only place I can chat about Raku. :P 20:27
20:31 natrys left, wamba joined
synthmeat you can always talk to yourself though 20:32
rypervenche >< 20:36
20:40 natrys joined 20:43 molaf joined 20:44 stoned75 joined 20:47 MasterDuke left 20:51 Altai-man_ joined 20:52 MasterDuke joined 20:54 sena_kun left 20:58 wamba left 21:13 sena_kun joined 21:15 Altai-man_ left, Kaiepi joined 21:17 Kaiepi left, Kaiepi joined 21:37 aborazmeh left 21:40 wamba joined 22:11 natrys left 22:13 rindolf left 22:29 regreg left, regreg joined 22:38 Kaeipi joined, Kaeipi left, Kaiepi left 22:42 wamba left, mowcat joined 22:48 wamba joined 23:03 mowcat left 23:07 shadowpaste left 23:09 vrurg left, vrurg joined 23:12 shadowpaste joined 23:13 Altai-man_ joined 23:15 sena_kun left 23:16 a3f left 23:20 a3f joined 23:21 shadowpaste left 23:28 pecastro left 23:35 aborazmeh joined, aborazmeh left, aborazmeh joined 23:37 SQuoll left 23:56 SQuoll joined