»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
cpan-p6 New module released to CPAN! ULID (0.1.0) by 03HANENKAMP 00:02
dominix hi perl6 community 00:18
I have a question not directly related to perl6 but I trust this community for this kind of advice.
I need a low level/compiled language for performance reason. I would like this language to be integrated enought with perl6 00:19
I am exploring Nim, crystal and Rust, with of these would you recomend to me 00:20
i am currently learning perl6, and will mainly use perl6 over all 00:22
zachk I think C is kind of integrated with perl6, but not sure, I am kind of new to perl6 00:24
leont It's easy to integrate with anything that links like C
I know Rust can do that (extern "C"), I don't know Nim well and hadn't even heard of crystal, but I suspect they can do the same 00:26
discord6 <Vendethiel> Rust is for « real-time »-ish app where having a gc is something you can’t afford. Crystal is nice but lacks manpower. Nim is nice bug the compiler is bugridden 00:28
dominix what do you mean "lack manpower" ? too small community ? 00:30
btw I do not know any of these community. 00:31
discord6 <Vendethiel> No, I mean people working on the compiler toolchain. 01:01
vrurg m: role R0 { has $.a; }; role R1 does R0 { }; role R2 does R0 { }; class C does R1 does R2 { } 01:15
camelia 5===SORRY!5=== Error while compiling <tmp>
Attribute '$!a' conflicts in role composition
at <tmp>:1
vrurg Is it a known problem? 01:16
AlexDaniel vrurg: but is it a problem? I'm not sure 01:19
vrurg AlexDaniel: imagine you consume roles from different packages which consume same role from a third package. Everything is ok until the third package decides they need an attribute in their role... 01:20
AlexDaniel vrurg: maybe submit a ticket. If that's not supposed to work, then we can at least turn it into a doc ticket and explain what should be done in this case 01:23
vrurg Sure I will. Just wanted to know if this has been considered before. 01:24
dominix From my latest question I will go for rust for a side language. 02:15
Nim and crystal my be good language but rust is more disruptive in the innovations 02:16
dominix Still it has good perspective for perfor 02:17
Mance
masak is still a bit confused over "disrupt" taking on positive connotations 02:39
moritz language has disrupted you, masak :D 06:17
masak .oO( <archimedes> do not disrupt my circles! ) 06:47
mindd hi 07:50
discord6 <Vendethiel> People get bitter over Rust because they don’t actually fit too well within the initial use-case, methinks 08:01
<Vendethiel> It certainly has had more researchers writing about it than crystal and nim, though. 08:02
<Vendethiel> However I’m not sure I’d call that « disruptive »...
SyrupThinker I cannot resolve rakudo.org , does anybody else have that problem? 11:10
sena_kun isup.me says "It's not just you! rakudo.org looks down from here". :| 11:12
jnthn Next question: does anyone know where it should resolve to? :) 11:13
moritz to 213.95.82.53 11:14
jnthn The domain recently transferred ownership and moved registrar as part of that. It left the name server records intact. Unfortunately, the previous registrar seems to have immediately dropped answering resolution requests upon that happening. 11:15
moritz more than that, the resolver time out
jnthn Wow
moritz and 2001:780:101:ff00::80:1 as IPv6 address 11:16
jnthn Thanks; I've pointed it to a new nameserver and put in the A[AAA]? records :) 11:18
Bit annoying that there was no grace period; I checked last night "is the transfer done yet" and the answer was "no".
moritz yes, that's pretty shitty behavior from the old DNS provider 11:19
ok, a dig rakudo.org +trace now works for me
same for AAAA
so now it's just a matter of caches expiring 11:20
at $work, we decrease the zone TTL to 60s or so before migrating a domain, for cases exactly like this
but then we also strive to not be an asshole to people/companies leaving our service :D 11:21
jnthn :)
Thanks for checking/help; moritz++
moritz no problem :D 11:22
El_Che rakudo.org works for me (TM) 12:14
lizmat as for me 12:15
jnthn Still waiting on the timeout here, it seems 12:16
lizmat it might be your router keeping it... 12:17
El_Che jnthn: or your local pc cache
lizmat but if it is just you, don't worry about it :-)
mscha m: for 1,3...99999999 -> int $i { }; say now - INIT now; 12:18
camelia 0.3954962
El_Che lizmat: he probably doesn't even know what rakudo is :)
mscha m: loop (my int $i = 1; $i ≤ 99999999; $i += 2) { }; say now - INIT now;
Geth doc: d0b656b4fd | (JJ Merelo)++ | doc/Language/variables.pod6
Clarifies scope of state closes #2616
synopsebot Link: doc.perl6.org/language/variables
cygx so, no idea about other peple's workflow, but I've found local development with -I and PERL6LIB suboptimal
camelia 8.87235327
cygx hence, I've created a tool that might help: github.com/cygx/6lib
it's literally only a day old, so be warned if yout try it out yourself 12:19
lizmat mscha: the 1,3...9999 case is highly optimised
m: loop (my $i = 1; $i ≤ 99999999; $i += 2) { }; say now - INIT now;
mscha It isn't in my installation of Rakudo Star 2018.10 yet. ;-) (There, 1,3...99999999 is about 25 times slower than loop) 12:20
camelia (timeout)
mscha But the loop version is a *lot* faster on my machine. 12:20
lizmat m: loop (my int $i = 1; $i ≤ 99999999; $i = $i + 2) { }; say now - INIT now;
camelia 9.4707716
lizmat 0.37937893 vs 2.683154 on mine 12:21
mscha Rakudo Star 2018.10: loop takes half a second, for 1,3... takes 12.5 seconds. 12:22
lizmat oops, actually: 0.37937893 vs 0.322489 for me (I had forgotten the "int" 12:22
mscha So how come the loop one is so slow using the bot? 12:23
lizmat good question
Xliff \o 12:47
Xliff If I have a bunch of subs in a .pm6 file, if I use that pm6 file, can I list those subs? 12:48
sena_kun `use Foo; for MY::.keys -> do stuff` 12:49
Xliff :)
Lemme try
Aaannd.... now I have to wait for precompile hell. 12:50
(Yes, this is GTK stuffs)
sena_kun m: use NativeCall; MY::.grep({ $_.value ~~ Sub}).say 12:50
camelia (&postcircumfix:<[ ]> => &postcircumfix:<[ ]> &trait_mod:<is> => &trait_mod:<is> &explicitly-manage => &explicitly-manage &cglobal => &cglobal &nativecast => &nativecast &nativesizeof => &nativesizeof &refresh => &refresh)
sena_kun Xliff, something like ^
Xliff Hmm... not getting the subs 12:51
All subs are NOT listed as export.
sena_kun erm, if they are not, I don't think you can get those. 12:52
Xliff :(
That's what I suspected.
sena_kun I may be wrong, but that'd be too odd, isn't it?
I mean.
You know. :)
Xliff I know. Was hoping I could introspect at the package level. 12:53
Maybe I could make them our scoped?
sena_kun well... That might be possible, but it's just that I don't know how.
moritz if they are 'my' and not exported, that might have a reason
like, possibly nobody designed an API intended for public use
Xliff I am now 'our' scoping the subs. ;) 12:54
OK. Subs now "our" scoped, but not exported. 12:55
I still can't see 'em.
sena_kun well, if you do `use Foo;`, then you can do something with `Foo.HOW`, but tbh I don't remember right now what exactly. 12:57
ah, no, I think the case I know is made with `MY::.kv`, so please ignore me. 12:59
Xliff So is there any way to get our scoped symbols out of a compunit? 13:01
lizmat m: class Foo { our sub a { } }; dd Foo:: # Xliff 13:02
camelia Stash element = {"\&a" => sub a { #`(Sub|62371648) ... }}
lizmat m: class Foo { our sub a { } }; dd Foo::.keys
camelia ("\&a",).Seq
Xliff lizmat: File contains a role def and the sub defs are OUTSIDE of the role. 13:04
Here's the file: github.com/Xliff/p6-GtkPlus/blob/m...eneric.pm6 13:05
Subs at the bottom are "our" scoped in my local copy.
cygx I suspect they end up in GLOBAL:: 13:06
you might want to put them in a module... 13:07
lizmat m: class Foo { sub a { }; method subs() { OUTER::.keys.grep: *.starts-with("&") } }; dd Foo.subs 13:09
camelia ("\&a",).Seq
lizmat afk&
Xliff OK, now exported and STILL can't find them. 13:23
How would I look them up in GLOBAL?
timotimo m: say GLOBAL::.keys 13:28
camelia ()
Xliff Looking familiar, there. ;) 13:29
cpan-p6 New module released to CPAN! Canoe (0.0.3) by 03ALOREN 14:07
perlbot Eric pasted a new file at perlbot.pl/p/8m9big - 14:25
AlexDaniel` Haha 14:26
Ven`` what creativity. 14:27
El_Che what a waste of perfectly fine air 14:33
tadzik jokes are art 14:40
but I worry this might be someone seriously thinking this'll work
timotimo how do you sell perlbot.pl? 14:46
Geth ecosystem: 2e82582bd4 | cygx++ (committed using GitHub Web editor) | META.list
Add App::SixLib

See github.com/cygx/6lib
timotimo er, i mean
what do you sell on perlbot.pl?
AlexDaniel` That's automated for sure, but I wonder why it liked that form 14:50
timotimo "i am a simple bot. i see a submit button, i click" 14:54
Ven`` m: use v6e; 15:07
camelia ===SORRY!===
Cannot call method 'typed_panic' on a null object
Ven`` m: use v6.e; 15:08
camelia ===SORRY!===
Cannot call method 'typed_panic' on a null object
Ven`` mh.
discord6 <Rogue> I wonder, how do multiline messages get handled by the bot? This is a new line
sena_kun m: use v6.c;
camelia ( no output )
sena_kun m: use v6.d;
camelia ( no output )
sena_kun m: use v6.e;
camelia ===SORRY!===
Cannot call method 'typed_panic' on a null object
moritz the bot translates ␤ into newlines in the input, and the other way round in the output 15:09
discord6 <Rogue> I meant the bridge bot, sorry 15:10
timotimo Rogue, it seems to just put a space in between the lines 15:47
jmerelo releasable6: status 15:58
releasable6 jmerelo, Next release in ≈3 days and ≈3 hours. 4 blockers. 174 out of 302 commits logged
timotimo @Rogue - does this make a highlight?
releasable6 jmerelo, Details: gist.github.com/3a123f543a1c6c250b...06496122a0
timotimo oh, the bot left 16:02
that's why it doesn't send messages to discord any more 16:03
kybr Perl6 regex library yet? now that i'm getting to know them, i want'em everywhere. 16:19
Geth doc: 55a996492b | cfa++ | doc/Language/variables.pod6
Phrasing.
16:20
synopsebot Link: doc.perl6.org/language/variables
sjn kybr: it just means you'll have to use Perl 6 everywhere ;) 16:21
kybr i wish i could. in this case, maybe i can glue somethign together. i find myself using vim search and replace and i'd really like the p6re. 16:23
El_Che kybr: I would appreciate if you would implement :perl6do for vim 16:34
Ven`` do we not have some sort of .map-keys and .map-values? 16:35
Ven`` I must misremember. 16:35
jmerelo webstrand: we have .keys.map and .values.map 16:36
Ven`` er, not even the right prefix :P 16:36
I don't want .keys.map and .values.map, I want .map-keys and .map-values
(those keep the other side)
jmerelo Ven``: You want to map keys or values? I don't think I understand what you mean. 16:37
timotimo Ven``: you're probably looking for something with an :as parameter 16:38
anyway, .pairs.map is probably the right thing in your instance 16:39
Ven`` m: sub map-keys(%h, $f) { %h.map(-> $p { $f($p.key) => $p.value }); }; map-keys({:1a, :2b, :3c}, *.succ).say
camelia (c => 2 b => 1 d => 3)
Ven`` here's what I mean 16:40
jnthn I'm not aware of anything shorter than that.
El_Che perl 6, got to love it 16:41
Ven`` aw, ok
El_Che in go you know you'll end writing a function
in perl 6 there is some much in core, that you're always in doubt if the functionality isn't already built in
it does not matter how weird it is :) 16:42
timotimo m: my %h = :1a, :2b, :3c; my %x = %h.keys.map(*.succ) Z=> %h.values; say %x 16:43
camelia {b => 1, c => 2, d => 3}
jnthn El_Che: Not to mention that having such stuff to hand often leads me to solve problems in good ways rather than "eh, I'll cheat a bit" :)
El_Che jnthn: I alway reason that people that implement that stuff for me are better programmers, so their core stuff will be faster and safer :) 16:44
jnthn El_Che: I'm not sure it's so much about "better programmers" so much as "more eyes, more tests" 16:46
Ven`` timotimo: not shorter enough to warrant the "weird Z" ;) 16:47
(imho)
Ven`` (and since I'm writing this code for $work, it'll have to be maintained by others) 16:47
timotimo :) 16:48
Ven`` I'll probably stick a map-keys and map-values into a module and call it a day. Not sure whether as augments or not (I still like the feed operator...) 17:04
scimon I feel a strength of Perl6 is as a language for making shared languages. It's easy to extend and create an ecosystem a team can work in. 17:06
Ven`` I suppose some Common Lispers felt the same..:)
scimon One thing I think we should work on is documenting how to setup a shared local repository. DarkPan for Perl6. 17:07
I keep meaning to do it.
jmerelo scimon: I've also thought about that. 17:09
scimon As far as I can tell the easiest way is for a local group using git would be to mimic the original system
jmerelo scimon: but it's going to be a hard thing to do. For the time being, the paths to repos are hard-coded in zef. 17:09
scimon zef config.
github.com/ugexe/zef#phases--plugins-settings
jmerelo scimon: I'd do it in a roundabout way, and it's something I would like to do sooner or later: fork zef and do some other stuff.+ 17:10
scimon: no matter what, it's healthy to have several entry points to the ecosystem. Rigth now, zef is the only gate, and gatekeeper.
scimon I think it's a case of having a custom config with your local git repo data in and recreating the Meta json files. 17:11
Hmmm I was looking for a talk to give at LPM in a couple of weeks.
jmerelo scimon: theoretically. But in general, zef is not keen on being used outside its only intended purpose. 17:12
scimon: you might find paths to repo descriptions are hardcoded.
scimon github.com/ugexe/zef/blob/master/r...onfig.json
:D
(Now this is me just poking about.) 17:13
scimon But it looks like having a customer config that added a new Ecosystem from a given URL would be simple enough. 17:14
jmerelo scimon: well, give it a spin and report back. Good luck.
scimon Aye. :) 17:15
ufobat_ is there a "deep clone" method for (simple) objects, or do i need to implement such a ding by hand? 17:28
scimon .clone ? 17:31
ufobat_ it's shallow 17:32
jmerelo ufobat_: what about dumping to JSON and getting it back on the other side? As long as you know the type... 17:33
scimon What kind of objects are we talking about?
m: role Bob { has $.hi };role Sue { has Bob $.bob };my $b = Sue.new( bob => Bob.new( hi => "There" ) );say $b.perl;my $c = $b.clone;say $c.perl 17:34
camelia Sue.new(bob => Bob.new(hi => "There"))
Sue.new(bob => Bob.new(hi => "There"))
scimon Anyway. I need to run away. 17:35
Ciao
ufobat_ m: role Bob { has $.hi };role Sue { has Bob $.bob };my $b = Sue.new( bob => Bob.new( hi => "There" ) );say $b.perl;my $c = $b.clone; $b.bob.hi = "foo"; say $c.perl 17:54
camelia Sue.new(bob => Bob.new(hi => "There"))
Cannot modify an immutable Str (There)
in block <unit> at <tmp> line 1
ufobat_ m: role Bob { has $.hi is rw };role Sue { has Bob $.bob };my $b = Sue.new( bob => Bob.new( hi => "There" ) );say $b.perl;my $c = $b.clone; $b.bob.hi = "foo"; say $c.perl 17:55
camelia Sue.new(bob => Bob.new(hi => "There"))
Sue.new(bob => Bob.new(hi => "foo"))
ufobat_ but in general it are objects as simple as that 17:55
Xliff m: 1.fmt('%02d').say; 18:30
camelia 01
Xliff m: Version.new('v1.1.1').say 18:35
camelia vv.1.1.1
Xliff m: Version.new('v1.1.1'.substr(1)).say
camelia v1.1.1
Geth doc: 7ff36db5f8 | (JJ Merelo)++ | doc/Type/Mu.pod6
Clarifies example

Thanks to @raiph in
  stackoverflow.com/a/54635282/891440. This (hopefully) closes #2620
18:37
synopsebot Link: doc.perl6.org/type/Mu
b2gills m: Xliff: say v1.1.1 == Version.new('1.1.1') 18:45
camelia True
b2gills m: say Version.new('1.1.1')
camelia v1.1.1
Xliff b2gills: I know. ;) 18:50
I haved a C-lib that I want to build version info for. So the Str output needs to prefix the v. 18:51
I construct the Version output from the Str coz I'm lazy and the Str version was easy to write. :D
Xliff Can you have a package/object with a name that ends in "::Version"? 19:02
Or is that reserved?
timotimo should be fine 19:10
since version modifiers go by :ver rather than ::Version
cpan-p6 New module released to CPAN! Printing-Jdf (0.1.1) by 03JSTOWE 20:09
rindolf .seen Zoffix 20:12
yoleaux I saw Zoffix 6 Jan 2019 17:41Z in #perl6: <Zoffix> moritz: the project's direction and management style doesn't match my goals and I'll be happier elsewhere.
cpan-p6_ New module released to CPAN! Printing-Jdf (0.1.1) by 03JSTOWE 20:14
dominix hi everyone 21:57
I am looking for the short form of div
the short form of multiply is $x *= 2; 21:58
but what is the short form of $x = $x div 2; ?
$x /= 2 ; do not work
Xliff m: multi sub a ($i) { say "I"; }; multi sub a (*@i) { say "II"; }; a(1); 21:59
camelia I
discord6 <Vendethiel> div=
Xliff m: multi sub a ($i) { say "I"; }; multi sub a (*@i) { say "II"; }; a(1, 2);
camelia II
discord6 <Rogue> you can simply do $x div= 2 I believe
<Rogue> = is both a normal operator and a metaoperator
<Vendethiel> $x [Rdiv]= 2 for the other way around 22:00
dominix ok, ... weird but acceptable.
Xliff m: m $x = 4; $x [div]= 2; $x.say;
camelia 5===SORRY!5===
Unrecognized regex metacharacter = (must be quoted to match literally)
at <tmp>:1
------> 3m $x7⏏5 = 4; $x [div]= 2; $x.say;
Couldn't find terminator $ (corresponding $ was at line 1)
at <tmp>:1
------> 3m $x =7…
Xliff m: m $x = 4; $x [&div]= 2; $x.say; 22:01
camelia 5===SORRY!5===
Unrecognized regex metacharacter = (must be quoted to match literally)
at <tmp>:1
------> 3m $x7⏏5 = 4; $x [&div]= 2; $x.say;
Couldn't find terminator $ (corresponding $ was at line 1)
at <tmp>:1
------> 3m $x =7…
Xliff m: my $x = 4; $x [div]= 2; $x.say;
camelia 2
Xliff There you go
dominix m: my $x = 4; $x div= 2; $x.say; 22:03
camelia 2
dominix this works for me. 22:04
Xliff :) 22:05
Xliff If I want to access something like an array, can I just implement method AT-POS? 23:03
sena_kun m: class A { has @.a = 1,2,3,4,5; method AT-POS($index) { @!a[$index] } }; say A.new[2]; say A.new[4]; 23:06
camelia 3
5
Xliff sena_kun++: :) # Thanks! 23:07
sena_kun .oO ( some questions can be easier to check than to ask )
yw
Xliff I was thinking about how I would do that. You think faster. ;p
timotimo there's a module in the ecosystem meant to make it easier to build custom array-likes 23:51