🦋 Welcome to the former MAIN() IRC channel of the Raku Programming Language (raku.org). This channel has moved to Libera (irc.libera.chat #raku)
Set by lizmat on 23 May 2021.
00:00 _ed left 00:02 reportable6 left 00:03 _ed joined 00:04 reportable6 joined 00:07 _ed left
tonyo m: say S:g/ $<a> = <:Lu> || $<b> = <:!Lu> /{$<a>??$/.lc!!$/.uc}/ given "AbCd" 00:09
camelia aBcD
tonyo there ya go 00:10
codesections :-) so much better
guifa Actually if yyou're doing that, there's no reason to check for <:!Lu>, you can just do $<b> = . 00:14
m: say S:g/ $<a> = <:Lu> || $<b> = . /{$<a>??$/.lc!!$/.uc}/ given "AbCd" 00:15
camelia aBcD
guifa m: say S:g/<:L>/{$/ eq $/.lc??$/.uc!!$/.lc}/ given "AbCd" 00:16
camelia aBcD
guifa Golfing further (at the cost of perf) 00:19
m: say S:g/./{$/eq$/.lc??$/.uc!!$/.lc}/ given "AbCd" 00:20
camelia aBcD
guifa points out that after codesections 's last reddit post, he's not allowed to complain about line noise in the last time 00:21
moon-child one char longer, infinitely classier:
m: say S:g/./{[&lc,&uc][$/eq$/.lc]($/)}/ given "AbCd" 00:22
camelia aBcD
guifa ^_^
codesections Agreed
00:26 sono joined, _ed joined
guifa Also, I think I finished up Dateish.fmt … I think the formatters' code isn't too ugly 00:30
Thoughts? github.com/alabamenhu/DateTimeFmt/...imeFmt.pm6
00:38 _ed left 00:47 _ed joined 00:51 _ed left 00:53 Doc_Holliwood left 00:55 lucerne joined 00:57 japhb left
SmokeMachine Does anyone know a fix for this? github.com/raku-community-modules/...t/issues/6 00:59
01:01 japhb joined
moon-child probably the api should be redesigned to take an array of lines for 'expected' and call .lines on the result of the function 01:02
01:05 _ed joined 01:10 _ed left 01:24 _ed joined 01:29 _ed left, linkable6 left 01:30 linkable6 joined 01:39 m6502 left
codesections guifa: that looks like about the most readable nqp I've seen :D 01:40
01:42 _ed joined 01:46 _ed left 01:50 _ed joined 01:55 _ed left
rassoc noob question regarding that code: why bother with nqp::if when the regular if would be more readable? perf seems to be the same, according to this answer: stackoverflow.com/questions/551072...8#55107548 01:56
02:00 _ed joined 02:03 lucerne left, lucerne joined 02:04 _ed left
codesections Wait, I think I'm missing something, rassoc. What in that answer tells us that there's no perf difference? 02:08
rassoc wouldn't perf be listed under notable differences if it was significant? 02:10
02:12 _ed joined
codesections Hmm, I'm not sure. That seems like some evidence, but not 100%. In particular, I thought that some (all?) of the perf cost of an `if` came from building a new lexical scope, which is the second bullet 02:16
(the perf cost of it versus other conditionals, I mean – obviously branching code is going to lead to branch prediction misses/less optimized code in general, but that goes for any branching/condititioal) 02:17
02:24 _ed left
rassoc well, what the heck do i know. all my raku stuff runs like arse, not yet qualified to contribute on that front ;) 02:25
codesections well, don't take my word for it, that's for sure! 02:26
02:57 _ed joined 03:02 _ed left 03:12 rassoc left 03:15 _ed joined
moon-child I want to pass a Buf into a nativecall function. Is there a way to do that? 03:17
looks like nativecast(Pointer) will do it 03:18
03:20 _ed left 03:44 gordonfish- joined 03:46 gordonfish left 04:01 lucerne left 04:02 _ed joined
moon-child m: use NativeCall; my Pointer $x; say nativecast(size_t, $x) 04:03
camelia (signal SEGV)
04:03 frost joined
moon-child ^ is that right? Shouldn't it print 0? 04:03
04:07 _ed left 04:20 _ed joined 04:24 sono left, _ed left 04:47 lucerne joined 04:51 _ed joined 04:56 _ed left
tonyo what is your Buf of? 05:13
Buf[uint8] ?
moon-child yeah 05:14
tonyo you likely just want to pass uint8[] and the size 05:15
whatever func(unsigned int xs[], int xl) 05:16
or whatever your actual compiler type is func(uint8_t xs[] ..) 05:17
moon-child no, it's a string
Str on raku side, buffer (not nul-terminated) on c side
tonyo buffer of unsigned chars, then? 05:18
or wide chars?
moon-child regular size chars
nativecast(Pointer) seems to do the job 05:19
tonyo oh, those fools. you can cast pointer but you'll still want the length
unless it's always fixed
moon-child well, yeah, but that's easy
tonyo not if you can't count 05:20
05:20 codesections left 05:38 ufobat__ joined 05:43 ufobat__ left
guifa oof 05:49
I did something that's slowing down my dateish.fmt code. Suddenly got to be an order of magnitude slower =\
05:51 _ed joined 05:55 _ed left 05:58 Doc_Holliwood joined
guifa But … I'm a good 50% faster than sprintf generating a similar string, so I guess it's not terrible then given I'm handling all the same padding features. 05:59
moon-child maybe you should submit a patch to improve sprintf's performance! 06:01
06:02 reportable6 left 06:04 reportable6 joined
guifa moon-child: there's probably a little bit more going on under the hood with sprintf 06:07
but lizmat has been working on optimizing sprintf via caching the formatters, I don't think that's in the master branch just yet
06:09 _ed joined
guifa I'll do the same to my code once that's done and given that doing .&{ .year ~ '-' ~ .month ~ '-' .day } is currently about 30x faster than .fmt('%Y-%m%d') and about 60x faster than sprintf('%d-%d-%d', $date.year, $date.month, $date.day), I'd imagine the cached method will bear some pretty substantially improvements 06:10
s/once that's done/once RakuAST is done
06:14 _ed left 06:15 _ed joined 06:20 _ed left 06:24 lucerne left 06:28 Eddward left 07:03 _ed joined 07:08 _ed left 07:11 Sgeo left 07:17 leah2 left 07:18 Doc_Holliwood left 07:20 lucerne joined, ufobat joined, leah2 joined 07:31 _ed joined 07:45 _ed left 07:56 dakkar joined 08:04 _ed joined 08:08 _ed left 08:15 lucerne left 08:20 _ed joined 08:25 _ed left 08:36 _ed joined 08:40 _ed left 09:07 _ed joined 09:12 _ed left, lucerne joined 09:33 lucerne left, rassoc joined, lucerne joined 09:36 squashable6 left 09:37 _ed joined, squashable6 joined 09:42 _ed left 10:10 b2gills left, gfldex is now known as gfldex_, gfldex_ is now known as gfldex 10:11 gfldex is now known as gfldex_ 10:12 gfldex_ is now known as gfldex 10:13 gfldex is now known as gfldex_ 10:14 gfldex_ is now known as gfldex 10:17 Doc_Holliwood joined 10:25 _ed joined 10:26 squashable6 left 10:27 lucerne left 10:29 squashable6 joined, discord-raku-bot joined
gfldex Discord bridge test. 10:29
10:30 _ed left 10:35 _ed joined 10:36 patrickb joined 10:40 _ed left 10:43 _ed joined, discord-raku-bot left, linkable6 left 10:45 Doc_Holliwood left 10:46 linkable6 joined, discord-raku-bot joined 10:49 Doc_Holliwood joined 10:53 _ed left 10:54 discord-raku-bot left 10:55 linkable6 left 10:56 discord-raku-bot joined 10:58 linkable6 joined 11:01 dogbert17 left 11:07 _ed joined 11:09 dogbert17 joined 11:12 _ed left 11:13 _ed joined 11:17 _ed left 11:24 lucerne joined 11:32 Doc_Holliwood left 11:49 patrickb left 11:51 _ed joined 11:56 _ed left 12:02 reportable6 left 12:03 reportable6 joined 12:04 RandalSchwartz joined 12:11 lucerne left 12:12 lucerne joined 12:14 _ed joined 12:17 Doc_Holliwood joined, MasterDuke left 12:20 _ed left 12:30 jdporter joined 12:32 _ed joined 12:34 discord-raku-bot left 12:37 _ed left, frost left 12:41 jdporter left, nirnam joined 12:48 nirnam left 13:01 Eddward joined 13:07 _ed joined 13:14 jast left 13:15 timo left 13:16 _ed left 13:17 timo joined, discord-raku-bot joined 13:20 jast joined 13:23 b2gills joined 13:59 gordonfish- is now known as gordonfish, smarton left 14:02 smarton joined 14:11 discord-raku-bot left 14:13 Sgeo joined 14:26 rassoc left 14:29 _ed joined 14:34 _ed left 14:36 suman joined
suman m:my $num = 20129201828;my @arr= 2018..2020;if $num ~~/@arr.any/ { say "Matches"} 14:37
evalable6
suman m:my $num = 2012920128282020;my @arr= 2018..2020;if $num ~~/2018|2019|2020/ { say "Matches"} 14:39
evalable6 Matches
suman m: my $num = 2012920128282020;my @arr= 2018..2020;if $num ~~/{2018..2020}/ { say "Matches"} 14:40
camelia Matches
suman m: my $num = 2012920128;if $num ~~/{2018..2020}/ { say "Matches"} 14:42
camelia Matches
14:42 Doc_Holliwood left
suman Why is this code matching? Isn't it supposed to not match? 14:42
m: my $num = 2012920128;if $num ~~/{2018..2020}/ { say "Matches"}
camelia Matches
14:52 _ed joined
moritz you never told raku that you want to match a full string 14:53
so it searches for a substring
m: my $num = 20129201828; my @range = 2018...2020; say $/ if $num ~~ /^@range$/ 14:54
camelia ( no output )
moritz m: my $num = 20129201828; my @range = 2018...2020; say $/ if $num ~~ /^@range/
camelia ( no output )
moritz m: my $num = 2029201828; my @range = 2018...2020; say $/ if $num ~~ /^@range/
camelia ( no output )
moritz m: my $num = 2019201828; my @range = 2018...2020; say $/ if $num ~~ /^@range/
camelia 「2019」
moritz m: my $num = 2019201828; my @range = 2018...2020; say $/ if $num ~~ /^@range$/
camelia ( no output )
moritz but if you just want to check a number, no need to go for a regex
m: say 2019 ~~ 2018..2020 14:55
camelia True
moritz m: say 201933 ~~ 2018..2020
camelia False
14:55 Doc_Holliwood joined 14:58 _ed left
suman m: my $num = 2019201828; my @range = 2018...2020; say $/ if $num ~~ /@range/; 15:03
camelia 「2019」
suman m: my $num = 2019201828; say $/ if $num ~~ /{2018...2020}/;
camelia 「」
suman Is it possible to keep raku expression within regex? 15:04
m: my $num = 2019201828; say $/ if $num ~~ /{2018...2020}/;
camelia 「」
suman in this example range within regex directly
15:11 _ed joined
moritz m: my $num = 2019201828; say $/ if $num ~~ /<{2018...2020}>/ 15:12
camelia 「2019」
moritz see docs.raku.org/language/regexes#Reg...erpolation 15:13
15:19 discord-raku-bot joined, discord-raku-bot left, _ed left 15:20 discord-raku-bot joined 15:21 discord-raku-bot left 15:30 discord-raku-bot joined
gfldex Discord bridge test. 15:31
RandalSchwartz seriously? I can get rid of adium and just use discord? 15:32
gfldex not quite yet
For now I only implemented IRC -> Discord. IRC <-> Discord needs more thinking.
Those Dicord Inc folk really like their rate limiting. :-/ 15:33
15:46 Doc_Holliwood left 15:55 suman left 16:03 amishpa joined 16:09 amishpa left 16:21 _ed joined 16:23 ufobat left 16:26 _ed left 16:36 _ed joined 16:40 _ed left 16:45 dakkar left 16:51 _ed joined 16:55 _ed left 16:59 discord-raku-bot left 17:03 discord-raku-bot joined 17:04 discord-raku-bot left, discord-raku-bot joined 17:10 _ed joined 17:12 notzmv joined 17:15 _ed left 17:20 squashable6 left 17:23 squashable6 joined 17:27 _ed joined 17:31 _ed left 17:37 MoC joined 17:47 RandalSchwartz left 18:02 reportable6 left 18:03 reportable6 joined 18:13 discord-raku-bot left 18:25 Doc_Holliwood joined 18:36 discord-raku-bot joined 18:37 discord-raku-bot left 18:40 _ed joined 18:44 _ed left 18:50 discord-raku-bot joined 18:51 discord-raku-bot left 18:52 discord-raku-bot joined, MasterDuke joined, discord-raku-bot left 18:57 _ed joined 19:01 discord-raku-bot joined
gfldex TIL sub EXPORT can be a multi 19:01
19:02 discord-raku-bot left, _ed left, discord-raku-bot joined 19:03 discord-raku-bot left 19:06 discord-raku-bot joined 19:07 abraxxa-home joined 19:11 discord-raku-bot left 19:12 discord-raku-bot joined, discord-raku-bot left, discord-raku-bot joined 19:38 sono joined 19:48 discord-raku-bot left 19:49 discord-raku-bot joined 19:50 discord-raku-bot left, discord-raku-bot joined 19:54 hankache joined 19:57 melezhik joined
gfldex lolibloggedalittle: gfldex.wordpress.com/2021/06/23/be...agmat-ish/ 19:57
20:06 slu joined 20:13 hankache left 20:17 MoC left, _ed joined 20:22 _ed left 20:32 discord-raku-bot left 20:34 discord-raku-bot joined 20:41 RandalSchwartz joined
Geth doc: 2de140bc33 | Coke++ | 7 files
Remove unneeded 'use v6' from util/

Part of #3905
20:41
20:42 linkable6 left
Geth doc: f8251bedf0 | Coke++ | 2 files
rename to .raku extension

Part of #3905
20:43
20:44 linkable6 joined
[Coke] "oh, a doc commit, c... oh, that was me." 20:51
gfldex you are very commited to the docs :)
20:53 discord-raku-bot left, discord-raku-bot joined 21:07 _ed joined 21:11 _ed left 21:12 squashable6 left 21:14 squashable6 joined 21:17 _ed joined 21:25 _ed left 21:26 Bob joined 21:27 Bob left 21:42 MasterDuke left 22:01 MasterDuke joined 22:32 abraxxa-home left 22:40 Eddward left 23:40 quotable6 left, shareable6 left, tellable6 left, notable6 left, linkable6 left, bloatable6 left, nativecallable6 left, coverable6 left, committable6 left, bisectable6 left, reportable6 left, statisfiable6 left, releasable6 left, greppable6 left, sourceable6 left, benchable6 left, evalable6 left, squashable6 left, unicodable6 left 23:41 committable6 joined, squashable6 joined, releasable6 joined, bloatable6 joined 23:42 greppable6 joined, evalable6 joined, reportable6 joined, tellable6 joined, nativecallable6 joined, notable6 joined, shareable6 joined, linkable6 joined, sourceable6 joined 23:43 statisfiable6 joined, coverable6 joined, quotable6 joined, bisectable6 joined, unicodable6 joined, benchable6 joined
Geth doc: coke self-assigned error when binding variables github.com/Raku/doc/issues/3908
a254a27d09 | Coke++ | 14 files

Update references to old file names
Closes #3905
23:48
23:49 linkable6 left, linkable6 joined
Geth ¦ doc: coke self-unassigned error when binding variables github.com/Raku/doc/issues/3908 23:51
23:54 Doc_Holliwood left 23:56 slu left 23:58 m6502 joined