»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
RabidGravy BooYa! 06:11
grondilu .seen pmurias 07:19
yoleaux I saw pmurias 10 Apr 2017 14:55Z in #perl6: <pmurias> so if it fails a roast test it's most likely because of a bug rather then some minor unimplemented feature
samcv guys is it a bad idea or not to create an AppImage with ALL the perl 6 modules 07:34
well. as many as pass building 07:35
samcv i think that might be fun 07:35
pmurias grondilu: hi
moritz samcv: as long as it's not the only option, go for it! 07:38
samcv or could make zef availible and have it install to like ~/.perl6 or something 07:39
since it looks there anyway
make a rakudo moar-blead with everything in it. or whatever 07:40
and also would test the modules and give a report on it. though some of them may fail because of the appimage and it not starting out in ./ 07:41
well. but i can install them before making the appimage. so that shouldn't be too hard.
might still have the issue they have to recompile when first run. and they may or may not be cached after that. still need to investigate full
just added cron to it 07:45
but yeah the main real problem is getting it to change path before doing anything. so the relative paths work normally
does anybody have input on what command line option could be added to do that? what it wuold be? 07:46
moritz --cwd=path 07:47
or --workingdir=path
or something like that
samcv yeah that would be great
moritz or --chdir=path 07:48
samcv good suggestions
i tried adding a module that does it. but with how the appimage is relative, it totally breaks things to preload modules
they can be loaded fine in scripts but not *before* because the precompilation and stuff triggers a dependency cycle (even if it's an empty file you're preloading) 07:49
samcv argh. precomps have nonrelative paths in them 07:54
frustrating. so can't put them back in because then hashes are wrong
samcv wonder if i can just rename them based on the checksum? 07:55
after i edit them
samcv also i think we should have Readline not Linenoise for Rakudo * 08:12
since Linenoise does not support Unicode properly. it's UTF-8 naive
u-ou is there a way to tailcall in perl6 like 5's goto &foo 08:36
u-ou nvm, im off to bed ;p 08:53
night
oops
samcv night u-ou 09:05
u-ou, this is what the documentation says docs.perl6.org/language/5to6-perlfunc#goto 09:06
i would read here design.perl6.org/S04.html#The_goto_statement 09:08
samcv looks like next last and redo can be called on Label 's 09:10
and Label is a type 09:11
Geth ecosystem: a798b27b49 | (Alexey Melezhik)++ (committed using GitHub Web editor) | META.list
Install Rakudo as system package

  github.com/melezhik/perl6-sparrowdo-rakudo - This is simple installer of Rakudo Perl6.
09:26
fatguy how do i import class / role into my main perl file ? my class file is Class/Example.pm, i specified 'unit module Example' and use 'use Class:Example' on main file but when i run it, it return 'undeclared name' 10:35
geekosaur you needed "unit module Class::Example;" and probably "use lib '.'" 10:38
or, "use lib 'Class'" 10:39
Luna521 'Google haskell
moritz timotimo: fwiw perl6-all-modules is now up-to-date 13:48
timotimo thanks! 13:52
masak moritz++
timotimo moritz++
so it turns out that we never precompile nfas for grammars that are written in perl6 code. only grammars in nqp code get that benefit, like the Perl6::Grammar itself 13:53
masak huh
potential big speedup? 13:54
timotimo startup improvements could be had 13:58
so, this is confusing me right now:
i see that in the bootstrap a Regex gets @!caps, $!nfa, @!alt_nfas set as attributes, and SET_CAPS, SET_NFA, SET_ALT_NFA, and such set as methods 13:59
ah, it was just one of the <anon> in there 14:00
timotimo okay, let's see ... 14:01
haha 14:02
could it be ...
m)
nqp has the method ALT_NFAS that it calls to get at the nfas
rakudo calls it ALT_NFA
oh, not quite 14:04
that's supposed to be a different method
timotimo why ALT_NFA is calling atkey on an attribute that's supposedly a List ... nobody will ever know? 14:05
timotimo yeah, we're totally storing a hash inside an attribute that's defined to be List 14:08
it's iterating over the result of ALT_NFAS into a variable named $name, but it's actually expected to be a pair ... who thought of all this :D 14:11
timotimo cool, i think i've got it 14:25
and there's the commit 14:30
alphah how can I merge these two hashes: 17:39
%mainhash: {subhash1 => {key1 => True, key2 => value2}, subhash2 => {key3 => value3, key4 => True}}
%otherhash: {subhash1 => {key1 => True, key2 => othervalue2}, subhash2 => {key5 => value5, key6 => True}}
sotha %mainhash becomes {subhash1 => {key1 => True, key2 => othervalue2}, subhash2 => {key3 => value3, key4 => True, key5 => value5, key6 => True}}
alphah merge keys of %otherhash to %mainhash, if duplicate keys , then overwrite %mainhash and use the vlaues from %otherhash 17:41
MasterDuke m: my %a = (a => 1, b => 2); my %b = (b => 3, c => 4); %a ,= %b; dd %a 17:44
camelia Hash %a = {:a(1), :b(3), :c(4)}
MasterDuke that works for a single level of hashes, haven't tried with multi-leveled hashes 17:45
alphah yes, doesn't work for multi level hashes 17:46
TimToady m: my %a = :1a, :2b, :3c; my %b = :42b; %a «=» %b; say %a 17:49
camelia {a => 1, b => 42, c => 3}
TimToady that might recurse 17:51
but it's probably gonna screw up your top level 17:52
sometimes you just gotta write a map :)
alphah hmm 17:53
TimToady at one point we had a .tree command that could remap differently on different levels, dunno if we still do
jnthn m: my %mainhash := {subhash1 => {key1 => True, key2 => 'value2'},subhash2 => {key3 => 'value3', key4 => True}}; my %otherhash := {subhash1 => {key1 => True, key2 => 'othervalue2'}, subhash2 => {key5 => 'value5', key6 => True}}; for %otherhash { %mainhash{.key} = hash %mainhash{.key}, .value }; say %mainhash # shortest I figured so far 17:55
camelia {subhash1 => {key1 True
key2 value2 => {key1 => True, key2 => othervalue2}}, subhash2 => {key3 value3
key4 True => {key5 => value5, key6 => True}}}
jnthn Uh, not sure it's right though :) 17:56
m: my %mainhash := {subhash1 => {key1 => True, key2 => 'value2'},subhash2 => {key3 => 'value3', key4 => True}}; my %otherhash := {subhash1 => {key1 => True, key2 => 'othervalue2'}, subhash2 => {key5 => 'value5', key6 => True}}; for %otherhash { %mainhash{.key} = hash %mainhash{.key}<>, .value<> }; say %mainhash # shortest I figured so far 17:57
camelia {subhash1 => {key1 => True, key2 => othervalue2}, subhash2 => {key3 => value3, key4 => True, key5 => value5, key6 => True}}
TimToady maybe ««=»=» or some such
jnthn that looks more like it
Dinner :)
alphah trying to understand what you guys did :) 17:58
jnth: yeah it worked :) 18:04
alphah TimToady: reading about ««=»=» I'll see if I can make it work, looks shorter 18:05
Thanks guys
TreyHarris TimToady: I thought there was a categorize variant for this.... hrm 18:17
Geth doc: 56b50fe109 | (Zoffix Znet)++ | doc/Type/IO/Handle.pod6
[io grant] Document IO::Handle.slurp

  - Rakudo impl: github.com/rakudo/rakudo/commit/f1b4af7af4
  - Tests: github.com/perl6/roast/commit/7e4a2ae34b
  - Also add deprecation notice to .slurp-rest
18:19
TreyHarris Can anybody point me at a P6 port of a perlxs-dependent module? I just want to crib off how it was done, I can figure out my own way but there are probably already conventions I can follow 18:20
(A full port, I mean, not a p6-to-p5 bridge) 18:21
mst I'm not sure there exactly are such things, p6 seems to go straight to FFI
so it's more like a perl5 module using p3rl.org/FFI::Platypus
jnthn: suggestions for a good example of 'is native' ? 18:22
TreyHarris mst: that's what I was going to do when I said "I can figure out my own way"-- just translate the .t files into Perl 6 and rewrite the XS into "is native" calls. Assuming that the P5 API is equivalent to the best P6 API, which it may not be. 18:23
.subst(/\.t\/, ".t and .pm") 18:26
Geth ecosystem: b0036ac344 | (Zoffix Znet)++ (committed using GitHub Web editor) | META.list
Use META6.json for MARTIMM/pod-render
18:27
Geth ecosystem: 229fdc2aac | (Zoffix Znet)++ (committed using GitHub Web editor) | META.list
Use META6.json for XML.pm6
18:27
jnthn Depends what kind of library it is. If it's some C code that you want to compile on install and call, see Digest::SHA1::Native. If it's to some installed library (and maybe include a Win32 binary install option) then there's loads of examples; Acrhive::LibArchive::Raw is probably a nice mix of non-tiny but isolated. 18:29
And if it's some kind of non-blocking library and you want an example of how to front it with Promise/Supply, SSH::LibSSH is probably the best example so far 18:30
TreyHarris I'm specifically curious if anyone has done it in a case where different OS variants are smooshed together via XS into the same Perl 5. Like Proc::ProcessTable.
$*OS and $*SYS, which I remember from the Apocalypses, don't seem to exist anymore, so I don't even see how to switch on it 18:31
jnthn It's $*DISTRO and $*KERNEL nowadays
So far as native calls go, we don't resolve them until the first call 18:32
TreyHarris jnthn: and regex matching against it at compiletime (to switch on <linux bsd etc>) is allowable?
jnthn I think they're objects rather than strings so you may be able to exact match 18:33
m: say $*KERNEL
camelia linux (4.4.57.18.3.default)
jnthn m: say $*KERNEL.^methods
camelia (BUILD name version release hardware arch bits signals signal Str gist auth signature desc)
jnthn m: say $*KERNEL.name
camelia linux
TreyHarris m: say $*KERNEL.^methods 18:34
camelia (BUILD name version release hardware arch bits signals signal Str gist auth signature desc)
TreyHarris ah, cool
m: say $*KERNEL.name
camelia linux
TreyHarris that may be sufficient.
-Should I define such native subs in a phaser if I'm going to do that kind of thing? Or since it's not resolved until first call can I just do method dispatch on something I get out of $*KERNEL and assume the invalid native calls will never be reached? 18:37
i.e., method exposedthing (not native) uses $*KERNEL to call method hiddenthing-linux or method hiddenthing-bsd, etc.? 18:38
or can I even subsignature off of $*KERNEL itself and use a multi? 18:39
jnthn Personally I'd probably rely on it not being resolved until first call and just dispatch to the correct one
TreyHarris (Sorry, I know I _can_. I just don't know if I should.)
jnthn Unless there were a load of calls and I wanted to break them out into separate modules by OS or something 18:40
Not sure if I'd where-cause it off $*KERNEL
Those aren't...entirely optimal :)
Another option would be to have a role declaring the "interface" and then write a class doing it per OS or whatever 18:41
And then something like constant TheThingy is export = do given $*KERNEL { when 'linux' { TheLinuxImpl } ... } 18:42
Then the implementation is selected at compile time and you don't have repeated runtime checks, and export a consistent symbol name to userspace 18:43
uh, s/userspace/the user of your module/ :)
The interface role is optional of course, it just gives people a portable type they can talk about
shopping, bbl 18:45
TreyHarris jnthn: yeah, makes sense. The compiler doesn't even let you write a where clause for a parameterless signature, and taking advantage of it letting you write something like "multi foo($a where { $*KERNEL.name ~~ 'linux'}) { ... }" when you do have a parameter seems fugly as hell 18:47
TreyHarris jnthn: I like the "constant TheThingy is export = do given $*KERNEL" a lot. It answers a lot of cases where I felt frustrated that I couldn't declare the same name twice globally and disambiguate between them lexically 18:49
TreyHarris why I was complaining to geekosaur yesterday that use lack's Haskell's "import Long.Thing as T" and "import Prelude hiding (coreThing); import Elsewhere (coreThing)" 18:51
TreyHarris *C<use> lacks Haskell's... 18:51
TreyHarris That said, does that mean we've entirely given up on the idea of answering the diamond dependency problem where you depend on A and B where A depends on C version 1 and B depends on C version 2? 18:56
Because I know that was a design goal 18:57
geekosaur not so much given up, as not having tackled it yet and probably not going to happen for v6.d either 19:00
it's a Hard Problem
TreyHarris geekosaur: Oh, I know, and you know I know :-) 19:01
skids TreyHarris: I had a relatively efficient runtime backend chooser in the Sum:: module (lib/Sum/Recourse.pm), but it is currently bitrotten. Allowed the module to roll with it if someone installed/uninstalled a native library and fallback to a different one or pure Perl6. 19:20
grondilu m: say .fmt("%f") give [*] 1..361; 19:23
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3say .fmt("%f")7⏏5 give [*] 1..361;
expecting any of:
infix
infix stopper
postfix
statement end
state…
grondilu m: say .fmt("%f") given [*] 1..361;
camelia Inf
grondilu how can I get a scientific notation without going through floating points? 19:23
(also, can I?) 19:24
TreyHarris skids: yes! I vaguely remembered that, and I went looking for it
skids: guess it's best I didn't find it since it would have confused me
skids m: .fmt("%f").say given [*] 1..361; 19:28
camelia Inf
skids oh didn;t notice the reduce.
skids mind is dulled from logging into 300 switches today. 19:29
skids m: say (45/678939).base(10,50); # grondilu -- just move the '.' and count? 19:44
camelia 0.00006627988670558032459469849279537631510341871656
TreyHarris m: say .log10 given [*] 1..361; 19:47
camelia Inf
TreyHarris ouch
skids m: say $_.can("log10")[0]>>.package given [*] 1..361; 20:09
camelia ((Numeric))
Zoffix m: printf '%.5fe%d', $_/10**(.chars-1), .chars-1 with [*] 1..361 20:11
camelia 1.43792e768
Zoffix Negative numbers sold separately 20:12
Also, the 10** explodes at some largish point.
skids m: say $_.can("log")>>.package given [*] 1..361; #hehe 20:14
camelia ((Real) (Cool))
Geth ecosystem: blippy++ created pull request #315:
Add NCurses6 to ecosystem
20:21
Geth ecosystem: 1634b1f5ea | blippy++ (committed by Zoffix Znet) | META.list
Add NCurses6 to ecosystem (#315)

See github.com/blippy/perl6-ncurses6
20:24
Geth ecosystem: caecb13b8e | (Jonathan Worthington)++ (committed using GitHub Web editor) | META.list
Add IO::Socket::Async::SSL

See github.com/jnthn/p6-io-socket-async-ssl for further information.
21:37
leont That sounds like a useful module! 21:55
jnthn Took a bit of figuring how to do :) 21:57
Though writing async bindings to C libs is kinda a fun thing to be doing :)
[Coke] gets a new macbook pro for work, and wonders how on earth liz is coping with the lack of an escape key. 22:03
samcv it has no escappe key! 22:04
[Coke] it has the dynamic bar at the top, which usually has an escape "key" in it. 22:07
I am tempted to remap ` to be ESC instead.
leont Someone is hating users of proper editors? ;-) 22:08
AlexDaniel [Coke]: what about caps lock? :) 22:16
mst [Coke]: Ctrl-[ is your friend
[Coke] caps lock is control for me. 22:18
lucs [Coke]: Same for me, and Ctrl-[ for ESC works fine. 22:19
samcv when do we just get neural implants to control keyboards with our minds though 22:21
AlexDaniel samcv: these are called hands :) 22:27
Geth doc: 017acd4e18 | (Zoffix Znet)++ | doc/Type/IO/Path.pod6
[io grant] Improve docs for IO::Path.slurp
23:25
Geth doc: 0f49bb548c | (Zoffix Znet)++ | doc/Type/IO.pod6
[io grant] List Rakudo-supported encodings in open()
23:38
Geth doc: e60da5cc8d | (Zoffix Znet)++ | doc/Type/IO.pod6
[io grant] List utf-* alias examples too since they're common
23:41
Geth doc: f83f78cbec | (Zoffix Znet)++ | doc/Type/IO.pod6
[io grant] Use idiomatic Perl 6 in example
23:44