🦋 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.
SpiceMan $ raku -> You may want to `zef install Readline` etc etc. where do I get this Seph guy from? 05:26
AlexDaniel SpiceMan: sorry, what do you mean? 05:51
SpiceMan the repl says I can zef install Readline. I find no such zef :) 05:53
AlexDaniel SpiceMan: oh, then you need to install zef first github.com/ugexe/zef 06:08
SpiceMan thanks 06:11
Geth ecosystem: c355c7b2b3 | (Matias Linares)++ (committed using GitHub Web editor) | META.list
Matrix::Client moved to CPAN
06:22
ecosystem: d9dae40dad | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | META.list
Merge pull request #492 from Raku/matiaslina-patch-1

Matrix::Client moved to CPAN
doc/master: 4 commits pushed by (Stoned Elipot)++, (Juan Julián Merelo Guervós)++ 06:24
doc: 6a0e048c35 | (Stoned Elipot)++ | 2 files
Process Pod code block with lang:<raku>
06:25
doc: c3d8ba3edc | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | 2 files
Merge pull request #3376 from Raku/code-block-raku

Process Pod code block with lang:<raku>
robertle has anyone got experience with cro and exception handling? I would like to just throw exceptions within my app, and then transform them to responses in the router. works, but I can only put the exception handler into the "get -> 'path' {" sort of constructs, not the block around it. 11:49
which means I need to duplicate the exception handling, I would rather only have one... 11:50
sena_kun robertle, I imagine you can 1)throw an exception, it'll be converted into 500 response and then have a middleware to convert 500 responses into some pages; 2)to keep the information, dynamic var can be used, though I am not really sure how concurrency safe, possibly some sort of exception storage monitor would be more safe. 11:54
robertle, can you provide a pseucodoe example, please? 11:56
robertle sena_kun: yeah, but I would like it to be a bit more fine-grained, like 4xx/5xx depending on exception type etc. I'll keep playing and report back, just wondering if anyone has done this before and I am just stupid...
robertle so e.g. github.com/robertlemmen/svc-shelve...akumod#L80 11:57
this kinda works and can be extended to more exception types etc, but I need it in each route, and would like to have it one level up
sena_kun robertle, I think the easy way is to set the response's body to some constant text for this type of exception, then in middleware you can inspect it and rewrite as you wish, having the whole logic in a single place instead of duplicating it in every handler. 12:00
robertle hm, but where would you put the CATCH? I was trying to avoid duplicating that part... 12:09
anyway, just needs more fiddling... 12:10
konvertex Damn, chaining iterators is nice and all, but raku's meta operators are a whole different level. Nice and concise, slick! 12:29
Alright, actual newbie question: I want to extract the same chars of two string, removing non-matching. Is there a fancier way than this?
("abc".comb Z "axc".comb).grep({.head eq .tail}).map(*.head).join
MasterDuke konvertex: do they have to be in order? 12:34
konvertex Yes.
AlexDaniel konvertex: this is not really neater but: 12:38
m: say (‘abc’.comb Zxx ("abc".comb Zeq "axc".comb)).join
camelia ac
konvertex xx in conjunction with truthy vals, interesting. I like it. 12:42
AlexDaniel m: say zip(‘abc’.comb, ‘axc’.comb, with => { $^a eq $^b ?? $a !! Empty }).join 12:52
camelia ac
AlexDaniel konvertex: or maybe like this
tadzik heh, these “proper quotes” always make me uneasy when I see them in code :P 12:56
AlexDaniel tadzik: why
konvertex AlexDaniel: That will do, thanks!
tadzik AlexDaniel: just unusual, they always feel like "oh no, someone copypasted it from something with good formatting and now the parser will obviously reject them" ;) 12:57
and then I realize it's Raku so no need to worry
AlexDaniel ah :) 12:58
jnthn m: say ("abc".comb Z[&({ $^a if $^a eq $^b })] "axc".comb).join 13:04
camelia ac
[Coke] m: 0_0; 13:22
camelia WARNINGS for <tmp>:
Useless use of constant integer 0_0 in sink context (line 1)
timotimo m: say ... 0_0; 13:24
camelia Potential difficulties:
Apparent sequence operator parsed as stubbed function argument; please supply any missing argument to the function or the sequence (or parenthesize the ... call, or use 'fail' instead of ...)
at <tmp>:1
------…
timotimo m: say / <(^.^)> / 13:25
camelia / <(^.^)> /
[Coke] :) 13:26
AlexDaniel m: say 6^…^9
camelia (7 8)
timotimo nice 13:44
mahafyi raku scripts reacting to SIEM events via tailing syslog files (manually parsing logs, but learning grammars now heh, will recode next week). The whole thing is working well and *better* than fail2ban. Though slurping data inside the react block, memory utilization is fine, and scripts have been running without crash stably for a few days now. And 13:44
banned plenty bad guys, \o/
moritz nice! 13:45
konvertex Damn, Z[&({ ... })] is interesting as well. Raku's a complex beast indeed. 13:47
mahafyi i didn't use any telemetry (will learn also), no HUP kill inside a crontab entry either. Simply ran inside a terminal emulator (screen) , monitoring with htop only for now. 13:49
konvertex My homies over at #ada would lynch me for that.
moritz I prefer to call it "versatile" :D 13:50
AlexDaniel konvertex: well, it's not the most readable alternative
mayuresh i believe perl(5) had it's own extension to regex called 'pcre'. 14:55
does that same hold true for raku too?
tadzik pcre is not perl5's regex extension 15:02
it's a separate project that calls itself "perl compatible", but mostly it's just compatible with pcre ;)
I don't think there's anything like pcre for Raku's regexes though
mayuresh if anyone reads this, do take a look at "causal profiling". 15:18
their c++ based implementation; github.com/plasma-umass/coz/ 15:19
and they also have a python implementation called "scalene".
hope even "raku" gets one soon. :)
mayuresh hi merelo. :) 15:19
watched your video on youtube today. :)
love the way you talk, especially your accent. :) 15:20
jjmerelo: google for "scalene profiler python".
jjmerelo Thanks! 15:21
mayuresh or simply; github.com/emeryberger/scalene
jjmerelo But in relation to which video? 15:22
mayuresh umnn, the one in which you introduced your book on raku.
also talked about how to taught your girls programming.
lizmat weekly: p6steve.wordpress.com/2020/05/07/r...g-or-what/ 16:04
notable6 lizmat, Noted! (weekly)
AlexDaniel weekly: sparrowdo.wordpress.com/2020/05/08...eue-short/ 16:14
notable6 AlexDaniel, Noted! (weekly)
AlexDaniel 6c: say $*PERL 16:16
committable6 AlexDaniel, gist.github.com/5072e66403c8920dea...ff4e839395
El_Che the capitals :) 16:54
xps The Buf returned from .slurp'ing a IO handle with :bin returns Buf[uint8] - I want Buf[uint64], how can I influence that? 18:09
ctilmes xps: You could always read uint64s from a Buf[uint8] with read-uint64() 19:29
xps ctilmes: Alright, perfect, thanks! 19:30
jdv79 how come a MAIN arg declared as Int allows a Bool?
xps Also, is it correct that the filehandle lock method locks the filehandle itself in the program and it does not relate to file locking in say Linux?
MasterDuke m: say Bool.^mro 19:36
camelia ((Bool) (Int) (Cool) (Any) (Mu))
jdv79 how could one make a usage arg that only too integer values 0-3 let's say 19:40
and not Bools
hmm, seems to be inconsistency between different Int args... 19:42
oh, not really 19:43
xps sub foo (Int $i where * > 0 where * < 3)
MasterDuke not quite. you can't use * to refer to the same thing twice. sub foo(Int $i where 0 <= $i <= 3) {} 19:45
though by doing it like ^^^ it's only referred to once, so you could use * 19:46
jdv79 except True and False are effectively 1 and 0 so cmps like that don't exclude them 19:47
xps MasterDuke: Didn't know yet that you can't chain * refinements, good to know! Thanks!
ctilmes: Must be some silly mistake or something but I can't call that method on my Buf[uint8]. No such method 'read-uint64' for invocant of type 'Buf[uint8]' 19:48
jdv79 this seems to do accomplish what i want - Int :v(:$verbose) where { .WHAT !~~ Bool && 0 <= $_ <= 3 } 19:51
MasterDuke m: my $a = Buf[uint8].new(^16); say $a.^name; say $a.read-uint64(0)
camelia Buf[uint8]
506097522914230528
jdv79 but looks odd to me cause why am i declaring something as Int but then having to furth exclude Bools
xps Alright, so now I have to question my package distribution of rakudo-start I guess - bummer, thanks MasterDuke for the help 19:52
MasterDuke yeah, those are kind of new
xps perl6 -v claims 6.c 19:53
MasterDuke that the language version, you want to know the compiler version
xps This is nqp version 2017.01 built on MoarVM version 2017.01
MasterDuke ha. yeah, that's a bit out of date
xps I'm on nixos, the version is probaly not maintained that well 19:54
Alright, now I know why - thanks for the help!
MasterDuke there's someone else here packaging stuff for nix
chloekek maybe
xps I will google it a bit, did come across some threads talking about the packaging on nix not being actively maintained 19:55
MasterDuke i'd try looking in the logs for this channel. colabti.org 19:55
jdv79 hmm, if i cast from Str its less messy. 19:56
xps It seems like it's been updated in the unstable channel for just a couple of months ago MasterDuke 20:03
xps An update jump from 2017 to 2020 20:03
Quite a jump
robertle in case anyone was interested in the exception->response problem earlier, this is what I do now: github.com/robertlemmen/svc-shelve...akumod#L43 20:09
robertle it's just basic higher-order wrapping of the route block, to avoid having to repeat the catch logic in every block. :) 20:10
comments very welcome of course, I still have that inkling feeling that there must be a better way... 20:11
MasterDuke xps: should be quite a bit faster and more stable 20:25
tellable6 MasterDuke, I'll pass your message to xps
AlexDaniel but it depends, Rakudo from 2017 is also pretty good 20:27
maybe not as fast and not as stable, but still very usable and useful
MasterDuke sure. but if an update is available... 20:32
xps What's the supposed way of outputting the compiled bytecode? -o doesn't seem to do that and --target=moar says no dump method. 20:50
tellable6 2020-05-08T20:25:56Z #raku <MasterDuke> xps: should be quite a bit faster and more stable
MasterDuke --target=mbc, and -o is broken. you have to use --output=<foo> 20:54
Geth doc/test-for-3350: f78e05ac1f | (Stoned Elipot)++ | xt/routine-definitions.t
Add test for routine header vs routune definitions

ref #3350
20:59
doc: stoned++ created pull request #3380:
Add test for routine header vs routine definitions
21:01
Geth doc/regex-lookbehind-typo: ede6d5fa17 | (Stoned Elipot)++ | doc/Language/regexes.pod6
formatting code typo
21:53
doc: stoned++ created pull request #3381:
formatting code typo
lizmat weekly: raku-musings.com/linked-sum.html 22:03
notable6 lizmat, Noted! (weekly)
Geth doc: ede6d5fa17 | (Stoned Elipot)++ | doc/Language/regexes.pod6
formatting code typo
22:07
doc: 6394622b6d | (Will Coleda)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
Merge pull request #3381 from Raku/regex-lookbehind-typo

formatting code typo
linkable6 Link: docs.raku.org/language/regexes