Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-07-19

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:01 Geth_ ¦ whateverable: 8c3b7e5777 | (Aleks-Daniel Jakimenko-Aleksejev)++ | 2 files
00:01 Geth_ ¦ whateverable: sanify method reworked
00:01 Geth_ ¦ whateverable:
00:01 Geth_ ¦ whateverable: Resolves issue #182. Tests needed.
00:01 Geth_ ¦ whateverable: review: https://github.com/perl6/whateverable/commit/8c3b7e5777
00:01 unicodable6 joined #perl6
00:02 AlexDaniel /o\ wrong issue number /o\
00:04 MasterDuke i haven't pulled, you could fix the comment and force push
00:05 AlexDaniel MasterDuke: but I did pull on the server already… I can reset HEAD^ maybe but uhhhh…
00:05 MasterDuke up to you
00:06 Geth_ ¦ whateverable: a08f2e0065 | (Aleks-Daniel Jakimenko-Aleksejev)++ | 2 files
00:06 Geth_ ¦ whateverable: sanify method reworked
00:06 Geth_ ¦ whateverable:
00:06 Geth_ ¦ whateverable: Resolves issue #167. Tests needed.
00:06 Geth_ ¦ whateverable:
00:06 Geth_ ¦ whateverable: See this discussion: https://irclog.perlgeek.de/perl6-dev/2017-07-18#i_14890127
00:06 Geth_ ¦ whateverable: review: https://github.com/perl6/whateverable/commit/a08f2e0065
00:06 AlexDaniel well, done
00:07 MasterDuke cool
00:08 AlexDaniel well, it's better than hating myself for the rest of my life :)
00:09 Cabanossi joined #perl6
00:10 cdg joined #perl6
00:26 lookatme joined #perl6
00:26 lookatme morning
00:29 lizmat joined #perl6
00:36 BenGoldberg joined #perl6
00:45 alphah joined #perl6
00:46 alphah hello, What would be a good way to parse big files 10 GB by Grammar?
00:47 alphah in terms of memory and speed
00:49 timotimo if you can, try to match it line-by-line or in chunks
00:50 skids joined #perl6
00:50 alphah timotimo how does Grammar parse file? does it read the whole file or line by line?
00:51 timotimo the whole file
00:51 timotimo and texts tend to become 4x the size because we do fancy unicode stuff
00:51 alphah so if I have 10 GB file and 8 GB memory the program will not run right?
00:52 timotimo correct
00:53 timotimo well, i don't think it forces all of it to be in memory at the same time, though it might fail to allocate anyway?
00:53 timotimo you can just try to slurp the file and see if the program explodes
00:53 timotimo (might want to save all open documents before you do this)
00:54 Cabanossi joined #perl6
00:56 alphah I will do this test later and see, but assuming memory allocation will fail,  so what i need to do is to read the file by chunks and let Grammar parse each chunk alone,, or there is a way parse all chunks and produce one match data structure at the end?
00:57 timotimo you can create a match object manually and put the sub-matches in by hand
00:58 alphah ok, will look into that as well
01:00 alphah Thanks timotimo
01:00 greppable6 joined #perl6
01:00 quotable6 joined #perl6
01:00 unicodable6 joined #perl6
01:00 bisectable6 joined #perl6
01:00 benchable6 joined #perl6
01:00 coverable6 joined #perl6
01:00 committable6 joined #perl6
01:00 evalable6 joined #perl6
01:00 bloatable6 joined #perl6
01:00 statisfiable6 joined #perl6
01:03 gdonald joined #perl6
01:06 stmuk_ joined #perl6
01:18 cognominal joined #perl6
01:20 moei joined #perl6
01:23 Actualeyes joined #perl6
01:48 ilbot3 joined #perl6
01:48 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:54 Cabanossi joined #perl6
01:59 zoll left #perl6
02:00 lizmat joined #perl6
02:14 cdg joined #perl6
02:31 noganex_ joined #perl6
02:31 Geth ¦ ecosystem/japhb-Text-MiscUtils: 4ece62af66 | japhb++ (committed using GitHub Web editor) | META.list
02:31 Geth ¦ ecosystem/japhb-Text-MiscUtils: Add japhb/Text-MiscUtils to ecosystem
02:31 Geth ¦ ecosystem/japhb-Text-MiscUtils: review: https://github.com/perl6/ecosystem/commit/4ece62af66
02:31 Geth ¦ ecosystem: japhb++ created pull request #351: Add japhb/Text-MiscUtils to ecosystem
02:31 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/pull/351
02:37 mr-foobar joined #perl6
02:38 semigloss joined #perl6
02:54 Cabanossi joined #perl6
03:08 alphah joined #perl6
03:13 zoll joined #perl6
03:13 Ben_Goldberg joined #perl6
03:24 Geth ¦ ecosystem: albastev++ created pull request #352: Add Grammar::Modelica to ecosystem
03:24 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/pull/352
03:32 alphah joined #perl6
03:42 shadowpaste joined #perl6
03:44 Cabanossi joined #perl6
03:50 Actualeyes left #perl6
03:53 Geth ¦ ecosystem: 4277fe5175 | albastev++ (committed using GitHub Web editor) | META.list
03:53 Geth ¦ ecosystem: Add Grammar::Modelica to ecosystem
03:53 Geth ¦ ecosystem:
03:53 Geth ¦ ecosystem: See https://github.com/albastev/Grammar-Modelica
03:53 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/4277fe5175
03:53 Geth ¦ ecosystem: eb49dc8c48 | Altai-man++ (committed using GitHub Web editor) | META.list
03:53 Geth ¦ ecosystem: Merge pull request #352 from albastev/master
03:53 Geth ¦ ecosystem:
03:53 Geth ¦ ecosystem: Add Grammar::Modelica to ecosystem
03:53 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/eb49dc8c48
03:53 Geth ¦ ecosystem/japhb-Text-MiscUtils: 4277fe5175 | albastev++ (committed using GitHub Web editor) | META.list
03:53 Geth ¦ ecosystem/japhb-Text-MiscUtils: Add Grammar::Modelica to ecosystem
03:53 Geth ¦ ecosystem/japhb-Text-MiscUtils:
03:53 Geth ¦ ecosystem/japhb-Text-MiscUtils: See https://github.com/albastev/Grammar-Modelica
03:53 Geth ¦ ecosystem/japhb-Text-MiscUtils: review: https://github.com/perl6/ecosystem/commit/4277fe5175
03:53 Geth ¦ ecosystem/japhb-Text-MiscUtils: eb49dc8c48 | Altai-man++ (committed using GitHub Web editor) | META.list
03:53 Geth ¦ ecosystem/japhb-Text-MiscUtils: Merge pull request #352 from albastev/master
03:53 Geth ¦ ecosystem/japhb-Text-MiscUtils:
03:54 Geth ¦ ecosystem/japhb-Text-MiscUtils: Add Grammar::Modelica to ecosystem
03:54 Geth ¦ ecosystem/japhb-Text-MiscUtils: review: https://github.com/perl6/ecosystem/commit/eb49dc8c48
03:54 Geth ¦ ecosystem/japhb-Text-MiscUtils: 245dddcb6b | Altai-man++ (committed using GitHub Web editor) | META.list
03:54 Geth ¦ ecosystem/japhb-Text-MiscUtils: Merge branch 'master' into japhb-Text-MiscUtils
03:54 Geth ¦ ecosystem/japhb-Text-MiscUtils: review: https://github.com/perl6/ecosystem/commit/245dddcb6b
03:54 Geth ¦ ecosystem: 4ece62af66 | japhb++ (committed using GitHub Web editor) | META.list
03:54 Geth ¦ ecosystem: Add japhb/Text-MiscUtils to ecosystem
03:54 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/4ece62af66
03:54 Geth ¦ ecosystem: 245dddcb6b | Altai-man++ (committed using GitHub Web editor) | META.list
03:54 Geth ¦ ecosystem: Merge branch 'master' into japhb-Text-MiscUtils
03:54 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/245dddcb6b
03:54 Geth ¦ ecosystem: dac3c56c44 | Altai-man++ (committed using GitHub Web editor) | META.list
03:54 Geth ¦ ecosystem: Merge pull request #351 from perl6/japhb-Text-MiscUtils
03:54 Geth ¦ ecosystem:
03:54 Geth ¦ ecosystem: Add japhb/Text-MiscUtils to ecosystem
03:54 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/dac3c56c44
04:12 cpage_ joined #perl6
04:14 Cabanossi joined #perl6
04:39 Exodist joined #perl6
04:40 TEttinger joined #perl6
04:45 zoll left #perl6
04:47 Actualeyes joined #perl6
05:08 espadrine joined #perl6
05:22 xtreak joined #perl6
05:27 nadim joined #perl6
05:36 gdonald joined #perl6
05:42 lowbro joined #perl6
05:42 lowbro joined #perl6
05:47 wamba joined #perl6
05:47 leah2 joined #perl6
06:14 Cabanossi joined #perl6
06:27 TimToady joined #perl6
06:35 r3m left #perl6
06:44 Cabanossi joined #perl6
06:52 domidumont joined #perl6
06:56 nadim joined #perl6
07:00 domidumont joined #perl6
07:10 abraxxa joined #perl6
07:14 Cabanossi joined #perl6
07:18 ab6tract joined #perl6
07:18 ab6tract .
07:18 yoleaux 18 Jul 2017 22:00Z <lizmat> ab6tract: (g => -5).Bag === bag(), that's why, you probably want Mixes ?
07:19 ab6tract m: dd [(^)] ( g => 5 ).Mix, ( g => -5 ).Mix
07:19 camelia rakudo-moar 8e9605: OUTPUT: «("g"=>10).Mix␤»
07:19 ab6tract .tell lizmat i see :)
07:19 yoleaux ab6tract: I'll pass your message to lizmat.
07:33 zakharyas joined #perl6
07:51 darutoko joined #perl6
07:51 rindolf joined #perl6
07:57 spider-mario joined #perl6
07:57 wamba joined #perl6
08:01 dakkar joined #perl6
08:22 abraxxa zostay: are you interessted in debugging the DOM::Tiny install issue I've pasted yesterday?
08:23 dayangkun joined #perl6
08:38 robertle joined #perl6
08:38 domidumont1 joined #perl6
08:48 domidumont joined #perl6
09:08 mcmillhj joined #perl6
09:14 Cabanossi joined #perl6
09:26 xtreak joined #perl6
09:37 Geth ¦ ecosystem: 9f5533a520 | (Alexey Melezhik)++ (committed using GitHub Web editor) | META.list
09:37 Geth ¦ ecosystem: Add Sparky - continues integration server.
09:37 Geth ¦ ecosystem:
09:37 Geth ¦ ecosystem: Sparky is a continues integration server based on Sparrow/Sparrowdo ecosystem.
09:37 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/9f5533a520
09:44 Cabanossi joined #perl6
09:45 xtreak joined #perl6
09:46 Actualeyes left #perl6
10:01 TimToady joined #perl6
10:14 Cabanossi joined #perl6
10:16 parv joined #perl6
10:22 eliasr joined #perl6
10:27 wictory[m] joined #perl6
10:45 Cabanossi joined #perl6
10:49 rindolf joined #perl6
10:54 lowbro joined #perl6
10:54 lowbro joined #perl6
11:10 nine Seeing print "Skip? "; my $do = <STDIN>; chomp $do; next if $do eq 'y'; really motivates me to port some of our scripts to Perl 6 ;)
11:37 geekosaur joined #perl6
11:58 mr-foobar joined #perl6
11:59 zakharyas1 joined #perl6
12:10 Voldenet nine: actually, this line could be very similar to perl6
12:11 Voldenet sub prompt { print shift; my $x = <>; chomp $x; $x }; next if prompt("Skip? ") eq "y"
12:11 Voldenet the last part works in perl6 ;)
12:12 nine Voldenet: I know, but no one writes that if there's only a single prompt in the script.
12:13 nine The other part is MAIN subs and the auto generated usage message. That's sooo incredibly useful :)
12:13 Voldenet Yeah, that is awesome
12:14 Voldenet but tbh, the thing I find the most useful in p6 so far is threading + threadpools + async + channels
12:15 Voldenet it's so above the forking black magic from p5
12:15 nine And just this week I wrote this image cache cleaner daemon in Perl 6 because of builtin IO::Notification and IO awesomeness in general: https://gist.github.com/niner/b65597abab2bf3ee446a1ce939421a44
12:18 jnthn Cute :)
12:19 wamba joined #perl6
12:20 nine Had to write this thing myself because I want to pass the name of the cache file off to nginx for delivery while all existing caching solutions would give me the file's content. But seriously, this was fun to implement :)
12:20 zostay abraxxa: sure
12:21 zostay I'm interested.
12:21 abraxxa zostay: ok, I have also time now
12:22 zostay Oh, if you mean do I have time now?  not really
12:23 ab6tract nine: why the use lib:from<Perl5> ?
12:23 abraxxa zostay: I guess I have some test env var set which triggers those tests to be run
12:24 nine ab6tract: it's part of our CMS's codebase and all included scripts do: use FindBin qw($Bin); use lib "$Bin/../lib";
12:25 abraxxa zostay: it's test #6 of Test::META used in t/999-meta.t
12:26 abraxxa zostay: 'Artistic' is not included in https://github.com/jonathanstowe/Test-META/blob/master/lib/Test/META/LicenseList.pm
12:26 abraxxa the version is missing
12:27 abraxxa zostay: no idea why it doesn't fail here https://travis-ci.org/zostay/p6-DOM-Tiny#L2381
12:29 abraxxa zostay: there seems some other issue as https://github.com/zostay/p6-DOM-Tiny/blob/master/META6.json#L25 reads "license" : "Artistic-2.0", mine "license" : "Artistic",
12:29 zostay But it is there, https://github.com/zostay/p6-DOM-Tiny/blob/master/META6.json
12:30 zostay That's my confusion
12:32 abraxxa zostay: see https://github.com/zostay/p6-DOM-Tiny/issues/2
12:33 zakharyas joined #perl6
12:35 zostay I don't understand. Why is zef not installing the latest code from github?
12:38 nine zostay: zef update?
12:38 ab6tract nine: ah, i see :)
12:39 zostay abraxxa: ^^^
12:39 abraxxa zostay: because you haven't released a new version?
12:40 zostay There's no release process. Have you tried a zef update?
12:41 abraxxa I hope that zef doesn't install just the current HEAD of master branch of a github repo!
12:41 abraxxa currently trying
12:41 Grauwolf joined #perl6
12:41 timotimo it does if you use the modules.perl6.org ecosystem and don't give a tag or commit name
12:41 abraxxa yes, also fails after zef update
12:42 zostay It does until we get better build tools. Changing tags in the ecosystem is not practical imo
12:42 raschipi joined #perl6
12:43 zostay Waiting for pause to become sop
12:43 nine zostay: why wait?
12:44 zostay Is there toolchain for it?
12:44 timotimo what's "sop" agains
12:45 nine zostay: Inline::Perl5 is already hosted on and installed from CPAN and I haven't heard any complaints. mi6 makes uploading just trivial
12:45 Cabanossi joined #perl6
12:45 nine timotimo: Standard Operating Procedures
12:45 timotimo lh
12:45 timotimo ah
12:45 zostay Then, how do we get zef to go there instead?
12:46 timotimo doesn't it prefer pause already?
12:47 zostay I will consider it when I get back to p6 stuff.
12:48 nine timotimo: yes it does
12:48 abraxxa ===> Found: DOM::Tiny:ver('0.3.3'):auth('github:zostay') [via Zef::Repository::LocalCache]
12:48 abraxxa zef update doesn't change that
12:48 nine timotimo: at least if the version of the module on PAUSE is newer than what's listed in the ecosystem's META.list
12:49 mcmillhj joined #perl6
12:49 zostay I can bump the v# if that will help
12:51 abraxxa I expected DOM::Tiny:ver('0.3.3'):auth('github:zostay') using the tag '0.3.3' or a release with that version if installing from github
12:51 abraxxa I've deleted ~/.zef/tmp and ~/.zef/store and trying again now
12:52 abraxxa now it installed correctly
12:52 abraxxa so zefs local cache handling is suboptimal
12:55 zostay v0.3.4 pshed
12:55 zostay pushed
12:56 mr-fooba_ joined #perl6
13:00 lucasb joined #perl6
13:00 zostay releases through master tagged branches is the suboptimal part
13:03 domidumont joined #perl6
13:12 abraxxa zostay++
13:13 Geth ¦ doc: 64912fb222 | (Brian Duggan)++ | doc/Language/py-nutshell.pod6
13:13 Geth ¦ doc: Mention that filter=grep in py-nutshell
13:13 Geth ¦ doc:
13:13 Geth ¦ doc: Resolves #1420
13:13 Geth ¦ doc: review: https://github.com/perl6/doc/commit/64912fb222
13:13 abraxxa zostay: fails to install ;(
13:14 abraxxa but that might be another zef bug
13:14 abraxxa zef upgrade DOM::Tiny
13:18 ufobat joined #perl6
13:23 cdg joined #perl6
13:24 abraxxa it works when I again delete the zef store and tmp dir contents
13:24 bdmatatu joined #perl6
13:36 skids joined #perl6
13:47 rubio_terra joined #perl6
13:52 mr_ron joined #perl6
14:03 dolmen joined #perl6
14:11 zakharyas1 joined #perl6
14:15 pmurias joined #perl6
14:21 Actualeyes joined #perl6
14:30 araraloren joined #perl6
14:33 araraloren_ joined #perl6
14:34 araraloren_ evening
14:34 pmurias araraloren_: evening
14:35 araraloren_ :)
14:35 bwisti joined #perl6
14:35 andrzejku araraloren_, hey
14:39 perlpilot joined #perl6
14:54 wamba joined #perl6
14:59 khw joined #perl6
14:59 Cabanossi joined #perl6
15:11 domidumont joined #perl6
15:17 ugexe you cant have mutatate a version of a distribution and blame the cache
15:19 ugexe release by putting your github commit id in the source-url then
15:21 nadim joined #perl6
15:25 raschipi He's pushing under the same version number and them expects zef to somehow know it changed? That's not how any of this works.
15:28 abraxxa joined #perl6
15:28 alimon joined #perl6
15:30 lizmat joined #perl6
15:47 dj_goku joined #perl6
15:49 colomon joined #perl6
15:54 nhywyll joined #perl6
15:59 lizmat joined #perl6
16:08 Skarsnik joined #perl6
16:09 Skarsnik Hello
16:09 nightfrog joined #perl6
16:09 Skarsnik is there a way to have the variable of a for @ -> $ contruct writable?
16:10 jnthn <->
16:11 cdg joined #perl6
16:12 Skarsnik I got an error
16:12 Skarsnik m: for 1..5 <-> $foo {;}
16:12 camelia rakudo-moar 8e9605: OUTPUT: «Parameter '$foo' expected a writable container, but got Int value␤  in block <unit> at <tmp> line 1␤␤»
16:12 Skarsnik do I need to declare the variable before so?
16:13 zakharyas joined #perl6
16:13 cdg_ joined #perl6
16:14 jnthn Oh, you can only do that if you actually have writable containers
16:14 jnthn Which you could if you had an array there
16:14 jnthn You'll need for 1.5 -> $foo is copy { }
16:14 Skarsnik Oooh
16:14 Cabanossi joined #perl6
16:14 Skarsnik yeah it was is copy
16:14 Skarsnik I tried is write xD
16:16 dj_goku joined #perl6
16:16 colomon joined #perl6
16:19 Skarsnik Thx jnthn :)
16:22 jnthn .oO( is rong )
16:32 tony-o m: sub x { "x".say; }; sub y { "y".say; }; sub z {"z".say;}; &x.wrap(&y); &y.wrap(&z); z;
16:32 camelia rakudo-moar 8e9605: OUTPUT: «z␤»
16:33 tony-o is that right?
16:33 jnthn Looks like, you didn't change z?
16:34 jnthn &y.wrap(&z) means "wrap &y with &x"
16:34 jnthn grr
16:34 jnthn &y.wrap(&z) means "wrap &y with &z"
16:34 tony-o oops, i'm forgetting some stuff
16:35 tony-o was trying to simplify another issue, and forgetting some callsames
16:39 robertle joined #perl6
16:44 Cabanossi joined #perl6
16:47 tony-o trying to track down: Cannot invoke this object (REPR: Null; VMNull)
16:47 tony-o while 'wrap'ing subs
16:49 tony-o https://gist.github.com/tony-o/458a31973a3a1e55e3549e42ef943c9d
16:50 tony-o i can `dd $req` but i can't `$req.params<stuff>` without that exception
16:51 dubi0us joined #perl6
16:55 tony-o ahh..missing `multi sub`
16:58 mr-foobar joined #perl6
16:59 ChoHag joined #perl6
17:03 dubi0us joined #perl6
17:11 itaylor57 joined #perl6
17:18 nadim o/
17:19 nadim is there a way to trace where a Seq is consummed ?
17:21 lizmat you mean, in a backtrace kind of way ?
17:23 nadim yes
17:24 nadim I think the hardest thing in P6 is tracking consummed Seqs
17:24 nadim that's made worse when a call to dd on a data structure makes things work!
17:24 fatguy joined #perl6
17:25 fatguy i have class required attribute like this 'has Int $!profileid is required;', and i initiate it like 'my $profile = ::(module)::Profile.new(profileid => 1);'
17:25 nadim so the "debugging" tool makes the bug go away.
17:25 fatguy but exception throwed "The attribute '$!profileid' is required, but you did not provide a value for it."
17:26 nadim $!var removes the accessor, no?
17:26 lizmat nadim: yes
17:27 lizmat hmmm... re consuming
17:27 |oLa| joined #perl6
17:27 lizmat nadim: do you actually have the Seq in a variable at some point ?
17:28 nadim lizmat:  last entry was for fatguy. not sure but should'nt it be $.profile_id
17:28 nadim lizmat: I this case I put it directly in an array
17:29 nadim lizmat: I this case I put the Seq directly in an array
17:29 lizmat that does make it clear where gets consumed, no ?
17:29 emeric joined #perl6
17:29 fatguy i tried $.profileid also, same result, confused...
17:29 lizmat if it's anything like "my @a = Iterable, it's the Array.STORE that consumes the Seq
17:29 Cabanossi joined #perl6
17:30 nadim here is the code https://nopaste.linux-dev.org/?1159866
17:30 nadim I tried to peper it with .cache, i guess I have to try again
17:31 nadim or maybe make a list out of it first
17:31 perlpilot m: class C { has $.profileid is required; };  C.new( profileid => 1 );
17:31 camelia rakudo-moar 8e9605: ( no output )
17:31 lizmat nadim: I don't see the problem?
17:31 lizmat perhaps maybe precedence of ' ' ~ $foo ?
17:32 nadim later I get: This Seq has already been iterated, and its values consumed
17:32 perlpilot fatguy: There's probably a few things that you aren't telling us, but as you can see from the above example, it works if you use $.profileid
17:32 nadim and if I dump the array I get:  @fs = [Seq.new-consumed(),]
17:34 lizmat ah, you're actually storing the Seq inside @fs[0], is that intentional?
17:34 Zoffix joined #perl6
17:34 Zoffix nadim: what version of Perl 6 you got?
17:34 nadim a week old or so
17:35 nadim lizmat: yes the array contains a lists of Seqs
17:35 Zoffix nadim: ah ok. There was a massive bug with Seqs where methods failed to find cache that was fixed sometime in April
17:36 nadim Zoffix: then it's not that build it last week
17:36 nadim I wrapped the whole thing in a ().cache and it seems to work
17:37 lizmat nadim: is there a reason you want to wait for the Seq to be consumed ?
17:37 nadim wait?  I store the seq in an array, and later when the rendering is done the seqs are consummed
17:38 nadim and the reason would be that i don't know who is going to consume them
17:38 nadim either the normal dumper renderer or a DHTML generator
17:38 Zoffix nadim: I see you storing it in an array element. Shove .list after the map?
17:38 Zoffix m: Seq.^lookup('iterator').wrap: -> | { say "touched in"; nextsame }; <a b c>.grep('a').say
17:38 camelia rakudo-moar 8e9605: OUTPUT: «touched in␤touched in␤No exception handler located for catch␤   at <unknown>:1  (/home/camelia/rakudo-m-inst-1/share/perl6/runtime/CORE.setting.moarvm:print_exception)␤ from SETTING::src/core/Exception.pm:452  (/home/camelia/rakudo-m-inst-1/share…»
17:39 Zoffix Unsure what exception it's whining about, but that'd be one way to trace where a seq is consumed
17:39 domidumont joined #perl6
17:39 Zoffix m: Seq.^lookup('iterator').wrap: -> | { say "touched in" ~ (callframe(-1).?name||''); nextsame }; sub foo { <a b c>.grep('a').say }()
17:39 camelia rakudo-moar 8e9605: OUTPUT: «touched in␤touched in␤No exception handler located for catch␤   at <unknown>:1  (/home/camelia/rakudo-m-inst-1/share/perl6/runtime/CORE.setting.moarvm:print_exception)␤ from SETTING::src/core/Exception.pm:452  (/home/camelia/rakudo-m-inst-1/share…»
17:39 Zoffix bah
17:40 nadim looks like something that's good to keep, I put this code somewhere
17:40 lizmat nadim: so that I understand: you basically have a dispatch table with blocks that close over some variables that depend on using a dumping renderer or the DHTML renderer ?
17:42 Zoffix nadim: there's also a list of all the methods that cache Seqs automatically: https://rakudo.party/post/Perl-6-Seqs-Drugs-and-Rock-n-Roll#stashintothecache
17:42 Zoffix nadim: but if you don't care about your Seq being a seq, just store in in an array or .List it to store it in a List form you can re-use until you're blue in a face
17:43 Zoffix .map returns a Seq for example.. If you want to re-use that @fs[0] data, pop a .List on the end of your .map
17:44 deep-book-gk_ joined #perl6
17:44 nadim Zoffix: the problem is 80% due that I am hard headed, Yes I can put it in a list but it is actually a sequence as it is consummed once only, just trying to be a purist and regretting it.
17:46 fatguy perlpilot: the class does role, if i remove the does, it works. but i still can't figure it out
17:47 nadim lizmat: I have a block of data, the data dump with colors separated from the string representation, that block has different type of consummers. DHTML, ANSI color dumper, Curses dumper
17:47 Zoffix .map returns a Seq for example.. If you want to re-use that @fs[0] data, pop a .List on the end of your .map
17:47 Zoffix oops
17:47 nadim hehe
17:49 nadim I'll probably end up making lists out of it because the curses dumper supports dynmic folding, so the Sequences will be consummed multiple times
17:50 lizmat that feels like a good idea
17:50 lizmat fwiw, Seqs should be mostly invisible
17:53 nadim even though I have not measured, I think it's also an efficiency problem, making Lists, Arrays, of a Seq must have a cost.
17:53 setty1 joined #perl6
17:53 nadim the dumper is already not fast enough for my taste, although not too bad.
17:54 Zoffix m: Seq.^lookup("iterator").wrap: sub (|) { say "touched in: "; for 3..20 { try say "\t -> {.name || <anon>} ({.file}:{.line})" with callframe($_).code };  put(); nextsame; }; sub foo { <a b c>.grep("a").say }()
17:54 camelia rakudo-moar 8e9605: OUTPUT: «touched in: ␤       -> CALL-ME (SETTING::src/core/Routine.pm:85)␤   -> cache (SETTING::src/core/Seq.pm:22)␤         -> gist (SETTING::src/core/Seq.pm:143)␤         -> gist (SETTING::src/core/Mu.pm:581)␤  -> say (SETTING::src/core/io_operators.pm:22)␤  -> say (SE…»
17:54 Zoffix nadim: output's a bit verbose, but it does manage to mention to routine where the seq is being consumed: https://gist.github.com/zoffixznet/2c2b0adcbff28412d5284fb65a1fd401
17:54 domidumont joined #perl6
17:54 nadim Zoffix: looks good to me
17:55 nadim can always filter the list out
17:55 nhywyll joined #perl6
17:56 tony-o is blead on the fritz?
17:58 Zoffix m: https://gist.github.com/zoffixznet/02c6b10cc15230df3c681332a9d907d2
17:58 camelia rakudo-moar 8e9605: OUTPUT: «Not consumed yet␤touched in: ␤      -> CALL-ME (SETTING::src/core/Routine.pm:85)␤   -> foo (<tmp>:10)␤      -> <unit> (<tmp>:1)␤␤ABCAlready consumed␤touched in: ␤  -> CALL-ME (SETTING::src/core/Routine.pm:85)␤   -> foo (<tmp>:10)␤      -> <unit> (<…»
17:58 Zoffix hm, locally that SEGVs
17:59 Zoffix on 2017.05-297-g608e886
18:02 Zoffix This version also says when the seq is already consumed or not when its iterator is poked at: https://gist.github.com/zoffixznet/2c2b0adcbff28412d5284fb65a1fd401
18:03 Zoffix How to make your own Seqs: https://rakudo.party/post/Perl-6-Seqs-Drugs-and-Rock-n-Roll--Part-2 </shameless-plug>
18:04 nadim saving this for the cold days
18:05 Zoffix tony-o: probably won't help your case, but I think whenever you're using `wrap` you also need to put `use soft` in your code
18:06 Zoffix There's also a whole bunch of tickets with .wrap exploding, especially in procompiled modules (search https://perl6.fail/ for "wrap"). Perhaps, try sticking `no precompilation`?
18:09 Zoffix zostay: zef already considers stuff on pause when looking for the newest dist. App::Mi6 supports uploading dists to PAUSE. And "soon enough" modules.perl6.org will list CPAN dists too
18:10 |oLa| joined #perl6
18:10 vendethiel joined #perl6
18:14 tony-o Zoffix++ - i'll give that shot when i finish nuking p6, getting something about a grapheme when i just run perl6 -e '"hi".say;'
18:15 tony-o Zoffix: would i do 'no precompilation' in the module doing the wrapping, the consumer of the module, or both?
18:15 Zoffix jsimonet: you're just misinterpreting the result. There's nothing illegal in `3.3/0` you get back a Rat that's got `33` as numerator and `0` as denominator. The explosion happens when you try to get the Str view of that Rat which does try to divide 33 by 0. The error can probably be improved by saying the division is happening in a Rat :/
18:15 Zoffix tony-o: no idea. Try all three cases?
18:16 Zoffix m: say (3.3/0).nude
18:16 camelia rakudo-moar 8e9605: OUTPUT: «(33 0)␤»
18:16 tony-o Zoffix: thanks for the info
18:18 tony-o is soft preventing all subs in that file from being inlined?
18:18 Zoffix I think so
18:18 u_nuSLASHkm8 joined #perl6
18:19 tony-o so, maybe methods that don't need to be wrapped should be elsewhere
18:20 Skarsnik is there something nice to plot graph from p6 data? x)
18:20 u_nuSLASHkm8 left #perl6
18:22 tony-o Skarsnik: a module?
18:23 tony-o https://github.com/azawawi/perl6-graphics-plplot #maybe?
18:24 Zoffix ChristopherBottoms, that issue sounds like your zef is way outdated, as it was a bug in it that got fixed I think some time in spring. Are you sure your system is using the RC Star's zef  and not some other one you had installed previously?
18:24 Skarsnik let's try https://github.com/colomon/Benchmark-Plot maybe
18:25 ugexe Skarsnik: https://perlgeek.de/blog-en/perl-6/2017-012-inline-python.html "Perl 6 By Example: Plotting using Matplotlib and Inline::Python"
18:27 Skarsnik Not sure how useful it can be : https://gist.github.com/Skarsnik/9052b9a5b1447cb0c515b00d267f0a60 but there is a weird drop of perf after 2017.02
18:29 Zoffix Without code it's pretty useless :)
18:30 Cabanossi joined #perl6
18:30 Zoffix Might as well say "some things got slightly slower"
18:30 * Zoffix &
18:30 Zoffix left #perl6
18:31 dubi0us joined #perl6
18:36 andrzejku joined #perl6
18:37 dubi0us joined #perl6
18:38 Skarsnik The code is just a call to Gumbo (C lib) to parse an signifiant html file (11k elements) then transforming then in Perl 6 object, so basicly it's recursly goes through the C struct then creating XML perl6 object.
18:39 lizmat Skarsnik: does --profile give any clues ?
18:39 Skarsnik The time on this test is after the call to the C lib from the end of the creation of all the object
18:41 Skarsnik What rekudo version should I use? or do you want a --profile for each version (it's the average time of 50 executions)
18:42 Skarsnik I guess I could run this stripping the XML object creation to compare
18:43 lizmat Skarsnik: any help in finding why the performance dropped, would be welcome  :-)
18:43 dubi0us joined #perl6
18:46 |oLa| joined #perl6
18:49 Skarsnik anyways to exit a when statement?
18:50 dubi0us joined #perl6
18:52 TEttinger joined #perl6
18:53 lizmat Skarsnik: alas, "leave" is not yet implemented
18:54 lizmat m: when 42 { leave }
18:54 camelia rakudo-moar 8e9605: ( no output )
18:54 lizmat m: $_ = 42; when 42 { leave }
18:54 camelia rakudo-moar 8e9605: OUTPUT: «leave not yet implemented. Sorry.␤  in block <unit> at <tmp> line 1␤␤»
18:54 zostay m: given 'foo' { when 'foo' { say 'A'; proceed; say 'B'; } }
18:54 camelia rakudo-moar 8e9605: OUTPUT: «A␤»
18:55 lizmat TIL proceed
18:56 dubi0us joined #perl6
18:58 zostay there's also succeed which is pretty much the same, but lets you give it an argument which becomes the result for the given {}
18:58 zostay i don't think i've actually used either in code
18:58 zostay i tend to prefer multis to given blocks
18:59 hythm joined #perl6
18:59 hythm Hi
19:00 hythm m: grammar Log { token TOP { <alnum>+} }; class LogAction { method TOP($/) { say $v } }; sub MAIN($v) {}
19:00 camelia rakudo-moar 8e9605: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$v' is not declared␤at <tmp>:1␤------> 3 class LogAction { method TOP($/) { say 7⏏5$v } }; sub MAIN($v) {}␤»
19:00 hythm I want to use $v variable (reading it from command args, in LogAction method
19:01 hythm how can I do that?
19:02 dubi0us joined #perl6
19:05 hythm grammar Log { token TOP { <alnum>+} }; class LogAction { method TOP($/) { say $v } }; sub MAIN($v) {my $m = Log.parse("hello", actions => LogAction.new)}
19:06 tony-o Skarsnik: is that not specific to benchmarking?
19:07 Skarsnik What do you mean? x)
19:08 dubi0us joined #perl6
19:10 tony-o Benchmark::Plot
19:11 domidumont joined #perl6
19:11 andrzejku hey
19:12 andrzejku how can I check operation system
19:13 nine $*KERNEL.name
19:13 raschipi m: say $*KERNEL.name
19:13 camelia rakudo-moar 2dd596: OUTPUT: «linux␤»
19:14 nine $*VM.osname takes only half the time though ;)
19:14 andrzejku oh thnks actually I tried to find some globals description in
19:14 andrzejku documentation but it was hard ;d
19:14 raschipi There's $DISTRO.name too.
19:15 dubi0us joined #perl6
19:15 zostay andrzejku: for future reference: https://docs.perl6.org/language/variables#Compile-time_variables
19:16 Skarsnik tony-o, Oh right, well I am doing some benchmark ^^
19:16 zostay i meant to click on dynamic variables, tho
19:17 raschipi andrzejku: If you want to detect if it's windows, there's $*DISTRO.is-win
19:18 hythm I'll rephrase my question, hopefully this time I be more clear: how to pass a command line arg variable to grammar action method?
19:19 tinyurl_comSLASH joined #perl6
19:21 dubi0us joined #perl6
19:21 tinyurl_comSLASH left #perl6
19:23 tony-o Skarsnik: ah
19:26 zostay hythm: just add a has $.v to LogAction and pass that through and change the referenced far to $!v or $.v
19:26 zostay m: grammar Log { token TOP { <alnum>+} }; class LogAction { has $.v; method TOP($/) { say $.v } }; sub MAIN($v) {my $m = Log.parse("hello", actions => LogAction.new(:$v))}
19:26 camelia rakudo-moar 2dd596: OUTPUT: «Usage:␤  <tmp> <v> ␤»
19:27 zostay m: grammar Log { token TOP { <alnum>+} }; class LogAction { has $.v; method TOP($/) { say $.v } }; sub main($v) {my $m = Log.parse("hello", actions => LogAction.new(:$v))}; main(42)
19:27 camelia rakudo-moar 2dd596: OUTPUT: «42␤»
19:30 tinyurl_comSLASH joined #perl6
19:32 tinyurl_comSLASH left #perl6
19:34 dalek joined #perl6
19:34 hythm Thanks zostay, That what I needed
19:38 wamba joined #perl6
19:40 dubi0us joined #perl6
19:41 dubi0us joined #perl6
19:44 SourceBaby joined #perl6
19:44 andrzejku hey guys who to get %APPDATA% variable on windows?
19:46 Skarsnik probably @*ENV ?
19:46 Skarsnik or %*ENV
19:47 Skarsnik lizmat, I started the benchmark script again to do 100 iterations instead of 50, I will check to have profile for each rakudo release tommorow, since this will take a while
19:47 andrzejku how to run external command?
19:48 Skarsnik shell "command"
19:48 Skarsnik there is lot of way
19:48 synopsebot6 joined #perl6
19:48 andrzejku Skarsnik okay thnks I got it
19:48 andrzejku srry
19:49 Skarsnik my $proc = shell "PERL6_GUMBOLIB=/usr/local/lib/libgumbo.so.1 " ~ $file.IO.path ~ '/install/bin/perl6 ' ~ $torun, :out;
19:49 Skarsnik for $proc.out.lines -> $line {
19:49 Skarsnik do stuff with the output}
19:50 Skarsnik for an example
19:50 perlpilot raiph++  I just read your answer to the .bib parsing question on SO.   That could almost be a whole chapter in a Perl 6 book.
19:52 zostay i usually prefer to run instead to avoid involving the shell if i can
19:52 Skarsnik yes, but it's more tedious to call
19:52 zostay m: run "ls"
19:52 camelia rakudo-moar 250ae1: OUTPUT: «run is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub run at src/RESTRICTED.setting line 14␤  in block <unit> at <tmp> line 1␤␤»
19:52 Skarsnik since you have to pass each arguments separatly
19:53 Skarsnik And I was not sure how to easily pass the PERL6_GUMBOLIB tibbit easily in this case
19:53 dct joined #perl6
19:54 andrzejku Skarsnik what does it mean Str:D ? d?
19:54 Skarsnik Defined
19:54 zostay m: my $f = "foo.txt; rm *"; shell "cat $f"; # why i don't use shell
19:54 camelia rakudo-moar 250ae1: OUTPUT: «shell is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub shell at src/RESTRICTED.setting line 15␤  in block <unit> at <tmp> line 1␤␤»
19:55 lizmat m: say "foo" ~~ Str
19:55 camelia rakudo-moar 250ae1: OUTPUT: «True␤»
19:55 lizmat m: say "foo" ~~ Str:D
19:55 camelia rakudo-moar 250ae1: OUTPUT: «True␤»
19:55 lizmat m: say Str ~~ Str
19:55 camelia rakudo-moar 250ae1: OUTPUT: «True␤»
19:55 lizmat m: say Str ~~ Str:D
19:55 camelia rakudo-moar 250ae1: OUTPUT: «False␤»
19:55 zostay i don't trust that any particular use of shell will never ever involve user input
19:55 dubi0us joined #perl6
19:56 rindolf joined #perl6
19:56 Skarsnik m: say Str ~~ Str:U;
19:56 camelia rakudo-moar 250ae1: OUTPUT: «True␤»
19:58 zostay m: say "foo" ~~ Str:_; say Str ~~ Str:_; say Str:D ~~ Str:_; say Str:U ~~ Str:_;
19:58 camelia rakudo-moar 250ae1: OUTPUT: «True␤True␤True␤True␤»
20:01 Skarsnik :_?
20:02 lizmat :_ is the same as absence
20:02 lizmat so Str:_ is the same as Str
20:03 zostay it's there for java programmers who are used to stating every tiny detail explicitly (*ducks out*)
20:03 lizmat but Str might be different in some contexts in the future, when a pragma like "use default :D" might force Str to be Str:D
20:03 lizmat *then* you would need :_ to force either defined or undefined
20:03 Skarsnik I wish there was a pragma to force type checking of method/sub at compile time x)
20:04 lizmat type checking of subs already happens at compile time
20:04 Skarsnik I am pretty sure 99% of program never add method at runtime
20:04 lizmat m: sub a(Int $a) {}; a "foo"
20:04 camelia rakudo-moar 250ae1: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Calling a(Str) will never work with declared signature (Int $a)␤at <tmp>:1␤------> 3sub a(Int $a) {}; 7⏏5a "foo"␤»
20:05 lizmat Skarsnik: with role composition, this may be easier to do than you think
20:05 lizmat m: my $a = 42 but role { method gist() { "foo" } }; say $a
20:05 camelia rakudo-moar 250ae1: OUTPUT: «foo␤»
20:06 Skarsnik but probably will force the compiler to check more stuff?
20:06 lizmat the whole idea of spesh / JIT is that code needing optimization for a particular run of a program will get optimized on the fly
20:07 Skarsnik It's more for type checking/Validation that optimisation for me
20:11 Manifest0 joined #perl6
20:12 itaipu joined #perl6
20:14 andrzejku hi I got a problem
20:14 andrzejku Failed to copy file: illegal operation on a directory why I cann't copy to directory
20:14 andrzejku with IO:Path
20:16 geekosaur probably it's being literal and requires a filename, not a directory name, as the destination
20:16 Skarsnik dunno, what function did you use?
20:17 andrzejku X::IO::Copy
20:19 geekosaur https://docs.perl6.org/type/IO::Path#routine_copy and it looks to me like it does not support the common idiom where the destination is a directory and a file with the same basename as the original is created
20:22 dubi0us joined #perl6
20:25 andrzejku geekosaur I just take basename
20:25 andrzejku :)
20:25 andrzejku but it could be fixed in the future
20:26 andrzejku usually people copy to dir
20:26 andrzejku i suppose
20:27 geekosaur if you think it should be changed, file a rakudobug
20:28 geekosaur I suspect that this is the lower level operation and it might be best to reserve that behavior for a higher level one.
20:28 andrzejku ok
20:28 geekosaur and users should use the higher level one because they often care about metadata that the lower level one will not handle for them
20:29 geekosaur permissions, extended attributes, etc.
20:29 andrzejku geekosaur I need to go
20:29 andrzejku so :D
20:29 andrzejku thnks for info and bye
20:36 emeric1 joined #perl6
20:42 ChoHag joined #perl6
21:01 devmikey joined #perl6
21:04 AlexDaniel joined #perl6
21:05 tony-o .when leont
21:07 geekosaur .seen leont
21:07 yoleaux I saw leont 10 Jul 2017 12:02Z in #perl6: <leont> Would I need a rakudobrew build-zef? Or can I assume it's already there?
21:09 tony-o .tell leont - i'm looking into it but on moar-blead i'm getting 'Iteration past end of grapheme iterator' on all tests for YAMLish
21:09 yoleaux tony-o: I'll pass your message to leont.
21:09 tony-o ty geekosaur
21:22 pmurias joined #perl6
21:23 pilne joined #perl6
21:37 committable6 joined #perl6
21:37 bisectable6 joined #perl6
21:37 benchable6 joined #perl6
21:37 coverable6 joined #perl6
21:37 bloatable6 joined #perl6
21:37 unicodable6 joined #perl6
21:37 greppable6 joined #perl6
21:37 evalable6 joined #perl6
21:37 quotable6 joined #perl6
21:44 hythm hello, I'm writing a script to parse large files, the script parses http log files and create a hash of each domain and the status code. I'm using Grammar to parse the file line by line, but can't figure out how to gather all data from each line in one hash. any idea how to do that?  here is the code https://gist.github.com/hythm7/f80b2d291dfdc5cf491ca6437b72fcef
21:45 jnthn hythm: I'd probably write an actions class with a hash attribute, and write the action method that is called after each line to insert into the hash
21:48 hythm jnth, I tired that, (probably i did it wrong), beacuse when i try to print the hash at the end i find it empty,, then I commented these hash lines in the code gist above
21:52 hythm will look into that more and will try to do it right this time
21:58 imcsk8 joined #perl6
22:01 pecastro joined #perl6
22:05 raiph perlpilot: Thank you so much for reading it and giving me that feedback. :)
22:08 zoll joined #perl6
22:10 raiph moritz: if you're allowed to use bits from SO given an author's permission, and if any of https://stackoverflow.com/a/45181464/1077672 is useful for your regex book, feel free to copy whatever you want (cf perlpilot's comment)
22:29 Cabanossi joined #perl6
22:31 BenGoldberg joined #perl6
23:28 MasterDuke joined #perl6
23:31 bartolin joined #perl6
23:33 skids joined #perl6
23:59 Cabanossi joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo