🦋 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:02 melezhik left 00:07 mowcat left 00:10 rindolf left 00:16 notagoodidea left 00:23 grayrider joined 00:24 grayrider left 00:37 pecastro left 01:20 Voldenet joined, Voldenet left, Voldenet joined 01:35 jmchael left 01:39 cog_ joined 01:41 cog left 01:55 cooper joined 02:06 cooper left 02:31 JRaspass left 02:39 kvw_5 joined 02:42 kvw_5_ left 03:07 imcsk8 joined 03:08 afresh1 joined 03:57 [Sno] joined 03:59 sno left 04:23 _jrjsmrtn left, __jrjsmrtn__ joined 04:47 edk_ joined 05:13 brtastic joined 05:25 dogbert11 left 06:07 jmerelo joined 06:27 rindolf joined
elcaro Been poking around with APL the last few days. I still don't know what I'm doing with it, but I saw this quote at dyalog.tutorial.com... 06:37
"Often, those who hate APL don't really understand it. Or, they understand it only enough to argue its weak points. Hopefully, this course will teach you enough about APL to love it or hate it intelligently. You may as well be a well-informed bigot."
that's a really great quote that could easily apply to Raku (or Perl) 06:38
06:39 parabolize left
sortiz Indeed 06:42
06:54 japhb joined 07:20 japhb left 07:22 japhb joined 07:40 wamba joined 08:05 domidumont joined 08:16 Altai-man joined 08:24 coldpress joined 08:25 coldpress_ joined 08:29 coldpress left 08:41 dakkar joined 08:43 patrickb joined 08:45 berber44 joined 08:47 Manifest0 left 08:49 pecastro joined 08:51 Manifest0 joined 09:04 sjm_uk joined 09:08 JRaspass joined 09:12 thdrmz left 09:17 Sgeo left 09:26 thdrmz joined, patrickb left 09:38 edk_ is now known as e 09:43 MasterDuke joined 09:44 coldpress joined 09:47 coldpress_ left 09:54 sortiz left 10:11 patrickb joined 10:19 guifa left 10:32 jmchael joined 10:57 guifa joined 10:59 thdrmz left 11:10 jmchael left 11:18 notagoodidea joined, berber44 left 11:20 telex left 11:22 telex joined 11:24 berber44 joined 11:26 thdrmz joined 11:31 sena_kun joined 11:32 Altai-man left 11:34 berber44 left 11:35 agentzh left 11:47 MasterDuke left 12:05 PimDaniel joined
PimDaniel Hello everybody. 12:05
tadzik o/
PimDaniel Is there a buildin function like assert that throws an exception if assertion is false? 12:06
12:14 [Sno] left
El_Che while testing? docs.raku.org/language/testing 12:18
PimDaniel No while running! But i see die is an overloaded sub and could probably make the job. 12:20
12:21 jmchael joined
gfldex m: die "welp‼" if False; 12:23
camelia ( no output )
gfldex m: sub assert($msg, &c) { die $msg if c() }; assert("welp‼", { True }); 12:24
camelia welp‼
in sub assert at <tmp> line 1
in block <unit> at <tmp> line 1
gfldex That would be a good candidate for a macro because the stacktrace starts at the wrong spot if thrown in the sub assert. 12:25
PimDaniel In fact i need to control bounds! limits. 12:26
gfldex : 1st thank's for your help! 12:27
die if width > maxwidth;
but there can be many well say 4 conditions max. 12:28
what is c() au juste!
A sub?
i'm quite new to raku. 12:29
12:29 sno joined
PimDaniel Is &c a pointer to sub? 12:29
tadzik you can see it that way, yes 12:30
in this case it's just a Callable I think, that's why you can pass a block, which isn't even a sub
PimDaniel @tadzik : ok i see. 12:31
patrickb m: sub a() { say "Lubba dub dub" };my $x = &a; $x(); 12:32
camelia Lubba dub dub
tadzik m: sub assert($msg, &c) is hidden-from-backtrace { die $msg if c() }; assert("welp‼", { True }); # is that still a thing?
camelia welp‼
in block <unit> at <tmp> line 1
lizmat is hidden-from-backtrace still is, yes 12:33
tadzik it'd be fun to apply it to the block itself too
...though that won't really make sense
nevermind :P
PimDaniel why not just : die if $a < $LIMIT; ? 12:34
well limit is not a constant in fact and constants have no $ in raku. 12:35
gfldex m: use experimental :macros; macro assert($msg, $c) { quasi { {{{ die $msg if $c }}} } }; assert("welp‼", { False });
camelia 5===SORRY!5=== Error while compiling <tmp>
("welp‼", { False })
at <tmp>:1
gfldex PimDaniel: ^^^
That will throw from the right line number. 12:36
12:37 Celelibi joined
PimDaniel gfldex : not sure i can make a macro : my limits can change during runtime. 12:38
gfldex The macro takes any expession as a 2nd argument. (I think.) 12:39
PimDaniel gldex : Ok i was not sure to understand! 12:40
gfldex I'm not sure macros are ment to be understood.
PimDaniel may not experimental features disapear? 12:41
gfldex Macros are planned to change. That's why you may want to use v6.d.
PimDaniel macro are processing lighter! but present heavy! 12:42
gfldex PimDaniel: see: gfldex.wordpress.com/2020/10/26/pl...olescence/ 12:43
PimDaniel gfldex : Ok, thanks again. 12:44
I must still learn again and take choice. Thanks to all of you. You bought me light! 12:45
12:48 MasterDuke joined 12:58 notagoodidea left 12:59 dakkar left 13:00 dakkar joined
PimDaniel gfldex : what is m: ? a label? 13:00
gfldex m: say "m: is a marker for this irc bot."; 13:02
camelia m: is a marker for this irc bot.
gfldex is heads to $dayjob
PimDaniel Ho sorry! Your 1st solution works : sub assert($msg, &c) is hidden-from-backtrace { die $msg if c() }; assert("welp‼", { True }); just test on die must be reverte { die if not c() } or unless c(). 13:03
Because we assert something True and rise exception on False. 13:04
13:06 cpan-raku left
PimDaniel I think it is convenient enought for me , i can even change sub to put several conditions and adapt the message. 13:08
13:17 thdrmz left 13:18 thdrmz joined
lizmat m: sub assert($a is raw,&op,$b is raw) { die "assert failed: $a &op.name() $b" unless op($a,$b) }; assert(42,&[<],6) # PimDaniel 13:27
camelia assert failed: 42 infix:«<» 6
in sub assert at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat m: sub assert($a is raw,&op,$b is raw) { die "assert failed: $a &op.name() $b" unless op($a,$b) }; assert(42,&[<],666)
camelia ( no output )
PimDaniel lizmat: thanks! I'll test your solution. 13:28
lizmat note that &[foo] is a short annotation for &infix:<foo> 13:29
where foo can be any infix operator
PimDaniel Okay! i must watch that! it will be probably usefull for multi-conditions assertions. 13:30
lizmat just realize that everything in Raku is an object, even objects are objects :-) 13:32
PimDaniel ok like in Java! :))))
lizmat I guess :-) 13:33
PimDaniel No not *like" fortunatly! 13:35
13:36 berber44 joined 13:42 notagoodidea joined 13:46 thdrmz left 13:52 berber44 left 13:59 thdrmz joined 14:04 nige joined
nige o/ 14:05
just trying to sort out Fosdem video recording for a Raku-related presentation - does anyone have any tips for recording slides and speaker at the same time? 14:06
lizmat would be interested in that as well :-) 14:08
kiti_nomad[m] Very happy, rakudo's Chinese book is published
I bought one 14:09
lizmat kiti_nomad[m]++
14:11 jmerelo left 14:18 Black_Ribbon left
kawaii www.irccloud.com/pastebin/xBEmbeZK...s%20why%3F 14:28
For some reason the items in my array here are being put into one object (a string?) when unpacked, these are 'Devops' and 'Web' not 'Devops Web', any ideas why? ^
lizmat what's in %team ? 14:29
or %config for that matter ?
kawaii %team is the top level hash, containing keys of all the member usernames, %config is another hash containing a whole bunch of sub-keys, let me extract the appropriate parts 14:30
lizmat perhaps golf it down ?
kawaii I can make an attempt
lizmat afk for a few hours& 14:32
PimDaniel hi everybody : I my nick hightlighted sometimes, when some of you replies to me. How do you make it? Thank's. 14:47
*I see !
I mean i see my nick in light yellow ... how do you make it? 14:48
Light yellow is due to my program : i use irssi.
14:51 nige left 14:53 Kaeipi joined
perry Huh, when was this a thing? course.raku.org 14:53
14:54 aborazmeh joined, aborazmeh left, aborazmeh joined
patrickb perry: Exists since a week or so. Kudos go to Andrew Shitov 14:55
MasterDuke kawaii: there may be a precedence problem with your assignment and the feed operators 14:57
what happens if you try `my $a = do <...>`?
kawaii MasterDuke: I resolved it by changing my ==> to distinct .map() calls instead 14:58
no idea why it fixed it, but it did
`%member<role_memberships><standard>.map({%config<discord-team-roles>{$_}}).map({"<@&{$_}>"}).join(', ')`
14:58 Sgeo joined
MasterDuke probably the precedence then, someone else here had a similar problem a day or two ago 14:58
notagoodidea MasterDuke: Yep, it was me and `do` solve the issue. 15:00
tellable6 2021-01-13T20:54:35Z #raku <melezhik> notagoodidea: this is good , very clear
MasterDuke m: my $a = <a b c> ==> map { .uc } ==> join(","); say $a; my $b = do <a b c> ==> map { .uc } ==> join(","); say $b
camelia (a b c)
MasterDuke kawaii: ^^^ 15:01
PimDaniel Does "is raw" means any type? 15:03
I mean for a sub argument : sub mysub ( a is raw) {...} ? 15:05
MasterDuke 'is raw' deals with containerization, but i'm not the person to explain in any more depth than that 15:10
PimDaniel MasterDuke : Okay thank's dont't worry, i'll found it. 15:12
15:27 PimDaniel left 15:30 Altai-man joined 15:32 sena_kun left 15:38 wamba left 15:52 aborazmeh left 16:00 parabolize joined 16:01 Kaeipi left 16:03 squashable6 left 16:04 squashable6 joined 16:07 wamba joined 16:42 xinming left 16:49 notagoodidea left 16:51 patrickb left
notandinus is there a cgi module for raku? 17:03
or something that could run in cgi mode (like mojo (p5)) ? 17:04
17:05 mowcat joined
lizmat news.ycombinator.com/item?id=25775696 # Raku course comments on Hacker News 17:05
17:08 Garbanzo joined
[Coke] there are multiple web service frameworks. I'm not sure anyone has a CGI dropin 17:10
but start here: modules.raku.org/search/?q=cgi 17:11
(yes there appear to be) 17:12
notandinus hmm yeah i started there 17:16
i'm not sure if fastcgi is the same thing as cgi 17:17
btw is modules.raku.org down for anyone else?
[Coke] it's up here. 17:19
lizmat uo for me
tony-o works fine for me, i think cloudflare is having some issues though.
[Coke] downforeveryoneorjustme.com/modules.raku.org 17:20
notandinus hmm looks up again, wasn't responding to pings for like a minute 17:22
17:29 dakkar left
tony-o cf is having some issues 17:33
17:34 ufobat__ left 17:53 wamba left
notandinus looks like ngnix supports fastcgi, will check it out tomorrow 17:57
notandinus sleeps
18:28 wamba joined 18:29 domidumont left 18:44 domidumont joined 18:49 abraxxa1 left 19:02 domidumont left 19:14 lucasb joined 19:27 JRaspass left 19:30 xelxebar left 19:31 sena_kun joined 19:32 Altai-man left 19:33 xelxebar joined 19:55 sortiz joined
sortiz \o #raku 19:56
20:00 b2gills left 20:12 pierrot joined 20:18 sjm_uk left
[Coke] hurls twitter.com/cokebot9000/status/134...4776266761 in case anyone wants to fill out a CS related poll. 20:19
sortiz I am surprised by the lack in the documentation of references to creating by direct assignment of @ or% sigiled variables of alternate types (is Foo = ...). Only binding is marginally mentioned or used.
[Coke] (it me. I cokebot9000)
sortiz m: my %M is Map = :foo(1), :bar('hi'); dd %M; 20:20
camelia Map.new((:bar("hi"),:foo(1)))
sortiz m: my @B is Buf[int32] = 200,300,400; dd @B; 20:21
camelia Buf[int32].new(200,300,400)
20:24 b2gills joined
sortiz I suspect it is the reason why many users end up creating Array when a List is enough. 20:25
m: my @l is List = <foo bar>; dd @l; 20:26
camelia ("foo", "bar")
20:33 xelxebar left 20:34 xelxebar joined 20:41 Garbanzo_ joined 20:43 Garbanzo left 20:46 rindolf left 20:48 dataangel joined, Garbanzo_ left 20:49 Garbanzo joined 20:56 JRaspass joined 20:59 sena_kun left 21:30 jcallen_ joined 21:31 rypervenche joined, BuildTheRobots joined 21:44 Garbanzo left, Garbanzo joined 21:50 wamba left
codesections oh, cool, that Raku tutorial lizmat mentioned is on the HackerNews front page 21:57
22:20 rir joined 22:22 rir left
guifa codesections: nice 22:32
22:36 agentzh joined, agentzh left, agentzh joined 22:40 mojca left, cono joined
cono p6: my $s = Supply.from-list(<a b c>); my $x = supply { whenever $s { .emit }}; my $y = supply { whenever $x { .emit }}; $y.tap: *.say 22:41
camelia a
cono why similar code stucking? my $s = Supply.from-list(<a b c>); my $z = $s; for ^2 { $z = supply { whenever $z { .emit } } }; $z.tap: *.say 22:42
22:47 brtastic left 22:49 mojca joined 22:54 bigdata joined
gfldex cono: you tap on $z after anything can be send to it. Also you shadow $z in the loop body 22:57
cono I thought that from-list gives me on-demand supply, so it waits until I tap on it 23:00
like this tap: $z.tap: *.say 23:01
gfldex you shadow `$z = $s` with `$z = supply` 23:02
cono not sure I understand what `shadow` means
gfldex You replace the Supply.from-list with another Supply object. 23:03
cono yes, and closuring from-list in {} 23:04
23:05 stoned75 left
gfldex "Note that no history is kept for on-demand supplies, instead, the supply block is run for each tap of the supply." 23:08
23:13 Black_Ribbon joined
gfldex m: my $s = Supply.from-list(<a b c>); my $z = $s; for ^2 { our $z = supply { whenever $z { .emit } } }; $z.tap: *.say 23:15
camelia a
gfldex cono: ^^^
cono wow, seems like a scoping bug to me 23:16
23:19 notagoodidea joined
cono p6: my $s = Supply.from-list(<a b c>); my $z = $s; for ^3 { our $z = supply { whenever $z { "$_ layer".emit } }; }; react { whenever $z { .say }} 23:25
camelia a
gfldex m: { say &?BLOCK.signature }; await supply { say &?BLOCK.signature } 23:28
camelia (;; $_? is raw = OUTER::<$_>)
gfldex cono: supply and whenever blocks are not normal blocks. I don't think they are supposed to form a closure.
cono oh, you are correct 23:42
p6: my $s = Supply.from-list(<a b c>); my $z = $s; sub magic($t) { supply { whenever $t { "$_ layer".emit } } }; for ^2 { $z = magic($z) }; react { whenever $z { .say }}
camelia a layer layer
b layer layer
c layer layer
cono thanks! gfldex++ 23:43
moon-child I'm trying to figure out why a script is slow; can anyone lend a hand? 23:44
the script is ix.io/2M3n/perl6; it's a testrunner for my c compiler 23:45
it currently takes 0.7~0.8s (or, claims to). If I run the tests from the shell, they take half that
23:46 bigdata left
moon-child but curiously, the time doesn't seem to be in the grammar or parsing; if I comment out the lines that actually do the compilation (but still run everything else), it claims to take 0.01~0.02s--practically instant 23:46
tony-o you might use Bench and time different parts you think are eating time 23:50
moon-child if I comment out the 4 lines that actually compile things, the time goes down almost to nothing. That seems pretty damning... 23:52
(though it might be optimizer-related?)
also curious why adding .hyper/.race to the loop doesn't help performance any 23:53
tony-o you might look into Proc::Async if you want to run tests in parallel 23:54
23:56 bigdata joined 23:57 aluaces left
moon-child oh, oops, apparently I was racing 23:59