»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:01 canopus joined 00:02 espadrine left 00:17 empT left 00:21 girafe left 00:25 canopus left 00:27 kyclark joined 00:30 canopus joined 00:42 Ben_Goldberg joined 00:52 slobo joined 00:55 addison left 00:57 kyclark left 01:02 kalkin-_ joined, kalkin- left 01:08 kyclark joined 01:11 canopus left 01:13 Senji left 01:18 canopus joined, kyclark left 01:22 fhorck left, sammers joined 01:27 AlexDaniel left 01:29 cdg left 01:30 Actualeyes joined, cdg joined 01:34 cdg left
sammers hi from Japan 01:37
01:47 canopus left, mohae joined 01:52 canopus joined 01:55 MadcapJake left 01:59 kalkin- joined 02:02 kalkin-_ left
BrokenRobot m: sub こんにちは{ "こんにちは".say }; こんにちは 02:07
camelia rakudo-moar d075c8: OUTPUT«こんにちは␤»
02:17 canopus left 02:23 canopus joined 02:26 kid511 left
sammers ha 02:39
hello
02:40 BenGoldberg_ joined 02:41 Ben_Goldberg left
sammers ok, is there a secret to getting a module's /bin/* files available as callable scripts? 02:44
02:49 noganex_ joined 02:52 noganex left 03:06 canopus left 03:08 TimToady left 03:10 TimToady joined 03:11 mohae_ joined 03:12 canopus joined, cog__ joined 03:14 mohae left 03:15 zacts joined, cognominal left
sortiz sammers, usually module's ./bin/* files are installed at $*REPO.next-repo.writeable-path.child('bin') 03:20
03:25 canopus left
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:29
03:30 gcole joined, canopus joined 03:31 cooper left, cooper joined, cooper left, cooper joined 03:32 gcole_ left
ugexe technically only bin wrappers are installed in /bin 03:42
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:45
03:46 kyclark joined
ugexe or my $dist = CompUnit::Repository.repository-for-name('site').resolve(CompUnit::DependencySpecification.new(:short-name("name of dist")).distribution; my $bin = $dist.prefix.child("sources/" ~ $dist.meta<files><bin/xxx>) 03:51
The second one requires a blead version of rakudo though 03:54
03:58 khw left 03:59 canopus left 04:01 obfusk joined
ugexe or if i misunderstand the question: you need to do `rakudobrew rehash` after installing the module with bin/* files 04:03
04:05 canopus joined 04:14 kyclark left 04:18 slobo left 04:20 canopus left
sammers sortiz, ugexe, thanks. `rakudobrew rehash` solved the issue 04:21
04:24 skids left, canopus joined
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:25
I should add, whenever I run a command that is located in ~/.rakudobrew/bin/ 04:26
ugexe no, because otherwise you wouldnt be able to differentiate between 2 scripts of the same name that are both in your PATH 04:31
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:32
sammers it prints out something like this when I run the command "Usage: /home/user/.rakudobrew/moar-2016.06/install/share/perl6/site/resources/55EC986C6963846DFA7B2117603305011CD0103F update <filename>" 04:33
ugexe right
sammers so for now I am just overriding the USAGE message
ugexe that doesnt help for `script --non-existant-option` 04:34
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/install/share/perl6/site/resources/55EC986C6963846DFA7B2117603305011CD0103F", I would expect to see "nameofcommand" instead. 04:35
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
but nameofcommand might not run that script
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
ugexe so the full path needs to be shown
i know what it does
sammers right, but if I run nameofcommand then I want to see nameofcommand in the Usage message output for that command
the long shim doesn't mean anything to me
ugexe that doesnt mean such situations dont exist 04:38
sammers right
they do
but I mean, the normal expectation would be to see nameofcommand
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
sammers yeah
ugexe no it discourages you from using rakudobrew
sammers yeah, good point..
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
sammers panda install .
ah
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 Cabanossi left
ugexe github.com/rakudo/rakudo/blob/3ebf...ain.pm#L73 04:41
you can see how it actually works 04:42
sammers ok, thanks 04:43
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:44
04:45 BenGoldberg_ left
ugexe because apt-get would invoke the OS package manager, not your bin script 04:45
04:45 Cabanossi joined 04:47 xiaomiao left 04:48 xiaomiao joined
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:55
ugexe ~/.rakudobrew/bin/ isnt your script, its just a bash or perl script that launches your actual script 04:56
04:57 ufobat joined
ugexe your actual script has no way of knowing this 04:57
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
maybe you write your own shim that launches it with `foobar`, would you expect USAGE to know or display this?
sammers ok, so for example, I am using rakudobrew to manage moar and panda because it is easy. 04:59
and I isntall a local module using panda install .
and it makes the nameofscript availabe for use
so is there an alternative setup that could get me the same functionality without using these shim names in usage?
ugexe those arent shim names 05:00
sammers or just override usage?
ugexe those are the actual names of the scripts
sammers ok
yeah, so any better alternative?
ugexe they only show scriptname if NOWHERE earlier in PATH contains a scriptname
sammers just install everything seperately without using rakudobrew?
ugexe which is impossible if you want shims with the same name
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
sammers ok, that is fine.
for the time being I will just override USAGE.
keeps things simple
ugexe that won't fix 'scriptname --asfasfasf' though 05:04
where --asfasfasf is invalid option
05:05 canopus left
sammers ok 05:06
05:07 mohae joined
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:08
05:10 mohae_ left
sortiz dj_goku, Sure! All contributions to P6's ecosystem are appreciated 05:14
05:15 canopus joined 05:16 rurban joined 05:17 zacts left 05:21 sortiz left 05:29 CIAvash joined
sammers ugexe, can you take a look at this for me? gitlab.com/snippets/22354 05:30
I am trying to find where the invalid option overrides the custom USAGE message 05:31
05:57 b2gills left 06:00 b2gills joined 06:03 canopus left 06:11 canopus joined 06:14 b2gills left 06:16 rgrinberg left 06:21 firstdayonthejob joined 06:25 canopus left 06:28 b2gills joined 06:34 canopus joined 06:38 ufobat left 06:40 domidumont joined 06:43 firstdayonthejob left 06:47 domidumont left 06:51 canopus left 06:53 rurban left 06:59 domidumont joined 07:00 huggable joined, domidumont left 07:01 canopus joined, domidumont joined 07:12 darutoko joined 07:22 dakkar joined 07:26 zakharyas joined 07:40 bjz joined 07:43 telex left, wamba joined 07:44 telex joined 07:45 abraxxa joined 07:54 bjz left 07:59 vendethiel- joined 08:00 vendethiel left
lizmat clickbaits p6weekly.wordpress.com/2016/07/11/...ur-papers/ 08:07
DrForr Speaking of clickbaiting, O'Reilly will be holding an online perl 6 training seminar in the fall. 08:23
08:24 rindolf joined
moritz speaking of clickbaiting, I'm writing a book: leanpub.com/deploy (though not on Perl 6) 08:24
08:35 rurban1 joined 08:39 TEttinger left 08:43 rindolf left, RabidGravy joined, pmqs joined 08:45 zakharyas1 joined 08:46 rurban joined, Xliff joined 08:50 rurban1 left 08:53 zakharyas1 left, rindolf joined
DrForr Are there plans for 'anon', 'augment' and 'supersede' scopes to be implemented? 08:55
08:55 pdcawley_ left 08:57 rindolf left
psch "scopes"? 08:57
m: anon module { } # this works, but...
camelia ( no output )
08:58 bjz joined
DrForr Sorry, variable scoping. 08:58
m: my $x; anon $x = 32;
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␤ …»
psch oh
i honestly don't know what that would mean
same for 'augment' and 'supersede', actually
DrForr They're mentioned in the variable docs. 08:59
(don't have the link handy, one moment.)
(and BTW (the new sidebar)++ 09:00
psch ah, design.perl6.org/S02.html#Scope_declarators 09:02
assuming that bit is still up to date
DrForr docs.perl6.org/language/variables#..._and_Scope # The examples admittedly don't mention variables for 'anon' and 'augment'.
09:02 pdcawley joined
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.
psch yes, but it does state NYI
09:04 rurban left
DrForr Yes, it does. I was merely asking if it was planned, it's right now just a TODO in my test sutie. 09:04
09:06 roguelazer left, roguelazer joined
DrForr *suite 09:07
psch i'd guess it depends on some design-y decision
as mentioned, i find it hard to imagine what declaring an anonymous variable actually means
09:08 canopus left
DrForr I haven't looked deeply enough into what the anonymity means, I'd probably agree at that point. 09:10
09:10 rindolf joined
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:11
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:13
09:14 canopus joined 09:25 canopus left 09:30 canopus joined 09:34 kurahaupo joined 09:37 kaare_ joined
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:46
09:48 bjz_ joined 09:49 bjz left
Xliff Wheee! Starting another round of p6-XML-LibXML porting, this week. 09:56
DrForr++ # For remembering 09:57
(Coding Flashbacks)-- # We've all been there
09:58 mr-foobar joined 10:01 canopus left 10:07 canopus joined 10:13 labster left 10:15 canopus left 10:17 kurahaupo left
DrForr w00t, I just coredumped perl6 moarvm for the first time in a *long* while. Too bad it's not reproducible. 10:18
10:21 canopus joined 10:28 canopus left 10:34 canopus joined 10:42 rindolf left 10:43 canopus left
Ulti neat another .2 seconds off of my tests since jnthn's change to dispatch cache for named parameters 10:46
at 1.3s down from 35s two years ago 10:47
10:50 canopus joined
lizmat m: say 1.3/35 10:58
camelia rakudo-moar 4e5c3e: OUTPUT«0.037143␤»
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␤»
lizmat m: say 1.3 R/ 35
camelia rakudo-moar 4e5c3e: OUTPUT«26.923077␤»
11:00 huggable left 11:02 kid51 joined 11:06 canopus left, Khisanth left
Xliff I'm still getting LONG parse times whenever I make a change in a XML::LibXML module --> Stage parse : 93.639 11:10
That's excessive. That's longer than it takes to parse the Perl6 grammar!
11:15 canopus joined 11:17 dakkar left, dakkar joined 11:19 Khisanth joined
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:21
Xliff: ^^^ I assume that's not the case with your code ? 11:22
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
github.com/Xliff/p6-XML-LibXML/blo...om.pm#L293
11:26 rindolf joined
lizmat well, that could be it... 11:26
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 ?
moritz uhm, I thought this was about literals in the source code
11:27 user9 left
moritz not about regexes matching high codepoints 11:27
lizmat Xliff: if you simplift that token to only the first line, does that change the parse time ? 11:28
moritz: perhaps building ranges is what takes so long ?
Xliff: any idea on memory usage ?
Xliff lizmat: No idea on memory usage. How can I check? 11:29
And I will try your suggestion... one sec.
11:30 canopus left
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␤»
Xliff Updated to latest rakudo while I was working on this. 11:31
And parse times are comparable to before update.
And it looks like simplifying the token did not have an effect.
Stage parse : 91.104 # !!! 11:32
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:33
11:35 canopus joined
lizmat Xliff: ok, so much for that idea then :-( 11:36
Xliff Thanks for the thought though, lizmat++ 11:38
I've been struggling with compile times for weeks and I am no closer to a solution than when I started.
I am almost wondering if there is something circular in my "use" order that's causing the problem. 11:39
nine Xliff: if there were a circle, you'd either get an error message or it would take forever. 11:40
Xliff And I'm assuming you mean really forever and not just 91 seconds? =) 11:41
nine yes
Xliff Heh.
lizmat Xliff: does RAKUDO_MODULE_DEBUG=1 give any extra timing info ?
nine Well, not really. It would give you another error due to too many processes or full memory
Xliff For those wanting hands on experience, you can check out branch 07dtd from here: github.com/Xliff/p6-XML-LibXML/tree/07dtd 11:42
lizmat, one sec.
lizmat: Gives plenty of info, but it's all greek to me. 11:44
lizmat could you gist it ?
Xliff lizmat: I will try and capture it next time I make a change to a module.
Is that output through STDERR?
lizmat think so 11:45
Xliff Redirecting now. Will gist as soon as it is done.
Output still generating. 11:48
Something tells me this will be an Energizer Bunny situation: "Stilll....gooing!" 11:49
Anyone wanna create a betting pool for when it's done?
Last line: 17 9483 RMD: Precompiling /home/cbwood/projects/p6-XML-LibXML/lib/XML/LibXML.pm into /home/cbwood/projects/p6-XML-LibXML/lib/.precomp/C521DC82132094A6D8FF6BBD8C5575985CF18AD1.1468322313.12496/1E/1E01892A64A383CF8DB46666BAAF21717C35B489.bc 11:51
Last timestamped 07:45 my time. It's now 07:52. 11:52
DrForr I.I code deadpool.
lizmat something weird going on here... add RAKUDO_MODULE_DEBUG shouldn't make that much difference in performance, should it? nine? 11:54
11:56 canopus left
Xliff Used the following invocation: RAKUDO_MODULE_DEBUG=1 perl6 --stagestats -Ilib t/07dtd.t > debugout 2>&1 11:59
And nothing has changed.
"Stilll....going!"
Now 07:59
lizmat Xliff: is the process using a lot of memory 12:01
?
Xliff 9485 cbwood 20 0 156400 150868 22808 R 100.0 1.8 16:09.09 moar
That's 100% CPU and 1.8% mem 12:02
ilmari 150MB resident
lizmat well, that feels like a loop alright :-( 12:03
Xliff 3 moar procs. Here's the complete list: 12:04
cbwood 9483 0.4 1.9 165764 160548 pts/0 S+ 07:45 0:05 /home/cbwood/.rakudobre
cbwood 9484 0.0 0.9 85460 79840 pts/0 S+ 07:45 0:00 /home/cbwood/.rakudobre
cbwood 9485 100 1.8 156400 150868 pts/0 R+ 07:45 17:47 /home/cbwood/.rakudobre
And yes, the 100% on the last one definitely feels like a loop.
Although I don't know why the redirection has exposed it.
If I run this without, I bet it completes.
lizmat please try :-) 12:05
Xliff I don't think we're going to get anything more out if this.
12:05 canopus joined
Xliff Restarting without the redirect. 12:06
Almost immediately, we get head scratchers:
cbwood 9531 12.1 1.9 165624 160440 pts/0 S+ 08:05 0:05 /home/cbwood/.rakudobre
cbwood 9532 1.6 0.9 85460 79868 pts/0 S+ 08:05 0:00 /home/cbwood/.rakudobre
cbwood 9533 102 1.8 156400 150880 pts/0 R+ 08:05 0:36 /home/cbwood/.rakudobre
102% CPU? # 0_o
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
Xliff ilmari: Ah. 12:07
lizmat Xliff: please try to gist whatever RAKUDO_MODULE_DEBUG output you *di* get 12:08
*did*
Xliff lizmat: Sure. 12:10
gist.github.com/Xliff/8325b4507325...a7e9263fd9 12:11
OK. 5 minutes are up. Trying again without RAKUDO_MODULE_DEBUG 12:12
That's going to make it a pain to track, though.
lizmat Xliff: is there a reason it's loading Test ? 12:13
Xliff Yes. t/07dtd.t <-- test script
Stage parse : 40.032 # Completes without RAKUDO_MODULE_DEBUG
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:14
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
Xliff lizmat: Based on my experience, it happens in both situations. 12:16
BRB: Breakfast.
lizmat I hope nine will be able to tell something from the gist
wonder why several modules occur more than once in this gist 12:17
12:17 Sgeo left
lizmat e.g. NativeCall::Types 12:17
moritz used from several files, maybe? 12:18
[Coke] has a business trip upcoming to Leeds, UK. 12:21
12:31 sno left 12:35 sno joined
nine It hangs trying to write this to STDERR: 1370 24417 RMD: Precompiled /home/nine/install/p6-XML-LibXML/lib/XML/LibXML/XPath.pm into /home/nine/install/p6-XML-LibXML/lib/.precomp/EDCEB6E1F3092E4F9B2909308664934E832B1A33.1467580863.58493/76/768114C2C22CE3EB994A37FC9E0CA9B37CC0977A.bc\n 12:36
12:36 canopus left
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 12:38 rurban joined
nine Even worse, it hangs in __write_nocancel 12:38
12:41 rindolf left 12:44 mcmillhj joined, rurban left
[Coke] RabidGravy: my company will appreciate that, anyway. :) 12:45
Xliff nine: Oh my, how ironic!
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 12:50 rurban joined, rurban1 joined
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:50
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;␤»
gfldex is that intentional?
moritz std: my $A::a = 42; constant B::b = 666;
camelia std : OUTPUT«No such file or directory»
moritz huh, std build broken 12:52
gfldex: no idea
camelia std : OUTPUT«(timeout)cat: /home/camelia/std/snap/revision: No such file or directory␤»
gfldex looks wrong to me to have a special case for the constant declarator
Xliff So can someone tell me what causes this error in a nativecast(): "Internal error: unhandled target type
"
And how can I fix it?
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
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 rurban left
Xliff That should trigger a recompile of just about everything. 12:54
And that's where you'll see >70 second precompiles.
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:56
Xliff: though it seems like it's actually precompiling only Node.pm, Element.pm, Document.pm and LibXML.pm 12:58
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 12:59
moritz wouldn't serve very well either while sitting on a couch 13:01
13:03 grondilu joined
Xliff nine: So why am I seeing precompile times > 80 seconds? 13:04
Oh! My timings come from a 32-bit VM with 4 procs
Which might do it.
nine Xliff: it's still mighty slow even on a faster machine 13:06
13:06 mr-foobar left 13:10 rurban1 left
Xliff nine: Any suggestions on how I can make it faster? 13:10
Or... at least not slow?
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:11
nine Xliff: I just pushed a fix to rakudo/nom giving me: 13:14
Initial compile: 49s -> 34s
Changing a base module: 39s -> 19s
Loading unmodified: 3s -> 1.9s
13:15 skids joined
nine I noticed that we did check dependencies like LibXML::CStructs a lot more than we actually needed to. 13:17
13:19 cdg joined
Xliff Ooh! 13:24
Will rakudobrew as soon as I get a chance. Thanks, nine++!
13:26 rgrinberg joined
gfldex moritz: i didn't find any spectest with `constant A::a` so I rekudobugged as RT#128610 13:30
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128610
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
nine :)
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
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 MafProd left, tadzik joined
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.
moritz Xliff: for example how you call it?
13:39 TeamBlast left
Xliff moritz: github.com/Xliff/p6-XML-LibXML/blo...nt.pm#L412 <- Call made here. 13:39
Class is loaded on Line #11
moritz Xliff: what's in $.extSubset when you get that error? 13:40
Xliff Will check.
13:41 TeamBlast joined
Xliff Odd. I thought the issue was the nativecast, not the value being cast. 13:42
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:45
Xliff Yes, but the user classes are repr('CStructs') 13:46
s/CStructs/CStruct/
So that should still work.
$.extSubset.^name == "xmlDtd" 13:47
I can't print or dd those values because the structs contain circular refs.
But the point there is to cast the bare struct into it's decendent class.
so xmlDtd goes to XML::LibXML::Dtd 13:48
xmlDtd is low level internal, whereas XML::LibXML::Dtd is what we pass to consuming code.
Prevents circular refs. 13:49
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:52
CUTE is repr('CStruct') but you cannot nativecast to its subclass 13:53
This however works: class Cuter is CUTE is repr('CStruct') { }; is nativecast(Cuter, ReturnStruct()).i, 100, 'casting to CStruct works';
moritz so maybe the error message should be "Cannot cast to $typename, because its representation does not allow nativecasting"? 13:54
13:54 TeamBlast left 13:55 M-matthew joined 13:56 M-Illandan joined
Xliff nine++ 13:57
That did the trick! 13:59
One less mystery to deal with, now.
moritz: That would be a better error. Yes. 14:00
14:05 kyclark joined
japanoise does perl6 have an equivalent to cdr in lisp? 14:06
DrForr @foo.rest # ? 14:09
sub car { .first } sub cdr { .rest }
14:09 kyclark left 14:10 TeamBlast joined
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␤␤»
japanoise first does do car 14:11
but i need a cdr
14:15 cooper left, skids left, obfusk left
parabolize @a.splice(1) 14:15
BrokenRobot @a[0] / @a[1..*-1] ?
14:15 cooper_ joined, cooper_ left, cooper_ joined
japanoise splice 1 seems right 14:15
thanks c:
BrokenRobot @a[1..^*] even
perlpilot 1..* would work.
BrokenRobot Oh, neat.
14:15 b^_^d joined, obfusk joined 14:16 skids joined 14:18 pr1_ joined, mcmillhj left
perlpilot waits for someone to use CANDO to automagically make all of the caar, cadr, etc variants 14:19
14:19 mcmillhj joined
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
Stream<String> stream = Stream.of("black bear", "brown bear", "grizzly");
long count = stream.filter(s -> s.startsWith("g")).peek(System.out::println).count();
System.out.println(count);
The Java code peeks for words starting with "g", but doesn't remove them from the stream. 14:21
BrokenRobot a .map on a Supply? 14:23
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␤gleanntáin␤ghlas’␤gnéill␤ghaoil,␤go␤gan␤ghá␤gach␤gach␤gach␤go␤gan␤gan␤ghruaim␤ghleanntáin␤ghlas’␤Céad slán ag sléibhte maorga Chontae Dhún na nGall Agus dh…»
BrokenRobot m: Promise.in(4).then: { exit }; eager Supply.interval(1).map: {say "Got an even [$_]" if $_ %% 2};
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
pr1_ Thks BrokenRobot and gfldex. I'll try out your solutions. 14:26
gfldex and .map is lazy
14:26 pmurias joined
gfldex Perl 6 doesn't really have streams but a generalisation that is lazy lists, that share properties with streams 14:26
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
pmurias DrForr: I guess the reason anon variables are not implemented is that they aren't very useful 14:28
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
Also, I suspect it'll take me some time to get used to '' for strings and "" for comments
pr1_ Hi, how do you collect the characters in the P6 equiv. of a Java stream, into a set? Java 8 code: 14:33
Stream<String> stream = Stream.of("w", "o", "l", "f");
TreeSet<String> set = stream.collect(TreeSet::new, TreeSet::add, TreeSet::all);
14:33 lucasb_ joined
pr1_ System.out.println(set); // [f, l, o, w] 14:33
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?
camelia rakudo-moar 7830ec: OUTPUT«set("l","w","o","f")␤»
pr1_ Looks good. I'll try it. 14:35
gfldex pr1_: the answer to your question could also be "Grammar" depeding on what you want to do in the end. 14:36
14:38 MafProd joined, dj_goku left
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:39
14:41 rindolf joined
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:47
It seem that to get a p6tidy to work we would need that info 14:48
gfldex m: package A { constant a = 42; }; say A::a 14:49
camelia rakudo-moar 7830ec: OUTPUT«42␤»
pmurias one idea I have is to monkey patch Perl6::Grammar but that seem very inelegant
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
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?
m: { my $a::b = 42; say 'hi' }; say $a::b
camelia rakudo-moar 7830ec: OUTPUT«hi␤42␤»
DrForr pmurias: Funny you should mention that :)
gfldex lucasb_: packages are lexical
14:51 woolfy joined
pmurias DrForr: is there some existing prior art I should know about? 14:51
;)
gfldex m: sub f() { package A { my $a = 42 }; say $A::a }; f; 14:52
camelia rakudo-moar 7830ec: OUTPUT«(Any)␤»
gfldex m: sub f() { package A { our $a = 42 }; say $A::a }; f;
camelia rakudo-moar 7830ec: OUTPUT«42␤»
DrForr It parses a non-trivial source file, although I haven't checked at *all* how the resultant source tree looks.
hoelzro o/ #perl6
pmurias hoelzro: \o 14:53
hoelzro I've published some fixes to the pygments lexer here: bitbucket.org/hoelzro/pygments-main
o/ pmurias
pmurias DrForr: got a link?
pr1_ lizmat: the idea is to collect all individual chars. in a stream (i.e., STDIN) into a set.
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.
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 ugexe left
DrForr pmurias: I can put up a small gist if you like, give me a few minutes. 14:53
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, ')␤»
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)…»
pr1_ BrokenRobot: that's what I was looking for.
BrokenRobot (An article on comb: perl6.party/post/Perl6-Comb-It ) 14:56
14:56 zakharyas left
pr1_ What does the "m:" you guys put in from of code excerpts mean exactly? 14:56
BrokenRobot pr1_: eval bot trigger
Stands for "moar" which is the MoarVM
hoelzro always thought it stood for "moar"
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␤␤»
hoelzro ah, beaten to the punch!
14:57 zakharyas joined
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
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␤␤»
pr1_ m: say "just testing m:"
camelia rakudo-moar 7830ec: OUTPUT«just testing m:␤»
BrokenRobot Also works via /msg or /notice to camelia 14:59
DrForr pmurias: gist.github.com/drforr/a1d250c32bc...0cb3876365 15:00
15:00 huggable joined
holyghost Hello, just gotten home, tomorrow some free time hacking 15:00
15:00 jonas2 joined
gfldex m: grammar G { rule TOP { <r> }; rule r { 'abc' } }; dd G::.keys 15:01
camelia rakudo-moar 7830ec: OUTPUT«().Seq␤»
gfldex is there any way to do introspection on a Grammar?
15:02 Coleoid_n joined
pr1_ gfldex: I get a "Could not find symbol '&r'' error when I run your grammar in rakudo 2016.04. 15:04
15:05 sammers left 15:06 heatsink joined
gfldex pr1_: Grammar are vm-magic. So I'm not surprised to see lack of introspection. 15:06
Xliff m: say $*IN.words
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…»
Xliff Default IN? Neat!
15:07 pochi left
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:08
15:11 mohae left, pr1_ left, pochi joined
lucasb_ gfldex: sorry for the delay. I didn't fully understand what you said. 15:12
I was intuitively expecting 'my $a::b::c = ...' to be a syntax error
15:12 TeamBlast left
gfldex how could you, even I don't understand what I say 15:12
lucasb_ :)
15:14 sammers joined
gfldex lucasb_: also, we didn't tell you in docs.perl6.org/language/syntax#Identifiers 15:15
gfldex takes notes
DrForr pmurias: Thoughts? 15:16
15:16 zakharyas left, TeamBlast joined
pmurias DrForr: looking at it 15:18
15:19 heatsink left
DrForr The main point is being very picky about what gets parsed where, so I can catch errors as early as possible. 15:20
15:20 ugexe joined
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:21
pmurias DrForr: Perl6::Tidy itself is not part of the gist? 15:22
ugexe sub foo(% (:$key1, :$key2)) { } is already easy enough no?
DrForr It's just a thin shell that invokes Root.new() on the parsed object, it's pretty trivial. 15:23
ugexe: Good point, though I might need to go farther than that.
15:23 mohae joined
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
It just runs the core parsegrammar method with the parseactions methods, it needs $*LINEPOSCACHE because apparently a few methods need it.
pmurias DrForr: what's the benefit of having a Perl 6 class for every grammar rule? 15:30
DrForr This lets Perl 6 users be able to walk the parse tree of a grammar without needing to learn NQP? 15:31
15:31 dvinciguerra joined
DrForr And my plan isn't necessarily 1:1 rule:class. 15:31
In fact it can't be in most cases. 15:32
15:33 zakharyas joined
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:35 rindolf left
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:37
15:37 aindilis left 15:38 rindolf joined, aindilis joined
DrForr Also, ::Tidy isn't the best namespace for this to be in, it'll move somewhere more appropriate. 15:38
15:46 BillSussman left 15:48 holyghost left 15:50 AndyBotwin joined
pmurias DrForr: you should look at masak's blog post about a new proposed ast format 15:51
DrForr Oo. Link? 15:55
15:55 cdg left
gfldex DrForr: strangelyconsistent.org/blog/macros...q-are-they 15:57
15:57 adu joined, abraxxa left
DrForr scribbles for later. 15:58
Oh, I think I've read that before. But good for review at least.
15:59 domidumont left, iH2O joined
BrokenRobot m: gist.github.com/zoffixznet/5d53dbf...7b7fab1bfa 16:12
camelia rakudo-moar 0941d0: OUTPUT«gist not found»
BrokenRobot :\ Github is getting hax0red again 16:13
16:14 dogbert17 joined
dogbert17 o/ #perl6 16:15
hoelzro o/ dogbert17
dogbert17 hi hoelzro
stupid question time again 16:16
adu hi all
dogbert17 m: my $block = { ENTER { say "entering block"}; 42 }; say $block.has-phasers # shouldn't this return a Bool?
camelia rakudo-moar 0941d0: OUTPUT«1␤»
16:16 vendethiel joined
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…»
dogbert17 perhaps I'm bikeshedding here
BrokenRobot m: my $block = { ENTER { say "entering block"}; LEAVE { }; 42 }; say $block.has-phasers
camelia rakudo-moar 0941d0: OUTPUT«1␤»
BrokenRobot m: gitlab.com/snippets/22362
camelia rakudo-moar 0941d0: OUTPUT«␤»
BrokenRobot How come this snippet returns nothing, but if I change .+ to \w+ on line 10, then it returns [BUG], as wanted: gitlab.com/snippets/22362#L10 16:18
16:18 vendethiel- left
BrokenRobot m: gitlab.com/snippets/22363 16:18
camelia rakudo-moar 0941d0: OUTPUT«[BUG]␤»
parabolize hoelzro: Thank you for updating pygments! 16:19
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)?
gfldex dogbert17: there are no spectests for .has-phasers. Nothing to see, move along!
16:20 dakkar left
dogbert17 gfldex: does that mean that I should not document it? 16:20
iH2O do whatever is necessary, Dagobert 17 16:21
parabolize err r'<<(?!==).*?>>|<[^<=].*?>|«.*?»' rather
dogbert17 I have a gist but github !¤#¤"%"% 404
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.
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
gfldex dogbert17: github.com/perl6/roast/
dogbert17 gfldex: thx
rindolf dogbert17: status.github.com/ 16:24
dogbert17 rindolf: thx, wonder what's up 16:25
hoelzro parabolize: thanks, I'll try that out!
16:25 ptolemarch joined
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
lucasb_ its definition is: has-phasers() { nqp::attrinited(self,Block,'$!phasers') }
so maybe, if someone wraps that in nqp::p6bool(...), it would be ok 16:28
gfldex it would also impact performance quite a bit
rakudo is not very good at shielding it's implementation details 16:29
lucasb_ gfldex: what? the p6bool op?
gfldex but then, subclassing Block would be tricky
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?
gfldex all user facing methods do that 16:31
16:31 pmurias_ joined
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
*talking
gfldex i don't expect anything of has-phasers because I expect blocks to be inlined. 16:33
16:34 domidumont joined, pmurias left 16:45 sammers left 16:49 sammers joined 16:54 lostinfog joined 16:59 mohae_ joined 17:01 mohae left 17:02 pmurias_ left 17:04 AndyBotwin left 17:10 lucasb_ left 17:12 dj_goku joined 17:15 firstdayonthejob joined
dalek osystem: 0bd7b7d | (Zoffix Znet)++ | META.list:
Add RT::REST::Client to ecosystem

Use Request Tracker's (RT) REST client interface
17:16
BrokenRobot github.com/zoffixznet/perl6-RT-REST-Client
17:16 domidumont left 17:17 domidumont joined, Coleoid_n left
[Coke] BrokenRobot: nifty! 17:21
I look forward to cutting over to using the p6 client on my dumb script.
17:30 stevieb joined
BrokenRobot I think yours uses summaries to get tags from. Mine (currently) doesn't. Just the [TAGS] in subjectlines. 17:38
17:38 zakharyas left 17:41 espadrine joined, wisti joined 17:44 adu left 17:49 iH2O left 17:50 wisti left 17:51 wisti joined 17:56 trnh joined, trnh left, trnh joined 18:02 dj_goku left 18:03 stevieb left, Xliff_ joined 18:04 wisti left 18:07 Xliff left 18:17 labster joined 18:20 wisti joined 18:26 girafe joined, setty1 joined, cdg joined 18:28 AndyBotwin joined, AndyBotwin left, AndyBotwin joined 18:29 dj_goku joined 18:31 adu joined 18:38 addison joined
[Coke] shapecatcher.com/ - oooh! 18:39
(lets you draw a unicode char and it tries to find it based on your drawing)
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!
hoelzro no CJK, though? 18:41
[Coke] nope. he notes why in the comments. 18:42
wonder if it's OS.
skids Oh yeah that site has been my goto resurce for a while, it's neat. 18:43
rindolf [Coke]: sounds cool.
hoelzro yeah, I saw, but of course that's the first thing I tried =/
BrokenRobot .u 𓂸 18:44
yoleaux U+130B8 EGYPTIAN HIEROGLYPH D052 [Lo] (𓂸)
18:44 girafe left, girafe joined, girafe left 18:45 girafe joined
skids .u ⍨ 18:45
yoleaux U+2368 APL FUNCTIONAL SYMBOL TILDE DIAERESIS [So] (⍨)
18:45 girafe left
[Coke] m: "💫".uniname.say 18:46
camelia rakudo-moar 0941d0: OUTPUT«DIZZY SYMBOL␤»
18:47 dj_goku left
skids .uꕁ 18:47
.u ꕁ
yoleaux U+A541 VAI SYLLABLE NJI [Lo] (ꕁ)
skids or, "YUP YUP YUP ALIEN FROM SESAME STREET" 18:48
18:49 mohae_ left, inokenty joined, zakharyas joined 18:50 wisti left
skids .u 😶 18:50
yoleaux U+1F636 FACE WITHOUT MOUTH [So] (😶)
skids Or ... COMPASEABLE MR POTATO HEAD 18:51
18:52 domidumont left
skids Huh. That site is using CUDA/graphics card. Who woulda thought. 18:54
moritz u+B0ATFACE BOATY MC BOATFACE 18:55
18:56 djbkd_ left 19:00 huggable left 19:04 spider-mario joined 19:06 lostinfog left 19:08 tbrowder left 19:09 TEttinger joined 19:10 darutoko left 19:24 tbrowder_ joined 19:25 chris2 left
BrokenRobot What a thing to see on a bug report: bugzilla.mozilla.org/show_bug.cgi?id=373621#c69 19:28
19:28 tbrowder_ left
BrokenRobot Kinda weird to read previous comments from a person that's now dead :| 19:28
19:29 domidumont joined
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:37
19:40 chris2 joined
[Coke] wonders why 1..10000 is getting expanded in makefile action 19:42
19:50 domidumont left
[Coke] ah, it's not, I'm a dummy, and also make-- 19:51
19:53 fsavigny joined 20:01 fsavigny left 20:05 girafe joined, girafe left 20:06 girafe joined, girafe left 20:08 girafe joined, girafe left 20:09 girafe joined 20:10 yqt joined, newbie1 joined 20:12 woolfy left 20:13 woolfy joined, yqt left 20:15 tbrowder joined 20:16 rindolf left 20:18 rindolf joined 20:19 fsavigny joined 20:20 dj_goku joined, trnh left
fsavigny I am new to this medium and wondering if it is really suited to these types of inquiries, but here goes: 20:20
20:20 canopus left
lizmat welcome fsavigny! 20:21
what is your question? 20:22
moritz (irc is not suited for inquiries of empty length :-) 20:23
dj_goku waits
dj_goku holds breath
lizmat tries to find the mind-reading activator switch
20:24 spebern_ joined
moritz tries to read lizmat's mind to get to the switch first 20:24
in the mean time, I'm reading www.meltingasphalt.com/a-nihilists-...o-meaning/ and thoroughly enjoying it 20:25
spebern_ pbs.twimg.com/media/CnMN6Q9WgAAxYSI.jpg:large
20:26 canopus joined
lizmat spebern_: yummy! :-) 20:26
fsavigny (Also, I am finding it difficult to format a question.) 20:27
lizmat spebern_: do you have any background info on the picture?
moritz fsavigny: just ask, don't format :-) 20:28
gfldex .oO( format /q Question: )
lizmat fsavigny: it is generally indicated by a question mark at the end :-)
20:28 spebern joined
gfldex you can also use ‽ if you like 20:29
20:29 spebern left
moritz .u ‽ 20:30
yoleaux U+203D INTERROBANG [Po] (‽)
20:30 spebern_ left
moritz
.oO( going out with an interrobang )
20:31
gfldex they used to be on typewriters (lower right corner) static1.squarespace.com/static/549e...rmat=2500w
moritz gfldex: wow, TIL 20:32
20:37 dj_goku left
mspo you learned‽‽ 20:37
fsavigny Erm ... any comment on my eval question? 20:41
AlexDaniel fsavigny: which question? 20:43
mspo fsavigny: I don't see your actual question
did you ask anything‽
20:43 AndyBotwin left 20:45 Guest64213 left 20:48 AndyBotwin joined, jonas2 left
AlexDaniel fsavigny: it seems like your message was not sent properly. Check it yourself: irclog.perlgeek.de/perl6/2016-07-12#i_12829554 20:48
fsavigny The question I asked at 22:27, directly before I complained about formatting ... 20:49
_AlexDaniel: You're right; it wasn't sent. I'll try again.
20:53 zakharyas left
AlexDaniel still nothing 20:53
fsavigny: what IRC client are you using?
fsavigny Riece. It 20:54
Riece. It is an Emacs package.
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
parabolize there is but it usually gets split by the client
fsavigny: you could try ERC
its in emacs by default 20:56
AlexDaniel yeah. No problems with ERC at all
fsavigny OK, thanks! I'll switch to ERC and retry. Might take a little while ... Thanks very much! 20:57
20:57 fsavigny left 20:58 fsavigny joined, adu left, canopus left
fsavigny OK, using ERC now. 20:59
I'll try to ask in short. 21:00
dalek c: c504fae | MasterDuke17++ | doc/Language/typesystem.pod6:
Fix spelling mistake
21:01
geekosaur pastebin sites are also helpful. although a large complex question may be better suited for a mailing list
fsavigny I once wrote an XML/SGML converter, which executes stored Perl code when a certain event happens.
That converter is written in Perl 5 and uses eval to execute this Perl code. 21:02
I am wondering if this is still a feasible method in Perl 6, as eval seems rather deprecated.
lizmat it's called EVAL nowadays 21:03
but having said that, perhaps you'd want to store precompiled code and execute that on demand
that would be *way* faster, if you can get that to work, though 21:04
you would be pretty bleeding edge then
21:04 canopus joined 21:06 mcmillhj left 21:07 wamba left
fsavigny But how would one do that in Perl 6: Store precompiled code? 21:07
My Perl 5 solution simply reads in Perl code as if it were a text file. 21:09
And then stores the code strings in a moderately complex hash structure.
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)
geekosaur seems like a custom CompUnitRepo might be a thing here too? 21:12
21:12 adu joined
gfldex github.com/gfldex/pod-to-bigpage/b...age.p6#L63 21:12
you have to decent into nqp-land to precompile and load at runtime 21:13
21:13 skids left
fsavigny And when the converter knows that eg element "HEADER" has opened, it finds the code for the opening of element HEADER 21:13
and executes that using eval.
But to make that clear: Precompiling (or speed, for that matter) is not that crucial to me. 21:14
geekosaur, what's CompUnitRepo? 21:15
gfldex m: use MONKEY-SEE-NO-EVAL; my &f = EVAL('sub f(){ say "oi‽" }'); f();
camelia rakudo-moar 371b93: OUTPUT«oi‽␤»
fsavigny glfdex, that looks quite exactly like the solution I used in Perl 5 ... 21:16
21:16 adu left
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
21:17 adu joined
fsavigny ... but isn't that sort of deprecated in Perl 6 (the EVAL thing, I mean)? 21:17
gfldex why would it be deprecated?
fsavigny Because of the MONKEY-SEE-NO-EVAL ... 21:18
You know that the monkey covers its eyes. Does not want to be responsible, probably ...
lizmat Perl 6 just wants to make sure you know what you're doing
geekosaur not so much deprecated as marked as dangerous 21:19
so you need to include a "I know what I'm doing"
lizmat I mean, compiling source code from untrusted sources is asking for problems, generally
gfldex also, you may anger the optimiser 21:20
lizmat fsavigny: have you considered putting code blocks in a hash?
gfldex didn't there be a trait called 'is deprecated'?
21:20 adu left
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␤␤»
lizmat m: my %h = HEADER => { say "header" }; %h<HEADER>() 21:21
camelia rakudo-moar 371b93: OUTPUT«header␤»
fsavigny Putting them in a hash is actually what the (p5-based) converter does internally.
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
fsavigny But apart from that, would that change anything about having to eval the code?
21:23 dvinciguerra left
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
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?
gfldex yes, and with some functional programming sprinkled on top 21:25
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␤»
gfldex m: sub factory(&before, &after){ return sub { before(); say 'oi‽'; after(); } }; my %h = one => factory({say('hello')}, {say('baby')}); %h<one>(); 21:28
camelia rakudo-moar 371b93: OUTPUT«hello␤oi‽␤baby␤»
literal so, there's IO::Path.extension ... is there no corresponding method to get the part of the filename without the extension? 21:29
fsavigny callsame looks interesting, thank you! I think I will evaluate that before continuing to ask ... 21:30
literal or at least something nicer than $foo.match(/^(<-[.]>+)/)[0] 21:32
perlpilot literal: isn't that .path ? 21:34
or, I guess perhaps .path ~ .basename
fsavigny Thanks to everybody for your patience, and have a nice evening!
21:34 fsavigny left
gfldex .basename.split('.').reverse[1]; 21:35
literal perlpilot: no, basename includes the extension
lizmat I think I had something for that in the newio branch :-(
gfldex you need the reverse[1] for '.foo'
actually that will fail for 'file.foo.bar' 21:36
literal yes 21:37
like bla.tar.gz
gfldex m: 'file.foo.bar'.split('.').reverse.rest.reverse.say
camelia rakudo-moar 371b93: OUTPUT«Method 'rest' not found for invocant of class 'List'␤ in block <unit> at <tmp> line 1␤␤»
lizmat perhaps .basename.substr(0,*-(.extension.chars + 1))
perlpilot yuck 21:38
lizmat
.oO( yuck )
perlpilot heh
literal m: say 'file.foo.bar'.comb(/<-[.]>+/, 1) 21:39
camelia rakudo-moar 371b93: OUTPUT«(file)␤»
perlpilot lizmat: maybe add .fileparse like p5's File::Basename ? 21:41
lizmat perlpilot: perhaps, but I'm pretty burnt out on IO stuff
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:42
gfldex the docs got filenames where the . is actually part of the filename 21:43
Ulti perf looking good gist.github.com/MattOates/c2e19950f46d1a1c241a
gfldex so it's not that easy to decide
lizmat Ulti: so roughly 3x as fast, if I read that correctly ? 21:44
since Sept 2015 ? 21:45
perlpilot gfldex: that's why I was thinking about fileparse actually. You can specify the suffixes you care about.
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
granted my CPU is more modern than his
2013-09 to now 40x faster on something numeric with lots of array pushing 21:47
I didnt write this up last time because I contacted Tim to maybe update his own blog but I heard nothing back 21:48
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>));
camelia rakudo-moar 371b93: OUTPUT«True␤»
lizmat Ulti++ # putting something in the world that *is* true ?
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
one of all the hardwork you have all put in :3 21:51
21:51 CIAvash left
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>));
camelia rakudo-moar 371b93: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤ in block <unit> at <tmp> line 1␤␤»
gfldex that would be nice to have
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:54
21:56 ptolemarch left
gfldex m: 'file.tar.gz'.split('.tar.gz').say 21:57
camelia rakudo-moar 371b93: OUTPUT«(file )␤»
gfldex m: 'file.tar.gz'.split('.tar.gz')[0].say
camelia rakudo-moar 371b93: OUTPUT«file␤»
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>));
camelia rakudo-moar 371b93: OUTPUT«any((file ), (file.tar.gz))␤»
gfldex the Junction is not to helpful in that case
what may be the fault of split. I am basicly asking .split to split by any of the provided junction values. 21:59
I'm assuming that I understood junctions, what I don't. 22:00
22:00 dj_goku joined
gfldex m: dd 'file.tar.gz'.split(any '.tar.gz'); 22:02
camelia rakudo-moar 371b93: OUTPUT«any(("file", ""))␤»
gfldex where does that "" come from?
22:04 addison left 22:15 dj_goku left 22:18 newbie1 left 22:19 spider-mario left, addison joined 22:20 Sgeo joined, espadrine left 22:22 dj_goku joined 22:29 khw joined 22:33 firstdayonthejob left 22:37 dj_goku left 22:38 skids joined 22:50 dwarring joined 22:53 rindolf left 22:56 rindolf joined 22:59 setty1 left 23:01 jack_rabbit joined 23:07 k-man joined 23:12 dvinciguerra joined 23:14 tbrowder left 23:22 rindolf left
AlexDaniel timeless: hi! 23:29
timeless: how are you? Any progress on url escaping thingy? 23:30
jdv79 lizmat++ # weekly 23:31
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?
AlexDaniel m: ‘meh’.split(‘eh’).perl.say 23:34
camelia rakudo-moar 303e77: OUTPUT«("m", "")␤»
AlexDaniel github.com/perl6/roast/blob/c3f40c...mple.t#L39 23:36
looks like it is so by design
23:40 Zoffix joined
Zoffix m: say('meow';); say 42; 23:40
camelia rakudo-moar 303e77: OUTPUT«(meow)()␤42␤»
Zoffix What sort of construct is this? With the ; inside?
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␤»
Zoffix ^ causes issues here
konobi jdv79: nope
jdv79: o.O why do you ask?
23:43 girafe left
AlexDaniel m: (‘meow’; ‘foo’; ‘test’).perl.say 23:44
camelia rakudo-moar 303e77: OUTPUT«("meow", "foo", "test")␤»
jdv79 i thought somebody was in here and thougjt it was you.
cause its the crazy day there. 23:45
23:45 RabidGravy left
jdv79 or it was. 23:45
AlexDaniel m: (‘meow’, 42; ‘foo’; ‘test’, 69).perl.say
camelia rakudo-moar 303e77: OUTPUT«(("meow", 42), "foo", ("test", 69))␤»
konobi jdv79: well, I'm from belfast... so could be
AlexDaniel Zoffix: it feels like something for multidimensional arrays
jdv79 ah
was just curious how this 12th turned out 23:46
AlexDaniel m: say(42,‘meow’;‘ha’;‘test’)
camelia rakudo-moar 303e77: OUTPUT«(42 meow)(ha)(test)␤»
konobi heh, I haven't lived in NI in 14 years and the last 10 have been in west coast canada =0)
jdv79 i only visited last year. am from ny. but i understand july 12 is a thing there. 23:47
nice
konobi yeah, can get nasty
funnily enough I was just in NY last week. Karen was too
jdv79 haha. there was no ny pm meeting. 23:48
karen and yaakov visited us 2? years ago.
still cant tell you why. very abstract and vague. 23:49
23:52 Zoffix left 23:56 BenGoldberg_ joined 23:57 cdg left