🦋 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:13
xinming_ left,
xinming_ joined
00:21
ex_nihilo joined
00:26
astronavt joined
00:30
ChoppedBacon left
00:31
xinming_ left
00:32
xinming_ joined,
Garbanzo left
00:33
Garbanzo joined,
Doc_Holliwould left
00:38
neshpion left
00:41
neshpion joined
00:46
xinming_ left
00:47
xinming_ joined
00:53
pecastro left
01:03
epony joined
01:27
marcusr left
01:28
marcusr joined
|
|||
japhb | camelia: my $a = chr(0x41); my $ring = chr(0x30a); my $a-with-ring = $a ~ $ring; my $angstrom = chr(0x212b); my $insert = 'AB'; substr-rw($insert, 1, 0) = $ring; for $a, $ring, $a-with-ring, $angstrom, $insert { say "$_: { .ords.map(*.fmt('%X')) }" } | 01:28 | |
m: my $a = chr(0x41); my $ring = chr(0x30a); my $a-with-ring = $a ~ $ring; my $angstrom = chr(0x212b); my $insert = 'AB'; substr-rw($insert, 1, 0) = $ring; for $a, $ring, $a-with-ring, $angstrom, $insert { say "$_: { .ords.map(*.fmt('%X')) }" } | 01:29 | ||
camelia | A: 41̊: 30A Å: C5 Å: C5 ÅB: C5 42 |
||
01:29
MasterDuke left,
marcusr left
|
|||
japhb | That's promising at least -- I can create from codepoints, or even insert into the middle of a string, and it canonicalizes across the boundary. | 01:30 | |
01:31
marcusr joined
01:34
leont left
01:43
aborazmeh left,
marcusr left
01:45
marcusr joined
01:59
cpage left
02:01
cpage joined,
gnufr33dom joined
02:02
aborazmeh joined
|
|||
elcaro | codesections: I found - on windows at least - I could not paste unicode glyphs into Alacritty | 02:02 | |
I believe there's a GH issue on Alacritty repo to add proper unicode support, so my take-away was the Unicode support was not great | |||
codesections | Interesting. I used mlterm for a bit – and claiming good unicode support is almost their whole deal – but was still getting errors after extensive troubleshooting. And they all went away with the default config on alacritty | 02:06 | |
codesections shrug | |||
02:15
Froogal joined
02:17
Froogal left
02:19
Froogal joined
02:54
kvw_5_ joined
02:58
kvw_5 left
03:07
aborazmeh left
03:27
orinthe left,
orinthe joined
|
|||
Froogal | How are dependencies handled in Raku modules? By zef? | 03:29 | |
I want to write a Module that relies on WWW and multiple other modules. | |||
summerisle | zef, yes. use mi6 to set up your project structure and it should generally be a breeze from there, in my experience | 03:31 | |
guifa2 | in your meta6.json, there's an entry for dependencies. if someone installs your module using zef | ||
zef will check each dependency, and see if they're present at the required ver/auth. If not, it'll fetch them | 03:32 | ||
Froogal | cool beans! Raku is such a breeze to work with so far lol | ||
03:34
xinming_ left,
xinming_ joined
|
|||
summerisle | integrating native code (e.g. stuff that needs to go VERY fast such as checksums) into the build process can be a bit cumbersome, but the resources system makes loading it easier once you deal with the build | 03:35 | |
better than XS, which I have never really touched | 03:36 | ||
guifa2 | I'm actually going to be writing a whole how-to on making a module | 03:37 | |
Froogal | guifa2 cool! I would love to take a look | 03:38 | |
guifa2 | but it'sonly about 20-25% done. Basing it on the units formatter | ||
Froogal | sumerisle whats XS? | ||
summerisle | |||
summerisle | XS is a set of tooling and macros used to build native code that integrates with Perl 5 code | 03:39 | |
perldoc.perl.org/perlxs | |||
better than having to do piles of heavy lifting to go between managed and native code, but still not as good as NativeCall in Raku | 03:40 | ||
and i have been buried in nativecall for most of february | |||
guifa2 | codesections: oh, if you have a commit bit, github.com/Raku/ecosystem/pull/582 ? (I feel dirty committing my own things so lol) | 03:41 | |
Froogal: github.com/alabamenhu/IntlFormatUn...ng-of-1.md <-- part one, but this doesn't really talk about the module making yet at all | 03:46 | ||
Froogal | guifa2 sweet! Thanks | 03:47 | |
04:08
xinming_ left
04:10
xinming_ joined
04:25
xinming_ left,
xinming_ joined
04:44
gabiruh left
04:45
gabiruh joined
04:48
Froogal left,
xinming_ left
04:49
xinming_ joined
05:04
aluaces joined
05:07
xinming_ left
05:08
xinming_ joined
05:13
parabolize left
05:18
tejr left,
tejr joined
05:26
neshpion left
05:29
mowcat left
05:39
xinming_ left,
xinming_ joined
05:46
berber44 joined
05:49
xinming_ left,
xinming_ joined
06:01
xinming_ left
06:02
xinming_ joined
06:09
tejr left,
tejr joined
06:12
aindilis left
06:18
xinming_ left
06:19
xinming_ joined
06:23
aborazmeh joined
06:28
sortiz left
06:38
__jrjsmrtn__ joined
06:39
_jrjsmrtn left
06:43
guifa2 left
06:45
ufobat_ joined
06:55
squashable6 left
06:58
squashable6 joined
07:06
Doc_Holliwould joined
07:17
xinming_ left
07:19
xinming_ joined
07:33
xinming_ left,
xinming_ joined
07:41
Garbanzo left
07:44
abraxxa left
07:48
Nora joined
07:51
abraxxa joined
07:53
Sgeo left
07:55
abraxxa left
07:56
abraxxa joined
07:59
xinming_ left,
xinming_ joined
08:00
Nora left
08:06
MasterDuke joined
08:16
xinming_ left,
xinming_ joined
08:29
aborazmeh left
08:31
orinthe left,
orinthe joined
08:33
Doc_Holliwould left
08:37
xinming_ left
08:39
Geth joined,
xinming_ joined
08:40
dakkar joined
08:47
domidumont joined
08:49
gnufr33dom left
08:55
pecastro joined
09:08
leont joined
09:16
xinming_ left,
xinming_ joined
09:19
sena_kun left
09:26
patrickb joined
09:27
xelxebar left,
xelxebar_ joined
09:28
xinming_ left,
xinming_ joined
09:35
sena_kun joined
09:53
Scimon joined
10:03
ab5tract joined
10:26
patrickb26 joined
10:27
patrickb left
|
|||
gfldex | lolibloggedalittle: gfldex.wordpress.com/2021/02/17/method-ish/ | 10:27 | |
10:38
xinming_ left,
xinming_ joined
10:53
xelxebar_ left
10:54
xelxebar joined
11:07
Black_Ribbon left
11:18
Geth left
11:21
wamba joined
11:56
wamba left
12:14
wamba joined
12:21
sena_kun left
12:28
jcarty joined
12:40
sena_kun joined
12:55
sena_kun left
12:56
sena_kun joined,
jcarty left
13:02
rindolf joined
13:42
guifa2 joined
13:50
aborazmeh joined,
aborazmeh left,
aborazmeh joined
13:56
Altai-man_ joined
13:58
sena_kun left
14:01
guifa2 left
14:06
sena_kun joined,
aborazmeh left
14:08
Altai-man_ left
14:20
marcusr left
14:21
marcusr joined
14:24
ab5tract left
14:44
xelxebar left,
xelxebar joined
14:59
Doc_Holliwould joined,
astronavt left
15:09
Sgeo joined
15:18
PimDaniel joined
|
|||
PimDaniel | Hello. | 15:18 | |
\o | |||
Has an Opcroft and Karp Algorithm been implemented into Raku? | 15:19 | ||
It is an algorithm to find the maximum matches in a bipartit graph. | 15:20 | ||
Just to know because one exist in Python and i'm about to rewrite it in Raku but if it has been already done : i'll loose my time. Thank's. | 15:22 | ||
sena_kun | PimDaniel, I doubt it is (see no libraries nor snippets), so feel free to port && release a library. | 15:23 | |
PimDaniel | Thank's sena_kun, ok, i'll try that! | 15:24 | |
15:24
patrickb joined
15:26
patrickb26 left
15:35
PimDaniel left
15:51
parabolize joined
16:19
mowcat joined
16:46
berber44 left
17:08
xinming_ left
17:09
xinming_ joined
17:34
Scimon left
17:36
dakkar left
17:47
ab5tract joined
17:49
Garbanzo joined
17:51
aborazmeh joined
17:53
Discipulus joined
18:02
aborazmeh left
18:06
aborazmeh joined
|
|||
jmerelo | There's still time to suggest new ideas for Google Summer of Code perl-foundation-outreach.github.io...021-ideas/ or to volunteer as a mentor, should it be funded | 18:16 | |
tonyo | jmerelo: i can mentor on rakumod | 18:18 | |
or just do it | 18:19 | ||
18:21
domidumont left,
ufobat_ left
|
|||
jmerelo | tonyo: Can you please add yourself to the project via PR? Thanks a lot... | 18:21 | |
TBH honest, someone doing it is probably the shortest path... But still, if someone is interested enough in a project to actually do it, they would make a great mentor too :-) | 18:22 | ||
tonyo | where do i send the PR? | 18:24 | |
codesections | And there's always the (not tiny) chance that a mentee turns into a long-term contributor | ||
tonyo | fewer users means fewer bugs discovered | ||
as uses approaches zero .. | 18:25 | ||
how do you have 1k repos jmerelo , holy s | |||
perry | Holy moly | 18:26 | |
codesections | "fewer users"? | 18:27 | |
tonyo | making a joke codesections | ||
codesections | ah. I guess I don't get it, but explaining would probably kill it. so nvm | 18:28 | |
jmerelo | tonyo: I do _everything_ in GitHub. Classes, talks... novels. | 18:29 | |
tonyo PR here github.com/perl-foundation-outreac...akumods.md | |||
tonyo | sent | 18:30 | |
jmerelo | tonyo: if you want to take the lead, I'd gladly step aside. Anyway, that's all dependent on Google footing the bill and someone picking up that project. Checking the PR | 18:31 | |
Accepting the PR. Thanks! | |||
18:33
PimDaniel joined
|
|||
tonyo | i'm wholly unfamiliar with the gsoc stuff, if the lead is just helping someone in writing code then i can do that. if it involves dealing with google or whoever then i'm likely not a good candidate for that. | 18:33 | |
PimDaniel | hi | 18:35 | |
Hi all! I really cannot see what is the difference between @list = (1,2,3); and @list = [1,2,3]; | |||
summerisle | m: (1,2,3).WHAT.say; [1,2,3].WHAT.say | ||
camelia | (List) (Array) |
||
PimDaniel | So there's none differences. | 18:36 | |
summerisle | well, sort of | ||
PimDaniel | An array is a list of thing and a list too. | ||
summerisle | The semantics of a List are Different from an array. Lists are immutable, where arrays are not, for instance. | 18:37 | |
PimDaniel | But why lists are immutables? What are they aimed for? | ||
jmerelo | tonyo: well, it involves at least a mid-term report. But leading the project need not include writing reports. So we'll see when we get there. | ||
summerisle | PimDaniel: sequences of data, potentially lazy sequences, etc... there are occasions where you might want immutability | 18:38 | |
with that having been said, assigning a list to an array container (@) will convert the list to an array | |||
m: my @was-list = (1,2,3); @was-list.WHAT.say | |||
camelia | (Array) | ||
jmerelo | PimDaniel: many basic data structures are inmutable, but they have a mutable version. It's Array in the case of lists | ||
codesections | Many programmers (esp. those who like functional programming) see advantages in immutable data structures, so Raku provides a lot. | 18:39 | |
jmerelo | summerisle: it will if there's no further qualification. The @ sigil implies Positional; but its type can include lists or Arrays. | ||
summerisle | right | ||
jmerelo | m: my @this-is-a-list is List = (1,2,3); say @this-is-a-list | 18:40 | |
camelia | (1 2 3) | ||
jmerelo | m: my @this-is-an-array-maybe = (1,2,3); say @this-is-an-array-maybe | ||
camelia | [1 2 3] | ||
PimDaniel | I could observe my problem when i declared a hash with %(a => ('b','c','d'), ...); then wanted to add an element value to a! should i use [] instead? | ||
codesections | List => immutable Array; Map => immutable Hash; Bag => immutable BagHash, etc | 18:41 | |
jmerelo | PimDaniel: right. [] are arrays | ||
(as seen above) | |||
PimDaniel | The problem is when between constants literal passed as parameters and variables. I think i see. | 18:43 | |
Another question in the same time: | 18:44 | ||
if i want to add a new key to an hash: | |||
In perl5 i could do this : push @{$h{$key}} , @values , then key $key was created if it did not exits. | 18:46 | ||
jmerelo | PimDaniel: you can simply do @hash{$key} = "Whatever" | 18:47 | |
summerisle | %hash{key}.push: value appears to work as well | ||
jmerelo | summerisle: that will push to whatever is in %hash{$key} | ||
summerisle | I think that's what PimDaniel wants | ||
m: my %h; %h<key>.push('value1'); %h.gist.say | 18:48 | ||
camelia | {key => [value1]} | ||
PimDaniel | No in Raku in my loop does not work anymore directly , i must first do %h{$key} = [];, then push. | ||
jmerelo | PimDaniel:you're pushing to the value, not to the hash | ||
as you see above, it's created an array with a single value, "value1" | 18:49 | ||
PimDaniel | my model is a hash , each key containing an array | ||
jmerelo | PimDaniel: Ah, OK. Then what summerisle has just said would work. Or use append if you want to add a whole array. | 18:50 | |
PimDaniel | so i push this way : push @(%h{$key}), $new_value; | ||
jmerelo | m: my %h; %h<key>.append: <foo bar baz>; %h.say | ||
camelia | {key => [foo bar baz]} | ||
summerisle | you don't need to do @() | ||
raku is a little smarter about container semantics than perl 5 | 18:51 | ||
and the use of references for nesting is no longer necessary | |||
PimDaniel | ok i know this. | ||
so %h{$key}.append? | 18:52 | ||
summerisle | should do the trick | ||
PimDaniel | so %h{$key}.append: $value? | ||
summerisle | for a single value you might use .push instead | 18:53 | |
but append will work as well | |||
PimDaniel | Haaa ok it works, it works, ça marche , ça marche! i earned 4 lines of code. | 18:54 | |
Thanks very much to each of you for this clarification. | 18:55 | ||
18:55
Black_Ribbon joined
19:06
aluaces left
19:22
PimDaniel left
19:25
patrickb left
19:31
kerframil joined
|
|||
ab5tract | m: my %h; %h<foo>.push: "hi"; %h<foo>.push: "bye"; dd %h | 19:35 | |
camelia | Hash %h = {:foo($["hi", "bye"])} | ||
ab5tract | ok, so .append is only about slip-ping | 19:37 | |
m: my %h; %h<foo>.push: "hi"; %h<foo>.push: "bye"; %h<foo>.push: <some more data>; %h<foo>.append: <even a bit more>; dd %h | 19:38 | ||
camelia | Hash %h = {:foo($["hi", "bye", ("some", "more", "data"), "even", "a", "bit", "more"])} | ||
19:39
aborazmeh left
19:40
aborazmeh joined
|
|||
ab5tract | anyone know off the top of their head how to get the number of lines in an open text file handle without ingesting them first? | 20:04 | |
tadzik | I don't think you can :/ | 20:05 | |
you can guesstimate if you know the length of the first one and can assume that they have similar length | |||
ab5tract | tadzik, interesting, how would that work? something about total bytes divided by approximate bytes per line? | 20:06 | |
tadzik | ab5tract: yeah | ||
ab5tract | hmm, tbh shelling out to `wc` feels less hacky than that :) | ||
tadzik | wc is just going to ingest them for yuo ;) | 20:07 | |
codesections | ab5tract: agreed. Not "don't think you can" in the weak sense of "I don't know if anyone has built a way to do that", but in the stronger sense of "if I'm not mistaken, that's impossible in principle" | ||
tonyo | you could sort all of the characters and then count them that way | 20:08 | |
tadzik | nod nod. Files don't really have lines | ||
tonyo | that'd be a hackier way to ingest them and be more inefficient | ||
ab5tract | tadzik, true but wc can do it in a fraction of the time it takes raku, unfortunately | 20:09 | |
tadzik | right | ||
ab5tract | I'm playing around with allCountries.txt from geonames.org. only about 12 million lines | ||
tadzik | sheesh | 20:10 | |
well, you already know the number, just hardcode it :P | 20:11 | ||
ab5tract | use case for knowing the number of lines in the file is to then feed $core number of promises each taking 12 million / $core lines to take ingest via Text::CSV | ||
I'm curious to see what kind of performance we get against node.js | 20:14 | ||
and then to become truly ashamed, I will test against q | 20:15 | ||
20:19
aluaces joined
20:22
epony left
|
|||
tonyo | you could pre break the lines into separate files and then count them that way | 20:25 | |
[0..*].line | 20:26 | ||
20:26
epony joined
|
|||
ab5tract | Decoder may not be used concurrently | 20:29 | |
:/ | |||
tonyo | not with that attitude | 20:30 | |
ab5tract | lol | ||
does Tux still hangout sometimes? | |||
tonyo | you parsing CSV files? | ||
ab5tract | indeed I am | 20:31 | |
tonyo | his csv repo was last updated in oct last year | 20:32 | |
ab5tract | to be honest I'm a bit impressed that he figured out how to issue a die when the decoder is being created in more than one thread | ||
tonyo | looks like he removed csv-parser from his benchmarks :_ | 20:33 | |
ab5tract | tonyo, maybe it's just me that hasn't been around for a long while... but I used to enjoy him jumping on here with the latest benchmarks | ||
oh? :( | |||
ab5tract remembers when tonyo was tony-o | 20:34 | ||
tonyo | err oh maybe not, just hasn't been updated since 2015 | ||
i had to reinvent myself | |||
ab5tract | it's healthy to die every once and a while | 20:37 | |
hm, all I'm doing is splitting each line by "\t" .. maybe I can skip the library and get the multi-threading | 20:38 | ||
ok, that went a lot .. lot .. faster than I expected | 20:44 | ||
codesections | if I want `?$a-string` to equal False, the normal way I'd do it is `my $a-string = 'some text' but False`. But that pays the performance cost of mixing in the entire Bool type -- is there a faster way to do it if I don't need anything else from Bool? | 20:46 | |
ab5tract | that was on the much smaller, < 1 million line file | ||
now I'm watching my swap space fill up, max'd ram | 20:47 | ||
codesections | (this is for relatively hot code, so I'm willing to dip into lower-level/MOP stuff if need be) | ||
20:50
MasterDuke left
|
|||
japhb | codesections: Subclass Str and hardcode `method Bool { False }`? | 20:58 | |
codesections | japhb: I was actually playing around with that, but I didn't see a way to make that work with literal string assignment. | 21:00 | |
meh, probably not worth it. Mixing in False isn't *that* expesive | 21:01 | ||
ab5tract | I'm going to go out on a limb here and say that it probably shouldn't tak 15GB+ of memory to 'my @data = "1.6GB-File".IO.lines' | 21:08 | |
does it really cost us 10x ? | 21:09 | ||
is it possible to imagine that .lines could be implemented in a streaming manner? | 21:10 | ||
21:12
guifa joined
|
|||
guifa | o/ | 21:13 | |
21:15
uzl[m] joined
|
|||
ab5tract | hi guifa, hows it going? | 21:21 | |
21:23
wamba left
|
|||
guifa | Not too bad. Finally getting to a slower point at $day-job so I can get back to more Raku dev ^_^ | 21:23 | |
21:30
ab5tract left,
ab5tract joined
21:31
ab5tract left
21:40
mowcat left
21:44
ex_nihilo left
21:51
mowcat joined
21:54
tejr left
21:55
MasterDuke joined
|
|||
MasterDuke | ab5stract: Tux still does post his benchmark timings most days, but in #raku-dev | 21:58 | |
21:58
rindolf left
|
|||
MasterDuke | ab5tract: Tux still does post his benchmark timings most days, but in #raku-dev | 21:58 | |
tellable6 | MasterDuke, I'll pass your message to ab5tract | ||
21:59
tejr joined
22:15
cog__ joined
22:18
cog_ left
22:32
Discipulus left
22:40
aborazmeh left
|
|||
SmokeMachine | vrurg: Sorry, but I'm curious: are you using Cro + Red with Cro::HTTP::Session::Red? | 23:10 | |
vrurg | SmokeMachine: trying it, yes. | ||
SmokeMachine | vrurg: please, let me know if I can help somehow | 23:11 | |
vrurg | SmokeMachine: thanks! The refresh was already very helpful. :) | 23:13 | |
SmokeMachine | vrurg: are you finding something hard to be done? something we could get better? | 23:20 | |
vrurg | SmokeMachine: Not really. | 23:22 | |
23:22
tyilanmenyn joined
|
|||
vrurg currently struggles with session cookie + session expiration + websockets closing on time. | 23:23 | ||
23:26
squashable6 left
23:28
squashable6 joined
23:38
xinming_ left
23:39
xinming_ joined
|
|||
guifa | How does the is repr(CStruct) trait handled? Do there end up being two representations of the class — a blob for a separate Raku version — or is there just the blob for C and that gets converted on the fly to P6Opaque, etc, when accessed via a method accessor? | 23:43 | |
23:56
xinming_ left,
xinming_ joined
23:58
Doc_Holliwould left
|