Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-07-12

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 canopus joined #perl6
00:27 kyclark joined #perl6
00:30 canopus joined #perl6
00:42 Ben_Goldberg joined #perl6
00:52 slobo joined #perl6
01:02 kalkin-_ joined #perl6
01:08 kyclark joined #perl6
01:18 canopus joined #perl6
01:22 sammers joined #perl6
01:30 Actualeyes joined #perl6
01:30 cdg joined #perl6
01:37 sammers hi from Japan
01:47 mohae joined #perl6
01:52 canopus joined #perl6
01:58 kalkin- joined #perl6
02:07 BrokenRobot m: sub こんにちは{ "こんにちは".say }; こんにちは
02:07 camelia rakudo-moar d075c8: OUTPUT«こんにちは␤»
02:23 canopus joined #perl6
02:39 sammers ha
02:39 sammers hello
02:40 BenGoldberg_ joined #perl6
02:44 sammers ok, is there a secret to getting a module's /bin/* files available as callable scripts?
02:49 noganex_ joined #perl6
03:10 TimToady joined #perl6
03:11 mohae_ joined #perl6
03:12 canopus joined #perl6
03:12 cog__ joined #perl6
03:15 zacts joined #perl6
03:20 sortiz sammers, usually module's ./bin/* files are installed at $*REPO.next-repo.writeable-path.child('bin')
03:29 dj_goku he sortiz question. you remember helping me with some inet_* c (native call stuff). you think that would be useful for others? I was thinking of creating a module of ones I have created an interface through nativecall.
03:30 gcole joined #perl6
03:30 canopus joined #perl6
03:31 cooper joined #perl6
03:31 cooper joined #perl6
03:42 ugexe technically only bin wrappers are installed in /bin
03:45 ugexe my $curi = CompUnit::Repository.repository-for-name('site'); my $bin = $curi.prefix.child("sources/" ~ $curi.files("bin/xxx", name => $name-of-dist)<files><<bin/xxx>>); # something like this to get the actual bin script
03:46 kyclark joined #perl6
03:51 ugexe or my $dist = CompUnit::Repository.repository-for-na​me('site').resolve(CompUnit::Dependenc​ySpecification.new(:short-name("name of dist")).distribution; my $bin = $dist.prefix.child("sources/" ~ $dist.meta<files><bin/xxx>)
03:54 ugexe The second one requires a blead version of rakudo though
04:01 obfusk joined #perl6
04:03 ugexe or if i misunderstand the question: you need to do `rakudobrew rehash` after installing the module with bin/* files
04:05 canopus joined #perl6
04:21 sammers sortiz, ugexe, thanks. `rakudobrew rehash` solved the issue
04:24 canopus joined #perl6
04:25 sammers whenever I run a command in the generated USAGE message includes the full source path in the MAIN examples... is there a way to avoid this?
04:26 sammers I should add, whenever I run a command that is located in ~/.rakudobrew/bin/
04:31 ugexe no, because otherwise you wouldnt be able to differentiate between 2 scripts of the same name that are both in your PATH
04:32 ugexe when you use rakudobrew you essentially have 2 copies of your bin scripts in your PATH (the copy rakudobrew makes, and the copy from your  rakudo/install/bin) so you get the full path shown
04:33 sammers it prints out something like this when I run the command  "Usage: /home/user/.rakudobrew/moar-2016.06/i​nstall/share/perl6/site/resources/55E​C986C6963846DFA7B2117603305011CD0103F update <filename>"
04:33 ugexe right
04:33 sammers so for now I am just overriding the USAGE message
04:34 ugexe that doesnt help for `script --non-existant-option`
04:35 sammers I guess as a user when I run a command available on my $PATH I would't expect to see "/home/user/.rakudobrew/moar-2016.06/i​nstall/share/perl6/site/resources/55EC​986C6963846DFA7B2117603305011CD0103F", I would expect to see "nameofcommand" instead.
04:36 ugexe the only way to fix it would be (i think) to make rakudobrew spawn the bin script but modify ENV for that process to not have rakudobrew/bin dir in PATH
04:36 ugexe but nameofcommand might not run that script
04:37 ugexe when you do `scriptname` it runs some rakudobrew shim, not your actual script
04:37 sammers when I run rakudobrew rehash, it makes nameofcommand available on PATH
04:37 ugexe so the full path needs to be shown
04:37 ugexe i know what it does
04:37 sammers right, but if I run nameofcommand then I want to see nameofcommand in the Usage message output for that command
04:37 sammers the long shim doesn't mean anything to me
04:38 ugexe that doesnt mean such situations dont exist
04:38 sammers right
04:38 sammers they do
04:38 sammers but I mean, the normal expectation would be to see nameofcommand
04:39 sammers it basically discourages us from using the generated USAGE message
04:39 ugexe the script doesnt know that. the script is launched by a shim
04:39 sammers yeah
04:39 ugexe no it discourages you from using rakudobrew
04:39 sammers yeah, good point..
04:39 sammers this is installed via panda
04:40 ugexe if you dont use rakudobrew and instead just add the rakudo install/share/site/bin path to PATH you dont get that
04:40 sammers panda install .
04:40 sammers ah
04:40 ugexe because then there is only a single copy of your bin script, the original. not a shim with the exact same name and the original
04:41 ugexe https://github.com/rakudo/rakudo/blob/3ebf31edcd3a​9358e217d80dfd1ca32843b8c7fb/src/core/Main.pm#L73
04:42 ugexe you can see how it actually works
04:43 sammers ok, thanks
04:44 ugexe as an example: if i made a script named 'apt-get' the USAGE would be incorrect if it said it was invoked with just `apt-get`
04:45 ugexe because apt-get would invoke the OS package manager, not your bin script
04:45 Cabanossi joined #perl6
04:48 xiaomiao joined #perl6
04:55 sammers right, but even in that case, the new apt-get runs from ~/.rakudobrew/bin/, but the usage prints out the long shim path.
04:56 ugexe ~/.rakudobrew/bin/ isnt your script, its just a bash or perl script that launches your actual script
04:56 ufobat joined #perl6
04:57 ugexe your actual script has no way of knowing this
04:58 sammers right, but "nameofcommand" is the command I run to launch ~/.rakudobrew/bin/nameofscript
04:58 ugexe yes, and your script has no way to know it was launched by a shim
04:58 ugexe maybe you write your own shim that launches it with `foobar`, would you expect USAGE to know or display this?
04:59 sammers ok, so for example, I am using rakudobrew to manage moar and panda because it is easy.
04:59 sammers and I isntall a local module using panda install .
04:59 sammers and it makes the nameofscript availabe for use
04:59 sammers so is there an alternative setup that could get me the same functionality without using these shim names in usage?
04:59 ugexe those arent shim names
05:00 sammers or just override usage?
05:00 ugexe those are the actual names of the scripts
05:00 sammers ok
05:00 sammers yeah, so any better alternative?
05:00 ugexe they only show scriptname if NOWHERE earlier in PATH contains a scriptname
05:00 sammers just install everything seperately without using rakudobrew?
05:00 ugexe which is impossible if you want shims with the same name
05:02 sammers I understand why it behaves like this now. that all makes sense. so I want to setup my system so that auto-generated USAGE methods do not use these long names in the output. what is the recommended setup to avoid that behavior?
05:03 ugexe you cant yet
05:03 sammers ok, that is fine.
05:03 sammers for the time being I will just override USAGE.
05:03 sammers keeps things simple
05:04 ugexe that won't fix 'scriptname --asfasfasf' though
05:04 ugexe where --asfasfasf is invalid option
05:06 sammers ok
05:07 mohae joined #perl6
05:08 sammers is there any discussion on the way this all behaves? or is the current implementation just the way p6 "should" work? I am not able to find any discussion on this.
05:14 sortiz dj_goku, Sure! All contributions to P6's ecosystem are appreciated
05:15 canopus joined #perl6
05:16 rurban joined #perl6
05:29 CIAvash joined #perl6
05:30 sammers ugexe, can you take a look at this for me? https://gitlab.com/snippets/22354
05:31 sammers I am trying to find where the invalid option overrides the custom USAGE message
05:59 b2gills joined #perl6
06:11 canopus joined #perl6
06:21 firstdayonthejob joined #perl6
06:28 b2gills joined #perl6
06:34 canopus joined #perl6
06:40 domidumont joined #perl6
06:53 rurban left #perl6
06:59 domidumont joined #perl6
07:00 huggable joined #perl6
07:01 canopus joined #perl6
07:01 domidumont joined #perl6
07:12 darutoko joined #perl6
07:22 dakkar joined #perl6
07:26 zakharyas joined #perl6
07:40 bjz joined #perl6
07:43 wamba joined #perl6
07:44 telex joined #perl6
07:45 abraxxa joined #perl6
07:57 dogbert17 left #perl6
07:59 vendethiel- joined #perl6
08:07 * lizmat clickbaits https://p6weekly.wordpress.com/201​6/07/11/2016-28-show-your-papers/
08:23 DrForr Speaking of clickbaiting, O'Reilly will be holding an online perl 6 training seminar in the fall.
08:24 rindolf joined #perl6
08:24 moritz speaking of clickbaiting, I'm writing a book: https://leanpub.com/deploy (though not on Perl 6)
08:35 rurban1 joined #perl6
08:43 RabidGravy joined #perl6
08:43 pmqs joined #perl6
08:45 zakharyas1 joined #perl6
08:46 rurban joined #perl6
08:46 Xliff joined #perl6
08:53 rindolf joined #perl6
08:55 DrForr Are there plans for 'anon', 'augment' and 'supersede' scopes to be implemented?
08:57 psch "scopes"?
08:57 psch m: anon module { } # this works, but...
08:57 camelia rakudo-moar 4e5c3e: ( no output )
08:58 bjz joined #perl6
08:58 DrForr Sorry, variable scoping.
08:58 DrForr m: my $x; anon $x = 32;
08:58 camelia rakudo-moar 4e5c3e: OUTPUT«5===SORRY!5===␤anon scoped variables not yet implemented. Sorry. ␤at <tmp>:1␤------> 3my $x; anon $x7⏏5 = 32;␤    expecting any of:␤        constraint␤Other potential difficulties:␤    Redeclaration of symbol $x␤    at <tmp>:1␤ …»
08:58 psch oh
08:58 psch i honestly don't know what that would mean
08:58 psch same for 'augment' and 'supersede', actually
08:59 DrForr They're mentioned in the variable docs.
08:59 DrForr (don't have the link handy, one moment.)
09:00 DrForr (and BTW (the new sidebar)++
09:02 psch ah, http://design.perl6.org/S02.html#Scope_declarators
09:02 psch assuming that bit is still up to date
09:02 DrForr https://docs.perl6.org/language/vari​ables#Variable_Declarators_and_Scope # The examples admittedly don't mention variables for 'anon' and 'augment'.
09:02 pdcawley joined #perl6
09:03 psch hmm, still, making sense of an anon variable declaration seems somewhat hard :)
09:03 DrForr The topic 'variable declarators' would seem to imply that you can declare an 'anon $x;' just like you declare 'my $x;', but that's not the case.
09:03 psch yes, but it does state NYI
09:03 rurban left #perl6
09:04 DrForr Yes, it does. I was merely asking if it was planned, it's right now just a TODO in my test sutie.
09:06 roguelazer joined #perl6
09:07 DrForr *suite
09:07 psch i'd guess it depends on some design-y decision
09:07 psch as mentioned, i find it hard to imagine what declaring an anonymous variable actually means
09:10 DrForr I haven't looked deeply enough into what the anonymity means, I'd probably agree at that point.
09:10 rindolf joined #perl6
09:11 DrForr I'm just pointing out that 'anon', 'augment' and 'suspend' are in the variable declarator section of doc.perl6.org and probably shouldn't be there if it makes no sense for a variable to be anonymous, and I agree that it doesn't make much sense.
09:13 DrForr Though this does mean I can add a whole new section to the test suite, since I'd forgotten that declarations can be applied to sub &c.
09:14 canopus joined #perl6
09:30 canopus joined #perl6
09:34 kurahaupo joined #perl6
09:36 kaare_ joined #perl6
09:46 DrForr I will state, however, that 'Illegally post-declared type' is getting on my nerves. I understand the rationale (I think) but it brings back ugly memories of Pascal and having to go back and reposition functions in a green-screen terminal.
09:48 bjz_ joined #perl6
09:56 Xliff Wheee! Starting another round of p6-XML-LibXML porting, this week.
09:57 Xliff DrForr++ # For remembering
09:57 Xliff (Coding Flashbacks)-- # We've all been there
09:58 mr-foobar joined #perl6
10:07 canopus joined #perl6
10:18 DrForr w00t, I just coredumped perl6 moarvm for the first time in a *long* while. Too bad it's not reproducible.
10:21 canopus joined #perl6
10:34 canopus joined #perl6
10:46 Ulti neat another .2 seconds off of my tests since jnthn's change to dispatch cache for named parameters
10:47 Ulti at 1.3s down from 35s two years ago
10:50 canopus joined #perl6
10:58 lizmat m: say 1.3/35
10:58 camelia rakudo-moar 4e5c3e: OUTPUT«0.037143␤»
10:59 lizmat m: say 1.3R/35
10:59 camelia rakudo-moar 4e5c3e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3say 1.37⏏5R/35␤»
10:59 lizmat m: say 1.3 R/ 35
10:59 camelia rakudo-moar 4e5c3e: OUTPUT«26.923077␤»
11:02 kid51 joined #perl6
11:10 Xliff I'm still getting LONG parse times whenever I make a change in a XML::LibXML module --> Stage parse      :  93.639
11:10 Xliff That's excessive. That's longer than it takes to parse the Perl6 grammar!
11:15 canopus joined #perl6
11:17 dakkar joined #perl6
11:19 Khisanth joined #perl6
11:21 lizmat the only anecdotal story I've heard about long parse times, was from TheDamian, but that seemed to involve very high unicode codepoint values in the source
11:22 lizmat Xliff: ^^^ I assume that's not the case with your code ?
11:25 Xliff lizmat: You are correct. There is very little (dare I say non-existant) unicode codepoint values in the code, unless you consider the following:
11:25 Xliff https://github.com/Xliff/p6-XML-LibXML/​blob/master/lib/XML/LibXML/Dom.pm#L293
11:26 rindolf joined #perl6
11:26 lizmat well, that could be it...
11:27 Xliff However I was experiencing high parse times before that method was written, just not to this extent.
11:27 lizmat EFFFF is pretty high, no ?
11:27 moritz uhm, I thought this was about literals in the source code
11:27 moritz not about regexes matching high codepoints
11:28 lizmat Xliff: if you simplift that token to only the first line, does that change the parse time ?
11:28 lizmat moritz: perhaps building ranges is what takes so long ?
11:28 lizmat Xliff: any idea on memory usage ?
11:29 Xliff lizmat: No idea on memory usage. How can I check?
11:29 Xliff And I will try your suggestion... one sec.
11:30 gregf_ m: say 1.1R.^name
11:30 camelia rakudo-moar 72d2d6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3say 1.17⏏5R.^name␤»
11:31 Xliff Updated to latest rakudo while I was working on this.
11:31 Xliff And parse times are comparable to before update.
11:31 Xliff And it looks like simplifying the token did not have an effect.
11:32 Xliff Stage parse      :  91.104 # !!!
11:33 Xliff Also getting this as a result of a nativecast even though the class should be defined in scope by the time of invocation: "Internal error: unhandled target type"
11:35 canopus joined #perl6
11:36 lizmat Xliff: ok, so much for that idea then  :-(
11:38 Xliff Thanks for the thought though, lizmat++
11:38 Xliff I've been struggling with compile times for weeks and I am no closer to a solution than when I started.
11:39 Xliff I am almost wondering if there is something circular in my "use" order that's causing the problem.
11:40 nine Xliff: if there were a circle, you'd either get an error message or it would take forever.
11:41 Xliff And I'm assuming you mean really forever and not just 91 seconds? =)
11:41 nine yes
11:41 Xliff Heh.
11:41 Xliff
11:41 lizmat Xliff: does RAKUDO_MODULE_DEBUG=1 give any extra timing info ?
11:41 nine Well, not really. It would give you another error due to too many processes or full memory
11:42 Xliff For those wanting hands on experience, you can check out branch 07dtd from here: https://github.com/Xliff/p6-XML-LibXML/tree/07dtd
11:42 Xliff lizmat, one sec.
11:44 Xliff lizmat: Gives plenty of info, but it's all greek to me.
11:44 lizmat could you gist it ?
11:44 Xliff lizmat: I will try and capture it next time I make a change to a module.
11:44 Xliff Is that output through STDERR?
11:45 lizmat think so
11:45 Xliff Redirecting now. Will gist as soon as it is done.
11:48 Xliff Output still generating.
11:49 Xliff Something tells me this will be an Energizer Bunny situation: "Stilll....gooing!"
11:49 Xliff Anyone wanna create a betting pool for when it's done?
11:51 Xliff Last line:   17  9483 RMD: Precompiling /home/cbwood/projects/p6-XM​L-LibXML/lib/XML/LibXML.pm into /home/cbwood/projects/p6-XML-LibXML/lib​/.precomp/C521DC82132094A6D8FF6BBD8C557​5985CF18AD1.1468322313.12496/1E/1E01892​A64A383CF8DB46666BAAF21717C35B489.bc
11:52 Xliff Last timestamped 07:45 my time. It's now 07:52.
11:52 DrForr I.I code deadpool.
11:54 lizmat something weird going on here...  add RAKUDO_MODULE_DEBUG shouldn't make that much difference in performance, should it?  nine?
11:59 Xliff Used the following invocation: RAKUDO_MODULE_DEBUG=1 perl6 --stagestats -Ilib t/07dtd.t > debugout 2>&1
11:59 Xliff And nothing has changed.
11:59 Xliff "Stilll....going!"
11:59 Xliff Now 07:59
12:00 lizmat Xliff: is the process using a lot of memory
12:01 lizmat ?
12:01 Xliff 9485 cbwood    20   0  156400 150868  22808 R 100.0  1.8  16:09.09 moar
12:02 Xliff That's 100% CPU and 1.8% mem
12:02 ilmari 150MB resident
12:03 lizmat well, that feels like a loop alright  :-(
12:04 Xliff 3 moar procs. Here's the complete list:
12:04 Xliff cbwood    9483  0.4  1.9 165764 160548 pts/0   S+   07:45   0:05 /home/cbwood/.rakudobre
12:04 Xliff cbwood    9484  0.0  0.9  85460 79840 pts/0    S+   07:45   0:00 /home/cbwood/.rakudobre
12:04 Xliff cbwood    9485  100  1.8 156400 150868 pts/0   R+   07:45  17:47 /home/cbwood/.rakudobre
12:04 Xliff And yes, the 100% on the last one definitely feels like a loop.
12:04 Xliff Although I don't know why the redirection has exposed it.
12:04 Xliff If I run this without, I bet it completes.
12:05 lizmat please try  :-)
12:05 Xliff I don't think we're going to get anything more out if this.
12:05 canopus joined #perl6
12:06 Xliff Restarting without the redirect.
12:06 Xliff Almost immediately, we get head scratchers:
12:06 Xliff cbwood    9531 12.1  1.9 165624 160440 pts/0   S+   08:05   0:05 /home/cbwood/.rakudobre
12:06 Xliff cbwood    9532  1.6  0.9  85460 79868 pts/0    S+   08:05   0:00 /home/cbwood/.rakudobre
12:06 Xliff cbwood    9533  102  1.8 156400 150880 pts/0   R+   08:05   0:36 /home/cbwood/.rakudobre
12:06 Xliff 102% CPU? # 0_o
12:07 Xliff If this doesn't complete in 5 minutes, I am going to drop RAKUDO_MODULE_DEBUG and see if it completes.
12:07 ilmari multiple threads, presumably
12:07 user9 joined #perl6
12:07 Xliff ilmari: Ah.
12:08 lizmat Xliff: please try to gist whatever RAKUDO_MODULE_DEBUG output you *di* get
12:08 lizmat *did*
12:10 Xliff lizmat: Sure.
12:11 Xliff https://gist.github.com/Xliff/8​325b45073259ff37c9cfaa7e9263fd9
12:12 Xliff OK. 5 minutes are up. Trying again without RAKUDO_MODULE_DEBUG
12:12 Xliff That's going to make it a pain to track, though.
12:13 lizmat Xliff: is there a reason it's loading Test ?
12:13 Xliff Yes. t/07dtd.t <-- test script
12:13 Xliff Stage parse      :  40.032 # Completes without RAKUDO_MODULE_DEBUG
12:14 Xliff So there are two issues that I am seeing: 1) long parse times 2) inability to use RAKUDO_MODULE_DEBUG in certain situations due to loop
12:15 Xliff lizmat: Do you think loading Test is an issue?
12:15 lizmat no, I was just wondering: I had assumed this was just about doing -Mmodule rather than trying to run it from a test script
12:16 Xliff lizmat: Based on my experience, it happens in both situations.
12:16 Xliff BRB: Breakfast.
12:16 lizmat I hope nine will be able to tell something from the gist
12:17 lizmat wonder why several modules occur more than once in this gist
12:17 lizmat e.g. NativeCall::Types
12:18 moritz used from several files, maybe?
12:21 * [Coke] has a business trip upcoming to Leeds, UK.
12:35 sno joined #perl6
12:36 nine It hangs trying to write this to STDERR: 1370 24417 RMD: Precompiled /home/nine/install/p6-XML-Li​bXML/lib/XML/LibXML/XPath.pm into /home/nine/install/p6-XML-LibXML/lib/.​precomp/EDCEB6E1F3092E4F9B290930866493​4E832B1A33.1467580863.58493/76/768114C​2C22CE3EB994A37FC9E0CA9B37CC0977A.bc\n
12:36 nine IOW: WTF? Messages like that are written all the time
12:36 RabidGravy [Coke] well your spending money will go further at least :)
12:36 AlexDaniel joined #perl6
12:38 rurban joined #perl6
12:38 nine Even worse, it hangs in __write_nocancel
12:44 mcmillhj joined #perl6
12:45 [Coke] RabidGravy: my company will appreciate that, anyway. :)
12:45 Xliff nine: Oh my, how ironic!
12:45 moritz so it writes in a pipe, and the other process either has gone away, or isn't reading, thus blocking the pipe?
12:47 canopus joined #perl6
12:50 rurban joined #perl6
12:50 rurban1 joined #perl6
12:50 nine I've never been a fan of capturing the precomp process' STDERR as it confuses RAKUDO_MODULE_DEBUG output. This time, I'm really considering to throw it out.
12:51 gfldex m: my $A::a = 42; constant B::b = 666;
12:51 camelia rakudo-moar 72d2d6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing initializer on constant declaration␤at <tmp>:1␤------> 3my $A::a = 42; constant B:7⏏5:b = 666;␤»
12:51 gfldex is that intentional?
12:51 moritz std: my $A::a = 42; constant B::b = 666;
12:51 camelia std : OUTPUT«No such file or directory»
12:52 moritz huh, std build broken
12:52 moritz gfldex: no idea
12:52 camelia std : OUTPUT«(timeout)cat: /home/camelia/std/snap/revision: No such file or directory␤»
12:52 gfldex looks wrong to me to have a special case for the constant declarator
12:52 Xliff So can someone tell me what causes this error in a nativecast(): "Internal error: unhandled target type
12:52 Xliff "
12:52 Xliff And how can I fix it?
12:53 nine Xliff: I get 3 second stage parse after the first run and 8 seconds stage parse after modification of lib/XML/LibXML.pm
12:53 nine The first run does indeed take some ~ 50 seconds where it compiles loads of modules.
12:54 Xliff nine: Try modifying lib/XML/LibXML/Node.pm
12:54 Xliff That should trigger a recompile of just about everything.
12:54 Xliff And that's where you'll see >70 second precompiles.
12:56 nine Xliff: 39 seconds as it precompiles a lot of modules again. Which is to be expected. Node is a very common base class in a DOM implementation
12:58 nine Xliff: though it seems like it's actually precompiling only Node.pm, Element.pm, Document.pm and LibXML.pm
12:59 RabidGravy Hmm, I guess that all the "live" tests are failing on my yet to be released CouchDB module probably indicates that there's something wrong with the couch server
13:01 * moritz wouldn't serve very well either while sitting on a couch
13:03 grondilu joined #perl6
13:04 Xliff nine: So why am I seeing precompile times > 80 seconds?
13:04 Xliff Oh! My timings come from a 32-bit VM with 4 procs
13:04 Xliff Which might do it.
13:06 nine Xliff: it's still mighty slow even on a faster machine
13:10 Xliff nine: Any suggestions on how I can make it faster?
13:10 Xliff Or... at least not slow?
13:11 Xliff Also.... still wondering how I can fix the "Internal error: unhandled target type" issue with nativecast(). There doesn't seem to be an obvious fix, since the class definition should be loaded when that call is encountered.
13:14 nine Xliff: I just pushed a fix to rakudo/nom giving me:
13:14 nine Initial compile: 49s -> 34s
13:14 nine Changing a base module: 39s -> 19s
13:14 nine Loading unmodified: 3s -> 1.9s
13:15 skids joined #perl6
13:17 nine I noticed that we did check dependencies like LibXML::CStructs a lot more than we actually needed to.
13:19 cdg joined #perl6
13:24 Xliff Ooh!
13:24 Xliff Will rakudobrew as soon as I get a chance. Thanks, nine++!
13:26 rgrinberg joined #perl6
13:30 gfldex moritz: i didn't find any spectest with `constant A::a` so I rekudobugged as RT#128610
13:30 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=128610
13:33 moritz gfldex: it's only a rakudobug if it's supposed to work; is there anything in the design docs to support that?
13:33 Xliff nine: Niice change! Stage parse (post new rakudo):  82.447 -> 54.499
13:33 nine :)
13:34 Xliff Now all that's left is this error on nativecast(). Can someone give me some idea as to what is going wrong?
13:34 Xliff Also.... still wondering how I can fix the "Internal error: unhandled target type" issue with nativecast(). There doesn't seem to be an obvious fix, since the class definition should be loaded when that call is encountered.
13:36 tadzik joined #perl6
13:37 nine Xliff: we're gonna need more info to help with that
13:37 Xliff nine: What kind of info?
13:38 gfldex moritz: S04 introduces the constant declarator but doesn't say how it's name should look like. I would assume that the general rules for variable identifiers apply and that includes the package part of a name. I can't see how adding the ability to have a fully qualified name would break existing code, so adding it should not cause harm.
13:38 moritz Xliff: for example how you call it?
13:39 Xliff moritz: https://github.com/Xliff/p6-XML-LibXML/bl​ob/07dtd/lib/XML/LibXML/Document.pm#L412 <- Call made here.
13:39 Xliff Class is loaded on Line #11
13:40 moritz Xliff: what's in $.extSubset when you get that error?
13:40 Xliff Will check.
13:41 TeamBlast joined #perl6
13:42 Xliff Odd. I thought the issue was the nativecast, not the value being cast.
13:45 nine Xliff: what exactly is that line supposed to do anyway? Seems to me like nativecast is meant for casting to one of the native types, not user classes.
13:46 Xliff Yes, but the user classes are repr('CStructs')
13:46 Xliff s/CStructs/CStruct/
13:46 Xliff So that should still work.
13:47 Xliff $.extSubset.^name == "xmlDtd"
13:47 Xliff I can't print or dd those values because the structs contain circular refs.
13:47 Xliff But the point there is to cast the bare struct into it's decendent class.
13:48 Xliff so xmlDtd goes to XML::LibXML::Dtd
13:48 Xliff xmlDtd is low level internal, whereas XML::LibXML::Dtd is what we pass to consuming code.
13:49 Xliff Prevents circular refs.
13:52 nine Xliff: I can reproduce the error by adding this to rakudo's t/04-nativecall/09-nativecast.t: class Cuter is CUTE { }; is nativecast(Cuter, ReturnStruct()).i, 100, 'casting to CStruct works';
13:53 nine CUTE is repr('CStruct') but you cannot nativecast to its subclass
13:53 nine This however works: class Cuter is CUTE is repr('CStruct') { }; is nativecast(Cuter, ReturnStruct()).i, 100, 'casting to CStruct works';
13:54 moritz so maybe the error message should be "Cannot cast to $typename, because its representation does not allow nativecasting"?
13:55 M-matthew joined #perl6
13:55 M-Illandan joined #perl6
13:57 Xliff nine++
13:59 Xliff That did the trick!
13:59 Xliff One less mystery to deal with, now.
14:00 Xliff moritz: That would be a better error. Yes.
14:04 kyclark joined #perl6
14:06 japanoise does perl6 have an equivalent to cdr in lisp?
14:08 DrForr @foo.rest # ?
14:09 DrForr sub car { .first } sub cdr { .rest }
14:10 TeamBlast joined #perl6
14:10 perlpilot m: my @a = ^10; say @a.rest;
14:10 camelia rakudo-moar 7830ec: OUTPUT«Method 'rest' not found for invocant of class 'Array'␤  in block <unit> at <tmp> line 1␤␤»
14:11 japanoise first does do car
14:11 japanoise but i need a cdr
14:12 parabolize @a.splice(1)
14:12 BrokenRobot @a[0] / @a[1..*-1] ?
14:12 cooper_ joined #perl6
14:12 cooper_ joined #perl6
14:12 japanoise splice 1 seems right
14:12 japanoise thanks c:
14:13 BrokenRobot @a[1..^*] even
14:14 perlpilot 1..* would work.
14:14 BrokenRobot Oh, neat.
14:15 b^_^d joined #perl6
14:15 obfusk joined #perl6
14:16 skids joined #perl6
14:18 pr1_ joined #perl6
14:18 * perlpilot waits for someone to use CANDO to automagically make all of the caar, cadr, etc variants
14:19 mcmillhj joined #perl6
14:19 pr1_ Hi, can you perform stream operations in p6 without changing the stream. I'll give an example in Java 8 in a sec.
14:19 pr1_ Stream<String> stream = Stream.of("black bear", "brown bear", "grizzly");
14:19 pr1_ long count  = stream.filter(s -> s.startsWith("g")).peek(Sys​tem.out::println).count();
14:19 pr1_ System.out.println(count);
14:21 pr1_ The Java code peeks for words starting with "g", but doesn't remove them from the stream.
14:23 BrokenRobot a .map on a Supply?
14:24 gfldex m: $*IN.words.map({ note $_ if .starts-with('g'); $_}).put
14:24 camelia rakudo-moar 7830ec: OUTPUT«ghluais␤go␤ghleann␤gleanntáin␤ghlas’␤gur␤gl​eanntáin␤ghlas’␤gnéill␤ghaoil,␤go␤gan␤ghá␤gach␤gac​h␤gach␤go␤gan␤gan␤ghruaim␤ghleanntáin␤ghlas’␤Céad slán ag sléibhte maorga Chontae Dhún na nGall Agus dh…»
14:24 BrokenRobot m: Promise.in(4).then: { exit }; eager Supply.interval(1).map: {say "Got an even [$_]" if $_ %% 2};
14:24 camelia rakudo-moar 7830ec: OUTPUT«Got an even [0]␤Got an even [2]␤»
14:25 gfldex .map({somestuff(); $_ }).foo will do stuff on a list without changing that list
14:26 pr1_ Thks BrokenRobot and gfldex. I'll try out your solutions.
14:26 gfldex and .map is lazy
14:26 pmurias joined #perl6
14:26 gfldex Perl 6 doesn't really have streams but a generalisation that is lazy lists, that share properties with streams
14:27 pmurias DrForr: wouldn't it be possible to use a anon variable as an 'is rw' argument to a sub?
14:27 gfldex to some degree, because of the dreaded unicode
14:28 pmurias DrForr: I guess the reason anon variables are not implemented is that they aren't very useful
14:32 arnsholt An initial report from the land of Smalltalk, if anyone's curious: It's super-minimal! I can really see why it's called *Small*talk now, which is pretty neat
14:32 arnsholt Also, I suspect it'll take me some time to get used to '' for strings and "" for comments
14:33 pr1_ Hi, how do you collect the characters in the P6 equiv. of a Java stream, into a set? Java 8 code:
14:33 pr1_ Stream<String> stream = Stream.of("w", "o", "l", "f");
14:33 pr1_ TreeSet<String> set = stream.collect(TreeSet::new, TreeSet::add, TreeSet::all);
14:33 lucasb_ joined #perl6
14:33 pr1_ System.out.println(set); // [f, l, o, w]
14:33 pr1_ I couldn't find the equivalent of a collect function in the P6 doc.
14:34 lizmat m: dd set( <w o l f> )   # pr1: this what you mean?
14:34 camelia rakudo-moar 7830ec: OUTPUT«set("l","w","o","f")␤»
14:35 pr1_ Looks good. I'll try it.
14:36 gfldex pr1_: the answer to your question could also be "Grammar" depeding on what you want to do in the end.
14:37 MafProd joined #perl6
14:39 pr1_ The example comes from the Java 8 OCP Study Guide p. 195. It shows how to use accumulators and [parallel] combiners. I just wondered how you could do it in P6.
14:41 rindolf joined #perl6
14:47 pmurias What would be a good way to parse a bit of Perl 6 while getting the information where the ws (white space) rule matched?
14:48 pmurias It seem that to get a p6tidy to work we would need that info
14:49 gfldex m: package A { constant a = 42; }; say A::a
14:49 camelia rakudo-moar 7830ec: OUTPUT«42␤»
14:49 pmurias one idea I have is to monkey patch Perl6::Grammar but that seem very inelegant
14:50 lucasb_ yes, this recent ticket about fully qualified constants mentioned the syntax 'my $a::b = 42', and I was wondering what that meant.
14:50 lucasb_ I thought 'my' was exclusively for creating lexicals, but, if the variable can be accessed from outside the block, then it's not a lexical, right?
14:50 lucasb_ m: { my $a::b = 42; say 'hi' }; say $a::b
14:50 camelia rakudo-moar 7830ec: OUTPUT«hi␤42␤»
14:50 DrForr pmurias: Funny you should mention that :)
14:50 gfldex lucasb_: packages are lexical
14:51 woolfy joined #perl6
14:51 pmurias DrForr: is there some existing prior art I should know about?
14:51 pmurias ;)
14:52 gfldex m: sub f() { package A { my $a = 42 }; say $A::a }; f;
14:52 camelia rakudo-moar 7830ec: OUTPUT«(Any)␤»
14:52 gfldex m: sub f() { package A { our $a = 42 }; say $A::a }; f;
14:52 camelia rakudo-moar 7830ec: OUTPUT«42␤»
14:52 DrForr It parses a non-trivial source file, although I haven't checked at *all* how the resultant source tree looks.
14:52 hoelzro o/ #perl6
14:52 pmurias hoelzro: \o
14:52 hoelzro I've published some fixes to the pygments lexer here: https://bitbucket.org/hoelzro/pygments-main
14:53 hoelzro o/ pmurias
14:53 pmurias DrForr: got a link?
14:53 pr1_ lizmat: the idea is to collect all individual chars. in a stream (i.e., STDIN) into a set.
14:53 DrForr I think it'll go up on my personal GH tonight, I've found myself wanting to move it to different PCs to work on it.
14:53 hoelzro I have about 2 years of changes to the language to get through, so it may be a few days before I submit a PR upstream
14:53 DrForr pmurias: I can put up a small gist if you like, give me a few minutes.
14:54 BrokenRobot m: say $*IN.comb.Set
14:54 camelia rakudo-moar 7830ec: OUTPUT«set(C, a,  , n, I, ,, p, S, l, r, c, L, á, g, E, b, ␤, ’, s, G, !, T, i, t, e, m, ;, M, ó, h, ú, A, u, í, ., B, é, d, o, D, N, f, ')␤»
14:55 BrokenRobot m: say $*IN.comb.Bag
14:55 camelia rakudo-moar 7830ec: OUTPUT«bag(S(3), p(2), ,(8), I(2), n(64),  (202), a(116), C(2), L(2), c(26), r(48), l(59), E, g(38), á(28), ’(10), ␤(20), b(19), T, !, G(13), s(43), ó(6), M(2), ;(4), m(37), e(41), t(31), i(69), B, .(4), í(13), u(13), A(4), ú(10), h(86), '(4), f(13), N(3)…»
14:55 pr1_ BrokenRobot: that's what I was looking for.
14:56 BrokenRobot (An article on comb: http://perl6.party/post/Perl6-Comb-It  )
14:56 pr1_ What does the "m:" you guys put in from of code excerpts mean exactly?
14:56 BrokenRobot pr1_: eval bot trigger
14:56 BrokenRobot Stands for "moar" which is the MoarVM
14:56 * hoelzro always thought it stood for "moar"
14:57 gfldex m: grammar G { rule TOP { <r> }; rule r { 'abc' } }; G::r.WHAT.say;
14:57 camelia rakudo-moar 7830ec: OUTPUT«Could not find symbol '&r'␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
14:57 hoelzro ah, beaten to the punch!
14:57 zakharyas joined #perl6
14:58 gfldex m: grammar G { rule TOP { <r> }; rule r { 'abc' } }; G.^methods>>.say
14:58 camelia rakudo-moar 7830ec: OUTPUT«rule TOP { <r> }␤rule r { 'abc' }␤parse␤parsefile␤subparse␤Method 'say' not found for invocant of class 'NQPRoutine'␤  in block <unit> at <tmp> line 1␤␤»
14:58 holyghost joined #perl6
14:58 gfldex m: grammar G { rule TOP { <r> }; rule r { 'abc' } }; G.^methods>>.?say
14:58 camelia rakudo-moar 7830ec: OUTPUT«rule TOP { <r> }␤rule r { 'abc' }␤parse␤parsefile␤subparse␤Method 'dispatch:<.?>' not found for invocant of class 'NQPRoutine'␤  in block <unit> at <tmp> line 1␤␤»
14:58 pr1_ m: say "just testing m:"
14:58 camelia rakudo-moar 7830ec: OUTPUT«just testing m:␤»
14:59 BrokenRobot Also works via /msg or /notice to camelia
15:00 DrForr pmurias: https://gist.github.com/drforr/a​1d250c32bc92f8455eb070cb3876365
15:00 huggable joined #perl6
15:00 holyghost Hello, just gotten home, tomorrow some free time hacking
15:00 jonas2 joined #perl6
15:01 gfldex m: grammar G { rule TOP { <r> }; rule r { 'abc' } }; dd G::.keys
15:01 camelia rakudo-moar 7830ec: OUTPUT«().Seq␤»
15:01 gfldex is there any way to do introspection on a Grammar?
15:02 Coleoid_n joined #perl6
15:04 pr1_ gfldex: I get a  "Could not find symbol '&r'' error when I run your grammar in rakudo 2016.04.
15:05 heatsink joined #perl6
15:06 gfldex pr1_: Grammar are vm-magic. So I'm not surprised to see lack of introspection.
15:06 Xliff m: say $*IN.words
15:06 camelia rakudo-moar 7830ec: OUTPUT«(Céad slán ag sléibhte maorga Chontae Dhún na nGall Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll; Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí I mo dhiaidh bhí gleanntáin ghlas’ Ghaoth…»
15:06 Xliff Default IN? Neat!
15:08 DrForr pmurias: The 'Tests' block has a sample of Perl6::Tidy (probably badly named at the moment) converting a non-trivial parse tree out to Perl 6, and later on are some sample node classes. There's a Node role whose sole role is to keep the classes' storage consistent.
15:11 pochi joined #perl6
15:12 lucasb_ gfldex: sorry for the delay. I didn't fully understand what you said.
15:12 lucasb_ I was intuitively expecting 'my $a::b::c = ...' to be a syntax error
15:12 gfldex how could you, even I don't understand what I say
15:12 lucasb_ :)
15:14 sammers joined #perl6
15:14 gfldex lucasb_: also, we didn't tell you in https://docs.perl6.org/language/syntax#Identifiers
15:15 * gfldex takes notes
15:16 DrForr pmurias: Thoughts?
15:16 TeamBlast joined #perl6
15:18 pmurias DrForr: looking at it
15:20 DrForr The main point is being very picky about what gets parsed where, so I can catch errors as early as possible.
15:20 ugexe joined #perl6
15:21 DrForr I *really* want to create a with-hash-keys(..) { } macro, but if I do that I'll never get around to finishing the module :)
15:22 pmurias DrForr: Perl6::Tidy itself is not part of the gist?
15:22 ugexe sub foo(% (:$key1, :$key2)) { } is already easy enough no?
15:23 DrForr It's just a thin shell that invokes Root.new() on the parsed object, it's pretty trivial.
15:23 DrForr ugexe: Good point, though I might need to go farther than that.
15:23 mohae joined #perl6
15:25 DrForr pmurias: Updaetd with the core method, Perl6::Tidy::Root.new(...) does essentially the same thing as the other classes, its new() method tears down the hash or list into a Perl6-space object.
15:26 DrForr It just runs the core parsegrammar method with the parseactions methods, it needs $*LINEPOSCACHE because apparently a few methods need it.
15:30 pmurias DrForr: what's the benefit of having a Perl 6 class for every grammar rule?
15:31 DrForr This lets Perl 6 users be able to walk the parse tree of a grammar without needing to learn NQP?
15:31 dvinciguerra joined #perl6
15:31 DrForr And my plan isn't necessarily 1:1 rule:class.
15:32 DrForr In fact it can't be in most cases.
15:33 zakharyas joined #perl6
15:33 pmurias can't because of <.foo> rules or it shouldn't be?
15:33 DrForr For instance there's no need for EClass to exist in the final parse tree, because the only thing the Perl 6 user wants to know is "What is the number in this argument?" They don't need to know the individual scale...
15:37 DrForr I'm not intending to mimick the exact grammar, it should be possible for users to say 'say ArgList.Str' and get back a stringified version of the arguments without worrying about what class each one of them is.
15:38 rindolf joined #perl6
15:38 aindilis joined #perl6
15:38 DrForr Also, ::Tidy isn't the best namespace for this to be in, it'll move somewhere more appropriate.
15:50 AndyBotwin joined #perl6
15:51 pmurias DrForr: you should look at masak's blog post about a new proposed ast format
15:54 DrForr Oo. Link?
15:57 gfldex DrForr: http://strangelyconsistent.org/b​log/macros-what-the-faq-are-they
15:57 adu joined #perl6
15:58 * DrForr scribbles for later.
15:58 DrForr Oh, I think I've read that before. But good for review at least.
15:59 iH2O joined #perl6
16:12 BrokenRobot m: https://gist.github.com/zoffixznet​/5d53dbf8c1dffe38b03a6e7b7fab1bfa
16:12 camelia rakudo-moar 0941d0: OUTPUT«gist not found»
16:13 BrokenRobot :\ Github is getting hax0red again
16:14 dogbert17 joined #perl6
16:15 dogbert17 o/ #perl6
16:15 hoelzro o/ dogbert17
16:15 dogbert17 hi hoelzro
16:16 dogbert17 stupid question time again
16:16 adu hi all
16:16 dogbert17 m: my $block = { ENTER { say "entering block"}; 42 }; say $block.has-phasers # shouldn't this return a Bool?
16:16 camelia rakudo-moar 0941d0: OUTPUT«1␤»
16:16 vendethiel joined #perl6
16:17 BrokenRobot m: my $block = { ENTER { say "entering block"}; LEAVE { }; 42 }; say
16:17 camelia rakudo-moar 0941d0: OUTPUT«5===SORRY!5===␤Argument to "say" seems to be malformed␤at <tmp>:1␤------> 3 "entering block"}; LEAVE { }; 42 }; say7⏏5<EOL>␤Other potential difficulties:␤    Unsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or u…»
16:17 dogbert17 perhaps I'm bikeshedding here
16:17 BrokenRobot m: my $block = { ENTER { say "entering block"}; LEAVE { }; 42 }; say $block.has-phasers
16:17 camelia rakudo-moar 0941d0: OUTPUT«1␤»
16:17 BrokenRobot m: https://gitlab.com/snippets/22362
16:17 camelia rakudo-moar 0941d0: OUTPUT«␤»
16:18 BrokenRobot How come this snippet returns nothing, but if I change .+ to \w+ on line 10, then it returns [BUG], as wanted: https://gitlab.com/snippets/22362#L10
16:18 BrokenRobot m: https://gitlab.com/snippets/22363
16:18 camelia rakudo-moar 0941d0: OUTPUT«[BUG]␤»
16:18 parabolize hoelzro: Thank you for updating pygments!
16:19 parabolize hoelzro: I beleave whitespace is allowed between the angle brackets and the first and last word: roast/S02-literals/listquote-whitespace.t. I'm not saying I would do that but obviously someone wanted it. «qq list quotes» arn't handled in many places. Language/operators and Language/quoting have lots of examples. Replace line 531 with (r'<<.*?>>|<[^<=].*?>|«.*?»', String) rather than (r'<[^\s=].*?\S>', String)?
16:19 gfldex dogbert17: there are no spectests for .has-phasers. Nothing to see, move along!
16:20 dogbert17 gfldex: does that mean that I should not document it?
16:21 iH2O do whatever is necessary, Dagobert 17
16:21 parabolize err r'<<(?!==).*?>>|<[^<=].*?>|«.*?»' rather
16:21 dogbert17 I have a gist but github !¤#¤"%"% 404
16:21 gfldex dogbert17: don't doc anything that isn't in roast. If you believe it should be in the language and not having a spectest is just a oversight, file a RT against roast.
16:22 dogbert17 gfldex: I see, where can I find roast then?
16:23 BrokenRobot Hm, OK. Seems .+ is greedy enough to take the closing ']'. If I make it .+? or <-[\]]>+ then it works. I kinda assumed '[' ~ ']' part will magically takle care of everything like this
16:23 gfldex dogbert17: https://github.com/perl6/roast/
16:23 dogbert17 gfldex: thx
16:24 rindolf dogbert17: https://status.github.com/
16:25 dogbert17 rindolf: thx, wonder what's up
16:25 hoelzro parabolize: thanks, I'll try that out!
16:25 ptolemarch joined #perl6
16:27 lucasb_ dogbert17: You were expecting .has-phasers to return a bool, right? I agree too, but I have never used this method before so I don't know if that's relevant.
16:27 parabolize hoelzro, also the ww adverb: qww, qqww and Q:ww
16:27 lucasb_ its definition is: has-phasers() { nqp::attrinited(self,Block,'$!phasers') }
16:28 lucasb_ so maybe, if someone wraps that in nqp::p6bool(...), it would be ok
16:28 gfldex it would also impact performance quite a bit
16:29 gfldex rakudo is not very good at shielding it's implementation details
16:29 lucasb_ gfldex: what? the p6bool op?
16:29 gfldex but then, subclassing Block would be tricky
16:30 gfldex expect has-phasers to be called a lot
16:30 lucasb_ most other user facing methods that returns a boolean query uses p6bool and prefers to return True/False rather than 0/1, right?
16:31 gfldex all user facing methods do that
16:31 pmurias_ joined #perl6
16:32 lucasb_ so I think that's what I would also expect from .has-phasers. But, as I said, I never used this method before, so idk what i'm taling about :)
16:32 lucasb_ *talking
16:33 gfldex i don't expect anything of has-phasers because I expect blocks to be inlined.
16:34 domidumont joined #perl6
16:49 sammers joined #perl6
16:54 lostinfog joined #perl6
16:59 mohae_ joined #perl6
17:12 dj_goku joined #perl6
17:15 firstdayonthejob joined #perl6
17:16 dalek ecosystem: 0bd7b7d | (Zoffix Znet)++ | META.list:
17:16 dalek ecosystem: Add RT::REST::Client to ecosystem
17:16 dalek ecosystem:
17:16 dalek ecosystem: Use Request Tracker's (RT) REST client interface
17:16 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/0bd7b7d9f3
17:16 BrokenRobot https://github.com/zoffixznet/perl6-RT-REST-Client
17:17 domidumont joined #perl6
17:21 [Coke] BrokenRobot: nifty!
17:21 [Coke] I look forward to cutting over to using the p6 client on my dumb script.
17:30 stevieb joined #perl6
17:37 BrokenRobot I think yours uses summaries to get tags from. Mine (currently) doesn't. Just the [TAGS] in subjectlines.
17:41 espadrine joined #perl6
17:41 wisti joined #perl6
17:49 iH2O left #perl6
17:51 wisti joined #perl6
17:56 trnh joined #perl6
17:56 trnh joined #perl6
18:03 Xliff_ joined #perl6
18:17 labster joined #perl6
18:20 wisti joined #perl6
18:26 girafe joined #perl6
18:26 setty1 joined #perl6
18:26 cdg joined #perl6
18:28 AndyBotwin joined #perl6
18:28 AndyBotwin joined #perl6
18:28 dj_goku joined #perl6
18:31 adu joined #perl6
18:38 addison joined #perl6
18:39 [Coke] http://shapecatcher.com/ - oooh!
18:39 [Coke] (lets you draw a unicode char and it tries to find it based on your drawing)
18:40 hoelzro oooooo neat!
18:40 BrokenRobot Doesn't seem to be working. I draw and draw, but all it gives me is a PILE OF POO!
18:40 hoelzro no CJK, though?
18:41 [Coke] nope. he notes why in the comments.
18:42 [Coke] wonder if it's OS.
18:42 skids Oh yeah that site has been my goto resurce for a while, it's neat.
18:43 rindolf [Coke]: sounds cool.
18:43 hoelzro yeah, I saw, but of course that's the first thing I tried =/
18:44 BrokenRobot .u 𓂸
18:44 yoleaux U+130B8 EGYPTIAN HIEROGLYPH D052 [Lo] (𓂸)
18:44 girafe joined #perl6
18:45 girafe joined #perl6
18:45 skids .u ⍨
18:45 yoleaux U+2368 APL FUNCTIONAL SYMBOL TILDE DIAERESIS [So] (⍨)
18:46 [Coke] m: "💫".uniname.say
18:46 camelia rakudo-moar 0941d0: OUTPUT«DIZZY SYMBOL␤»
18:47 skids .uꕁ
18:47 skids .u ꕁ
18:47 yoleaux U+A541 VAI SYLLABLE NJI [Lo] (ꕁ)
18:48 skids or, "YUP YUP YUP ALIEN FROM SESAME STREET"
18:49 inokenty joined #perl6
18:49 zakharyas joined #perl6
18:50 skids .u 😶
18:50 yoleaux U+1F636 FACE WITHOUT MOUTH [So] (😶)
18:51 skids Or ... COMPASEABLE MR POTATO HEAD
18:54 skids Huh.  That site is using CUDA/graphics card.  Who woulda thought.
18:55 moritz u+B0ATFACE BOATY MC BOATFACE
19:04 spider-mario joined #perl6
19:08 tbrowder left #perl6
19:09 TEttinger joined #perl6
19:24 tbrowder_ joined #perl6
19:28 BrokenRobot What a thing to see on a bug report: https://bugzilla.mozilla.org​/show_bug.cgi?id=373621#c69
19:28 BrokenRobot Kinda weird to read previous comments from a person that's now dead :|
19:29 domidumont joined #perl6
19:37 gfldex there are about 100 billion dead humans on this planet (starting to count about 170ky ago). Most of them never wrote anything. In a few decades most words on record will be written by a now dead person.
19:40 chris2 joined #perl6
19:42 * [Coke] wonders why 1..10000 is getting expanded in makefile action
19:51 [Coke] ah, it's not, I'm a dummy, and also make--
19:53 fsavigny joined #perl6
20:05 girafe joined #perl6
20:06 girafe joined #perl6
20:08 girafe joined #perl6
20:09 girafe joined #perl6
20:10 yqt joined #perl6
20:10 newbie1 joined #perl6
20:12 woolfy joined #perl6
20:15 tbrowder joined #perl6
20:17 rindolf joined #perl6
20:19 fsavigny joined #perl6
20:20 dj_goku joined #perl6
20:20 dj_goku joined #perl6
20:20 fsavigny I am new to this medium and wondering if it is really suited to these types of inquiries, but here goes:
20:21 lizmat welcome fsavigny!
20:22 lizmat what is your question?
20:22 moritz (irc is not suited for inquiries of empty length :-)
20:23 * dj_goku waits
20:23 * dj_goku holds breath
20:23 * lizmat tries to find the mind-reading activator switch
20:24 spebern_ joined #perl6
20:24 * moritz tries to read lizmat's mind to get to the switch first
20:25 moritz in the mean time, I'm reading http://www.meltingasphalt.com/​a-nihilists-guide-to-meaning/ and thoroughly enjoying it
20:25 spebern_ https://pbs.twimg.com/media​/CnMN6Q9WgAAxYSI.jpg:large
20:26 canopus joined #perl6
20:26 lizmat spebern_: yummy!  :-)
20:27 fsavigny (Also, I am finding it difficult to format a question.)
20:27 lizmat spebern_: do you have any background info on the picture?
20:28 moritz fsavigny: just ask, don't format :-)
20:28 * gfldex .oO( format /q Question: )
20:28 lizmat fsavigny: it is generally indicated by a question mark at the end   :-)
20:28 spebern joined #perl6
20:29 gfldex you can also use ‽ if you like
20:29 moritz .u ‽
20:30 yoleaux U+203D INTERROBANG [Po] (‽)
20:31 moritz .oO( going out with an interrobang )
20:31 gfldex they used to be on typewriters (lower right corner) http://static1.squarespace.com/static/549ef7e4e4b​03939a85d2c77/t/54a4193fe4b03ccd29fb6734/14200405​15165/old+typewriter+keys+Cover1.jpg?format=2500w
20:32 moritz gfldex: wow, TIL
20:37 mspo you learned‽‽
20:41 fsavigny Erm ... any comment on my eval question?
20:43 AlexDaniel fsavigny: which question?
20:43 mspo fsavigny: I don't see your actual question
20:43 mspo did you ask anything‽
20:48 AndyBotwin joined #perl6
20:48 AlexDaniel fsavigny: it seems like your message was not sent properly. Check it yourself: http://irclog.perlgeek.de/p​erl6/2016-07-12#i_12829554
20:49 fsavigny The question I asked at 22:27, directly before I complained about formatting ...
20:49 fsavigny _AlexDaniel: You're right; it wasn't sent. I'll try again.
20:53 AlexDaniel still nothing
20:53 AlexDaniel fsavigny: what IRC client are you using?
20:54 fsavigny Riece. It
20:54 fsavigny Riece. It is an Emacs package.
20:55 fsavigny Is there an upper limit to the number of characters, perhaps?
20:55 gfldex there is and a proper IRC client will send as much as will fit
20:55 parabolize there is but it usually gets split by the client
20:55 parabolize fsavigny: you could try ERC
20:56 parabolize its in emacs by default
20:56 AlexDaniel yeah. No problems with ERC at all
20:57 fsavigny OK, thanks! I'll switch to ERC and retry. Might take a little while ... Thanks very much!
20:58 fsavigny joined #perl6
20:59 fsavigny OK, using ERC now.
21:00 fsavigny I'll try to ask in short.
21:01 dalek doc: c504fae | MasterDuke17++ | doc/Language/typesystem.pod6:
21:01 dalek doc: Fix spelling mistake
21:01 dalek doc: review: https://github.com/perl6/doc/commit/c504fae982
21:01 geekosaur pastebin sites are also helpful. although a large complex question may be better suited for a mailing list
21:01 fsavigny I once wrote an XML/SGML converter, which executes stored Perl code when a certain event happens.
21:02 fsavigny That converter is written in Perl 5 and uses eval to execute this Perl code.
21:02 fsavigny I am wondering if this is still a feasible method in Perl 6, as eval seems rather deprecated.
21:02 lizmat it's called EVAL nowadays
21:03 lizmat but having said that, perhaps you'd want to store precompiled code and execute that on demand
21:04 lizmat that would be *way* faster, if you can get that to work, though
21:04 lizmat you would be pretty bleeding edge then
21:04 canopus joined #perl6
21:07 fsavigny But how would one do that in Perl 6: Store precompiled code?
21:08 fsavigny My Perl 5 solution simply reads in Perl code as if it were a text file.
21:09 fsavigny And then stores the code strings in a moderately complex hash structure.
21:11 gfldex fsavigny: you write the Perl 6 code into a file that will look like a module. Then precompile and load it. Let me find you a link.
21:11 fsavigny which stores the code according to element name and event (i.e. open, close etc)
21:12 geekosaur seems like a custom CompUnitRepo might be a thing here too?
21:12 adu joined #perl6
21:12 gfldex https://github.com/gfldex/pod-to-big​page/blob/master/pod2onepage.p6#L63
21:12 gfldex you have to decent into nqp-land to precompile and load at runtime
21:13 fsavigny And when the converter knows that eg element "HEADER" has opened, it finds the code for the opening of element HEADER
21:13 fsavigny and executes that using eval.
21:14 fsavigny But to make that clear: Precompiling (or speed, for that matter) is not that crucial to me.
21:15 fsavigny geekosaur, what's CompUnitRepo?
21:15 gfldex m: use MONKEY-SEE-NO-EVAL; my &f = EVAL('sub f(){ say "oi‽" }'); f();
21:15 camelia rakudo-moar 371b93: OUTPUT«oi‽␤»
21:16 fsavigny glfdex, that looks quite exactly like the solution I used in Perl 5 ...
21:16 geekosaur it's the perl 6 class that manages compiled code. I see gfldex suggested some nqp code needed, but this strikes me as something that could be wrapped into a CUR subclass and made available at perl6 level...
21:16 adu joined #perl6
21:17 fsavigny ... but isn't that sort of deprecated in Perl 6 (the EVAL thing, I mean)?
21:17 gfldex why would it be deprecated?
21:18 fsavigny Because of the MONKEY-SEE-NO-EVAL ...
21:18 fsavigny You know that the monkey covers its eyes. Does not want to be responsible, probably ...
21:18 lizmat Perl 6 just wants to make sure you know what you're doing
21:18 geekosaur not so much deprecated as marked as dangerous
21:19 geekosaur so you need to include a "I know what I'm doing"
21:19 lizmat I mean, compiling source code from untrusted sources is asking for problems, generally
21:19 gfldex also, you may anger the optimiser
21:20 lizmat fsavigny: have you considered putting code blocks in a hash?
21:20 gfldex didn't there be a trait called 'is deprecated'?
21:20 lizmat m: my %h = HEADER => { say "header" }; %h<a>()
21:20 camelia rakudo-moar 371b93: OUTPUT«Cannot find method 'Any' on object of type List␤  in block <unit> at <tmp> line 1␤␤»
21:21 lizmat m: my %h = HEADER => { say "header" }; %h<HEADER>()
21:21 camelia rakudo-moar 371b93: OUTPUT«header␤»
21:21 fsavigny Putting them in a hash is actually what the (p5-based) converter does internally.
21:22 fsavigny That would mean I would have to directly write the instructions into a hash.
21:22 gfldex there is very little that you coudn't do with a closure
21:22 fsavigny But apart from that, would that change anything about having to eval the code?
21:23 fsavigny Also, my reading-in solution had the nice sidekick that you could automatically add code before and after it
21:23 gfldex i can't see what you actually need EVAL for
21:24 gfldex there where cases where eval saved you plenty of typing in perl 5. That should not be a problem in Perl 6 tho.
21:24 fsavigny Hmm, gfldex, so do you mean using anonymous subs as the values of the hash, maybe?
21:25 gfldex yes, and with some functional programming sprinkled on top
21:27 lizmat m: sub a() { say "a" }; &a.wrap( { say "before"; callsame; say "after" } ); a   # fsavigny
21:27 camelia rakudo-moar 371b93: OUTPUT«before␤a␤after␤»
21:27 gfldex m: sub factory(&before, &after){ return sub { before(); say 'oi‽'; after(); } }; my %h = one => factory({say('hello')}, {say('baby')}); %h<one>();
21:27 camelia rakudo-moar 371b93: OUTPUT«hello␤oi‽␤baby␤»
21:28 literal so, there's IO::Path.extension ... is there no corresponding method to get the part of the filename without the extension?
21:30 fsavigny callsame looks interesting, thank you! I think I will evaluate that before continuing to ask ...
21:32 literal or at least something nicer than $foo.match(/^(<-[.]>+)/)[0]
21:33 perlpilot literal: isn't that .path ?
21:34 perlpilot or, I guess perhaps .path ~ .basename
21:34 fsavigny Thanks to everybody for your patience, and have a nice evening!
21:35 gfldex .basename.split('.').reverse[1];
21:35 literal perlpilot: no, basename includes the extension
21:35 lizmat I think I had something for that in the newio branch  :-(
21:35 gfldex you need the reverse[1] for '.foo'
21:36 gfldex actually that will fail for 'file.foo.bar'
21:37 literal yes
21:37 literal like bla.tar.gz
21:37 gfldex m: 'file.foo.bar'.split('.').reverse.rest.reverse.say
21:37 camelia rakudo-moar 371b93: OUTPUT«Method 'rest' not found for invocant of class 'List'␤  in block <unit> at <tmp> line 1␤␤»
21:37 lizmat perhaps .basename.substr(0,*-(.extension.chars + 1))
21:38 perlpilot yuck
21:38 lizmat .oO( yuck )
21:38 perlpilot heh
21:39 literal m: say 'file.foo.bar'.comb(/<-[.]>+/, 1)
21:39 camelia rakudo-moar 371b93: OUTPUT«(file)␤»
21:41 perlpilot lizmat: maybe add .fileparse like p5's File::Basename ?
21:41 lizmat perlpilot: perhaps, but I'm pretty burnt out on IO stuff
21:42 literal it's worth noting that IO::Path.extension actually doesn't return the full extension currently (i.e. only ".gz" in "foo.tar.gz")
21:43 gfldex the docs got filenames where the . is actually part of the filename
21:43 Ulti perf looking good https://gist.github.com/Mat​tOates/c2e19950f46d1a1c241a
21:43 gfldex so it's not that easy to decide
21:44 lizmat Ulti: so roughly 3x as fast, if I read that correctly ?
21:44 lizmat since Sept 2015 ?
21:45 perlpilot gfldex: that's why I was thinking about fileparse actually.   You can specify the suffixes you care about.
21:46 Ulti lizmat well not from Tim King's original! he had 2s for something that is now 0.05s so thats 40x faster
21:46 Ulti granted my CPU is more modern than his
21:47 Ulti 2013-09 to now 40x faster on something numeric with lots of array pushing
21:48 Ulti I didnt write this up last time because I contacted Tim to maybe update his own blog but I heard nothing back
21:49 Ulti given if you search Perl 6 and speed his is the first blog you come across its worth putting something in the world that this isn't still true
21:49 gfldex m: say so 'file.tar.gz'.ends-with(any(<.tar.gz .tar.xz>));
21:49 camelia rakudo-moar 371b93: OUTPUT«True␤»
21:49 lizmat Ulti++  # putting something in the world that *is* true ?
21:50 Ulti yeah I will write something up between my bioinformatics tests, the CSV tests and the primes benchmarks there is a nice story
21:50 Ulti one of all the hardwork you have all put in :3
21:53 lizmat Cool!
21:53 gfldex m: my $endings = any <.tar.gz .tar.xz>; say 'file.tar.gz'.trim-trailing($endings) if 'file.tar.gz'.ends-with(any(<.tar.gz .tar.xz>));
21:53 camelia rakudo-moar 371b93: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤  in block <unit> at <tmp> line 1␤␤»
21:53 gfldex that would be nice to have
21:54 gfldex we got a very easy way to test for endings and a very easy way to trim whitespace off the end. But we don't got an easy way to trim off a string from a bigger string.
21:57 gfldex m: 'file.tar.gz'.split('.tar.gz').say
21:57 camelia rakudo-moar 371b93: OUTPUT«(file )␤»
21:57 gfldex m: 'file.tar.gz'.split('.tar.gz')[0].say
21:57 camelia rakudo-moar 371b93: OUTPUT«file␤»
21:57 gfldex m: my $endings = any <.tar.gz .tar.xz>; say 'file.tar.gz'.split($endings) if 'file.tar.gz'.ends-with(any(<.tar.gz .tar.xz>));
21:57 camelia rakudo-moar 371b93: OUTPUT«any((file ), (file.tar.gz))␤»
21:57 gfldex the Junction is not to helpful in that case
21:59 gfldex what may be the fault of split. I am basicly asking .split to split by any of the provided junction values.
22:00 gfldex I'm assuming that I understood junctions, what I don't.
22:00 dj_goku joined #perl6
22:02 gfldex m: dd 'file.tar.gz'.split(any '.tar.gz');
22:02 camelia rakudo-moar 371b93: OUTPUT«any(("file", ""))␤»
22:02 gfldex where does that "" come from?
22:19 addison joined #perl6
22:20 Sgeo joined #perl6
22:22 dj_goku joined #perl6
22:22 dj_goku joined #perl6
22:29 khw joined #perl6
22:38 skids joined #perl6
22:50 dwarring joined #perl6
22:56 rindolf joined #perl6
23:01 jack_rabbit joined #perl6
23:07 k-man joined #perl6
23:12 dvinciguerra joined #perl6
23:14 tbrowder left #perl6
23:29 AlexDaniel timeless: hi!
23:30 AlexDaniel timeless: how are you? Any progress on url escaping thingy?
23:31 jdv79 lizmat++ # weekly
23:32 tony-o gfldex: that looks like it might be a bug, it comes from the empty string left at the end of the string once '.tar.gz' is removed
23:32 jdv79 konobi: are you in belfast?
23:34 AlexDaniel m: ‘meh’.split(‘eh’).perl.say
23:34 camelia rakudo-moar 303e77: OUTPUT«("m", "")␤»
23:36 AlexDaniel https://github.com/perl6/roast/blob​/c3f40c4b360c0b18364af49fa8f30a2aec​d1d267/S32-str/split-simple.t#L39
23:36 AlexDaniel looks like it is so by design
23:40 Zoffix joined #perl6
23:40 Zoffix m: say('meow';); say 42;
23:40 camelia rakudo-moar 303e77: OUTPUT«(meow)()␤42␤»
23:40 Zoffix What sort of construct is this? With the ; inside?
23:41 Zoffix m: use Test; todo('meow';); ok 0, 'not really TODOed'
23:41 camelia rakudo-moar 303e77: OUTPUT«not ok 1 - not really TODOed␤␤# Failed test 'not really TODOed'␤# at <tmp> line 1␤»
23:41 Zoffix ^ causes issues here
23:41 konobi jdv79: nope
23:41 konobi jdv79: o.O why do you ask?
23:44 AlexDaniel m: (‘meow’; ‘foo’; ‘test’).perl.say
23:44 camelia rakudo-moar 303e77: OUTPUT«("meow", "foo", "test")␤»
23:44 jdv79 i thought somebody was in here and thougjt it was you.
23:44 jdv79 cause its the crazy day there.
23:45 jdv79 or it was.
23:45 AlexDaniel m: (‘meow’, 42; ‘foo’; ‘test’, 69).perl.say
23:45 camelia rakudo-moar 303e77: OUTPUT«(("meow", 42), "foo", ("test", 69))␤»
23:45 konobi jdv79: well, I'm from belfast... so could be
23:45 AlexDaniel Zoffix: it feels like something for multidimensional arrays
23:45 jdv79 ah
23:46 jdv79 was just curious how this 12th turned out
23:46 AlexDaniel m: say(42,‘meow’;‘ha’;‘test’)
23:46 camelia rakudo-moar 303e77: OUTPUT«(42 meow)(ha)(test)␤»
23:46 konobi heh, I haven't lived in NI in 14 years and the last 10 have been in west coast canada =0)
23:46 jdv79 i only visited last year.  am from ny.  but i understand july 12 is a thing there.
23:47 jdv79 nice
23:47 konobi yeah, can get nasty
23:47 konobi funnily enough I was just in NY last week. Karen was too
23:48 jdv79 haha.  there was no ny pm meeting.
23:48 jdv79 karen and yaakov visited us 2? years ago.
23:49 jdv79 still cant tell you why.  very abstract and vague.
23:52 Zoffix left #perl6
23:56 BenGoldberg_ joined #perl6

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

Perl 6 | Reference Documentation | Rakudo