🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
00:03 discord-raku-bot left, discord-raku-bot joined 00:07 reportable6 left 00:15 Geth left 00:16 Geth joined
leont There was a way in this channel to run a raku sniplet on a bunch of different versions, right? 00:21
guifa bisectable 00:30
00:32 hasrthur left
leont bisectable: say sub foo(Str :@foo) { say "success" }.cando(\()) 00:38
bisectable6 leont, Will bisect the whole range automagically because no endpoints were provided, hang tight
leont, ¦6c (60 commits): «()␤»
leont, Nothing to bisect!
leont bisectable6: help
bisectable6 leont, Like this: bisectable6: old=2015.12 new=HEAD exit 1 if (^∞).grep({ last })[5] // 0 == 4 # See wiki for more examples: github.com/Raku/whateverable/wiki/Bisectable
leont bisectable6: old=2015.12 new=HEAD say sub foo(Str :@foo) { say "success" }.cando(\()) 00:39
bisectable6 leont, On both starting points (old=2015.12 new=3823f88) the exit code is 0 and the output is identical as well
leont, Output on both points: «()␤»
perryprog commit: say sub foo(Str :@foo) { say "success" }.cando(\())
committable6 perryprog, Seems like you forgot to specify a revision (will use “v6.c” instead of “say”)
perryprog, ¦v6.c (60 commits): «()␤»
perryprog commit: releases sub foo(Str :@foo) { say "success" }.cando(\())
leont should read the wiki first 00:40
committable6 perryprog, ¦releases (60 commits): «»
perryprog leont :(
leont bisectable6: old=2015.12 new=HEAD exit ?sub foo(Str :@foo) { say "success" }.cando(\())
bisectable6 leont, On both starting points (old=2015.12 new=3823f88) the exit code is 0 and the output is identical as well
leont, Output on both points: «»
leont commit: say sub foo(Str :@foo) { say "success" }.cando(\()) 00:41
committable6 leont, Seems like you forgot to specify a revision (will use “v6.c” instead of “say”)
leont commit: v6.c say sub foo(Str :@foo) { say "success" }.cando(\())
committable6 leont, ¦v6.c (60 commits): «()␤» 00:42
leont I really thought I had seen that work at some point, but apparently my memory is wrong
01:09 reportable6 joined
lucs Is there something like (elem) that could give me the index of the found element? 01:51
japhb lucs: (elem) is a set-like operator, and sets are unordered. Are you looking for something like .first(:k)? 01:53
moon-child m: say <a b c>.first('b', :k)
camelia 1
lucs japhb: I believe I am :-) 01:54
Thanks japhb and moon-child.
japhb :-)
moon-child one thing to watch out for: 0 is falsy. <a b c>.first('a', :k) is 0, <a b c>.first('d', :k) is Nil 01:55
lucs Gotcha.
01:59 linkable6 joined 02:32 hasrthur joined 02:34 xinming left 02:36 xinming joined 02:37 hasrthur left
guifa (one of the really nice differences between with and if. with requires a defined value — which Nil is not, but 0 is, so if you anticipate 0 or empty string/lists but not as falsey values, use with) 03:36
03:37 linkable6 left, evalable6 left
lucs tweaks his code. 03:39
Thanks for the reminder guifa :)
03:39 linkable6 joined 03:40 evalable6 joined
leont really likes combining with with named block arguments 04:04
«with some.expression() -> $value {}» is so much better than «if defined(my $value = some.expression()) {}» 04:05
lucs tweaks his code some more :) 04:07
leont (erm, I meant normal block arguments, these aren't named) 04:14
04:19 perlbot left, simcop2387 left 04:30 simcop2387 joined, frost joined 04:32 perlbot joined 05:09 Altai-man joined 05:11 sena_kun left 05:49 frost left 06:07 reportable6 left 07:07 linkable6 left, evalable6 left 07:08 reportable6 joined 07:10 linkable6 joined 07:19 seednode99 left 07:20 seednode99 joined 08:08 evalable6 joined 08:34 dakkar joined 08:55 ufobat joined 09:07 tejr left, tejr joined 09:40 linkable6 left 09:43 dakkar left 10:33 Sgeo left 10:35 ufobat left 10:41 linkable6 joined 10:43 jjido joined 11:25 eseyman joined 11:26 nine left 11:27 nine joined 11:53 hasrthur joined 11:59 jjido left 12:08 reportable6 left 12:41 frost joined 13:10 frost left 13:11 reportable6 joined
tbrowder howdy, folks 13:26
lizmat tbrowder o/
tbrowder you're up late! 13:28
13:28 frost joined
lizmat ?? it's 2.30 pm here ? 13:28
tbrowder sorry, my tz sense is off!
.oO( it's all relative )
tbrowder i've been working on tail end of my day more 13:29
i don't see much on 2d array in docs. do i remember seeing some syntax like @a[1;3]? 13:32
for row 1, col 3 13:33
Geth CCR: sjn++ created pull request #4:
Jnthn's presentation at NUUG, 2010-09-14
tbrowder or can we fake [][] using AT-POS somehow on a class
maybe back later today, bye-bye 13:38
lizmat make sure your outer AT-POS returns an object that the inner AT-POS can work on? 13:48
13:48 discord-raku-bot left 13:51 discord-raku-bot joined 14:29 frost left 14:45 frost joined 14:55 getimiskon joined
Anton Antonov I there a package/module for extracting plain text from HTML strings? 15:06
15:25 frost left
lizmat Anton Antonov: (run lynx $url, :out, :!err).out.slurp ? 16:15
16:25 evalable6 left, linkable6 left, linkable6 joined
ugexe .slurp(:close) 16:26
moon-child I used HTTP::UserAgent 16:36
seems to work pretty well
ugexe that wouldn't strip the html tags would it? 16:37
moon-child OH
I misread the original request
and I misread lynx as curl
should say misinterpreted, I guess 16:38
ugexe i'd think libxml would work
moon-child yeah I've used XML::Text and gumbo, both worked fine, but that's a lot more work (and more error-prone) than shelling out ot an actual web browser 16:39
(note: iirc gumbo is supposed to be fast, but for what I used it it was somewhat slower than XML::text; maybe conv overhead idk) 16:40
16:42 ufobat joined
Anton Antonov Thank you all for the suggestions! 16:43
@lizmat I did not have `lynx` ; I installed it. Had to fiddle with certificates settings. The command that worked is this `run('/usr/local/bin/lynx', '-dump', $url, :out, :!err).out.slurp(:close)` 17:10
@moon-child I was thinking to use XML::<Something> libraries, but I spent too much time with `lynx` and it worked, so some another time... 17:12
17:25 seednode99 left 17:26 seednode99 joined, evalable6 joined 17:29 Skarsnik_ is now known as Skarsnik
How can find who contributed Raku code to rosettacode.org/ ? And more specifically the Raku code for Finite State Machines : rosettacode.org/wiki/Finite_state_machine#Raku . 17:43
(I would like to give proper reference / credit in my packages and talks...)
18:08 reportable6 left
lizmat Anton Antonov: rosettacode.org/mw/index.php?title...on=history 18:12
will be messy, would have to go by commit messages :-( 18:13
18:22 ufobat left 18:33 dogbert11 left 18:34 dogbert11 joined
Anton Antonov Ah -- good reason to postpone it indefinitely... 🙂 I was also kind of hoping that some here would proclaim authorship. 18:43
19:11 reportable6 joined 19:12 timo joined 19:14 clarjon1 joined 19:18 Sgeo joined 19:38 clarjon1 left 19:39 clarjon1 joined
MasterDuke i think thundergnat has done a bunch 19:48
guifa lizmat later today you're FINALLY going to see my took-way-longer-than-it-should-have new release of DateTime::Timezones :-) 19:57
hopefully it will work well for the logger
lizmat hopes so too :-) 19:58
guifa is really secretly just hoping lizmat will bug test it for him haha
lizmat I might :-)
20:01 dextercd joined
guifa The good thing is that I finally really understand how the tz codebase works, so you could also have methods like "DateTime.next-dst-change" and "DateTime.last-dst-change" (that's the only one that comes to mind, but i'm sure I could think of other stuff down the road) 20:01
Anton Antonov @MasterDuke Ok, thanks!
MasterDuke i'm pretty sure i would use DateTime.ante-penultimate-dst-change on a daily basis 20:02
is the same one guy still maintaining the tz database? 20:04
20:18 Skarsnik_ joined 20:22 Skarsnik left
m_athias MasterDuke: he is. 20:23
MasterDuke wow 20:25
20:25 lichtkind joined 20:31 nebuchadnezzar left, nebuchadnezzar joined
japhb Olson? 20:40
That's ... dedication.
20:53 discord-raku-bot left 20:54 discord-raku-bot joined
m_athias IIRC olson wrote the code and eggert maintained the data. there was some podcast about it some time ago but I didn't manage to dig it out. 20:55
21:54 evalable6 left, linkable6 left 21:56 linkable6 joined 22:37 getimiskon left 22:45 djerius left, djerius joined 22:48 sena_kun joined 22:49 Altai-man left 22:55 Curiosa joined
Curiosa Would it be possible to write an assembler in Raku that takes as input some text and outputs Blobs, then use Nativecall to invoke those Blobs as native functions? 23:09
moon-child Curiosa: you would need to use mmap
I have a demo, one sec lemme see if I can find it
Curiosa: ix.io/2W7Q/perl6
Curiosa That’s great! 23:10
Well, one would need to write an assembler around that 23:14
23:16 Esoren joined
moon-child yeah 23:16
but this is the 'invoke those blobs as native functions' part
Curiosa One could start with a primitive assembler like the one in this video: m.youtube.com/watch?v=Z73eKb2-YrU&t=30 23:17
Of course for x64 it’s more difficult
23:27 Curiosa left 23:31 lichtkind left
guifa MasterDuke japhb m_athias Olson wrote the initial code, etc, but now it's handled by IANA who has a process set up for updates 23:34
23:35 Curiosa joined
Curiosa Let’s say one want to write a miniassembler like the one in video. Is there a way from Nativecall to get the symbol tables? 23:39
moon-child Curiosa: what do symbol tables have to do with an assembler? What are you tryihng to do? 23:42
23:44 monkey_ joined, hasrthur left
Curiosa Just tell ant to mess around 23:45
He symbol table is useful 23:46
Because on the 6502 you knew where all the important values and procedure were located in the rom
In a modern OS it’s all dynamically randomized 23:47
So you need to find them
moon-child Sure. So: grab function symbol, nativecast to pointer, nativecast to size_t, copy it into your buffer
Curiosa that works 23:48
You could also pass it as an argument to the function 23:49