»ö« 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.
seatek I forgot this: in Perl5 Moose you can use variable attribute names like $self->$attr_name -- anyone know the equiv. in Perl6 for variable attribute names? 00:10
timotimo self."$attr_name"() 00:11
seatek oh yeah!!!! i was trying those crazy ::($attr) ones ;)
timotimo heh, :: is for packages and lexical scopes
seatek well self is for methods ;) 00:12
timotimo right, and attributes are accessed with accessor methods
private attributes are different, though
seatek yay
yeah
lookatme morning 00:38
moritz lizmat++ # p6weekly.wordpress.com/2017/06/26/...way-there/ 04:23
lookatme moritz++ 04:37
ufobat ola 07:09
lizmat_ clickbaits p6weekly.wordpress.com/2017/06/26/...way-there/ 07:31
El_Che hello 07:38
parv yo 07:40
howizit? 07:41
lookatme hello 07:50
melezhik Hi! 07:52
I am reading docs of github.com/zoffixznet/perl6-Proc-Q and not quite clear how can I pass parameters to proc-q ?
I am talking about commands parameter - github.com/zoffixznet/perl6-Proc-Q#commands
say I want to run external program by using Proc::Q 07:53
the example I see works fine, but when I try to adopt it I get this 07:54
perl6 -e 'use Proc::Q; proc-q {"echo OK"};' 07:55
Constraint type check failed in binding to parameter '@commands'; expected anonymous constraint to be met but got Array ($[-> ;; $_? is raw { ...)
I the doc for command parameter I read - "A list of lists, where each of inner lists is a list of arguments to Proc::Async.new. " 07:56
but I can't come up with a proper way to use it ... 07:57
llfourn m: say ({ "echo OK" }).WHAT 07:59
camelia (Block)
llfourn but what it wants is a list of lists
so if you just want one echo
do proc-q [<echo OK>,] 08:00
actually no need for the comma
m: say [<echo OK>]
camelia [echo OK]
llfourn m: say [<echo OK>,] # actually there is
camelia [(echo OK)]
llfourn melezhik: ^ 08:01
melezhik hi llfourn: 08:03
perl6 -e 'use Proc::Q; proc-q [<echo OK>];'
Constraint type check failed in binding to parameter '@commands'; expected anonymous constraint to be met but got Array ($["echo", "OK"])
llfourn o.o
llfourn oh 08:03
they have to be a list for some reason
llfourn m: dd (<echo OK>,) 08:04
camelia (("echo", "OK"),)
llfourn melezhik: like that ^
melezhik perl6 -e 'use Proc::Q; proc-q (("echo", "OK"),);' - succeed 08:05
llfourn \o/
melezhik btw it requires the last comma
llfourn yep
melezhik after "OK"
thanks !
llfourn nw gl
melezhik will go further with my investigation of Proc::Q and stuff ;))) 08:06
llfourn I'm interested to see where you are going with sparrowdo etc
I read your blog post on using it to do docker
I'm currently trying the same sort of things with spitsh
parv that comma makes the first arg as a list; turning that data into list-of-list 08:07
melezhik I am not sure about certain target auditory, meanwhile I use sparrowdo at my current work, not that extensively 08:07
llfourn target audience?
melezhik spitsh? probably I have already seen that ... 08:08
llfourn melezhik: github.com/spitsh/spitsh
melezhik yeah, target audience ... sorry
yeah will look at ...
parv m: my @x = (<a b>); my @y = (<a b>,) ; say @x[0].WHAT ; say @y[0].WHAT
camelia (Str)
(List)
llfourn heh that makes too of us
melezhik: are you going to be at TPC eu? 08:09
two*
melezhik unfortunatelly I don't have much time at the moment, pretty buzy with many things, so can't attend 08:10
llfourn ah k 08:10
llfourn &
melezhik looks spitsh is more intelegent than sparrowdo, as under the hood sparrowdo just pushes jobs over ssh and runs sparrow client written on Perl5 ... 08:11
))
jsimonet m: use NativeCall; subset char_t of Str; my Pointer[char_t] $c; 08:15
camelia 5===SORRY!5=== Error while compiling <tmp>
An exception occurred while parameterizing Pointer
at <tmp>:1
Exception details:
A typed pointer can only hold:
(u)int8, (u)int16, (u)int32, (u)int64, (u)long, (u)longlong, num16, num32, (s)s…
jsimonet Hello, I'm trying to use a C lib in Perl6 and I used GPTrixie to generate Perl6 mapping, but some special types are used in Pointer. Sould I modify all sub definitions or is there another way ? 08:17
parv i am using rakudo rg276d4. why is there no difference between "@x = (<a b>)" & "@x = [ <a b> ]" (both ~~ & == return True)? 08:20
melezhik parv: thanks for explanation of the last comma 08:24
parv happy to help, with what little I know. I am also learning 08:27
melezhik )) 08:29
how to read a directory structure ? I need the first level directories inside some dir ... 08:30
probably this one ? - docs.perl6.org/routine/dir 08:31
Ven`` o/
melezhik might be handy with in-dir?
moritz melezhik: yes, dir
melezhik: and you can pass a dir to dir :-)
m: say dir('/tmp') 08:32
camelia ("/tmp/y2yamldata-M2wvA1".IO "/tmp/.X11-unix".IO "/tmp/.ICE-unix".IO "/tmp/.XIM-unix".IO "/tmp/.font-unix".IO "/tmp/.Test-unix".IO "/tmp/3rat9uqe4F".IO "/tmp/IXajBf20V7".IO "/tmp/b_kUNwvxo8".IO "/tmp/gzUJ6dIrZV".IO "/tmp/EMgpnqBzo8".IO "/tmp/hsperfdata_c…
melezhik thanks, moritz:
parv does zef know about modules installed with installation of rakudo (if any installed at all) besides the ones installed by zef itself? 08:56
nevermind, seems so. 08:58
parv later people ... 09:14
llfourn m: say *<foo>:v # why can't I adverb? 09:56
camelia 5===SORRY!5=== Error while compiling <tmp>
You can't adverb
at <tmp>:1
------> 3say *<foo>:v7⏏5 # why can't I adverb?
expecting any of:
pair value
sena_kun o/ 10:12
m: "foo/bar".IO.add("../../").resolve.relative.say; 10:13
camelia foo/bar/../..
sena_kun But docs.perl6.org/type/IO::Path#method_add 10:13
Is it docs or implementation?
FROGGS maybe it only resolves stuff that actually exists? 10:16
have you tested that?
sena_kun Nope. Let's try... 10:17
sena_kun Indeed. Fool me! FROGGS, thanks. 10:18
FROGGS :o)
probably means we should put that in the docs...
sena_kun Yeah. 10:18
FROGGS sena_kun: are you going to do it? 10:21
sena_kun FROGGS, yeah. Though it is assume method, not `add`. And I'll fix indentation too.
Hmmm. Well, it doesn't seem like a problem, much more as a fault of mine. I mean, resolve method says explicity that "This means that the filesystem is examined for each directory in the path". So fixing only indentation then... 10:23
Geth doc: 5cca681092 | Altai-man++ (committed using GitHub Web editor) | doc/Type/IO/Path.pod6
Fix up code sample indentation
10:24
Geth doc: e1c508f314 | Altai-man++ (committed using GitHub Web editor) | doc/Type/IO/Path.pod6
More indentation fixing
10:28
FROGGS nine: okay, got Inline::Perl5 installed now... had to change the "perl"-binary name to "perl5.24.0" for me... (I'm using perlbrew, and not switching perls actually) 10:36
nine: I get a single test failure though when installing Inline::Perl*6*... Can't call method "get_one" on an undefined value at t/use.t line 12. 10:38
is that known
nine No, it isn't.
neuron Hi 10:39
FROGGS k
neuron I don't seem to be able to file a bug using the rt.cpan.org web interface
FROGGS hi neuron
neuron I would like to report issue with NativeCall, where should I send the email to?
FROGGS you can send an email to [email@hidden.address]
neuron So simple :) Thank you 10:40
FROGGS this will go straight into RT
FROGGS damn, maybe I'm just missing -Duseshrplib 10:44
FROGGS nine: I still get that error after rebuiling that libperl.so :o( 11:07
melezhik How can I delete an element from array?
sena_kun melezhik, some particular element? .grep maybe. 11:08
FROGGS delete? with grep? 11:08
sena_kun On some condition, I mean. 11:09
It wasn't note what element should be deleted. :/
nine m: my @a = 1,2,3; @a[1]:delete; dd @a; @a.splice(1, 1); dd @a
camelia Array @a = [1, Any, 3]
Array @a = [1, 3]
Geth doc: 6986130f4e | Altai-man++ (committed using GitHub Web editor) | doc/Type/IO.pod6
Fix a strange old thinko
11:10
melezhik thanks nine: 11:11
travis-ci Doc build errored. Altai-man 'More indentation fixing' 11:18
travis-ci.org/perl6/doc/builds/247460697 github.com/perl6/doc/compare/5cca6...c508f31454
lizmat melezhik: does that what you want? Or maybe you should look at splice 11:20
?
melezhik I guess :delete is fine 11:21
lizmat melezhik: oki :-) 11:23
FROGGS nine: do you have a blog post or something else that describes how I should subclass a Perl 5 class? 11:33
melezhik I wonder how poll described at docs.perl6.org/type/Channel#method_poll work?
ilmari FROGGS: github.com/niner/Inline-Perl5#inhe...rl-5-class 11:34
melezhik I mean at what conditions item is removed from the channel?
FROGGS uhh, silly me
I even got that page open -.-
thanks ilmari
nine And I hope it's kinda intuitive anyway :)
FROGGS that use.t is still failing (and I was unable to understand whats going on), so I try to continue to do what I wanted initially 11:35
nine FROGGS: could be that the test is victim to the lexical module loading changes in rakudo 11:38
FROGGS nine: can I test that with an older version of rakudo perhaps?
nine FROGGS: you could try something like my $whatever = $p6->run('use Whatever; Whatever'); my $obj = $whatever->new(); 11:40
FROGGS no dice, `$p6->run('use Perl6Test; Perl6Test')` still returns undef 11:42
melezhik given a channel I want want to see all it's items. basicly poll is ok, but I am not clear _which_ item it recieves?
travis-ci Doc build passed. Altai-man 'Fix a strange old thinko' 11:46
travis-ci.org/perl6/doc/builds/247472851 github.com/perl6/doc/compare/e1c50...86130f4ef2
sena_kun m: 'one two three' ~~ /(\w+)+ % ' '/ 11:48
camelia ( no output )
sena_kun m: say 'one two three' ~~ /(\w+)+ % ' '/
camelia 「one two three」
0 => 「one」
0 => 「two」
0 => 「three」
sena_kun Why indexes are zeroed, instead of proper count? 11:49
sena_kun if 'one two three' ~~ /(\w+)+ % ' '/ { say $0[1] } 11:50
sena_kun m: if 'one two three' ~~ /(\w+)+ % ' '/ { say $0[1] } 11:50
camelia 「two」 11:51
sena_kun It still works. Hmm.
timotimo melezhik: polling out an item from the channel grabs the earliest one that was sent and not yet received. the channel acts like a queue, you cannot get any other item than the "next to be received" one 12:09
melezhik ok 12:10
melezhik I guess I end up with simple Per6 / Promice implimentation to get what I need 12:10
melezhik probably Proc::Q/Channel does not fit for my task or I still understand well how this works ... 12:11
timotimo what is proc-q not doing for you? 12:12
melezhik my inital task is to run many externall program (processes) asynchronoulsy , but I also need to ensure not run the same program twice. 12:16
Proc::Q starts a banch of proccess but then I need to walk though all of then to get know that some of them finish 12:17
I have tried to use Channel/poll for this
melezhik the reason is why I need to know that some process finishes that this is creteria that I can re-run the same programm again safely 12:18
melezhik timotimo: probably it might be better to understand what I wanted to achieve looking at the implimentation with Promise - github.com/melezhik/sparky/blob/ma...sparky.pl6 12:22
which I failed to do with Proc::Q/Channel
melezhik but again probably I miss something ))) 12:23
jnthn That code has a read/write data race on %project-state 12:26
timotimo aha, proc-q doesn't seem to give you a "this program has been started" message at all, eh? 12:30
FROGGS haha lol
nine: it just works!
wth
melezhik I am aware about possible races 12:31
timotimo so you won't get the "started" 12:31
er, i mean "running"
melezhik if I use Proc::Q I have a Channel object which I can't iterrate through to get know which processes finish 12:32
FROGGS I'm doing this now in a Mojolicious controller: standard Perl 5 preamble, then "use Inline::Perl6; use v6-inline;", and after that I write the implementation of my routes in shiny nice Perl 6!
melezhik at least with Promise I can
timotimo why do you think you can't iterate through a channel? 12:33
jnthn melezhik: Untested but I'd probably write it something like gist.github.com/jnthn/32c3359202ec...e372fc2a75
Though does it need to watch for new scripts also? 12:34
melezhik yeah, I need an endless loop and I need to ensure that gist.github.com/jnthn/32c3359202ec...e-x-p6-L11 does not if already running 12:35
for the same project
jnthn Ah, what I did doesn't handle the new script case 12:36
nine FROGGS: yeah, I've done something like that for a talk or two :)
FROGGS nine: I love it *g*
jnthn But anyway, doing it in the react block and with Proc::Async will be far more manageable :)
(react essentially gives you an event loop that stays alive so long as there's work)
melezhik yeah, without this one I would use Proc::Async
nine FROGGS: niner.name/talks/Web%20development%...rl%206.pdf 12:37
melezhik I need state where I can read/write information about some external programm with some paramteres are running at the moment to ensure that it does not run two copies of it 12:38
melezhik at the same time 12:38
jnthn Yeah, the "spawn another copy when the last one exits" is what the run-project call is doing
In the whenever
Basically, whenever the last one exits, spawn another one 12:39
(Since whenever is an async construct, it isn't actually recursive)
melezhik jnthn: can I look at the implimetation where it does not run two copies at the time ? 12:40
jnthn melezhik: What, where it detects new projects also? 12:41
(The current version will never run two copies at a time.) 12:42
melezhik for simplicity let's say that projects list does not change
jnthn Oh 12:42
Then the current one I pasted should handle it
We do one loop over the directories at startup and call run-project 12:43
That runs the command using Proc::Async
The contents of the whenever block runs when the process exits
melezhik ahh, I see )))
jnthn And so at this point there's no copies of it running so we just call run-project again
:)
melezhik ok, but I am not clear how this ensure not run '/bin/sh', '-c', $cmd if $cmd is already runnning? 12:47
melezhik I mean I checked that this work how I expected but can't understand how ))) 12:51
jnthn melezhik: Do you understand how `whenever` works? Or is that the piece you're missing? :) 12:52
Proc::Async.new('/bin/sh', '-c', $cmd).start returns a Promise that is kept when the command exits
whenever $some-promise { code } runs code when $some-promise completes 12:53
So at that point we know that the process has already exeited, so we can start it again
Which we do by calling run-project
jnthn You might think of react as being like an event loop 12:54
And whenever sets up an event handler
FROGGS nine: I can't use a P5 module before the line "use v6-inline;", and call methods on that class after said line, right? 12:59
I also am not able to use a P5 module after said line, without causing P6M-duplicate-symbol errors... 13:00
melezhik neat! ))) 13:00
nine FROGGS: duplicate symbol errors sound troublesome?
FROGGS yes 13:01
FROGGS it reports the package name of the controller I am in to be duplicate 13:01
nine That's odd. It should only try to import modules that were loaded by the use statement. 13:03
melezhik jnthn: how to adjust your example to make it possible to re-read root directory structure in case new projects appear? any ideas? 13:36
jnthn melezhik: See IO::Notification 13:37
FROGGS nine: am I meant to access, say JSON::XS, that was loaded by P5 in a v6-inline block? 13:40
melezhik ok, I will look at this. And one more thing. Seems with new code my scripts ignore ctrl^c when running from console , so I have to `ps uax|grep` and then kill $pid to terminate it 13:41
ab6tract has just tried to sneak a talk submission into the YAPC::EU queue past the deadline 14:00
the computer didn't say "no", so ... :) 14:01
nine FROGGS: if you use JSON::XS:from<Perl5>; you should be able to access it 14:06
melezhik jnthn: IO::Notification works fine on itslef, but I hardly can see how to combine it with my script using react/react/Proc::Async 14:09
melezhik and I still have to care about directories untrouched to process them again and again where IO::Notification does not help 14:10
jnthn Yeah, you'd still need some kind of hash for directories you already added
You'd use the IO::Notification with another whenever block 14:11
INside of the react
And pull the code that scans directories out into a sub
And call it from the whenever
melezhik yeah I have just thought about this ... 14:12
)))
jnthn melezhik: Untested, but gist.github.com/jnthn/32c3359202ec...e372fc2a75 is a sketch of it 14:14
jnthn Inside of a react block, it makes sure that you are only inside of one of the whenevers at a time 14:14
(And code called as part of executing a whenever)
So this solution doesn't contain race conditions :)
oh, I forgot one thing 14:15
updated
jnthn Should call add-dirs() once a the start too, to set things up for what's already there :) 14:15
FROGGS nine: that's would be the point where I get that P6M duplicate symbol issue 14:28
melezhik jnthn: looks good for me. last thing I need to run add-dirs at the very of the begining when there are not events to trigger 14:31
how can I do this?
I mean the very beginning of the script ...
jnthn melezhik: I did that in the last update of the gist. Just call it at the end of the react block, once everything is set up :)
melezhik gist.github.com/jnthn/32c3359202ec...e-x-p6-L29 ? ))) 14:32
jnthn yes, that
jnthn Note that whenever is just setting up the handler for when there are notifications 14:33
It doesn't block execution
dogbert2 moritz: is irclog.perlgeek down atm? 14:36
lizmat moritz: seems down for me as well 14:42
melezhik jnthn: looks good. btw if I terminate script does it wait it's childs, lanched by Proc::Async.new ? 14:51
melezhik looks like if I terminate the script some sparrowdo commands are still here (at least I see the one ) 14:51
in `Sl` state
jnthn How are you terminating it?
melezhik kill $pid 14:52
jnthn But no, there's nothing set up for it to wait
You could install a signal handler to make that happen
melezhik good. could you please point me docs on how to set up signals in Perl6 ? 14:53
jnthn docs.perl6.org/routine/signal#class_Supply 14:54
It also returns a Supply
lizmat signal(SIGINT).tap( { say "Thank you for your attention"; exit 0 } ); # melezhik
jnthn so whenever signal(SIGINT) { ... }
You can probably set some boolean flag $killed = True or so and then in the whenever earlier do `run-project($dir, $project) unless $killed` 14:55
Then it just won't spawn another one of them
moritz dogbert2, lizmat: the server swapped; i've restarted the webserver, should be back up now 15:03
lizmat not just yet for me
moritz :( 15:04
moritz it all seems kinda slow, and consumes a lot of memory 15:08
have to investigate after $dayjob
melezhik Thanks a lot for help jnthn: and lizmat: will try to add signal handler later, so far all is good ))) 15:09
have commited changes to sparky repo 15:10
ufobat there is often a our $VERSION in perl5 modules. is this still idiomatic/a good way to go in perl6 15:24
timotimo i think the version is meant to be part of the meta info and such? 15:25
ufobat but that means the module itself does not know about its version, just e.g. zef does? 15:27
timotimo i'm convinced there ought to be a way to get the full meta info from whatever installation your script was grabbed from 15:29
but i don't know what or how
ufobat okay 15:37
dogbert2 moritz: are you running perlgeek on an RPi :-)
moritz dogbert2: I kinda wish I did 15:40
I ^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^HInstead it's a Vm with 2gb RAM, and I recently did an OS upgrade 15:42
[Coke] is there a way to tell if a test file is being run via prove with other files vs. standalone? (might be nice to adding some threading to a slow test file if it's not being run with other files) 16:06
[Coke] with jnthn's latest updates to Proc, getting a new (I think) failure in doc's xtest: 16:12
perl6 xt/space-after-comma.t doc/Type/IO/CatHandle.pod6 -> Malformed UTF-8
[Coke] golfed: say "LINE: " ~ $++ for run($*EXECUTABLE-NAME, '--doc', "doc/Type/IO/CatHandle.pod6", :out).out.lines; # prints up through 243 and then dies with Malformed UTF-8 - Zoffix, is there actually malformed UTF-8 in there, or is this a result of the .lines? (or passing through perl6 -doc?) (or the run?) 16:29
[Coke] looking at line 243 of the output of perl6 --doc on that file, there's nothing obviously malformed. Looks like straight ASCII 16:31
Geth doc: c6e8d0809c | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Iterator.pod6
Add IterationEnd to search index
16:32
mr_ron r: gist.github.com/ronaldxs/97c0118cf...d686c113f8 16:33
camelia ===SORRY!===
Could not find Bench at line 1 in:
/home/camelia/.perl6
/home/camelia/rakudo-j-inst-1/share/perl6/site
/home/camelia/rakudo-j-inst-1/share/perl6/vendor
/home/camelia/rakudo-j-inst-1/share/perl6
CompUnit::Reposi
===SORRY!===
Could not find Bench at line 1 in:
/home/camelia/.perl6
/home/camelia/rakudo-m-inst-2/share/perl6/site
/home/camelia/rakudo-m-inst-2/share/perl6/vendor
/home/camelia/rakudo-m-inst-2/share/perl6
CompUnit::Repos
mr_ron star: gist.github.com/ronaldxs/97c0118cf...d686c113f8
camelia ===SORRY!===
Could not find Bench at line 1 in:
/home/camelia/.perl6
/home/camelia/star-2016.10/share/perl6/site
/home/camelia/star-2016.10/share/perl6/vendor
/home/camelia/star-2016.10/share/perl6
CompUnit::Repository::Absolu
mr_ron Any way to run my gist with Bench? Perhaps Bench would be a good idea for R* anyway? 16:35
[Coke] for now, I'd recommend installing it locally. 16:36
(doc bad utf8) - .slurp.perl.say - works. .lines.perl.say - dies with utf8 error 16:37
mr_ron I can run the script on my system, but I was hoping to demo here.
[Coke] zoffiz: Pod formatting code X missing endtag '>' (on the Iterator edit you just made) 16:39
*zoffix
DeadDelta [Coke]: the end tag is present when I look at github commit: github.com/perl6/doc/commit/c6e8d0809c 16:57
Geth doc: 4c00a55a7d | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Iterator.pod6
Fix index tag
16:58
DeadDelta Looking at /glossary code, looks like the pipe should be before the term instead of after
[Coke] DeadDelta++ 16:59
DeadDelta [Coke]: for CatHandle, this doesn't die, so I assume it's the --doc stuff or something: perl6 -e '"doc/doc/Type/IO/CatHandle.pod6".IO.slurp.say'
[Coke] slurp works on the --doc output also 17:00
just not lines
DeadDelta hm. perl6 -e '"doc/doc/Type/IO/CatHandle.pod6".IO.lines.put' works 17:00
[Coke] doc/doc 17:01
I haven't been able to golf it smaller than "run, perl6 --doc, .lines"
DeadDelta doc/doc is because the clone is in doc/ 17:02
I have no problems with perl6 -e 'run(<perl6 --doc doc/doc/Type/IO/CatHandle.pod6>, :out).out.lines.put' 17:03
That's on 2017.05-389-g326faed. So it might be the proc rework at fault
DeadDelta & 17:04
mr_ron m: gist.github.com/ronaldxs/97c0118cf...d686c113f8 17:07
camelia 5===SORRY!5=== Error while compiling /home/camelia/site#sources/FC133D3E7EC3B0CBE238C296893894C9AB745A05 (Inline::Perl5)
An exception occurred while evaluating a constant
at /home/camelia/site#sources/FC133D3E7EC3B0CBE238C296893894C9AB745A05 (Inl…
timotimo mr_ron: may also want to test the shortcut += vs the full $r = $r + ... 17:23
mr_ron timotimo: Did you run it? 17:25
timotimo i don't have inline::perl5
i did run the code in one of the examples
nadim_ Hello P6!, I saw the word "QuqntHash" twice this week, once in the weekly changes and once when I merged the latest rakudo (512 commit since last, good work), I checked what it is at docs.perl6, it says it's a role, mhhh OK, but then little examples. are there some example of usage?
timotimo on my machine the "int" version is noticably slower, probably doing a bunch of boxing somewhere
lizmat nadim_: QuantHash is the generic term for Set,SetHash,Bag,BagHash,Mix,MixHash 17:26
nadim_ lizmat++
timotimo interesting, += is faster than the full form
i did not expect that
lizmat timotimo: since when ??? 17:27
timotimo no clue
the whateverable bots have netsplit out and haven't come back 17:28
mr_ron timotimo: The point of the exercise was that perl6 int arithmatic is about 10* slower than perl5 which would be understandable since p6 provides unlimited precision but limiting p6 precision with native int only seems to make it worse. 17:28
timotimo half a day ago
mr_ron: yeah, i expect we're losing a bunch of time from boxing and unboxing at some position
have you tried with the last few releases?
i seem to recall there was some kind of regression or something?
memory's hazy 17:29
lizmat m: my $a = 42; for ^10000000 { $a += 1 }; say now - INIT now
camelia 4.807176
lizmat m: my $a = 42; for ^10000000 { $a = $a + 1 }; say now - INIT now 17:29
camelia 3.8667810
timotimo now compare with int instead of Int
lizmat m: my int $a = 42; for ^10000000 { $a = $a + 1 }; say now - INIT now
camelia 7.3726763
lizmat m: my int $a = 42; for ^10000000 { $a += 1 }; say now - INIT now 17:30
camelia 4.35697416
timotimo fascinating
lizmat wow, even faster than the Int version
mr_ron m: my Int $a = 42; for ^10000000 { $a += 1 }; say now - INIT now 17:30
lizmat m: use nqp; my int $a = 42; for ^10000000 { $a = nqp::add_i($a,1) }; say now - INIT now 17:31
camelia 4.7593613
1.9248574
timotimo except camelia's host may be busy or something
lizmat m: use nqp; my int $a = 42; for ^10000000 { $a = nqp::add_i($a,1) }; say now - INIT now
camelia 2.003535
lizmat using nqp::ops on native ints still more than 2x as fast
mr_ron Is it a reasonable goal for p6 with native int to approach p5 performance? 17:32
Should it be significantly faster than Any/Int anyway?
timotimo we ought to be able to get faster than p5 17:33
mr_ron Should I look into filing a PERF ticket?
timotimo the int and += one spends 3.7% of its time in box_int, whereas it should be more like 0% 17:34
ilmari m: my int $a = 42; for ^10000000 { $a++ }; say now - INIT now 17:35
camelia 1.91576415 17:35
timotimo m: my int $a = 42; $a = $a + 1 for ^10_000_000; say now - INIT now
camelia 7.59916169
timotimo interesting, that's equivalently slow to the prefix-for 17:36
anyway, that code also spends a whole lot of time in invoking and returning from frames
mr_ron m: my $a = 42; for ^10000000 { $a++ }; say now - INIT now
camelia 2.3997292
timotimo the spesh redesign document says we could probably inline closures that were taken immediately before they get called; that'd benefit that benchmark 17:38
timotimo we're getting $_ passed in and are boxing every single value for that for loop, even though we don't use $_ even once 17:40
timotimo about 30% more time is spent if the $_ is unspecified vs when i specify it as being "int" 17:41
timotimo also, the + inside the loop isn't getting inlined, which is certainly odd 17:43
mr_ron m: {my $a = 42; for ^10000000 { $a++ }; say now - ENTER now}; { my int $a = 42; for ^10000000 { $a++ }; say now - ENTER now}
camelia 2.34404888
1.8906015
mr_ron m: {my $a = 42; for ^10000000 { $a += 2 }; say now - ENTER now}; { my int $a = 42; for ^10000000 { $a += 2 }; say now - ENTER now} 17:44
camelia 4.812863
3.084417
17:45
timotimo if you $a++; $a++; you get almost no time increase over just $a++ 17:46
mr_ron m: {my $a = 42; for ^10000000 { $a += 1 + $a %3 }; say now - ENTER now}; { my int $a = 42; for ^10000000 { $a += 1 + $a %3 }; say now - ENTER now} 17:46
camelia 8.119853
10.5393037
17:47
timotimo indeed, apart from having a bindlex immediately followed by a getlex in there, the $a++; $a++ is rather good performance-wise
but the loop itself is still calling the loop body over and over and it's still passing the $_ argument and not using it 17:49
timotimo m: say "{13130020819 / 10000000} cycles per loop entry" 17:55
camelia 1313.0020819 cycles per loop entry
timotimo we could do a lot better 17:56
mr_ron I would currently be looking to document with a PERF ticket on 17:59
"native int" vs INT/Any
but am open to other suggestions
s/INT/Int/ 18:00
lizmat m: for ^1000000 -> { } # huh? couldn't we optimize for that in the mean time ? 18:01
camelia Too many positionals passed; expected 0 arguments but got 1
in block <unit> at <tmp> line 1
lizmat timotimo: ^^^ 18:02
timotimo i guess we could 18:05
DeadDelta timotimo: the += version has been slower than $x = $x + foo for as long as I remember; even in my upcoming article I mention it. It gets wrapped as a meta operator. 18:12
timotimo but the optimizer has a thing for metaop assign
DeadDelta Does it?
OK
As for "regression". It's the outcome of the fix for the native candidate dispatch 18:13
m: my int $a = 42; for ^10000000 { $a = $a + 1 }; say now - INIT now
timotimo yeah, the METAOP_ASSIGN is flattened out manually by the optimizer
camelia 7.6750003
DeadDelta ^ that code doesn't go through native candidate. It boxes the native int each time and goes through Int candidate
m: my int $a = 42; for ^10000000 { $a = $a + my int $ = 1 }; say now - INIT now
camelia 2.1363054
DeadDelta You have to have both natives to go through native candidate
timotimo but 1 can be either native or non-native?
DeadDelta Yup
timotimo i mean we have a Want for that specific reason? 18:14
i'm clearly confused
DeadDelta I dunno. jnthn++ can clarify, but that's my (and I believe pmurias++'s too) understanding that the current behaviour is how it's supposed to work
timotimo that's fair 18:15
DeadDelta In that we don't nativize non-natives in multi dispatch.
huggable: native
huggable DeadDelta, here's a ticket: rt.perl.org/Ticket/Display.html?id...xn-1433016 and here's explanation why it isn't: irclog.perlgeek.de/perl6-dev/2016-...i_13462673
DeadDelta Yeah, the rules I wrote out had the "convert to native if size fits", but the rules are wrong. 18:16
timotimo hm, okay
when using the "my int $ = 1" trick the + operator does get inlined 18:18
mr_ron m: {my $a = 42; for ^10000000 { $a += 1 + $a%3 }; say now - ENTER now}; { my int ($a, $one, $three) = (42, 1, 3); for ^10000000 { $a += $one + $a%$three }; say now - ENTER now} 18:19
camelia 8.18530108
2.74818107
DeadDelta This kinda gives more merit to the idea that was proposed of having to-native syntax or coersers; something shorter and easier to use than (my int $ = foo) 18:21
hythm Zamelk is 2 , the other team is 0 ;) 18:24
DeadDelta ?
hythm Sorry, Wrong channel.
DeadDelta heh 18:25
DeadDelta Yeah, from user perspective this kinda sucks. If all the arguments have a native Want, it isn't really wrong to expect native candidates to be called. Reading the explanation here irclog.perlgeek.de/perl6-dev/2016-...i_13462673 I wouldn't want the big int to match, only when we have a Want that's native 18:31
And at least the optimizer could see we're calling native + want that has a native + there's a candidate that can accept two natives and then just rewrite it to be all-native 18:33
DeadDelta puts it onto "when my skill level get there, try to do so" shelf and moves on
DeadDelta qast: ▸Op: :op<say>, ▸Op(:op<add_i>, ▸Want(▸IVal(:value(72)), 'iI', ▸IVal(:value(42))), ▸IVal(:value(10)) ) 18:40
Ah, no bot :)
DeadDelta Gives 52 18:40
El_Che so, many perl6 talk in amsterdam soon? 18:44
someone here presenting
? 18:45
DeadDelta timotimo: what do you mean flattened? The only thing I see between perl6 --target=optimize -e '42 += 55' and perl6 --target=ast -e '42 += 55' is the optimizer making the QAST::Op(call &METAOP_ASSIGN) to QAST::Op(callstatic &METAOP_ASSIGN)
I forget what callstatic is about. Is that the flattening bit?
m: use nqp; my int $i = 0; nqp::while($i > 1000_000, $i += 2); say now - INIT now 18:46
camelia 0.0011683
DeadDelta benchable6: m: use nqp; my int $i = 0; nqp::while($i < 1_000_000, $i += 2); say now - INIT now 18:47
benchable6 DeadDelta, ¦m:: «Cannot find this revision (did you mean “all”?)»
DeadDelta yes, I did. Now, get on with it
benchable6: all use nqp; my int $i = 0; nqp::while($i < 1_000_000, $i += 2); say now - INIT now
benchable6 DeadDelta, starting to benchmark the 42 given commits
DeadDelta oh damn, the native thing 18:48
benchable6 DeadDelta, benchmarked the given commits, now zooming in on performance differences 18:49
DeadDelta Abort the mission. I have a new code for you to bench.
Stupid robot 18:50
benchable6 DeadDelta, gist.github.com/90f33f9ae4cf366335...0659cb51b2 18:51
DeadDelta benchable6: releases use nqp; my int $i = 0; my int $two = 2; my int $lim = 1_000_000; nqp::while($i < $lim, $i += $two); say now - INIT now ||| use nqp; my int $i = 0; my int $two = 2; my int $lim = 1_000_000; nqp::while($i < $lim, $i = $i + $two); say now - INIT now 18:53
benchable6 DeadDelta, starting to benchmark the 20 given commits
DeadDelta, benchmarked the given commits, now zooming in on performance differences
DeadDelta zoom faster, dammit 18:57
mr_ron m: {my $a = 42; for ^10000000 { $a += 1 + $a%3 }; say now - ENTER now}; { my int ($a, $one, $three) = (42, 1, 3); for ^10000000 { $a += $one + $a%$three }; say now - ENTER now}; { my int ($a, $one, $three, $limit) = (42, 1, 3, 10000000); loop (my int $i = 0; $i < $limit; $i += $one) { $a += $one + $a%$three }; say now - ENTER now} 19:08
camelia 9.6187681
2.8602481
3.7480661
19:09
mr_ron m: {my $a = 42; for ^10000000 { $a += 1 + $a%3 }; say now - ENTER now}; { my int ($a, $one, $three) = (42, 1, 3); for ^10000000 { $a += $one + $a%$three }; say now - ENTER now}; { my int ($a, $one, $three, $limit) = (42, 1, 3, 10000000); loop (my int $i = 0; $i < $limit; $i++) { $a += $one + $a%$three }; say now - ENTER now} 19:11
camelia 8.39889307
2.7175026
0.8140489
19:12
DeadDelta mr_ron: dunno if you were around for the discussion, but what you're observing is expected with the native dispatch bug fix that happened sometime in 2017.05-2017.06 commits 19:14
benchable6: so wtf? Where's the zooming?
benchable6 DeadDelta, ¦so: «Cannot find this revision (did you mean “all”?)»
DeadDelta ... 19:15
benchable6: releases use nqp; my int $i = 0; my int $two = 2; my int $lim = 1_000_000; nqp::while($i < $lim, $i += $two); say now - INIT now ||| use nqp; my int $i = 0; my int $two = 2; my int $lim = 1_000_000; nqp::while($i < $lim, $i = $i + $two); say now - INIT now
benchable6 DeadDelta, starting to benchmark the 20 given commits
DeadDelta, benchmarked the given commits, now zooming in on performance differences
AlexDaniel slaps benchable6 19:18
“Cannot coerce NaN to an Int”
DeadDelta Well, running that code for all releases with committable, looks like the $i = $i + $two version was always like two orders of magnitude faster than $i += $two: gist.github.com/Whateverable/c62f2...f783452de9 gist.github.com/Whateverable/b8bd4...6ee9dfb90a 19:19
So the unrolling timotimo mentioned needs to have a look at it
pmurias DeadDelta: what positive thing does fueling Perl 5/Perl 6 hostility get us? 19:21
AlexDaniel DeadDelta: fwiw github.com/perl6/whateverable/issues/176
MasterDuke: benchable6 clearly needs some love :)
DeadDelta pmurias: we crush them and move on with One True Perl.
lizmat DeadDelta: for crushing, you need mass 19:23
mr_ron Being more careful with natives I got p6 to run faster than p5: gist.github.com/ronaldxs/74b7450ae...871f53d364
lizmat or a very high velocity :-)
DeadDelta mr_ron++ awesome
AlexDaniel
.oO( eat more and run faster )
DeadDelta lizmat: yeah, well, I don't feel like sitting silent while Perl 5 folks are having a day mocking Perl 6 does us any good either. 19:24
El_Che mr_ron: run the perl5 version with a foreach instead of the C loop
lizmat and where is that mocking taking place ? 19:25
DeadDelta lizmat: I'm guessing pmurias was referring to my comments on this reddit post that has an image of a warrior named "Perl6six Isnotperl" with adjacent commentery about how it was very hard to get that character name, but it was well worth it: www.reddit.com/r/perl/comments/6jp...rver_that/ 19:26
mr_ron El_Che: I tried with "for (1..10000000) {" and got similar results. Why did you ask?
lizmat ah, the colourful one 19:27
El_Che mr_ron: I have seen foreach outperform the C loop
lizmat what can I say, ignore him
DeadDelta :) 19:27
El_Che mr_ron: on my machine, the foreach loop is faster 19:30
DeadDelta m: dd max () 19:31
camelia -Inf
lizmat DeadDelta: I *will* mention it in the next P6W though
m: dd min()
camelia Inf 19:32
DeadDelta m: dd max (Int)
camelia -Inf
El_Che mr_ron: and both are way faster than the perl6 example
DeadDelta AlexDaniel: a hunch would be some math with max/min is what gives a NaN 19:32
lizmat: and ask for more mass... for crushing :P 19:33
mr_ron El_Che: I have p6 faster than p5.10 and about the same as 5.18 but 40% slower than 5.26 19:36
El_Che this is on a mac with 5.18 and rakudo start 2017.01 19:38
I'll try later on my linux laptop
DeadDelta Time to upgrade :)
El_Che (I don't completely get the star versions, but it's the latest I could find)
(I'll compile it locally)
(but I have wasted more than enough time to make osx workable for me : ) ) 19:39
DeadDelta Though that code doesn't look like something happened much
Star version follow the Rakudo versions they're based on, except they get released like thrice as fewer than monthly rakudo releases
huggable: star
huggable DeadDelta, Estimated Rakudo Star releases for 2017: .01, .04, .07 & .10 19:40
DeadDelta So latest is 2017.04 and next will be next month
DeadDelta &
El_Che I follow the rakudo release closedly for my linux packages. But got a mac at work (in addition to my main laptop) so I was curious what was needed to write perl6, 5 and go 19:41
mr_ron: with the extremely anti-scientific method of running the loop once, I get perl-foreach < perl6 < perl5 when I went to 100000000 (x10) 19:44
so it looks good indeed
on the second run the perl6 is the fastest (0.059s faster than the foreach) so I'll stop running it 19:45
El_Che success 19:45
:)
moritz PSA: I had to disable irclog.perlgeek.de 19:50
the web application process used too much memory, and brought down the whole server 19:51
it's still logging in the background
lizmat moritz: so what caused it to explode like that? Or did it just go across some threshold ? 19:53
perlpilot clearly it needs a rewrite in P6 ;-)
moritz lizmat: I updated the OS from Debian Jessie to Stretch
perlpilot: patches welcome :-) 19:54
perlpilot first someone needs to provide me a patch for some extra time and/or more brain power. :)
and maybe update my brain so that it doesn't require as much sleep
andrzejku hi 19:59
do someone want to make money with perl?
my friend aksed me as he have an offer
rindolf andrzejku: hi, I do 20:00
andrzejku rindolf okay
rindolf andrewalker: perl 6?
andrzejku can we speak here?
rindolf andrzejku: in private will probably be better
andrzejku okay 20:01
perlpilot though if it really is a Perl 6 job, it would be interesting to here the outcome :)
s/here/hear/
samcv u: left corner bracket 20:19
unicodable6 samcv, U+23A3 LEFT SQUARE BRACKET LOWER CORNER [Sm] (⎣)
samcv, U+23A1 LEFT SQUARE BRACKET UPPER CORNER [Sm] (⎡)
samcv, 9 characters in total: gist.github.com/883a1d8bf709933658...24251e89c1
amkhlv m: "Hi Andrei".say 20:40
camelia Hi Andrei
amkhlv perl6 -e 'for "/tmp/utf-error.txt".IO.lines { say "hi" } ' 20:41
gives : Malformed UTF-8 20:42
in block <unit> at -e line 1
where /tmp/utf-error.txt contains the word Birkhäuser
in ISO-8859
jnthn Use "/tmp/utf-error.txt".IO.lines(:enc<ISO-8859-1>) 20:45
amkhlv Yes, this works. But extremely inconvenient. I have thousands of files all in different encodings. 20:46
lizmat
.oO( encoding is a bitch)
amkhlv is it possible to process file in binary format? Will regex match on binary file? 20:47
jnthn No, but ISO-8859-1 will never give a decoding error, so if you care little enough about matching stuff outside of the ASCII range then that'll work :) 20:48
Don't think there's a module for doing encoding guessing yet 20:49
jnthn afk 20:49
amkhlv Why ISO-8859-1 will never give a decoding error ? 20:51
geekosaur because all bytes are valid. they may not be *meaningful* in a given context, but unlike utf8 there are no invalid byte sequences 20:55
amkhlv Very interesting, geekosaur, I did not know that ! Thank you 20:56
geekosaur (the utf8 invalid sequences represent multibyte sequences that can't happen, for example the reserved utf16 surrogate codepoints or codepoints outside 00000-10ffff) 20:57
zengargoyle m: say DateTime.new(1498597328) 21:02
camelia 2017-06-27T21:02:08Z
zengargoyle hrm... sub MAIN ( Int $now ) { ... } still keeps a numeric arg as IntStr... 21:05
timotimo of course 21:06
IntStr is Int, so it matches and thus that is what you get 21:07
m: say (<100> + 0).perl
camelia 100
timotimo m: say (+<100>).perl
camelia 100
timotimo m: say (+<100>).^name
camelia Int
timotimo m: say (<100>).^name
camelia IntStr
zengargoyle that $now doesn't pass into DateTime that also asks for an Int. :( 21:10
have to to $now.Int 21:11
DeadDelta m: say DateTime.new(<1498597328>) 21:17
camelia Invalid DateTime string '1498597328'; use an ISO 8601 timestamp (yyyy-mm-ddThh:mm:ssZ or yyyy-mm-ddThh:mm:ss+01:00) instead
in block <unit> at <tmp> line 1
zengargoyle not sure i like multi method new(Int:D $posix, :$timezone=0, :&formatter) from DateTime and sub MAIN(Int $now) behaving differently....
DeadDelta Ah haha
Right, 'cause the Str candidate wins over
zengargoyle ah
DeadDelta zengargoyle: well, just coerce it to int. sub MAIN (Int() $now) {} will probably work
Oh, it won't coerce, 'cause it already an Int 21:18
timotimo yeah
DeadDelta +$now when using it then 21:19
zengargoyle is there any major difference between + and .Int? 21:20
DeadDelta Not in this case
&prefix:<+> -> .Numeric -> .Int 21:21
Just shorter to type
zengargoyle yeah... :)
DeadDelta And .Int is just nqp::add_I(self, 0, Int) 21:22
that forces it to numeric only
timotimo right, it also gets rid of any roles you may have mixed in
[Coke] ff 21:32
ww
DeadDelta buggable: drwa 21:33
buggable: draw
buggable DeadDelta, The next Accidental /win Lottery draw will happen in 3 days, 2 hours, 26 minutes, and 56 seconds. Currently have 1 ballots submitted by 1 users!
timotimo not as popular as it used to be
DeadDelta is very happy with a new upgrade to perl6.party's markdown pre-processor
``Iterator|'s`` gets converted to [`Iterator`'s](docs.perl6.org/type/Iterator). ``.pull-one`` -> [`.pull-one`](docs.perl6.org/routine/pull-one) 21:34
Gonna link the hell out of articles now :) 21:35
Would be cool to have an end point that displayed search results on docs site. Like docs.perl6.org/search/meow would show all results for "meow" 21:36
[Coke] DeadDelta: on my todo list, fwiw.
DeadDelta [Coke]++ 21:37
[Coke] ... I mean, it's been a year, but I'll get to it eventually. :)
DeadDelta :D
[Coke] the whole thing is just so (&#$ slow. :|
gets frustrating to try to hack on stuff when the build takes a half hour. 21:38
DeadDelta Making it faster sounds like a fun project. 21:40
Polish all that nasty code in htmlify.p6. Make it pretty and maintainable.
And fastah
MasterDuke DeadDelta: fwiw, benchable's 'compare' option was originally intended to only be used with one commit (i.e., not 'releases', 'all', etc). not sure the output would make sense otherwise (might be the reason why it died) 21:44
but it does need to be made a little smarter/more robust 21:45
DeadDelta MasterDuke: it told me to if meant to use "all" so I did. 21:59
benchable6: m: 42 22:00
benchable6 DeadDelta, ¦m:: «Cannot find this revision (did you mean “all”?)»
MasterDuke hm, i think that's a generic whateverable feature, will try to fix for benchable
timotimo good idea %) 22:01
MasterDuke can probably add support for multiple commits with compare, it just won't do the bisecting 22:05
Geth perl6-examples: 99856ad51e | (David Warring)++ | 2 files
populate META6 provides. add t/test-meta.t
23:16
grondilu weird: I can't access the logs on irclog.perlgeek.de/perl6/today 23:31
[Coke] they're down for maint. 23:34
DeadDelta they're down 'cause of apparent memory leak on newer Perl 5s. Patches welcome: github.com/moritz/ilbot 23:36
moritz: they're running in their own user don't they? Maybe perlbrewing older perl for just that user can be a temporary fix?
MasterDuke moritz: i've used heaptrack a couple of times recently to help out with memory issues 23:40
timotimo just kill the process daily :P 23:43
leont Many moons ago I ran into an hourly root-cronjob perl script that also had a daily kill cronjob, because of terrible choices in the script. 23:47
Rewrote the hell out of it as soon as they let me. 23:50
timotimo oh my 23:57
BenGoldberg If the author of a program *knows* his program leaks memory... he could use exec() to start with a clean slate