Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2018-01-09

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:18 lookatme joined #perl6
00:32 mempko joined #perl6
00:49 silug joined #perl6
00:58 Aaronepower joined #perl6
01:06 comborico1611 joined #perl6
01:07 kerframil left #perl6
01:08 comborico1611 I just got this used book. I noticed that it had a strong scent of Febreze. Now I can smell the undertone of cigarettes.
01:08 comborico1611 Really strange. The book is like in perfect new condition. Yet it reeks.
01:09 lizmat joined #perl6
01:14 geekosaur sounds/smells very undergrad dorm >.>
01:14 tusooa lol
01:14 comborico1611 Heh
01:15 comborico1611 Every turn of the page is like a squirt of the cologne bottle.
01:15 comborico1611 Good thing this book doesn't look very promising.
01:16 entonian joined #perl6
01:16 nativecallable6 joined #perl6
01:17 unicodable6 joined #perl6
01:17 adu joined #perl6
01:17 quotable6 joined #perl6
01:27 astj joined #perl6
01:32 b2gills I've gone into an apartment that was so caked with smoke that the walls were yellow where pictures were, and a light brown everywhere else
01:32 cdg joined #perl6
01:33 Zoffix joined #perl6
01:34 Zoffix If several tokens of a single proto regex can match the text, what are the rules for which one gets chosen?
01:36 Zoffix For example, both of these can match `- QAST::Var(lexical $limit :decl(var))` https://github.com/zoffixznet/q/blob/master/lib/CoreHackers/Q/Parser.pm6#L13-L14
01:36 Zoffix And :sym<qast> wins now, but if I change that to <name=ident> then :sym<misc> is used. What causes the switch?
01:38 Zoffix Looks like "If a subrule is a protoregex, it is treated just as alternation with | is" (from speculations)...
01:38 comborico1611 B2gills, that's sad.
01:38 Zoffix My next question is: if two alernations match the same length, which one is used
01:39 Zoffix "However, if two alternatives match at the same length, the tie is broken first by specificity. The alternative that starts with the longest fixed string wins; that is, an exact match counts as closer than a match made using character classes. If that doesn't work, the tie is broken by one of two methods. If the alternatives are in different grammars, standard MRO (method resolution order) determines which one
01:39 Zoffix to try first. If the alternatives are in the same grammar file, the textually earlier alternative takes precedence. (If a grammar's rules are defined in more than one file, the order is undefined, and an explicit assertion must be used to force failure if the wrong one is tried first.)"
01:41 Zoffix So what does that mean to mere mortals? I'd figure "'- QAST::'" is a "fixed string" and would win over \N+
01:42 Zoffix `'- QAST::' $<name>=[a..zA..Z]+ $<rest>=\N+` seems to lose to \N+
01:43 TimToady not if \N+ is longer
01:43 TimToady generally if you're gonna write a \N+ kind of rule, you should stop LTM before it
01:43 Zoffix They should match the same length here: https://github.com/zoffixznet/q/blob/master/lib/CoreHackers/Q/Parser.pm6#L13-L14
01:44 Zoffix And there :sym<qast> wins, but if I change $<name>=\S+ to [a..zA..Z]+ then it loses
01:45 ck joined #perl6
01:47 TimToady I have a faint recollection of enumerated character classes being allowed to be treated as literal so that you could write [Aa]bc and such
01:47 TimToady maybe that's what's going on here
01:48 ckraniak joined #perl6
01:48 TimToady except that seems backwards to what you're seeing
01:49 Zoffix Oh, it needs to be $<name>=<[a..zA..Z]>+
01:50 Zoffix But, the <name=ident> version still doesn't match like I want
01:50 Zoffix m: grammar { token TOP { <z>+ }; proto token z {*}; token z:sym<qast> { 'QAST' <name=ident> $<rest>=\N+ }; token z:sym<misc> { \N+ } }.parse: 'QASTmeow♥', :actions(class { method z:sym<qast>($/) { say "qast"};  method z:sym<misc>($/) { say "misc"}; })
01:50 camelia rakudo-moar 14c2cdb31: OUTPUT: «misc␤»
01:50 TimToady but in any case, treating the entire line as a token is generally suboptimal
01:50 jcallen joined #perl6
01:56 TimToady m: grammar { token TOP { <z>+ }; proto token z {*}; token z:sym<qast> { 'QAST' <name=ident> $<rest>=\N+ }; token z:sym<misc> { {} \N+ } }.parse: 'QASTmeow♥', :actions(class { method z:sym<qast>($/) { say $/};  method z:sym<misc>($/) { say "misc"}; })
01:56 camelia rakudo-moar 14c2cdb31: OUTPUT: «「QASTmeow♥」␤ name => 「meow」␤ ident => 「meow」␤ rest => 「♥」␤»
01:57 Zoffix Ah. Thanks
01:57 TimToady at a guess, the ident rule is terminating LTM somehow
01:58 TimToady at a guess, the ident rule is terminating LTM somehow
01:58 TimToady m: grammar { token TOP { <z>+ }; proto token z {*}; token z:sym<qast> { 'QAST' <name=ident> $<rest>=\N+ }; token z:sym<misc> { {} \N+ } }.parse: 'QASTmeow ♥', :actions(class { method z:sym<qast>($/) { say $/};  method z:sym<misc>($/) { say "misc"}; })
01:58 camelia rakudo-moar 14c2cdb31: OUTPUT: «「QASTmeow ♥」␤ name => 「meow」␤ ident => 「meow」␤ rest => 「 ♥」␤»
01:58 TimToady hmm, it's not eating ws anyway...
02:01 TimToady the other \N+ probably wants the same treatment too, otherwise you're just wasting NFA cycles
02:01 Zoffix OK. Thanks
02:03 comborico1611 Off to bed.
02:03 Zoffix \o
02:03 comborico1611 o/
02:15 Zoffix left #perl6
02:19 GregDonald joined #perl6
02:19 FROGGS joined #perl6
02:27 Kaiepi joined #perl6
02:33 ckraniak joined #perl6
02:40 nekomune joined #perl6
03:03 ilbot3 joined #perl6
03:03 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
03:05 jstuder joined #perl6
03:07 ponbiki joined #perl6
03:20 astj joined #perl6
03:21 astj joined #perl6
03:27 mempko joined #perl6
03:57 bloatable6 joined #perl6
04:25 Geth ¦ perl6-examples: ryn1x++ created pull request #52: Add Windows clear screen example
04:25 Geth ¦ perl6-examples: review: https://github.com/perl6/perl6-examples/pull/52
04:46 Cabanossi joined #perl6
05:01 epony joined #perl6
05:03 epony joined #perl6
05:08 Geth ¦ perl6-examples: d29719a785 | ryn1x++ | 2 files
05:08 Geth ¦ perl6-examples: added windows example
05:08 Geth ¦ perl6-examples: review: https://github.com/perl6/perl6-examples/commit/d29719a785
05:08 Geth ¦ perl6-examples: 86b49e8a85 | ryn1x++ (committed using GitHub Web editor) | categories/cookbook/15interactivity/15-03-clear-screen.pl~
05:08 Geth ¦ perl6-examples: Delete 15-03-clear-screen.pl~
05:08 Geth ¦ perl6-examples: review: https://github.com/perl6/perl6-examples/commit/86b49e8a85
05:08 Geth ¦ perl6-examples: 1b0d45ae7a | (Zoffix Znet)++ (committed using GitHub Web editor) | categories/cookbook/15interactivity/15-03-clear-screen.pl
05:08 Geth ¦ perl6-examples: Merge pull request #52 from ryn1x/master
05:08 Geth ¦ perl6-examples:
05:08 Geth ¦ perl6-examples: Add Windows clear screen example
05:08 Geth ¦ perl6-examples: review: https://github.com/perl6/perl6-examples/commit/1b0d45ae7a
05:53 konsolebox joined #perl6
06:32 lowbro joined #perl6
06:32 lowbro joined #perl6
06:41 domidumont joined #perl6
06:42 parv joined #perl6
06:49 domidumont joined #perl6
07:07 aindilis joined #perl6
07:11 DarthGandalf joined #perl6
07:15 rindolf joined #perl6
07:16 ggoebel joined #perl6
07:31 domidumont joined #perl6
07:51 domidumont joined #perl6
07:57 cdg joined #perl6
08:20 cdg joined #perl6
08:21 ckraniak joined #perl6
08:25 wamba joined #perl6
08:30 domidumont joined #perl6
08:32 lizmat Zoffix: errata applied
08:33 * lizmat clickbaits https://p6weekly.wordpress.com/2018/01/08/2018-02-fosdem-nearing/
08:34 abraxxa joined #perl6
08:38 leah2 joined #perl6
08:43 astj_ joined #perl6
08:45 lowin joined #perl6
08:46 zakharyas joined #perl6
09:04 zakharyas joined #perl6
09:04 dakkar joined #perl6
09:05 lowin I've got an idea for a new hobby project and thought it would be a nice opportunity to learn a new language at the same time. So here I am, without the intention of stirring up any flame wars. Would perl6 be a good choice for me? I plan to do lots of raw binary file I/O, socket networking and hopefully never having to go back to old projects to fix future language version incompatibilities.
09:05 zakharyas joined #perl6
09:06 lowin perl6 caught my eye before, but I didn't have much time to really read up on it. So far the only reason I have for choosing perl6 is that I like the logo
09:07 lizmat lowin: you might want to check http://mi.cro.services
09:07 DrForr Well, for binary files you'l want to look at the Pack module (I forget the name), for socket networking you'll want to look at Cro, and otherwise I'd go for it.
09:07 lizmat PackUnpack you mean ?
09:08 DrForr Thank you, yes.
09:08 lizmat which reminds me, I need to push that to CPAN
09:09 lowin Well I'm not really looking for modules right now, because I haven't even started yet. I was just asking if it's a good idea at all. especially the forward compatibility part
09:10 lowin I come with C background, and things like raw I/O comes naturally. I'm hoping the language won't block me to do things like that
09:10 DrForr Well, no language is perfect, libraries change, interfaces change, to everyting there is a season etc.
09:10 lizmat lowin: re forward compatibility is well on our radar
09:10 lizmat the "use" statement allows you to specify a version of a module to load
09:11 lizmat and multiple versions of the same module can be installed simultaneously
09:11 lowin lizmat, I'm glad to hear it. I understand sometimes change is inevitable. But the frequency of change is what matters. I'll read up on use statement
09:14 scimon joined #perl6
09:25 darutoko joined #perl6
09:30 [particle] joined #perl6
09:31 MilkmanDan joined #perl6
09:32 luiz_lha joined #perl6
09:34 Ven joined #perl6
09:36 [particle] joined #perl6
09:50 El_Che lowin: if you don't want change use C89 :)
09:51 El_Che lowin: otherwise, most of what you mention is part of the core of rakudo
09:51 lowin El_Che, already am. Using C for hobby projects gets boring when you are dealing with it every day at work
09:52 El_Che lowin: I agree, my point is that a compiled languages has advantages in the "do-not-change" department
09:53 El_Che lowin: however, perl6 has many backward compatible features (like the "use version" lizmat mentioned)
09:54 lowin Yes ofcourse. I'm just hoping a python3 situation won't happen with perl6, I know perl6 broke compatibility with perl5, but atleast they didn't deprecate perl 5 right away like python.
09:54 scimon Oh no, they are two different streams.
09:55 scimon Perl5 isn't going anywhere. And there's a lot of people who do both.
09:55 El_Che python2 and 3 is a total different story (not better, not worse, just different)
09:56 lowin That's why I didn't turn away from perl6 like I did from python3. It was mostly that and the lack of curly braces
09:56 El_Che perl6 is not depreciating 5 (althoug the name is confusing as hell, granted), they are different languages released by different people
09:57 jast hey, let's fork Perl 6 and call the result Python 4, for improved clarity
09:57 lichtkind joined #perl6
09:58 lichtkind cheers
09:58 lichtkind how do i include a module in a category on modules.perl6.org? thanks
09:58 El_Che jast: perl6 foresees multiple implementations :)
09:59 jam__ joined #perl6
10:00 jam__ I'm reading about grammars right now. I came across "method TOP ($/) {     make $<definition>>>.made;   }" What's going on with the >> and .made?
10:01 jast jam__: foo>>.bar means, apply the bar method to all members of foo
10:01 jam__ nice jast ty
10:01 jast >> is an operator on an operator, a hyper operator
10:02 jast https://docs.perl6.org/language/operators#Hyper_Operators
10:02 lichtkind yes but ops on ops are called meta ops, << is a special meta op called hyper
10:02 jam__ there's an operator for everything :]
10:02 jam__ thanks for the link
10:03 jast there are multiple hyper operators
10:03 lichtkind perl was always an operator oriented language :)
10:03 jast syntax-oriented, in fact
10:03 lichtkind or in short oo :)
10:03 jast I love me some syntax
10:13 cdg joined #perl6
10:17 scimon lichtkind: I'm guessing the tags list in META6.json is used for the tags in modules.perl6.org (that's a total guess but I think it makes sense)
10:20 scimon (Now I have to tag my modules...)
10:21 jnthn Yes, that's where the tags show up
10:22 DrForr scimon: Look around for a t/meta.t test file as well, that helps keep things organized.
10:24 jnthn But if writing one, please put it in xt, not in t
10:26 scimon Any doc's on meta.t ? (First I've heard of it)
10:27 DrForr Not especially, it just runs Test::META that checks your META6.json file for formatting and potential infelicities.
10:27 scimon Ah.
10:28 scimon I'm mostly using mi6 for module building and testing so much of the time it's managing the file (and it explodes hilariously if you have poorly formatted JSON in it).
10:29 scimon I've got a couple of plans for stuff to write, first up is a Test module that wraps HTTP::Server::Async to make running Mock HTTP servers nice and easy.
10:31 scimon As I need something like that for the bigger plan which is to start work on WWW::Mechanize.
10:37 El_Che lizmat, AlexDaniel`: I am getting a idea why buggable test passed and the ones on the released tar aren't
10:40 zakharyas joined #perl6
10:46 vichib joined #perl6
10:53 AlexDaniel` El_Che: what is it?
10:58 vichib joined #perl6
10:58 wamba joined #perl6
11:06 ExtraCrispy joined #perl6
11:08 ExtraCrispy_ joined #perl6
11:10 reu joined #perl6
11:13 ExtraCrispy_ joined #perl6
11:13 El_Che AlexDaniel`: I think buggable and dev use --gen-moar and --gen-nqp, while I build from the released tars from nqp, moarvm and rakudo. Testing this as we speak
11:14 ExtraCrispy joined #perl6
11:22 zakharyas joined #perl6
11:23 Zoffix joined #perl6
11:24 Zoffix El_Che: FWIW, I use ZScript that keeps MoarVM/nqp/rakudo in separate dirs and builds them each separately and doesn't use --gen thing: https://github.com/zoffixznet/z/blob/master/lib/RDev.pm6#L204-L222
11:27 Zoffix RE: https://github.com/zoffixznet/q yeah I'll write docs eventually; I think it'll end up as an ecosystem module CoreHackers::Q after I tune it up a bit. And I think the current QAST::Node.dump is fairly decent. My tool just adds a dynamic browser-based explorer to QAST::Node.dump where you can collapse tree nodes and it colorcodes things like sunk layers or calls that weren't made static
11:31 luiz_lha joined #perl6
11:31 solarbunny joined #perl6
11:34 El_Che Zoffix: do you use the release tars of git commits?
11:44 Zoffix El_Che: git commits.
11:46 Zoffix and looks like release tarballs would just contains a tar of git ls-files: https://github.com/rakudo/rakudo/blob/master/tools/build/Makefile-Moar.in#L312-L325
11:46 Zoffix so I'm dubious the problems you're seeing is due to that
11:48 Zoffix left #perl6
11:53 cdg joined #perl6
12:03 lichtkind joined #perl6
12:04 vichib joined #perl6
12:12 El_Che ok, it is as I suspected
12:12 [particle] joined #perl6
12:12 El_Che I'll update the bug
12:13 konsolebox joined #perl6
12:14 markong joined #perl6
12:15 domidumont joined #perl6
12:19 hoka joined #perl6
12:27 cdg joined #perl6
12:32 someuser joined #perl6
12:34 konsolebox joined #perl6
13:08 Geth ¦ doc: 3796780fb8 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Signature.pod6
13:08 Geth ¦ doc: Clarify interaction between :D and optional params
13:08 Geth ¦ doc:
13:08 Geth ¦ doc: - Include examples and clarify typecheck explosion
13:08 Geth ¦ doc: - Remove "passed", since that implies[^1] typecheck
13:08 synopsebot Link: https://doc.perl6.org/type/Signature
13:08 Geth ¦ doc:   does not apply to optional params
13:08 Geth ¦ doc: - Reword "undefined", since there's a difference between
13:08 Geth ¦ doc:     .defined and .DEFINITE
13:09 Geth ¦ doc:
13:09 Geth ¦ doc: [1] https://stackoverflow.com/questions/48166325/should-constraining-a-perl-6-named-parameter-to-a-definite-value-make-it-a-requi
13:09 Geth ¦ doc: review: https://github.com/perl6/doc/commit/3796780fb8
13:11 Geth ¦ doc: b794a73e66 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Signature.pod6
13:11 Geth ¦ doc: Fix default default for optional params
13:11 Geth ¦ doc:
13:11 Geth ¦ doc: Blocks actually default to Mu not Any
13:11 Geth ¦ doc: review: https://github.com/perl6/doc/commit/b794a73e66
13:22 pmurias joined #perl6
13:32 lichtkind joined #perl6
13:33 torbjorn joined #perl6
13:34 torbjorn should I include \n when writing grammars to mark the end of line?
13:34 torbjorn Im trying to parse this: https://paste.fedoraproject.org/paste/UU01HFH8SS1V88sRDigHyQ
13:35 jnthn You'll need something that eats the newline char, yes
13:35 jnthn \n will do it
13:35 moritz torbjorn: yes
13:36 masak hi torbjorn. it looks like a line-based format, so I'd say yes
13:36 moritz though you can use $$ to match a line end without consuming it from the input
13:36 masak $$ and \n are two fairly different things, though :)
13:36 masak (like moritz said)
13:36 torbjorn I see the distinction
13:36 torbjorn which explained why my use of ^ does not work , I need ^^ further down, thanks
13:37 masak torbjorn: I would *warmly* recommend evolving a grammar alongside a test suite
13:38 torbjorn how does one do that?
13:38 torbjorn like any other perl6 module test suite i suppose
13:38 jast yes :)
13:38 masak yes, one with exercises the grammar's .parse method
13:39 masak and negative tests ("this shouldn't parse") are just as important as positive ones ("this parses")
13:39 moritz may I warmly recommend https://smile.amazon.com/Parsing-Perl-Regexes-Grammars-Recursive-ebook/dp/B0785L6WR6 ?
13:39 moritz I'm biased, but the reviews are very positive so far as well :-)
13:39 masak moritz++ # I should've thought of suggesting that :)
13:39 moritz (and yes, that also talks about testing grammars, and has worked examples)
13:40 vichib joined #perl6
13:40 moritz and about dealing with significant whitespace
13:40 moritz and even indentation-based languages, like python or yaml
13:40 torbjorn well the temperature of the recomendation is yours to adjust, the temperature of my receiption matches that of yours though, so yes!
13:40 vichib joined #perl6
13:40 moritz </ad>
13:41 lichtkind is the modules index hand crafted?
13:41 moritz it's even organic!
13:41 moritz lichtkind: the software behind it is
13:41 [particle] joined #perl6
13:42 lichtkind so what i have to do to include math:matrix into math section
13:42 moritz lichtkind: you can put tags into the meta file
13:42 moritz or your module
13:42 ckraniak joined #perl6
13:43 moritz lichtkind: https://perl6.party/post/Tag-Your-Dists
13:44 dakkar joined #perl6
13:50 lichtkind thanks
13:52 dakkar joined #perl6
13:53 vichib joined #perl6
13:59 travis-ci joined #perl6
13:59 travis-ci Doc build errored. Zoffix Znet 'Clarify interaction between :D and optional params
13:59 travis-ci https://travis-ci.org/perl6/doc/builds/326805393 https://github.com/perl6/doc/compare/64cbf77584cb...3796780fb883
13:59 travis-ci left #perl6
13:59 buggable [travis build above] ✓ All failures are due to: timeout (1 failure).
14:03 cdg joined #perl6
14:08 domidumont joined #perl6
14:14 cdg joined #perl6
14:15 cdg joined #perl6
14:16 cdc joined #perl6
14:17 torbjorn regarding my xrandr output grammar - I used token TOP { <screen><monitor>* } to parse for the screen definition and any monitor definitions under it. which is nice and all. however would it be perhaps better to use <monitors> and let a rule/token define <monitor>* , that way I could easily have monitors make only connected monitors, which is what Im really after
14:17 torbjorn or I could make that in TOP I suppose
14:18 cdc Hello #perl6, about FOSDEM2018, this presentation doesn't make any sense: https://fosdem.org/2018/schedule/event/perl6_extending_disco_era_crypto/
14:19 cdc it seems to be written by a troll/bot
14:19 ggoebel joined #perl6
14:19 committable6 joined #perl6
14:19 lizmat oops
14:20 jast looks like scigen
14:22 lizmat El_Che: ^^^
14:23 Thrush joined #perl6
14:24 jast no, it's too cohesive for scigen
14:24 Thrush I'm trying to figure out how to do Perl 5's "my @textFiles = <*.txt>;" in Perl 6.  I googled, but I couldn't find a way to do filename globbing in Perl 6.
14:24 timotimo you'll probably want to use the dir sub
14:24 timotimo https://docs.perl6.org/routine/dir
14:25 jast seems to promise something that I don't think exists outside of quantum links, though
14:26 jast so any practical relevance is doubtful :)
14:27 timotimo i wonder how the exploding japanese nuclear reactor factors in
14:28 jast it does seem a little too jargon-babble-y, too
14:28 timotimo does "disco-era" refer to "the time when disco music & dancing was popular"?
14:29 jast possibly refers to stuff like libdisco
14:32 silug joined #perl6
14:36 Aaronepower joined #perl6
14:36 pmurias cdc: I sometimes feel the same way reading through the jargon filed unicode documents
14:38 Thrush Is there a way to do Perl 5's "my @textFiles = <*.txt>;" in Perl 6?
14:40 perlpilot Thrush: IO::Glob probably  (it's not built-in)
14:41 perlpilot http://modules.perl6.org/search/?q=glob
14:43 jast there's also anything like: dir(test => /\.txt$/)
14:43 * perlpilot can't tell if Thrush rejected timotimo's suggestion to use dir or just didn't see it.
14:44 jast I didn't see it, either, too busy picking apart the strange FOSDEM abstract :)
14:45 Thrush Perlpilot:  Oh, I thought what timotimo wrote about dir() was part of another conversation.
14:46 perlpilot Thrush: ah, no.  dir() is built-in that can *kinda* act like glob, but with regex and other stuff instead of the normal shell globbing syntax.
14:46 Thrush Still, can dir() use wildcards as directories, like "<*/*.txt>" in Perl 5 can?
14:46 perlpilot Thrush: See jast's example
14:47 perlpilot Thrush: oh, and that's where glob is "better" in some sense.
14:47 jast */* isn't gonna work like that, though, because dir() only returns direct children
14:48 Thrush Makes sense.
14:49 timotimo instead of just glob strings like in the shell, you can test with regex or with your own code
14:49 El_Che cdc: the speaker made travel arrangements already. I asked him to clarify the abstract.
14:49 timotimo for glob-compatible globbing, see IO::Glob
14:50 Thrush Here's a different question:  If I create a function that operates on, say, a string, and call it like this:  my $ersult = blah($string);  Is there any way to make it so that I can also call it like this:  my $result = $string.blah(); ?
14:50 epony joined #perl6
14:50 Thrush I'm unable to install IO::Glob with "zef fetch IO::Glob", unfortunately.
14:51 perlpilot Thrush: there's always a way; it's just about how much you want to "pay" to make what you want work.
14:51 Thrush (I'm using Windows.)
14:53 timotimo well, you can just $string.&blah() anyway
14:53 jast one way to do it is with <https://docs.perl6.org/syntax/augment>. not sure I'd *recommend* that, but it's *possible*. :)
14:54 perlpilot Thrush: the short of it is that the method version could be tricky.
14:56 scimon (Late for the party but I'd recommend Moritz's new book to anyone doing things with Grammars)
14:58 Zoffix joined #perl6
14:59 Zoffix Thrush: that's probably because you don't have git installed. You can either install it ( https://git-scm.com/download/win ) or go to http://modules.perl6.org/repo/IO::Blob and manually get a URL to ZIP of the repo and do zef install https://github.com/moznion/p6-IO-Blob/archive/master.zip
15:01 Zoffix Thrush: and along with the options others mentioned, there are `does` and `but` infix operators you can use to mixin into objects roles that provide methods that call your sub:
15:01 Zoffix m: sub blah { $^v.uc.flip }; my $string = "string" but role { method blah { blah self } }; $string.blah.say
15:01 camelia rakudo-moar ca4fcacaf: OUTPUT: «GNIRTS␤»
15:02 Zoffix Thrush: oops, I meant IO::Glob, not IO::Blob... zef install https://github.com/zostay/perl6-IO-Glob/archive/master.zip
15:03 Altreus Given that that URL is consistent and predictable, couldn't zef use it by default?
15:03 Altreus or as a fallback
15:03 perlpilot your given isn't given
15:03 Altreus alas
15:03 Altreus well that's what given means
15:03 Altreus :)
15:04 Altreus also now the word is weird
15:04 Altreus It sounds like a fey creature
15:05 Zoffix Altreus: I think it's a job for the p6c ecosystem generator... Some zoffix promised to add alternate URLs like a year ago but never did it..
15:05 zakharyas joined #perl6
15:05 Altreus can you chase him up on it :p
15:05 Thrush Running "zef install https://github.com/zostay/perl6-IO-Glob/archive/master.zip" resulted in:  No such method 'IO' for invocant of type 'Any' (and many more lines of errors).
15:06 Zoffix The code would go somewhere here: https://github.com/perl6/ecosystem/blob/master/server/updatelist.pl#L70-L79
15:06 Zoffix Thrush: what perl6 version are you using?
15:06 Altreus this is perl 5 :o
15:06 Zoffix Altreus: yeah :)
15:07 Altreus how odd
15:07 Altreus isn't that dead xD
15:07 Ven`` of course not
15:07 Ven`` it's a different language from Perl 6, contrarily to what may be obvious
15:07 Altreus I am aware
15:07 Altreus but you are not aware of that :)
15:08 Zoffix Thrush: perl6 -v
15:08 Thrush perl -v says:  This is Rakudo version 2017.07 built on MoarVM version 2017.07
15:08 * Zoffix tries installing
15:08 Altreus Ven``: it is a common joke in the perl5 community to keep repeating that it's dead ;)
15:09 Zoffix Thrush: can you pastebin the full output, along with the errors?
15:09 Ven`` Altreus: TIL :)
15:09 Altreus Ven``: if you can't beat 'em join 'em
15:09 Thrush Zoffix:  pastebin?  What's that?
15:09 * Ven`` came to Perl 6 from Ruby, and only learned Perl 5 afterwards.
15:10 Zoffix Thrush: copy-paste into a pastebin. Like https://gist.github.com/  copy the ouput, paste into the box on that page, click "Create secret gist" and when the new page loads gives us the URL of that page
15:10 jast a pastebin is a site to share pasted text, like an image upload site but for text
15:11 jast I run a tiny pastebin site that automatically clears submissions after ~1h
15:11 perlpilot Altreus: A few years ago, I told someone "Perl 5 is so dead is only has a conference somewhere in the world once a *month*"  (this was a year when it actually did have conferences or workshops or whatever for every month :)
15:11 lichtkind joined #perl6
15:12 Zoffix Thrush: I don't get your errors, but IO::Glob fails nearly all its tests on Windows :(
15:12 Thrush Like this?  :  https://gist.github.com/anonymous/665c5c239cb03a3302f809f57085de2c
15:13 Thrush I don't have github; is it a requirement for zef?
15:13 Zoffix Thrush: no, but many modules provide source URLs as git URLs and zef needs git to fetch those.
15:13 tadzik not at all :)
15:13 Zoffix Thrush: oh "github".. No, you don't need github, but having "git" is beneficial
15:14 cdc El_Che: ok, thanks.
15:14 Zoffix Thrush: "git" is a version control system; "github" is a popular site with "git" repositories
15:14 Thrush Could my problem be that I don't have "git"?
15:15 Zoffix Thrush: no, it's something else
15:16 * [Coke] wonders if a zef update is needed?
15:16 Zoffix Yeah, likely.. Wonder what's a good way, considering git isn't available
15:16 Zoffix Thrush: or you could just install git: https://git-scm.com/download/win
15:17 Zoffix Thrush: and then run:   cd \temp && git clone https://github.com/ugexe/zef.git && cd zef && perl6 -Ilib bin/zef --force install .
15:17 Zoffix Thrush: you could also try   zef update zef  and see what it says
15:19 Zoffix Thrush: but even with that solved, IO::Blob will likely fail. I filed an Issue with the author: https://github.com/zostay/perl6-IO-Glob/issues/7
15:22 Zoffix Man, Perl 6's Test::META6 is becoming Perl 5's Pod::Coverage. Users sticking it into user tests instead of author tests :(
15:23 Zoffix Thrush: you might make use of File::Find instead: https://github.com/tadzik/File-Find
15:23 natrys joined #perl6
15:24 Thrush zef update zef" results in:  An unknown plugin name used
15:25 Thrush "zef fetch https://github.com/tadzik/File-Find" gave me:  Failed to resolve any candidates. No reason to proceed
15:26 Zoffix Thrush: zef install File::Find
15:26 tadzik yay, my stuff :)
15:26 Zoffix or use ZIP URL https://github.com/tadzik/File-Find/archive/master.zip
15:27 Thrush Well, I gotta go now.  Thanks to all for all your help.
15:28 Zoffix Thrush: if all you need is `glob <*/*.txt>` you can use this monstrocity: my @glob = gather for ".", |dir.grep: *.d { .IO.dir.grep({.f and .extension eq "txt"})».take }; .say for @glob
15:29 Zoffix well, that'd be `glob <*.txt,*/*.txt>` toss `"."` to make it `<*/*.txt>`
15:29 Thrush Thanks, Zoffix.  I've done a lot of magic things with Perl 5 using <*/*/*/*.zip>, and I wouldn't mind having the same in Perl 6.
15:30 Thrush Anyway, I gotta go.  Thanks again.
15:30 Zoffix or this: my @glob = dir.grep(*.d)».dir.flat.grep: {.f and .extension eq "txt"}; .say for @glob
15:30 Zoffix Yeah, I guess that's what IO::Glob does. It just needs to be fixed for Windows
15:31 Zoffix (and you often need `use IO::Glob qw/bsd_glob/` for many usecases in perl 5 too; so that's just as much module loading)
15:34 Zoffix left #perl6
15:40 ctilmes joined #perl6
15:52 Altreus perlpilot: how often now? :P
15:57 eliasr joined #perl6
16:04 perlpilot Altreus: dunno.  It fluctuates with time and I'm not sure where to look anymore for the "official" calendar.  But we're still more than 4 or 5 conference-like events per year without even trying.  (I bet lizmat or woolfy could tell you precisely how many ;)
16:08 * perlpilot just wrote some perl 5 where the code was like:  if ($some->{long}{drawn}{out}{thing}) { do_something_with($some->{long}{drawn}{out}{thing}) }
16:08 Ven`` perlpilot: is `if (my $x = ...)` problematic?
16:09 Ven`` ugh I hate the freenode webchat
16:09 perlpilot just slightly annoying, not problematic.
16:09 perlpilot It's the little things where I wish Perl 5 was more like Perl 6
16:11 perlpilot especially when I'm in the middle of it.
16:11 squashable6 joined #perl6
16:12 perlpilot I didn't realize up front that I would need the long thing twice, but once I wrote it, the realization hit me, which means I had to stop and assign the result of the conditional to a var at some point.   That kind of thing interrupts the flow
16:13 perlpilot (once I wrote it once, I realized I'd need it again)
16:19 b2gills lowin: One person here has stated that they use Perl 6 for testing their C code (using NativeCall)
16:21 zakharyas joined #perl6
16:25 Phlogistique joined #perl6
16:31 khw joined #perl6
16:37 cdg joined #perl6
16:49 lowin b2gills, sounds doable (and not fun, because testing is never fun), Perhaps one day I'll be proficient in perl6 to do it myself too.
16:54 cdg joined #perl6
16:56 wamba joined #perl6
17:01 Altreus perlpilot: I was trying to shorten basically exactly that recently
17:08 AlexDaniel joined #perl6
17:12 ck joined #perl6
17:23 coverable6 joined #perl6
17:23 benchable6 joined #perl6
17:26 natrys joined #perl6
17:39 bisectable6 joined #perl6
17:43 zakharyas joined #perl6
17:48 |oLa| joined #perl6
17:49 margeas joined #perl6
17:57 El_Che AlexDaniel: I commented on the closed ticket giving it a thumbs up (in case close tickets don't send notifications)
17:57 AlexDaniel they do! Just received it :)
17:57 El_Che hehe
17:58 El_Che I forgot my keys, and now I am in the only sushi bar in my village: )
17:59 markong joined #perl6
18:08 dwarring joined #perl6
18:09 epony joined #perl6
18:11 epony joined #perl6
18:17 Aaronepower joined #perl6
18:19 zakharyas joined #perl6
18:24 tony-o digging the new modules.perl6.org
18:25 Aaronepower joined #perl6
18:27 [Coke] Zoffix++
18:27 [Coke] (think it was mostly zoffix)
18:32 natrys joined #perl6
18:48 Aaronepower joined #perl6
19:09 cdg joined #perl6
19:17 |oLa| left #perl6
19:17 Possum joined #perl6
19:21 Aaronepower joined #perl6
19:26 setty1 joined #perl6
19:29 kerframil joined #perl6
19:37 Aaronepower joined #perl6
19:38 TreyHarris joined #perl6
19:39 greppable6 joined #perl6
19:39 Zoffix joined #perl6
19:39 Zoffix m: use nqp; my $eval_ctx := nqp::getattr(CALLER::, PseudoStash, '$!ctx'); my $compiled := nqp::getcomp('perl6').compile('*+*', :outer_ctx($eval_ctx), :mast_frames(nqp::hash),    :target('optimize')); nqp::forceouterctx(nqp::getattr($compiled, ForeignCode, '$!do'), $eval_ctx); say $compiled()
19:39 camelia rakudo-moar 6709166f3: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "+" in expression "*+*" in sink context (line 1)␤===SORRY!===␤compunitmainline requires an MVMCompUnit␤»
19:40 Zoffix Any idea how to make it happy? It's `:target('optimize')` that causes the crash... I wanna take a peek at the ASTs of the code somehow
19:40 Zoffix (mostly curious why the wantedness doesn't propagate to WhateverCode, despite propagating to other evaled things)
19:43 Aaronepower joined #perl6
19:53 Aaronepower joined #perl6
19:53 Zoffix m: use nqp; my $eval_ctx := nqp::getattr(CALLER::, PseudoStash, '$!ctx'); my $compiled := nqp::getcomp('perl6').compile( '*+*', :compunit_ok, :outer_ctx($eval_ctx), :mast_frames(nqp::hash), :target('optimize')); say $compiled.dump;
19:53 camelia rakudo-moar 6709166f3: OUTPUT: «WARNINGS for <tmp>:␤- QAST::CompUnit  :W<?> :UNIT<?>␤  [post_deserialize]␤    - QAST::Stmts ␤      - QAST::Op(bind) ␤        - QAST::Var(attribute $!do) ␤          - QAST::WVal(WhateverCode) ␤          - QAST::WVal(Code) ␤        - QAS…»
19:54 Zoffix `:compunit_ok` is the trick
19:54 Zoffix Makes it bail out instead of doing things: https://github.com/perl6/nqp/blob/master/src/HLL/Compiler.nqp#L503-L509
19:54 Zoffix left #perl6
20:02 DrForr Flight & Hotel booked for FOSDEM.
20:02 DrForr I'll be there Thursday evening, probably at Delirium around 8pm if anyone's going to be there.
20:05 Aaronepower joined #perl6
20:12 Aaronepower joined #perl6
20:32 jam__ joined #perl6
20:35 jam__ I'm trying to write a declarative language interpreted with grammars. I know I can write a grammar (with an associative actions class) for specific things like parsing a variable definition or parsing a function call. But how would I merge all these grammars together so that I end up with a collective AST from my matches? Would anyone know were to point me documentation-wise?
20:36 wamba joined #perl6
20:36 ckraniak joined #perl6
20:38 buggable New CPAN upload: PDF-Class-0.0.5.tar.gz by WARRINGD https://cpan.metacpan.org/authors/id/W/WA/WARRINGD/Perl6/PDF-Class-0.0.5.tar.gz
20:41 timotimo https://crystal-lang.org/2015/04/01/auto.html - junior project: implement this feature in rakudo :D
20:46 perlpilot cute
20:46 TEttinger joined #perl6
20:47 ck joined #perl6
20:48 brrt joined #perl6
20:49 jam__ joined #perl6
20:52 jam__ joined #perl6
20:52 jam__ just asked this question and closed the browser. Pasting it one more time: I'm trying to write a declarative language interpreted with grammars. I know I can write a grammar (with an associative actions class) for specific things like parsing a variable definition or parsing a function call. But how would I merge all these grammars together so that I end up with a collective AST from my matches? Would anyone know were to point me document
20:53 pilne joined #perl6
20:53 Voldenet joined #perl6
20:53 Voldenet joined #perl6
20:53 perlpilot jam__: glad you're back  :-)
20:53 timotimo jam__: personally, i'd probably compose one grammar and one action class together using multiple roles if i want the grammar to be split up into sections
20:53 DrForr Well, I can't advise you specifically, but theperlfisher.blogspot.ro has several grammar tutorials that might help. (full disclosure: they're my articles.)
20:54 DrForr And yes, roles do help quite a bit.
20:55 jam__ I know, my presence was missed :'( ah thank you guys, this helps
20:55 perlpilot jam__: and then there's moritz++'s book on grammars https://smile.amazon.com/Parsing-Perl-Regexes-Grammars-Recursive-ebook/dp/B0785L6WR6  that might help you doo
20:55 jam__ I'll check out all of those. Just exploring different ways of parsing the language first. Usually a python guy, but it just doesn't compare to perl6 for this sort of thing
20:56 timotimo i think if you call into another grammar's regexes there's no way to say "and use this other action class with those"
20:56 jam__ cool cool
20:57 perlpilot timotimo: saying that there's "no way" to do something in Perl is inviting someone to prove you wrong  :-)
20:57 moritz you could call .subparse on the other grammar, and supply a custom actions object
20:57 moritz though subparse has no :pos argument :(
20:58 moritz might be a worthy addition
20:58 timotimo yeah, could be
20:58 timotimo and you'd have to do a bit of fiddling when the subparse returns to give a correctly placed cursor back to continue work
20:58 timotimo and i can imagine cross-grammar backtracking to be really slow with that kind of setup :D
20:59 DrForr drforr/perl6-Pod-To-HTMLBody now has a tree creation module and a reasonably small subclassable shim generating HTML.
20:59 evalable6 joined #perl6
21:00 moritz jam__: another option is to use roles for the separate sublanguages, and compose them into a single grammar
21:00 moritz that way, you can avoid crossing grammar boundaries, which is not really well documented
21:00 DrForr jam__: Also if yu do the conference thing c'mon down to FOSDEM, the last talk is on a similar subject.
21:03 jam__ @moritz I'm checking roles out now actually, let's see if I can get this :) yeah definitely, it's coming up here pretty soon
21:04 DrForr Yep. I just booked my flight/hotel.
21:05 DrForr (further disclaimer - I'm the last speaker :) )
21:07 jam__ oh snap, well good luck man. be sure to live stream it on 7 different social media platforms
21:08 jam__ best way to go viral :)
21:12 cdg joined #perl6
21:14 cdg joined #perl6
21:16 brrt ooh, is the schedule published already?
21:16 troys joined #perl6
21:17 brrt i like how it is called perl programming languages with a plural s
21:20 Ven`` joined #perl6
21:24 perlpilot well, you know that there are many perls now
21:26 perlpilot someone could a really nice lightning talk on just that.
21:27 perlpilot or perhaps a longer talk that "positions" the perls so that people who would encounter them know if they are useful or relavant to their problems.
21:46 tomaw joined #perl6
21:50 grumble joined #perl6
21:55 cdg_ joined #perl6
22:14 dct joined #perl6
22:23 brrt joined #perl6
22:27 riceandb1ans joined #perl6
22:29 Grauwolf joined #perl6
22:29 Grauwolf joined #perl6
22:29 TimToady joined #perl6
22:32 releasable6 joined #perl6
22:32 statisfiable6 joined #perl6
22:32 reportable6 joined #perl6
23:03 espadrine joined #perl6
23:14 Manifest0 joined #perl6
23:23 margeas joined #perl6
23:26 markong joined #perl6
23:29 comborico1611 joined #perl6
23:36 lelf joined #perl6
23:45 margeas joined #perl6
23:50 lelf Hey. I need to know if a dynamic library contains certain symbol (say, function). Any sane way to know this without calling the said function?
23:52 perigrin joined #perl6
23:54 mspo nm?

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

Perl 6 | Reference Documentation | Rakudo