🦋 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:30
gnufr33dom joined
|
|||
guifa2 | Xliff: I haven't yet, but I'm about to switch to it. The main XML lib is painfully slow because of the way it does mixins | 00:57 | |
00:57
guifa2 left
01:00
aindilis joined
01:12
Toilie is now known as dudz
|
|||
Xliff | Yes. I understand that mixins can be very slow. | 01:15 | |
At least until the new compiler change (supposedly) fixes this. | |||
guifa2: What are you working on, if I may ask? | 01:16 | ||
tellable6 | Xliff, I'll pass your message to guifa2 | ||
01:16
pecastro left
01:19
lucasb left
02:04
wamba left
02:26
kvw_5 joined
02:29
kvw_5_ left
02:46
mowcat left
03:04
Manifest0 left
03:06
Manifest0 joined
03:33
brtastic joined
04:07
rindolf joined
05:07
squashable6 left,
bloatable6 left,
linkable6 left,
notable6 left,
committable6 left,
greppable6 left,
tellable6 left,
benchable6 left,
releasable6 left,
shareable6 left,
coverable6 left,
nativecallable6 left,
sourceable6 left,
bisectable6 left,
statisfiable6 left,
unicodable6 left,
quotable6 left,
evalable6 left,
benchable6 joined,
bloatable6 joined,
squashable6 joined
05:08
notable6 joined,
linkable6 joined,
coverable6 joined,
greppable6 joined,
sourceable6 joined,
quotable6 joined
05:09
releasable6 joined,
statisfiable6 joined,
evalable6 joined,
nativecallable6 joined,
committable6 joined,
unicodable6 joined,
shareable6 joined
05:10
bisectable6 joined,
tellable6 joined
05:16
gnufr33dom left
05:19
gnufr33dom joined
05:40
guifa2 joined
|
|||
guifa2 | o/ | 05:46 | |
tellable6 | 2021-01-24T01:16:14Z #raku <Xliff> guifa2: What are you working on, if I may ask? | ||
guifa2 | Xliff: I'm parsing the CLDR into a compressed/efficient format | 05:47 | |
It takes it about 20-30 seconds to handle each one, and the XML operations are a large portion of that (based on profiling, it's the "but" mixins that are killing it) | 05:48 | ||
Xliff | Ah. I'm doing that a lot in my current projects. | 05:50 | |
So I take it using "but" is a significant performance hit? | |||
It | 05:51 | ||
Ah, the timing couldn't be more auspicious. We're both working in XML. You with CLDR and me with Amazon AWS EC2 api and my GUPnP bindings (wiki.gnome.org/Projects/GUPnP) | |||
My current work is showing progress... see github.com/Xliff/p6-GUPnP | 05:52 | ||
06:03
clarjon1 left
06:05
clarjon1 joined
06:07
asy joined
06:08
asymptotically left
06:18
parabolize left
06:52
Some-body_ joined
|
|||
guifa2 | Xliff: using but once or twice probably doesn't have huge implications, but the way XML (as opposed to LibXML), it does lots of substring operations that are then butted to add on the XML-ish roles | 06:54 | |
06:55
Some-body_ is now known as DarthGandalf
|
|||
Xliff | Oh, ouch! | 07:04 | |
guifa2 | Yeah. I was a bit relieved to know it wasn't my code, although since it's all in a preprocessing phase, it's not the end of the world | 07:23 | |
ugh | |||
speaking of long times | |||
my FOSDEM talk is a solid 10 minutes over | 07:24 | ||
guifa2 wonders what he can cut | |||
scratch that, I'm oevr by 15 minutes! :-( | 07:26 | ||
Xliff | Ah. | 07:29 | |
Have fun at FOSDEM! | |||
What's your talk going to be about? | |||
guifa2 | Basically how to make a smart module | 07:31 | |
but also an ode to Raku's elegance | |||
Xliff | A smart module? | 07:48 | |
07:55
linkable6 left,
evalable6 left
07:57
linkable6 joined,
evalable6 joined
|
|||
guifa2 | smart = one that is very Raku-ish and user friendly | 08:03 | |
I'll probably do a text-based guide at some point too | 08:13 | ||
.tell jmerelo I've got the talk down to 52 minutes, exporting the video but looks like my laptop will take a bit. Sleeping now but will upload it in the AM and see if I can cut down a few more minutes to do an afternoon upload | 08:14 | ||
tellable6 | guifa2, I'll pass your message to jmerelo | ||
08:24
wamba joined
08:36
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
ens | i am also doing some stuff and need to parse some xml from an rss feed | 08:41 | |
08:43
aborazmeh left
08:48
gnufr33dom left
08:59
JRaspass left,
aborazmeh joined,
aborazmeh left,
aborazmeh joined
09:05
aborazmeh left
|
|||
ens | is there a way to see larry's fosdem talk online? I heard he gave an entire talk with in analogies to lord of the rings. | 09:12 | |
09:25
Garbanzo left
09:27
Garbanzo joined
09:41
Garbanzo left
10:07
Sgeo left
10:26
sena_kun joined
10:29
stoned75 left
|
|||
El_Che | sadly, the FOSDEM recording was lost/failed | 10:36 | |
and he did (I was there) | |||
10:42
MasterDuke joined
|
|||
lizmat | a while ago Andrew Shitov posted his (bootleg) audio recording of Larry's talk | 11:17 | |
11:23
Geth joined
11:25
asy is now known as asymptotically
11:48
leah2 left
12:01
leah2 joined
12:02
pecastro joined
12:04
stoned75 joined
12:13
aborazmeh joined,
aborazmeh left,
aborazmeh joined
12:30
sjm_uk joined
|
|||
ens | i am a bit new. i am trying to do some regexes on some stuff i'm getting back from: my $content = LWP::Simple.get($url); | 13:01 | |
but it just seems to not really like it. Also when i try to 'say $content' it comes out as hex (but the hex data looks correct) | 13:02 | ||
do i need to convert it from a Buf to something else first? | |||
13:11
aborazmeh left
13:22
jmchael joined
13:28
stoned75 left
13:29
aborazmeh joined,
aborazmeh left,
aborazmeh joined
13:38
aborazmeh left
13:56
MasterDuke left
14:06
sena_kun left
|
|||
ens tugs on raku-channel sleeve | 14:19 | ||
halp | |||
14:20
bdju left
14:21
bdju joined
|
|||
Tirifto[m] | ens: I’m a bit new, too, but I’ll try to reproduce! | 14:23 | |
ens | thanks Tirifto[m] . i think i found something that might solve this. | ||
perl6advent.wordpress.com/2011/12/...binary-io/ | |||
this says i can do $str = $content.decode('UTF-8') to convert it | |||
i kinda wonder if this is the correct approach... but it seems to work at least! | 14:24 | ||
14:25
Black_Ribbon left
|
|||
Xliff | ens: Sorry I didn't see your call for help sooner. From Buf to something Stringy is as simple as $buf.decode. UTF-8 is the default so you don't need to specify it. | 14:29 | |
You coudl also do something like $buf.decode('ASCII') if that buffer is encoded in that way. | 14:30 | ||
14:32
lucasb joined
|
|||
ens | thanks Xliff | 14:32 | |
Tirifto[m] | I’m guessing it returns something Buf since a webpage could use any of the various encodings? | 14:35 | |
ens | what i find slightly amusing then is that the encoding is given in text "<?xml version="1.0" encoding="UTF-8"?>" which means i have to convert to a string in order to know what encoding it is. | 14:37 | |
but i guess it is easy enough to just check the page and just use that and presume it won't change any time soon. | 14:38 | ||
timotimo | xml is specified as a binary format i think? | 14:45 | |
hm. that would be very weird with utf16 or ucs16 | |||
actually | 14:47 | ||
i do not wish to find out | 14:48 | ||
but the http result message should also contain a Content-Type that can include an encoding | |||
ens | that makes sense i suppose. | 14:55 | |
my next challenge is to parse this xml data. I have decided that it is not the best idea to use a regexp | 14:56 | ||
so i am now using XML::Parser::Tiny | |||
I feed it this: pastebin.com/tBXZyLpN and the result structure looks like this: pastebin.com/Z06eUcy8 | |||
kiti_nomad[m] | I often fail to install modules with cpan, and often fail with cpanm. But I use the option --force but almost all succeed. So why does the regular installation make any sense? | 14:57 | |
ens | i'm trying to extract <news:title> and <news:publication_date> from the listing. | ||
looks like i need to get an array of all things under '<urlset>' tag and then i suppose it would be the element under <url> in each of those. inside that get into <news:news> and get the relevant tags under there. | 15:00 | ||
Tirifto[m] | ens: I searched for a bit and ended up looking at the standard. Apparently it’s best if you get the enocding information externally, but since the internal declaration comes at the beginning of the file, XML parsers should be able to figure it out with some magic. | ||
15:00
Xliff left
15:23
parabolize joined
|
|||
ens | hrm. so i am doing: my $tree = $parser.parse($xml); | 15:25 | |
#say $tree.perl; | |||
my %t = $tree; my %body = %t{':body'}; say %body.perl; | 15:26 | ||
it says: Odd number of elements found where hash initializer expected: Only saw 1 element in block <unit> at ./h.p6 line 28 | 15:27 | ||
but in the dumped structure it says the stuff under :body should be a hash... | |||
15:31
mowcat joined
|
|||
Tirifto[m] | ens: Shouldn’t it be just %t{'body'}, without the colon? | 15:33 | |
ens | progress! thanks. | 15:35 | |
Tirifto[m] | I think the output was just using one of the many syntaxes for Pairs: docs.raku.org/type/Pair | 15:36 | |
15:39
elcaro left
15:40
elcaro joined
|
|||
ens | so hashes are classes with methods in raku. that is nice | 15:51 | |
Tirifto[m] | It is! I think everything can be regarded as an object in Raku. :-) | 15:54 | |
15:55
stoned75 joined,
stoned75 left
15:58
leah2 left
15:59
leah2 joined
|
|||
Tirifto[m] | By the way: Does someone know of a way to convert a string into a regular expression? For example, ‘\w+’ into /\w+/? I have read about regex interpolation, but that doesn’t seem to do what I want: | 16:01 | |
p6: my $h = ‘H.y’; my $r = / <$h> ‘ ’ Jude /; say(‘Hey Jude’ ~~ $r); $h = ‘Hi’; say(‘Hey Jude’ ~~ $r); | |||
camelia | 「Hey Jude」 Nil |
||
moritz | Tirifto[m]: my $rx = rx/<$r>/ | 16:02 | |
Tirifto[m]: also, now I have that song in my head. Thanks :/ :-) | 16:03 | ||
Tirifto[m] | moritz: The problem seems to persist for me, meaning that instead of interpolating the variable into the regex at the time of creation, it is interpolated anew whenever the regex is used. (Like so, it feels as if the variable were dynamic.) | 16:04 | |
moritz: And of course, you are welcome. :P | 16:05 | ||
(In this particular example, I’d like for $r to never look at $h again, that is for the regex to keep matching /H.y ‘ ’ Jude/, even if $h changes or disapperas.) | 16:07 | ||
16:18
b2gills left,
b2gills1 joined
|
|||
cog_ | m : say $*KERNEL.signals | 16:21 | |
m: say $*KERNEL.signals | |||
camelia | [(Any) SIGHUP SIGINT SIGQUIT SIGILL SIGTRAP SIGABRT SIGBUS SIGFPE SIGKILL SIGUSR1 SIGSEGV SIGUSR2 SIGPIPE SIGALRM SIGTERM SIGSTKFLT SIGCHLD SIGCONT SIGSTOP SIGTSTP SIGTTIN SIGTTOU SIGURG SIGXCPU SIGXFSZ SIGVTALRM SIGPROF SIGWINCH SIGIO SIGPWR SIGSYS T… | ||
cog_ | m: say $*KERNEL.signals[*-1] | 16:22 | |
camelia | True | ||
cog_ | Why the Any at the start and the true at the end ? | ||
16:26
_jrjsmrtn joined
16:27
__jrjsmrtn__ left
|
|||
lizmat | cog_ : the Any at the beginning is to allow for easier indexing: there is no signal 0 I believe (at least not trappable) | 16:59 | |
as to why the last one is True, I have no idea | 17:01 | ||
guifa2 | Tirifto[m]: if you need to freeze the regex in place, you can use an enclosure. But regexen are just specialized code blocks, that's why the variable is evaluated several times over | 17:06 | |
17:08
sjm_uk left
|
|||
Tirifto[m] | guifa2: What do you mean by enclosure? I tried enclosing it in a block to see if that was what you meant, and it seems to work if I prefix it with ‘do’, but I’m not sure why. :P | 17:19 | |
p6: my $r = do { my $h = ‘H.y’; rx/ <$h> ‘ ’ Jude / }; say(‘Hey Jude’ ~~ $r); my $h = ‘Hi’; say(‘Hey Jude’ ~~ $r); | |||
camelia | 「Hey Jude」 「Hey Jude」 |
||
17:24
mowcat left
|
|||
guifa2 | Tirifto[m]: I mean like this: my $h = ‘H.y’; my $r; {my $temp = $h; $r = / <$temp> ‘ ’ Jude /}; say(‘Hey Jude’ ~~ $r); $h = ‘Hi’; say(‘Hey Jude’ ~~ $r); | 17:30 | |
the $temp value is enclosed in that block, and never changes | |||
Tirifto[m] | Ohhh, I see now! I guess what I wrote amounts to the same thing then. | 17:34 | |
guifa2: Once again, thanks for help! :-) | 17:35 | ||
17:35
domidumont joined
17:37
gnufr33dom joined
|
|||
cog_ | Thx, lizmat | 17:38 | |
lizmat | cog_ the last True feels like a bug BTW | ||
cog_ | Lizmat: bug true of Big Sur as well, btw | 17:39 | |
lizmat | same on Mojave fwiw | ||
or on Linux, as that is what camelia runs on | 17:40 | ||
guifa2 just realized he called lizmat "lizmat" in his presentation. naming fail | 17:41 | ||
cog_ | On a related note, what is the equivalent of perl waitpid ? The doc does not help. docs.raku.org/language/5to6-perlfu...-_perlfunc | ||
guifa2 | (although I imagine all tech conferences have the issue of username vs real name) | 17:42 | |
moritz | cog_: if you spawn a program with Proc::Async, you can await the promise that it returns | ||
there's also a POSIX module if you need the C-level function | 17:43 | ||
cog_ | Motitzm that makes sense. Btw, he raku doc is lacking in that area if you try to enter it thru the signal perspective | 17:44 | |
18:05
JRaspass joined,
mario__ joined
|
|||
mario__ | Hi | 18:06 | |
18:12
natrys joined
18:15
mowcat joined
18:21
mario__ left
18:47
mario1 joined
18:48
sena_kun joined
|
|||
El_Che | ik was de elek offertes aan het bekijken | 18:51 | |
de elektricien: doe je iets met IT? | |||
omdat utp6 in offerte stond :) | |||
voor bureau beneden en AP heb ik kabel voorzien | |||
ik vraag met af of ik utp ga voorzien in de slaapkamers (waar kinderen hun bureau hebben) | 18:52 | ||
oops | 18:53 | ||
ignore the dutch | |||
:) | |||
(and if understand it, feel free to advice me :) ) | |||
18:53
mario1 left
19:01
Garbanzo joined
19:05
Xliff joined
19:15
[Sno] left
19:30
Sgeo joined
19:48
domidumont left
20:02
[Sno] joined
20:10
aborazmeh joined,
aborazmeh left,
aborazmeh joined
20:22
brtastic left
20:33
rindolf left
20:36
natrys left
20:39
Air4x joined
20:41
wamba left,
wamba joined
20:55
JRaspass left
20:58
Air4x left
21:01
Air4x joined
|
|||
gfldex | lolibloggedalittle: gfldex.wordpress.com/2021/01/24/chain-calling/ | 21:13 | |
Xliff | There is a .chain, gfldex? | 21:20 | |
gfldex++ # Nice post! | 21:21 | ||
21:24
Air4x left
21:25
Air4x joined
21:27
Air4x left
21:31
Xliff left
21:42
aborazmeh left
21:46
notagoodidea joined
|
|||
notagoodidea | Is it someone that can replicate a weird behavior from the REPL + Linenoise? (It is coming from Linenoise, I am pretty sure) | 21:47 | |
To replicate : type "foo é " and backspace to remove the space after "é". The cursor will stay at the same position. | 21:50 | ||
21:50
wamba left,
wamba joined
|
|||
notagoodidea | And typing backspace again will remove the é but the cursor will be where the space was so at a +1 position as if "é" was treated like 2 characters. | 21:50 | |
and if you type other stuff after and hit backspace to delete a space or a character, it will realign the line correctly. | 21:52 | ||
tony-o | likely a terminal issue | 22:19 | |
doesn't happen for me in iterm | |||
notagoodidea | I am using kitty + fish | ||
tobs .oO( you won't have that fish for long then ) | 22:20 | ||
notagoodidea | :D | ||
tony-o | disregard, it loaded readline - that happens on iterm2 too. | 22:21 | |
it doesn't muck up the spacing but does do some weird character stuff | |||
notagoodidea | m: my %outer = 1, 2 Z=> <a b>; my %inner = 1 Z=> 'x'; say %outer <<~>> %inner; say %outer >>~<<; say %outer >>~>> %inner; | 22:34 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing required term after infix at <tmp>:1 ------> 3ay %outer <<~>> %inner; say %outer >>~<<7⏏5; say %outer >>~>> %inner; expecting any of: prefix term |
||
notagoodidea | tony-o: I am not sure how Linenoise handle multi-bytes characters or if treats them as a sum of 2 asci characters "«" being "<<" and "é" being "'e". | 22:36 | |
hum. it seems that Linenoise (the C lib) don't have UTF-8 support. | 22:37 | ||
tony-o | guess it's not a bug | 22:40 | |
22:42
gordonfish left
23:17
wamba left
23:21
mowcat left
23:22
lucasb left,
gordonfish joined
23:39
Black_Ribbon joined
23:43
mowcat joined
23:49
mowcat left
|