»ö« 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.
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
Really strange. The book is like in perfect new condition. Yet it reeks.
geekosaur sounds/smells very undergrad dorm >.> 01:14
tusooa lol
comborico1611 Heh
Every turn of the page is like a squirt of the cologne bottle. 01:15
Good thing this book doesn't look very promising.
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
Zoffix If several tokens of a single proto regex can match the text, what are the rules for which one gets chosen? 01:34
For example, both of these can match `- QAST::Var(lexical $limit :decl(var))` github.com/zoffixznet/q/blob/maste...m6#L13-L14 01:36
And :sym<qast> wins now, but if I change that to <name=ident> then :sym<misc> is used. What causes the switch?
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.
Zoffix My next question is: if two alernations match the same length, which one is used
"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
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.)"
So what does that mean to mere mortals? I'd figure "'- QAST::'" is a "fixed string" and would win over \N+ 01:41
`'- QAST::' $<name>=[a..zA..Z]+ $<rest>=\N+` seems to lose to \N+ 01:42
TimToady not if \N+ is longer 01:43
generally if you're gonna write a \N+ kind of rule, you should stop LTM before it
Zoffix They should match the same length here: github.com/zoffixznet/q/blob/maste...m6#L13-L14
And there :sym<qast> wins, but if I change $<name>=\S+ to [a..zA..Z]+ then it loses 01:44
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
maybe that's what's going on here
TimToady except that seems backwards to what you're seeing 01:48
Zoffix Oh, it needs to be $<name>=<[a..zA..Z]>+ 01:49
Zoffix But, the <name=ident> version still doesn't match like I want 01:50
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"}; })
camelia misc
TimToady but in any case, treating the entire line as a token is generally suboptimal
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 「QASTmeow♥」
name => 「meow」
ident => 「meow」
rest => 「♥」
Zoffix Ah. Thanks 01:57
TimToady at a guess, the ident rule is terminating LTM somehow 01:57
at a guess, the ident rule is terminating LTM somehow 01:58
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"}; })
camelia 「QASTmeow ♥」
name => 「meow」
ident => 「meow」
rest => 「 ♥」
TimToady hmm, it's not eating ws anyway...
the other \N+ probably wants the same treatment too, otherwise you're just wasting NFA cycles 02:01
Zoffix OK. Thanks
comborico1611 Off to bed. 02:03
Zoffix \o
comborico1611 o/
Geth perl6-examples: ryn1x++ created pull request #52:
Add Windows clear screen example
04:25
Geth perl6-examples: d29719a785 | ryn1x++ | 2 files
added windows example
05:08
perl6-examples: 86b49e8a85 | ryn1x++ (committed using GitHub Web editor) | categories/cookbook/15interactivity/15-03-clear-screen.pl~
Delete 15-03-clear-screen.pl~
perl6-examples: 1b0d45ae7a | (Zoffix Znet)++ (committed using GitHub Web editor) | categories/cookbook/15interactivity/15-03-clear-screen.pl
Merge pull request #52 from ryn1x/master

Add Windows clear screen example
lizmat Zoffix: errata applied 08:32
lizmat clickbaits p6weekly.wordpress.com/2018/01/08/...m-nearing/ 08:33
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
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:06
lizmat lowin: you might want to check 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.
lizmat PackUnpack you mean ?
DrForr Thank you, yes. 09:08
lizmat which reminds me, I need to push that to CPAN
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:09
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.
lizmat lowin: re forward compatibility is well on our radar
the "use" statement allows you to specify a version of a module to load
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
El_Che lowin: if you don't want change use C89 :) 09:50
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
El_Che lowin: I agree, my point is that a compiled languages has advantages in the "do-not-change" department 09:52
lowin: however, perl6 has many backward compatible features (like the "use version" lizmat mentioned) 09:53
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.
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)
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
jast hey, let's fork Perl 6 and call the result Python 4, for improved clarity 09:57
lichtkind cheers 09:58
how do i include a module in a category on modules.perl6.org? thanks
El_Che jast: perl6 foresees multiple implementations :)
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:00
jast jam__: foo>>.bar means, apply the bar method to all members of foo 10:01
jam__ nice jast ty
jast >> is an operator on an operator, a hyper operator
docs.perl6.org/language/operators#..._Operators 10:02
lichtkind yes but ops on ops are called meta ops, << is a special meta op called hyper
jam__ there's an operator for everything :]
thanks for the link
jast there are multiple hyper operators 10:03
lichtkind perl was always an operator oriented language :) 10:03
jast syntax-oriented, in fact
lichtkind or in short oo :)
jast I love me some syntax
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:17
scimon (Now I have to tag my modules...) 10:20
jnthn Yes, that's where the tags show up 10:21
DrForr scimon: Look around for a t/meta.t test file as well, that helps keep things organized. 10:22
jnthn But if writing one, please put it in xt, not in t 10:24
scimon Any doc's on meta.t ? (First I've heard of it) 10:26
DrForr Not especially, it just runs Test::META that checks your META6.json file for formatting and potential infelicities. 10:27
scimon Ah.
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:28
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:29
scimon As I need something like that for the bigger plan which is to start work on WWW::Mechanize. 10:31
El_Che lizmat, AlexDaniel`: I am getting a idea why buggable test passed and the ones on the released tar aren't 10:37
AlexDaniel` El_Che: what is it? 10:53
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:13
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: github.com/zoffixznet/z/blob/maste...#L204-L222 11:24
Zoffix RE: 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:27
El_Che Zoffix: do you use the release tars of git commits? 11:34
Zoffix El_Che: git commits. 11:44
and looks like release tarballs would just contains a tar of git ls-files: github.com/rakudo/rakudo/blob/mast...#L312-L325 11:46
so I'm dubious the problems you're seeing is due to that
El_Che ok, it is as I suspected 12:12
El_Che I'll update the bug 12:12
Geth doc: 3796780fb8 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Signature.pod6
Clarify interaction between :D and optional params

  - Include examples and clarify typecheck explosion
  - Remove "passed", since that implies[^1] typecheck
   does not apply to optional params
  - Reword "undefined", since there's a difference between
   .defined and .DEFINITE
  [1] stackoverflow.com/questions/481663...it-a-requi
13:08
synopsebot Link: doc.perl6.org/type/Signature
doc: b794a73e66 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Signature.pod6
Fix default default for optional params

Blocks actually default to Mu not Any
13:11
torbjorn should I include \n when writing grammars to mark the end of line? 13:34
Im trying to parse this: paste.fedoraproject.org/paste/UU01...88sRDigHyQ
jnthn You'll need something that eats the newline char, yes 13:35
\n will do it
moritz torbjorn: yes
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
masak $$ and \n are two fairly different things, though :)
(like moritz said)
torbjorn I see the distinction
which explained why my use of ^ does not work , I need ^^ further down, thanks
masak torbjorn: I would *warmly* recommend evolving a grammar alongside a test suite 13:37
torbjorn how does one do that? 13:38
like any other perl6 module test suite i suppose
jast yes :)
masak yes, one with exercises the grammar's .parse method
and negative tests ("this shouldn't parse") are just as important as positive ones ("this parses") 13:39
moritz may I warmly recommend smile.amazon.com/Parsing-Perl-Rege...B0785L6WR6 ? 13:39
I'm biased, but the reviews are very positive so far as well :-)
masak moritz++ # I should've thought of suggesting that :)
moritz (and yes, that also talks about testing grammars, and has worked examples)
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!
moritz </ad> 13:40
lichtkind is the modules index hand crafted? 13:41
moritz it's even organic!
lichtkind: the software behind it is
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
or your module
moritz lichtkind: perl6.party/post/Tag-Your-Dists 13:43
lichtkind thanks 13:50
travis-ci Doc build errored. Zoffix Znet 'Clarify interaction between :D and optional params 13:59
travis-ci.org/perl6/doc/builds/326805393 github.com/perl6/doc/compare/64cbf...96780fb883
buggable [travis build above] ✓ All failures are due to: timeout (1 failure). 13:59
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
or I could make that in TOP I suppose
cdc Hello #perl6, about FOSDEM2018, this presentation doesn't make any sense: fosdem.org/2018/schedule/event/per...ra_crypto/ 14:18
it seems to be written by a troll/bot 14:19
lizmat oops 14:19
jast looks like scigen 14:20
lizmat El_Che: ^^^ 14:22
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.
timotimo you'll probably want to use the dir sub
docs.perl6.org/routine/dir
jast seems to promise something that I don't think exists outside of quantum links, though 14:25
so any practical relevance is doubtful :) 14:26
timotimo i wonder how the exploding japanese nuclear reactor factors in 14:27
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"?
jast possibly refers to stuff like libdisco 14:29
pmurias cdc: I sometimes feel the same way reading through the jargon filed unicode documents 14:36
Thrush Is there a way to do Perl 5's "my @textFiles = <*.txt>;" in Perl 6? 14:38
perlpilot Thrush: IO::Glob probably (it's not built-in) 14:40
modules.perl6.org/search/?q=glob 14:41
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.
jast I didn't see it, either, too busy picking apart the strange FOSDEM abstract :) 14:44
Thrush Perlpilot: Oh, I thought what timotimo wrote about dir() was part of another conversation. 14:45
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?
perlpilot Thrush: See jast's example
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
Thrush Makes sense. 14:48
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.
timotimo for glob-compatible globbing, see IO::Glob
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
Thrush I'm unable to install IO::Glob with "zef fetch IO::Glob", unfortunately. 14:50
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.)
timotimo well, you can just $string.&blah() anyway 14:53
jast one way to do it is with <docs.perl6.org/syntax/augment>. not sure I'd *recommend* that, but it's *possible*. :)
perlpilot Thrush: the short of it is that the method version could be tricky. 14:54
scimon (Late for the party but I'd recommend Moritz's new book to anyone doing things with Grammars) 14:56
Zoffix Thrush: that's probably because you don't have git installed. You can either install it ( git-scm.com/download/win ) or go to modules.perl6.org/repo/IO::Blob and manually get a URL to ZIP of the repo and do zef install github.com/moznion/p6-IO-Blob/arch...master.zip 14:59
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
m: sub blah { $^v.uc.flip }; my $string = "string" but role { method blah { blah self } }; $string.blah.say
camelia GNIRTS
Zoffix Thrush: oops, I meant IO::Glob, not IO::Blob... zef install github.com/zostay/perl6-IO-Glob/ar...master.zip 15:02
Altreus Given that that URL is consistent and predictable, couldn't zef use it by default? 15:03
or as a fallback
perlpilot your given isn't given
Altreus alas
well that's what given means
:)
also now the word is weird 15:04
It sounds like a fey creature
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
Altreus can you chase him up on it :p 15:05
Thrush Running "zef install github.com/zostay/perl6-IO-Glob/ar...aster.zip" resulted in: No such method 'IO' for invocant of type 'Any' (and many more lines of errors).
Zoffix The code would go somewhere here: github.com/perl6/ecosystem/blob/ma...pl#L70-L79 15:06
Thrush: what perl6 version are you using?
Altreus this is perl 5 :o
Zoffix Altreus: yeah :)
Altreus how odd 15:07
isn't that dead xD
Ven`` of course not
it's a different language from Perl 6, contrarily to what may be obvious
Altreus I am aware
but you are not aware of that :)
Zoffix Thrush: perl6 -v 15:08
Thrush perl -v says: This is Rakudo version 2017.07 built on MoarVM version 2017.07
Zoffix tries installing
Altreus Ven``: it is a common joke in the perl5 community to keep repeating that it's dead ;)
Zoffix Thrush: can you pastebin the full output, along with the errors? 15:09
Ven`` Altreus: TIL :)
Altreus Ven``: if you can't beat 'em join 'em 15:09
Thrush Zoffix: pastebin? What's that?
Ven`` came to Perl 6 from Ruby, and only learned Perl 5 afterwards.
Zoffix Thrush: copy-paste into a pastebin. Like 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
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 :)
Zoffix Thrush: I don't get your errors, but IO::Glob fails nearly all its tests on Windows :( 15:12
Thrush Like this? : gist.github.com/anonymous/665c5c23...f57085de2c
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.
tadzik not at all :)
Zoffix Thrush: oh "github".. No, you don't need github, but having "git" is beneficial
cdc El_Che: ok, thanks. 15:14
Zoffix Thrush: "git" is a version control system; "github" is a popular site with "git" repositories
Thrush Could my problem be that I don't have "git"?
Zoffix Thrush: no, it's something else 15:15
[Coke] wonders if a zef update is needed? 15:16
Zoffix Yeah, likely.. Wonder what's a good way, considering git isn't available
Thrush: or you could just install git: git-scm.com/download/win
Thrush: and then run: cd \temp && git clone github.com/ugexe/zef.git && cd zef && perl6 -Ilib bin/zef --force install . 15:17
Thrush: you could also try zef update zef and see what it says
Thrush: but even with that solved, IO::Blob will likely fail. I filed an Issue with the author: github.com/zostay/perl6-IO-Glob/issues/7 15:19
Man, Perl 6's Test::META6 is becoming Perl 5's Pod::Coverage. Users sticking it into user tests instead of author tests :( 15:22
Zoffix Thrush: you might make use of File::Find instead: github.com/tadzik/File-Find 15:23
Thrush zef update zef" results in: An unknown plugin name used 15:24
Thrush "zef fetch github.com/tadzik/File-Find" gave me: Failed to resolve any candidates. No reason to proceed 15:25
Zoffix Thrush: zef install File::Find 15:26
tadzik yay, my stuff :)
Zoffix or use ZIP URL github.com/tadzik/File-Find/archive/master.zip
Thrush Well, I gotta go now. Thanks to all for all your help. 15:27
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:28
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.
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
Yeah, I guess that's what IO::Glob does. It just needs to be fixed for Windows
(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:31
Altreus perlpilot: how often now? :P 15:52
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:04
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?
ugh I hate the freenode webchat 16:09
perlpilot just slightly annoying, not problematic.
It's the little things where I wish Perl 5 was more like Perl 6
especially when I'm in the middle of it. 16:11
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:12
(once I wrote it once, I realized I'd need it again) 16:13
b2gills lowin: One person here has stated that they use Perl 6 for testing their C code (using NativeCall) 16:19
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:49
Altreus perlpilot: I was trying to shorten basically exactly that recently 17:01
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 :)
El_Che hehe
I forgot my keys, and now I am in the only sushi bar in my village: ) 17:58
tony-o digging the new modules.perl6.org 18:24
[Coke] Zoffix++ 18:27
(think it was mostly zoffix)
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 WARNINGS for <tmp>:
Useless use of "+" in expression "*+*" in sink context (line 1)
===SORRY!===
compunitmainline requires an MVMCompUnit
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:40
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 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…
Zoffix `:compunit_ok` is the trick 19:54
Makes it bail out instead of doing things: github.com/perl6/nqp/blob/master/s...#L503-L509
DrForr Flight & Hotel booked for FOSDEM. 20:02
I'll be there Thursday evening, probably at Delirium around 8pm if anyone's going to be there.
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:35
buggable New CPAN upload: PDF-Class-0.0.5.tar.gz by WARRINGD cpan.metacpan.org/authors/id/W/WA/...0.5.tar.gz 20:38
timotimo crystal-lang.org/2015/04/01/auto.html - junior project: implement this feature in rakudo :D 20:41
perlpilot cute 20:46
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 documenta 20:52
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
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.)
And yes, roles do help quite a bit. 20:54
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 smile.amazon.com/Parsing-Perl-Rege...B0785L6WR6 that might help you doo
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
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"
jam__ cool cool 20:56
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
though subparse has no :pos argument :(
might be a worthy addition 20:58
timotimo yeah, could be
and you'd have to do a bit of fiddling when the subparse returns to give a correctly placed cursor back to continue work
and i can imagine cross-grammar backtracking to be really slow with that kind of setup :D
DrForr drforr/perl6-Pod-To-HTMLBody now has a tree creation module and a reasonably small subclassable shim generating HTML. 20:59
moritz jam__: another option is to use roles for the separate sublanguages, and compose them into a single grammar 21:00
that way, you can avoid crossing grammar boundaries, which is not really well documented
DrForr jam__: Also if yu do the conference thing c'mon down to FOSDEM, the last talk is on a similar subject.
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:03
DrForr Yep. I just booked my flight/hotel. 21:04
(further disclaimer - I'm the last speaker :) ) 21:05
jam__ oh snap, well good luck man. be sure to live stream it on 7 different social media platforms 21:07
best way to go viral :) 21:08
brrt ooh, is the schedule published already? 21:16
brrt i like how it is called perl programming languages with a plural s 21:17
perlpilot well, you know that there are many perls now 21:24
someone could a really nice lightning talk on just that. 21:26
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:27
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:50
mspo nm? 23:54