šŸ¦‹ 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:00 MasterDuke left 00:03 sena_kun joined 00:05 Altai-man_ left 00:09 OpenZen joined 00:11 jdoege left
cpan-raku New module released to CPAN! JSON::Fast (0.12) by 03TIMOTIMO 00:18
00:20 oddp left
cpan-raku New module released to CPAN! JSON::Hjson (0.0.2) by 03AKIYM 00:22
00:51 hungrydonkey left, hungrydonkey joined 00:52 pocloq joined
pocloq How do I get an Array or a List from the command line?raku -e 'sub MAIN ( Array :$arr ) { say ++$, $_ for $arr }' --arr="<1 2 3>" 1[<1 2 3>] 00:56
this only gets a single element into the array 00:58
rbt This might be closer:
raku -e 'sub MAIN (:@arr ) { say ++$, $_ for @arr }' --arr=a --arr=b
pocloq doing --arr="first" --arr="second" also only creates a single element
rbt Otherwise, you might need to take a string and split on space or comma or something. 00:59
00:59 wamba joined
pocloq i was hoping there would be some kind of syntax that allows for array/list creation straight from the command lineā€¦ 01:00
without having to repeat the switch for every element
01:10 pocloq left 01:21 molaf left 01:22 lizmat left 01:26 Tirifto left 01:28 lizmat joined 01:33 molaf joined
rbt Has anyone considered changing Travis-CI to use rakubrew downloadables rather than building via rakudobrew? It would significantly shorten build times across the board. 01:40
01:56 xinming left 01:58 xinming joined 02:02 Altai-man_ joined 02:05 sena_kun left 02:09 xinming left 02:10 xinming joined 02:52 Benett left 02:53 Benett joined 03:25 yangzq50 left 03:28 yangzq50 joined, RaycatWhoDat left 04:03 sena_kun joined 04:04 Altai-man_ left 04:12 rbt left, rbt joined 04:14 hungrydonkey left 04:15 hungrydonkey joined 04:43 xinming_ joined 04:47 xinming left 05:01 Noisytoot left 05:07 Noisytoot joined 05:11 OpenZen left 05:15 bocaneri joined 05:22 molaf left 05:28 wamba left 06:02 Altai-man_ joined 06:05 sena_kun left 06:22 stoned75 joined 06:26 _jrjsmrtn joined, __jrjsmrtn__ left, Noisytoot left 06:27 Noisytoot joined 06:37 guifa2 left 06:38 sarna joined 06:39 JJMerelo joined 06:46 wamba joined 06:50 Noisytoot left 06:51 Noisytoot joined 06:54 kawaii left 06:55 peteretep left
JJMerelo CommaIDE stopped working again... 06:55
06:55 zostay left, peteretep joined, kawaii joined 06:57 zostay joined 06:58 orinthe1 joined 07:00 orinthe left, orinthe1 is now known as orinthe 07:01 abraxxa left, abraxxa joined 07:05 Noisytoot left 07:14 pecastro joined 07:24 hungrydonkey left
Geth doc: 00669aef5b | (JJ Merelo)++ | doc/Type/Cool.pod6
Fixes unimatch example.

Closes #3509. Also grammar fixes, and added explanation.
07:25
linkable6 Link: docs.raku.org/type/Cool
DOC#3509 [closed]: github.com/Raku/doc/issues/3509 `unimatch 'A', 'Ll'` should return `False`
07:26 dakkar joined, grondilu joined
grondilu wasn't there a :defined adverb to test the existence of a hash entry ? Like %foo<bar> :defined ? 07:27
m: my %foo; say %foo<bar> :defined
camelia Unexpected named argument 'defined' passed
in block <unit> at <tmp> line 1
grondilu m: my %foo; say %foo<bar> :exists 07:29
camelia False
grondilu oh, ok
grondilu just search "raku hash entry test" and learned about :exists
*searched
07:30 sarna left, skids left 07:31 wamba left 07:32 sarna joined 07:46 vike left 07:53 rindolf joined 08:00 vike joined 08:03 sena_kun joined 08:04 BuildTheRobots left, Altai-man_ left 08:06 BuildTheRobots joined 08:08 cpan-raku left 08:09 cpan-raku joined, cpan-raku left, cpan-raku joined 08:15 rbt left, rbt joined 08:16 ca53 joined 08:18 fling left 08:20 grondilu left, leont joined 08:25 cpan-raku_ joined, cpan-raku_ left, cpan-raku_ joined, cpan-raku left 08:28 dogbert17 left 08:30 sarna left 08:36 hungrydonkey joined 08:39 patrickb joined 08:52 lichtkind joined 09:11 wamba joined 09:13 lichtkind_ joined 09:14 JJMerelo left 09:15 lichtkind left 09:22 oddp joined 09:29 fling joined 09:35 aborazmeh joined, aborazmeh left, aborazmeh joined 10:02 sarna joined, Altai-man_ joined 10:05 sena_kun left 10:08 Black_Ribbon left 10:24 wamba left 10:27 sarna left 10:31 aluaces left 10:41 epony left 10:43 epony joined 10:56 wamba joined 11:01 hungrydonkey left, hungrydonkey joined
lizmat .ask tbrowder does one of your modules provide this? www.reddit.com/r/rakulang/comments...inet_ntoa/ 11:20
tellable6 lizmat, I'll pass your message to tbrowder
tbrowder lizmat: hi 11:25
it's supposed to. it has routines to convert ip to/from binary. i haven't looked at in a while--an update is in the works but the released version should work. i didn't thint to add aliases for inet* and nt* becasuse i was just pr 11:28
porting the perl version to raku.
Net::IP 11:29
oh, i see releasd new the api version in april. 11:30
.tell lizmat ^^^^ 11:31
tellable6 tbrowder, I'll pass your message to lizmat
lizmat answered the question on r/rakulang 11:37
afk for a few hours&
11:39 aborazmeh left 11:49 aluaces joined 11:50 IMP1 joined 11:59 dolmen joined 12:03 sena_kun joined 12:04 Altai-man_ left 12:18 rbt left, rbt joined 12:20 hungrydonkey left, hungrydonkey joined 12:28 vike left, guifa2 joined
El_Che Zero_Dogg: need to investigate the integration with bintray, where the packages are hosted 12:32
Zero_Dogg: certainly something worth enabling
Zero_Dogg El_Che: yeah, I want to update to a more recent raku, the packages look like a great way to do it, but found it a bit odd it was disabling gpg 12:34
El_Che it's https and they have a checksum generated in travis (hence public), so in that sense they are safe for mitm 12:36
but, I agree it would be a very nice to have
12:44 dolmen left 12:48 Kaiepi left 12:51 Kaiepi joined 12:52 dolmen joined 12:55 patrickb left 12:56 vike joined 12:58 patrickb joined
[Coke] lizmat: in review, I don't think we need Rakudo Star as a core thing, no. 13:13
(also, didn't see this in review yet, but clicking on "older versions" on the initial d/l page paradoxically shows you newer versions 13:14
I think having builds of compiler releases and zef work. I don't think we need a bundle with all the modules bundled in Star. 13:15
(but I admit, I am not a typical user). 13:16
13:19 yangzq50 left, dolmen_ joined, dolmen_ left 13:21 dolmen left 13:31 xinming joined 13:34 xinming_ left 13:41 hungrydonkey left, hungrydonkey joined 13:54 [Coke] left 14:00 sarna joined 14:02 Altai-man_ joined 14:05 sena_kun left 14:21 TimToady left 14:29 ensamvarg left, camelia left, mojca left 14:30 ensamvarg joined 14:31 camelia joined 14:32 mojca joined 14:34 [Coke] joined, [Coke] left, [Coke] joined 14:38 sarna left 14:42 xinming left 14:43 TimToady joined 14:44 xinming joined 14:56 xinming left, xinming joined 14:59 ensamvarg left 15:00 ensamvarg joined 15:03 dogbert17 joined
codesections Ok, syntax question: I have a list of Lists that I'd like to transform into Bags. I can do that in separate lines like this: 15:03
m: my $lists = ((first => 1, first => 2), (key => 40, key => 2)); my %bag1 is Bag = $lists.head; my %bag2 is Bag = $lists.tail; say "bag1: {%bag1}\nbag1: {%bag2}" 15:04
camelia bag1: first(3)
bag1: key(42)
codesections But I thought I could do the same thing with destructuring assignment:
m: my $lists = ((first => 1, first => 2), (key => 40, key => 2)); my (%bag1 is Bag, %bag2 is Bag) = $lists; say "bag1: {%bag1}\nbag1: {%bag2}" 15:05
camelia bag1: first 1 first 2 key 40 key 2
bag1:
codesections but that doesn't work ā€“ am I not getting the syntax right, or is that way of using destructuring assignment just not supported? 15:06
jnthn Destructuring is done via binding 15:07
But you aren't quite wanting to destructure there, but rather coerce
widnow 20 15:08
m: my $lists = ((first => 1, first => 2), (key => 40, key => 2)); my (Bag() $bag1, Bag() $bag2) := $lists; say "bag1: $bag1\nbag2: $bag2"; 15:09
camelia bag1: first(3)
bag2: key(42)
jnthn There's not really a way to do it with the % sigil (coercion in signatures is about the value in the container)
But you can do it as above
Key thing to know: destructuring is done with signatures, so everything you know about writing those, you can apply to destructuring too. 15:10
15:13 grondilu joined
grondilu Is there an elegant way to create the array [0], [1], [2] ... [n] ? 15:14
m: say [$++] xx 10
camelia ([0] [1] [2] [3] [4] [5] [6] [7] [8] [9])
codesections Very helpful, thanks!
grondilu hum I guess that will do
El_Che someone here discussed Rakudo Star, binaries and the pain of getting rakudo onto macos: in my opinion, a easy way is to use homebrew to install a prcompiled rakudo compiler (and NOT rakudo-starm also present in homebrew) 15:16
thus the link we provide here raku.org/downloads/others.html is outdated 15:17
jnthn grondilu: Yeah, another one is `(^10)>>.Array` but I'm not sure how much more elegant it is. :)
El_Che in the beginning only rakudo-star was in homebrew
15:18 yangzq50 joined
grondilu oh I had no idea $x.Array could create [$x] 15:18
m: say pi.Array
camelia [3.141592653589793]
grondilu nice. 15:19
I'm guessing it inherits from Any
m: say Any.Array
camelia [(Any)]
grondilu m: say Mu.Array
camelia No such method 'Array' for invocant of type 'Mu'
in block <unit> at <tmp> line 1
Voldenet m: print join "", map({ "|$_|" }, split "", "wut") 15:20
camelia |||w||u||t|||
Voldenet i do wonder why there's 0-width chars on the beginning of that string
[Coke] m: say Cool.Array 15:21
camelia [(Cool)]
grondilu m: say "foo".split("").elems 15:22
camelia 5
grondilu you want to use .Comb instead
.comb
m: say "foo".comb.elems
camelia 3
grondilu "" is actually present at the beginning of any string 15:23
and the end
m: say "wut".comb.map({"|$_|"}).join 15:24
camelia |w||u||t|
Voldenet I know that there is, but I still wonder why :D
grondilu the empty string occurs everywhere, including before w and after t
[Coke] m: say "foo".split("",:skip-empty).elems
camelia 3
grondilu ok my bad, I can't explain this actually 15:25
oh it's 3, my bad again
Voldenet this happened because I was porting perl5 script 15:26
grondilu well raku is not back compatible
p5: print split "", "wut" 15:27
Voldenet bah, ofc, hence the name change :P
grondilu splitting with an empty string as first argument is kind of a degenerate case, semantics is not obvious to interpret. 15:29
IMHO
15:29 yangzq50 left 15:30 yangzq50 joined
tobs should have written your p5 script with `split //, ā€¦` because that would have errored in Raku :P 15:31
Voldenet Well yes, some languages just adopted the convention of "" meaning "split into 1-character strings array" and its meaning is completely arbitrary ;) 15:32
tobs (but no, I can't say anything helpful either)
15:34 molaf joined 15:35 markong joined
Voldenet m: use nqp; my @l = nqp::split("", "test"); @l.map({"|$_|"}).say 15:36
camelia (|t| |e| |s| |t|)
Voldenet huh
lizmat [Coke]: feels to me that zef should be part of core then ? 15:39
or at least something like zef
15:45 markoong joined 15:46 markong left
[Coke] or maybe have a package that includes rakudo,nqp,moar and zef. 15:53
(er, includes those packages)
16:03 sena_kun joined 16:04 Tirifto joined 16:05 Altai-man_ left
patrickb Coke: the packages nxadm prepares as well as the precompiled packages offered on rakudo.org provide those components. 16:05
(Note that I'm talking about the packages on rakudo.org/downloads , not the Rakudo Star bundle.) 16:06
jdv79 why should zef be in core? iirc pip isn't in python core. 16:08
i don't believe cpanm is in core though CPAN likely is but cpanm is more used now, right? 16:09
lizmat there *is* a cpan client in the perl core distribution afaik, so you don't need to install something to be able to install something 16:10
eery python does ship with a module installer afaik, if not pip it's something that can install pip 16:11
jdv79 so there would be a installer in raku core that only newbies use until someone in here says "just use zef"
hmm...
eery ah, no, pip is included by default, since 3.4 16:12
afresh1 FreeBSD ships with a "pkg" tool that can only install the real "pkg" tool
eery you could build/package it without it which some distro maintainers may do if they want to have separate packages, but if you download source and build it produces pip 16:13
lizmat hmmm.. i like the idea of having a "zef" stub that can only install itself, and *then* do whatever it was asked to do
eery is zef very large/are there competing package managers? 16:14
codesections the trend with languages more recently seems to be to include a language package manager (e.g., Go and Rust both do so)
patrickb I'd answer both questions with no. 16:15
jdv79 a zef trampoline?
lizmat a zef trampoline would ensure the most recent zef would be installed 16:16
you would need internet access for it, but then you would anyway if you want to install something else anyway
eery would you want the most recent version of zef vs. what is guaranteed to work with a given version of rakudo? 16:17
patrickb lizmat: Why is a recent zef preferable to a zef as old as its rakudo?
lizmat eery: the system dependent things are part of the core
zef doesn't know how to install modules, it just knows what to call in the core to install a module
tobs is there a way to include some wrapper c++ code, which is compiled and installed as %*RESOURCES, to ease nativecalling in a module? 16:19
patrickb I don't see why a zef installer is preferable to just bundling zef itself.
tobs just a starting point for cargo culting would be enough
codesections zef could also run `zef upgrade zef`, couldn't it?
16:21 rbt left 16:22 rbt joined
eery FWIW, FreeBSD's pkg command is likely packaged separately as it's incompatible with an older/auxillary package management tool/database 16:22
lizmat patrickb: well that *was* my original suggestion :-)
16:24 kensanata joined
tbrowder gy 16:24
g'day, raku people! 16:25
lizmat tbrowder o/
tbrowder i'm doing some more porting from perl to raku and typically i name a ported module with the same basename and new extension 16:26
lizmat \o/ 16:27
unfortunately rakumod follows pm in alpha sort order and the using prog sees the perl module first. the 16:28
the immediate solution is a rename or separate lib dirs. 16:29
lizmat tbrowder: but Rakudo should try the .rakumod extension first 16:30
are you saying that it doesn't?
tbrowder question: couldn't raku reject a module without
**** no it doesn't 16:31
lizmat that'd be a bug
tbrowder i'm not talking about installed modules, just plain local modules in the local file tree 16:32
lizmat yeah, that's a bug
and confirmed it
tbrowder ok, thnx!
cpan-raku_ New module released to CPAN! Red (0.1.15) by 03FCO
tbrowder filing bug now... 16:33
16:35 dakkar left 16:42 Noisytoot joined 16:44 grondilu left 16:48 Hotbees_ joined, ChoppedBacon_ joined 16:49 polettix1 left, BinGOs left 16:51 grondilu joined 16:53 kensanata left 16:54 mojca_ joined, kensanata joined 16:55 mojca left, Hotbees left, ChoppedBacon left, robinsmidsrod left, webstrand left, ecocode left, Hotbees_ is now known as Hotbees, ChoppedBacon_ is now known as ChoppedBacon, e left 16:56 ecocode joined, kensanata left, unclechu left, CIAvash left, matiaslina left, xfix left, AlexDaniel` left, Nasrudin left 16:57 bingos joined 16:58 robinsmidsrod joined, webstrand joined 16:59 Geth left 17:00 AlexDaniel` joined, polettixx joined 17:06 unclechu joined, matiaslina joined, Nasrudin joined, xfix joined, CIAvash joined 17:12 e joined 17:23 patrickb left 17:25 natrys joined
SmokeMachine I've added some new "answers" on the Red cookbook, could some one take a look, please? github.com/FCO/Red/blob/master/doc...ookbook.md 17:25
18:01 Kaiepi left 18:02 Altai-man_ joined 18:03 hungrydonkey left 18:04 sena_kun left
[Coke] as long as we don't end up with a-packge-for-each-module like I've seen elsewhere. 18:07
(which maybe is a fine model, but always seemed weird to me.) 18:08
18:10 Kaiepi joined 18:11 vike left
rypervenche It's nice for users, but I imagine it could be dependency hell. 18:15
18:17 dataangel joined 18:25 bocaneri left 18:32 dataangel left 18:35 stoned75 left, skids joined 18:36 stoned75 joined 18:46 Sgeo joined 18:48 lichtkind_ left, lichtkind joined 18:55 Black_Ribbon joined
[Coke] as a user, I hated it, because i'd get some via packages, but it's not like it covered all cpan 18:55
19:15 lichtkind left, lichtkind joined 19:19 molaf left 19:28 grondilu left 19:53 ca53 left 20:03 sena_kun joined 20:05 Altai-man_ left 20:08 kensanata joined 20:13 Geth joined 20:18 IMP1 left 20:20 rindolf left 20:24 maggotbrain left
ShimmerFairy I really wish OS package managers could mesh with subject-specific package managers so the OS guys don't feel the need to ban things like CPAN and tlmgr 20:24
20:24 rbt left 20:25 rbt joined, maggotbrain joined, rindolf joined 20:30 x[LGWs4x4i]uG2N0 left
tobs re my question from before about compiling native code upon module installation: zef executes a Build.pm file in the distribution during its build stage. Apparently I knew this in the past. 20:37
20:48 dolmen joined 20:50 vike joined 20:51 wamba left, natrys left 20:58 rindolf left 21:08 melezhik joined
melezhik I've added multiple hosts deployement in asyncronous mode in Sparrowdo/Sparky. Also tagging feature. github.com/melezhik/sparrowdo/wiki...amic-hosts 21:13
I am going to describe all this in the next RakuOps issue 21:14
lizmat melezhik++
melezhik basicly now Raku have alternative to ansible/rex/chef configuration management tool... 21:15
I've already played with my free tier aws account running multiple ec2 instances and configure them asynchronously and it looks cool for me ))) 21:16
it still has rough egdes, but basic layout looks good for me ...
and plays well with terraform - github.com/melezhik/sparrowdo/wiki...ntegration 21:17
I know u/bobthecimmerian already started to play with it ... But I need more testers ... )))) 21:18
21:19 Tirifto left 21:41 tobs left 21:50 tobs joined
SmokeMachine Iā€™ve made some more adds on the cook book, is someone is interested: fco.github.io/Red/tutorials/cookbook 22:01
22:02 kensanata left, Altai-man_ joined
SmokeMachine Or the file on github: github.com/FCO/Red/blob/master/doc...ookbook.md 22:04
22:05 melezhik left, sena_kun left
lizmat twitter.com/liztormato/status/1281...7373849608 # SmokeMachine 22:05
22:06 cpan-raku_ left
lizmat sleep& 22:08
SmokeMachine lizmat: thank you! 22:12
codesections Does Raku have a way to unzip? (That is, perform the inverse operation of the Zip method/operator and transform a list of lists into multiple lists? 22:18
)
22:27 nightfrog joined 22:28 nightfrog left 22:30 nightfrog joined, xinming left 22:32 xinming joined
jnthn codesections: I don't think there's a builtin for it, but you can get it by combining a couple of them, I think... 22:32
m: sub unzip(@x, $n) { roundrobin(@x.batch(3)) }; dd unzip 1..12, 3 22:33
camelia ((1, 4, 7, 10), (2, 5, 8, 11), (3, 6, 9, 12)).Seq
jnthn oops, I wrote 3 where I wanted $n to generalize it :)
22:33 markong joined 22:34 markoong left
codesections Hmm, I don't *think* that's what I meant. (1, 2, 3) Z <a b c> produces ((1 a) (2 b) (3 c)) 22:35
I'm looking to go from ((1 a) (2 b) (3 c)) back to (1, 2, 3) and ('a', 'b', 'c')
Unless I'm confused, I don't think the roundrobin + batch solution does that? 22:36
22:36 dolmen left
codesections wait, yes it does. I was confused. 22:37
Thanks, I see how it works now. Very helpful :)
jnthn I probably coulda picked a better example input :) 22:38
codesections wait, actually, I just realized there's a (very cool) better way: 22:40
tobs you mean zip it again? :)
codesections yeah, basically 22:41
Why does that work?
22:41 cpan-raku joined, cpan-raku left, cpan-raku joined
tobs m: say [Z] (<a b c> Z <1 2 3>) 22:41
camelia ((a b c) (1 2 3))
codesections m: [Z] ((1, 'a'), (2, 'b'), (3, 'c')) 22:42
camelia Potential difficulties:
Useless use of [Z] in sink context
at <tmp>:1
------> 3<BOL>7ā5[Z] ((1, 'a'), (2, 'b'), (3, 'c'))
tobs the [Z] now zips over three lists, each of which 2-element list
codesections m: say [Z] ((1, 'a'), (2, 'b'), (3, 'c'))
camelia ((1 2 3) (a b c))
22:43 Voldenet left
tobs sorry to steal your thunder 22:45
codesections Ok, yeah, I see it now. That's *really* cool
jnthn Oh, I totally didn't think of that one :)
That is cute.
tobs someone in this channel once remarked that zipping is a way of transposing a matrix (turning rows into columns) and that made an impression on me
codesections That is a helpful way of putting it 22:46
22:52 Voldenet joined, Voldenet left, Voldenet joined 23:09 hungrydonkey joined 23:17 hungrydonkey left 23:23 leont left 23:31 pecastro left 23:33 skids left