🦋 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: ... | Logs can be inspected at colabti.org/irclogger/irclogger_log/raku
Set by lizmat on 21 April 2021.
El_Che Xliff: is your network faster than your disk? 06:31
tellable6 El_Che, I'll pass your message to Xliff
lizmat :q 08:39
tellable6 2021-04-23T02:00:34Z #raku-dev <vrurg> lizmat gist.github.com/vrurg/a608e01a44e5...nt-3716606
PimDaniel \o 09:24
ça va?
How may i sort a hash by a part of his key? 09:25
My has has : these kind of keys : '33:A/B' , '9:Y/Q' '117:C/G' and i need to sort by the first number befor the ':'. 09:27
*My hash...
lizmat do they need to sort as number or as string ? I assume as number ? 09:28
PimDaniel Number 09:29
lizmat and are they always Int?
PimDaniel YES
lizmat %hash.sort: *.split(":").head.Int 09:30
%hash.sort: *.key.split(":").head.Int
PimDaniel From the lower to the bigger. They just can be many with the same number.
brtastic m: sub (@arr) { @arr.push(5).say }((1, 2, 3)) 09:30
camelia Cannot call 'push' on an immutable 'List'
in sub at <tmp> line 1
in block <unit> at <tmp> line 1
brtastic how do I make this argument into Array?
lizmat [1,2,3] 09:31
m: sub (@arr) { @arr.push(5).say }([1, 2, 3])
camelia [1 2 3 5]
brtastic without changing how it's called, I mean
lizmat m: sub (@arr is copy) { @arr.push(5).say }((1, 2, 3))
camelia [1 2 3 5]
brtastic ah cool
brtastic I also know this way: 09:32
m: sub (*@arr) { @arr.push(5).say }((1, 2, 3))
camelia [1 2 3 5]
brtastic is it any different?
PimDaniel This is to display hash and i must display the whole key. 09:33
lizmat brtastic: that's a slurpy hash, that would also work with any number of positional arguments
m: sub (@arr) { @arr.push(5).say }(1, 2, 3) 09:34
camelia Too many positionals passed; expected 1 argument but got 3
in sub at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat m: sub (*@arr) { @arr.push(5).say }(1, 2, 3)
camelia [1 2 3 5]
lizmat note the missing extra ( ) around (1,2,3)
brtastic ah right, I see
thanks lizmat++
lizmat but you appeared to want a list as a paramater, not just any number of parameters 09:35
PimDaniel I'd expect this kind of form : for %hash.sort(<condition>) -> $k { ...}
brtastic yes, I wanted to pass in a list as an object and make it into something mutable without declaring another variable
PimDaniel My question was not enought precise.
lizmat %hash.sort: *.key.split(":").head.Int -> (:$key) { # PimDaniel ?
brtasticL: then the "is copy" is your thing 09:36
PimDaniel I don't understand why -> (:$key) and *.key.split : you mean *.keys.split ? 09:38
lizmat m: my %h = a => 42; for %h -> (:$key, :$value) { dd $key, $value } # PimDaniel 09:39
camelia "a"
42
lizmat the (:$key, :$value) deconstructs the Pair from "for %h" 09:40
.sort takes a Callable: if that takes one parameter, it will do a Schwartzian Transform under the hood
PimDaniel Yess but why should we have a pair if we start with keys? 09:41
lizmat where do we start with keys ?
PimDaniel %hash.keys, no?
lizmat m: my %h = a => 42, b => 666; dd $_ for %h
camelia :a(42)
:b(666)
lizmat iterating over a hash gives you Pairs
m: my %h = a => 666, b => 42; for %h.sort( *.value.Int ) { dd $_ } 09:43
camelia :b(42)
:a(666)
PimDaniel keys function returns a list, no?
lizmat technically a Seq, yes
but I didn't use .keys in my examples ?
I used .key on the Pair
PimDaniel No, not you. 09:44
lizmat ah
PimDaniel Well this is what i wanted to use.
This is what i use now.
But not sorted. 09:45
Since/If we use .keys this is the same question as sorting a list , you are true, but i want to display the original keys into loop. 09:47
lizmat is unsure of who PimDaniel is talking to or what PimDaniel wants 09:51
PimDaniel lizmat: Ok sorry! i'm not clear as usual: Your solution work when applied like this: i just wanted to sort keys by a part or the key : pastebin.com/RkepsC9T 10:04
lizmat if you replace: 10:05
{$^a.split(':').head.Int <=> $^b.split(':').head.Int}
by:
{$^a.split(':').head.Int}
it will also work :-)
because *then* it does a Schwartzian Transform under the hood
and: 10:06
PimDaniel Okay thank you! I'll try it!
lizmat {$^a.split(':').head.Int}
can be written as:
*.split(':').head.Int
PimDaniel lizmat : It works! thank you very mutch. 10:08
lizmat: I suppose the Schwartzian Transform reduces the sort function to the shortest equivalent? 10:13
lizmat it makes the comparisons cheaper by doing the extraction of the value only once for each value, instead of two times for each comparison 10:15
PimDaniel haaa, it's better though! 10:17
Merci à plus tard. 10:20
demostanis[m] MoarVM is signed by alexander.kiryuhin? Who's that> 10:47
lizmat sena_kun alias Altai-Man
trusted co-worker of Jonathan Worthington 10:48
demostanis[m] Oh ok, is there anything on the MoarVM website which says which key the binary is signed with? 10:49
lizmat not sure, you should probably ask that on #moarvm :-) 10:51
demostanis[m] I still can't post in there with matrix 10:55
andinus are spaces allowed in tags (META6.json) ? 12:04
lizmat feels like a bad idea to me 12:13
andinus one of my modules has a few tags with spaces, i uploaded it to PAUSE a few days ago but don't see it listed on modules.raku.org 12:14
could it be because of the spaces?
lizmat what's the name ? 12:20
andinus orion : github.com/andinus/orion
lizmat andinus: how did you make it known to the ecosystem that you're module is a part of it? 12:23
did you upload to PAUSE ? used fez ? I don't see it in the ecosystem repo either
andinus uploaded it to pause under Perl6 dir 12:24
file: $CPAN/authors/id/A/AN/ANDINUS/Perl6/orion-0.2.0.tar.gz
lizmat did you upload directly to that directory ? 12:26
andinus yes 12:27
lizmat hmmm... you didn't use a tool such as App::Mi6? 12:28
I think it may have somehow bypassed some checks
the storing in Perl6 sub directory should be handled by PAUSE
andinus no, i used the web portal 12:29
lizmat ok, this is a new module, perhaps it's easier to use "fez" to upload to the ecosystem
andinus i see, i've tried fez before but it ends with some git+tar not found error
lizmat ah... hmmm 12:30
andinus i havent reported this yet. its on openbsd, i have both git and tar in $PATH
lizmat since you do have a PAUSE login, then maybe App::Mi6 is something for yiou
it handles all of that stuff for you with "mi6 release"
andinus i see, i'll check it out, thanks
demostanis[m] <andinus "orion : github.com/andin"> Is this an app to decrypt and send all your passwords to some website? lol 12:36
andinus it doesn't send your password but just the first 5 chars of the hash of your password 12:39
demostanis[m] How would it know if your password has been compromised then?
andinus they return a list of all the hashes starting with those chars and we just check it locally 12:40
demostanis[m] smart 12:41
lizmat Question: should a module that reads log files made by the Colabti logger, be called Log::Colabti or Colabti::Log or ? 13:03
hmmm. I guess IRC::Log::Colabti 13:08
Juerd IMHO the whole public namespace hierarchy doesn't work anyway. Different people would answer this question differently and there's no official guidance. 13:13
lizmat true 13:14
I guess I'm more searching for the best SEO
Juerd Looking at the Perl modules on CPAN, there's decades worth of irregularities :)
lizmat IRC::Log::Colabti seems to fit that best, I thing
lizmat *think 13:14
Juerd For SEO anything you put in the NAME section will work, including the description 13:15
lizmat right :-) 13:16
masak good localtime, #raku 13:25
moritz \o masak, long time no see!
... which reminds me of a terrible pun 13:26
masak public namespace hierarchies are ultimately futile and inconsistent -- but maybe still a net good...?
moritz why is "dark" spelled with a "k"? because you cannnot "c" in the dark... :D
masak (directed at Juerd's comment above)
moritz: :D
moritz: indeed, 好久不见了 13:27
huh, that didn't roundtrip well.
El_Che Public namespaces do indeed sound like a Perl artifact 13:28
masak logs picked it up OK, though
El_Che: I was always fascinated by the Newspeak language's stance: "there is no global namespace, because global namespaces don't make sense" 13:29
never quite did find out how they pulled that off, though
moritz with a global numberspace? :-) 13:30
masak Joe Armstrong had this idea that if you normalized and hashed your code, you wouldn't need to name it at all. he never got around to realizing that idea, though
moritz: I think the topologists might be onto something. they'd suggest just having a global space 13:31
masak .oO( though if the space were pointed, they would have a point ) 13:32
moritz you can also have local spaces, then you just need routing that depends on the local enviornment
just like email in the early days, where (allegedly) you'd have to tell the servers the next hop, or maybe even all of them, to deliver that mail 13:33
masak I'd prefer it if spammers had to do it that way
El_Che masak: you'd get more personal spam that way 13:36
and we may buy stuff once in a while if they go that extra mile :)
masak moritz: in the past week or so, I've been trying to imagine designing Sokoban, but with all the interacting sprites in the game (player character, walls, floor tiles, boxes) being Hewitt actors or CSP processes 13:38
seems like a non sequitur perhaps, but I was reminded of that when you said "local sapces" and routing based on the local environment :) 13:42
spaces*
El_Che you plan to release it?
masak only if I get around to implementing it 13:43
El_Che lol
a mario clone is popular
masak I have an extremely high idea/execution ratio
El_Che you could use one and say it's Larry
It's a Larry
masak .oO( Super Wallio ) 13:44
El_Che Walluigi
and I didn't have to invent that one
en.wikipedia.org/wiki/Waluigi 13:45
masak I'm aware of Waluigi :)
Juerd: if you got to redesign the CPAN namespace hierarchy from scratch -- like, wave a magic wand and make everything in a certain way, including all the legacy and inconsistent stuff -- what would you do? 13:48
moritz I know the question wasn't direct at me, but the first thing I'd do is to get rid of the mismatch between LWP:: and libwww- 13:49
and maybe call it something starting with HTTP::Client 13:50
masak provocative/radical question: does it need names at all? (I guess, in the spirit of Joe Armstrong) 13:52
what if there was a good enough search engine, that took you to the right module, based on its description or something. not its name.
lizmat
.oO( who needs names if you have numbers )
404 for the win!
masak yes, like that, but in all seriousness
are the names necessary? 13:53
maybe they are more of a social thing...?
lizmat well, suppose wines would work that way
.... savouring a nice 4573562 right now!
masak I don't see why not
except less sentimental, perhaps
lizmat: clearly you don't love numbers as much as I do :D 13:54
I guess I can see the social/sentimental use of names
like, the name "Dancer" turns into kind of a meme or nodal point for people's interest 13:55
lizmat en.wikipedia.org/wiki/The_Prisoner # I'm a not a number!
masak lizmat: I actually watched the 60s series. weird, occasionally good.
lizmat yeah, too bad the ending was meh because the funding had dried up 13:56
masak lizmat: I groaned when he crashed the 60s supercomputer by inputing the question "why?"...
moritz writes down "lizmat is NaN"
masak lizmat: what do you mean, the ending was awesome :P
lizmat but which NaN ?
masak .oO( and once you identify which one, how will you know? ) 13:57
tadzik . o O ( do you want some bread? Yes, NaN bread please ) )
lizmat the ending was hacked together really, it was never intended to end at 17 episodes
masak tadzik! \o/
moritz the bread one 13:58
tadzik masak! \o/
moritz dammit, I wasn't fast enough
\o tadzik
tadzik moritz o/
masak we have to stop meeting like this.
moritz #perl6 reunion day? :D
masak or maybe meet like this more often
tadzik hm, I barely greet people because I always assume that we're just always there, even if we don't talk a lot :P 13:59
sjn moritz: looks like a #perl6 reunion day, yes :)
masak tadzik: actor-based sokoban, what do you think?
tadzik masak: only if it's tracking your eyes and the stones move by themselves when you're not looking
masak sjn! \o/
sjn masak! \o\ \o/ /o/ 14:00
masak tadzik: "boxes" :)
tadzik though there might be a geneva convention that forbids this
masak: I was thinking outside of the boxes :P
masak nowadays, if something is tracking your eyes, it would be to train a neural net for something
tadzik: ah, you iconoclast
tadzik I'd welcome someone reclaiming it and turning it into something fun rather than exploitative 14:01
masak wait, sokoban is exploitative?
masak .oO( won't someone think of the poor warehouse managers? )
moritz eye-tracking sokoban could be :D
masak .oO( sokoban as a metaphor for working at an amazon warehouse ) 14:02
moritz combined with micro transactions to make it more bearable
masak .oO( "my boss pushes me, I push these boxes. the boxes don't push anything." )
moritz: I didn't come here to have my game idea destroyed like this. 14:03
masak looks around for the "throw table" emoji
moritz :tableflip: ? 14:04
masak ah, yes
moritz oh wait, this is neither rocketchat nor discord :D
masak haha 14:04
don't worry, my neural software compensated
it's like when someone types out \infty 14:05
it kind of looks like a lazy eight to me, don't know how
tadzik masak: here, take this: (╯°□°)╯︵ ┻━┻ 14:06
moritz but one set in Computer Modern, right masak? :D
masak naturally.
masak softly breaks the fall of tadzik's table with his body
tadzik: ow. 14:07
tadzik . o O ( over here, mister president! ) 14:08
stoned75 commit: releases ('a' ^..^ 'f').list.say 17:14
committable6 stoned75, ¦releases (52 commits): «(b c d e)␤» 17:15
demostanis[m] How long does it take you guys to install Rakudo Star, compiling every component + modules? 19:56
El_Che (I can't answer because I don't use it) 19:59
summerisle demostanis[m]: if it's any help (it probably isn't) it takes 2 minutes and 12 seconds to compile the rakudo distribution from Gentoo, this is with 56 threads on a 64 thread host. 23:38