»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
Xliff m: my ($x, $y) = CArray[num64] xx 2; for ^10 { my gdouble ($x, $y) = 1.Num xx 2; $x[$_] = $x; $y[$_] = $y; }; 01:03
camelia 5===SORRY!5===
Type 'gdouble' is not declared
at <tmp>:1
------> 3CArray[num64] xx 2; for ^10 { my gdouble7⏏5 ($x, $y) = 1.Num xx 2; $x[$_] = $x; $y[
Malformed my
at <tmp>:1
------> 3, $y) = CArray[num64] xx 2; for ^10 { my7⏏…
Xliff m: my ($x, $y) = CArray[num64] xx 2; for ^10 { my num64 ($x, $y) = 1.Num xx 2; $x[$_] = $x; $y[$_] = $y; };
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
CArray used at line 1. Did you mean 'Array', 'array'?
Xliff m: use NativeCall; my ($x, $y) = CArray[num64] xx 2; for ^10 { my num64 ($x, $y) = 1.Num xx 2; $x[$_] = $x; $y[$_] = $y; };
camelia Cannot modify an immutable Num (1)
in block <unit> at <tmp> line 1
Xliff ^^ WTF??
timotimo how about a .new? 01:04
Xliff /o\
m: use NativeCall; my ($x, $y) = CArray[num64].new xx 2; for ^10 { my num64 ($x, $y) = 1.Num xx 2; $x[$_] = $x; $y[$_] = $y; };
camelia Cannot modify an immutable Num (1)
in block <unit> at <tmp> line 1
Xliff Or not?
timotimo oh, why would you try to change $x[$_] inside the loop?
those are just num64 values?
Xliff m: use NativeCall; my ($x, $y) = CArray[num64].new xx 2; for ^10 { my num64 ($xx, $yy) = 1.Num xx 2; $x[$_] = $xx; $y[$_] = $yy; }; 01:05
camelia ( no output )
Xliff m: use NativeCall; my ($x, $y) = CArray[num64].new xx 2; for ^10 { my num64 ($xx, $yy) = 1.Num xx 2; $x[$_] = $xx; $y[$_] = $yy; }; say $x.REPR
camelia CArray
holyghost hi 03:20
javan I already found how to access the DOM, are there any samples/examples how to interop perl6 to js libraries 03:40
Xliff javan: What do you mean? 04:18
SmokeMachine Isn't `modules.perl6.org` being refreshed? I've uploaded a new module yesterday (Cro::HTTP::Session::Red) and it's not there yet (modules.perl6.org/search/?q=Cro%3A...%3A%3ARed) 07:45
lizmat timotimo did a manual refresh the other day... not sure why that doesn't happen automatically 07:51
moritz probably because it's still running on provisional infra 07:54
ufobat_ manual tasks, badness factor of 10! 08:12
moritz kinda reminds of me latex log output with "hbox overflow, badness 1000" or so :D 08:32
pmurias .tell javan you mean from rakudo.js or from moar? 08:48
yoleaux pmurias: I'll pass your message to javan.
sena_kun github.com/rakudo/rakudo/issues/2862 <- this ticket can be closed 09:47
moritz nope, needs a test first 09:48
sena_kun moritz, it has a test, no?
argh, sorry
where I was looking. :| 09:49
sena_kun tries to write a test 09:52
sena_kun successfully built all the needed stuff and wrote a test 10:47
Geth doc: lukasvalle++ created pull request #2794:
Example for the "hyper for" and the "race for" statements.
14:14
robertle is there a way I can 'use' a class/module from rakudo itself in my perl 6 program? for example, can I use Perl6::Grammar to parse a piece of perl into an AST of sorts? 14:18
robertle or taking a step back, how can I 'use' stuff from a nqp file in perl6? 14:36
vrurg robertle: You don't need to 'use' it, its already at your hands. 14:38
vrurg robertle: $*LANG would give you a grammar instanse, for example. 14:39
robertle m: $*LANG.WHAT 14:41
camelia ( no output )
robertle m: say $*LANG.WHAT
camelia (Failure)
Geth doc: 46f4f1369f | Altai-man++ (committed using GitHub Web editor) | doc/Language/control.pod6
Move links from anchors to a section header

Previously, there was an odd text e.g. "with orwith without", apparently added to serve as a search anchor. Luckily, we can just inline anchors into the appropriate section header and have a cleaner text on the actual page, preserving the search results.
14:42
synopsebot Link: doc.perl6.org/language/control
vrurg robertle: BEGIN say $*LANG.^name 14:43
m: BEGIN say $*LANG.^name
camelia Perl6::Grammar
SmokeMachine m: use Perl6::Grammar:from<nqp>; say Perl6::Grammar
camelia ===SORRY!===
Could not find Perl6::Grammar at line 1 in:
inst#/home/camelia/.perl6
inst#/home/camelia/rakudo-m-inst-1/share/perl6/site
inst#/home/camelia/rakudo-m-inst-1/share/perl6/vendor
inst#/home/camelia/rakudo-m-inst-1/s…
SmokeMachine m: use Perl6::Grammar:from<nqp>; say Perl6::Grammar.^name
camelia ===SORRY!===
Could not find Perl6::Grammar at line 1 in:
inst#/home/camelia/.perl6
inst#/home/camelia/rakudo-m-inst-1/share/perl6/site
inst#/home/camelia/rakudo-m-inst-1/share/perl6/vendor
inst#/home/camelia/rakudo-m-inst-1/s…
vrurg SmokeMachine: Perl6 prefix is not needed. 14:44
SmokeMachine use Perl6::Grammar:from<NQP>; say Perl6::Grammar.^name
evalable6 Perl6::Grammar
SmokeMachine vrurg: Hi!!! I was wondering about your last Red issue... 14:45
robertle awesome, the thing I was originally wondering about was that :from<NQP> 14:46
but it's also interesting that the BEGIN phaser changes things:
m: BEGIN say $*LANG.^name 14:47
camelia Perl6::Grammar
robertle m: say $*LANG.^name
camelia Failure
robertle why is that?
SmokeMachine vrurg: I think I'll make Metamodel::Red::Dirtable store the original value of the attribute... so on update it could try to use the id's original value, and if it's not set use the actual value... 14:48
vrurg SmokeMachine: It could be fixed with some work I haven't done yet. It needed .e language spec to be available.
vrurg Oops, you mean not the last one, but before the last? #159? 14:49
SmokeMachine vrurg: what do you think about it?
SmokeMachine vrurg: Oh! sorry!!! yes... #159± 14:49
s/±/!/ 14:50
vrurg SmokeMachine: not getting into details (no idea about ::Dirtable and how it works, though understand the purpose) but basically it's perhaps the only way to do it.
The old value has to be kept around for WHERE caluse. 14:51
SmokeMachine vrurg: another option would do that only for ids...
vrurg I'm more worried about threading matters. This is where the real can of worms is hiding.
SmokeMachine (the ::Dirtable is the way Red knows what was changed... that way it uses only what was changed on updates...) 14:52
vrurg SmokeMachine: as soon as ids are the only index objects – that's ok. I mean, whichever field can appear in WHERE is the subject for ::Dirtable. 14:53
SmokeMachine: unfortuantely, I might not be of much help is some near future. Time to roll back the stack of problems I was trying to fix in rakudo. :) 14:55
SmokeMachine vrurg: a few time ago, me and jonathanstowe has fixed some breaks that were "fixed" with `no precompilation` on Red... I think this one must be fixed the same way (I hope...)
vrurg have to run now. Breakfast time...
vrurg SmokeMachine: Something I wasn't been able to fix even with `no precompilation`. But don't remember what was it. The problem with operators and threads could be fixed with a subset fix I almost have on my hands. But future will show. 14:57
SmokeMachine vrurg: Thanks! and sorry for not fixing the issues yet... my wife's brother has passed away and she is needing me... so I am not finding time to fix bugs currently...
Geth doc/master: 4 commits pushed by lukasvalle++, Altai-man++ 15:22
vrurg SmokeMachine: oh, so sorry to hear that! 16:15
sena_kun SmokeMachine, take care. 16:23
Xliff jnthn: How would you write the following test with "is": "ok $a <= 2, 'This is acceptable'" 17:43
timotimo Xliff: i would use "cmp-ok" 17:43
otherwise, since "is" uses string equivalence .. don't use "is" :)
i might actually suggest cmp-ok with ~~ and a Range literal, tbh 17:44
m: use Test; cmp-ok 1, *..2, "it fits"
camelia not ok 1 -
# Failed test at <tmp> line 1
# Could not use '-Inf..2' as a comparator. If you are trying to use a meta operator, pass it as a Callable instead of a string: &[*..2]
timotimo m: use Test; cmp-ok 1, "~~", *..2, "it fits"
camelia ok 1 - it fits
timotimo m: use Test; for ^10 { cmp-ok $_, "~~", *..2, "it fits" }
camelia ok 1 - it fits
ok 2 - it fits
ok 3 - it fits
not ok 4 - it fits
# Failed test 'it fits'
# at <tmp> line 1
# expected: -Inf..2
# matcher: 'infix:<~~>'
# got: 3
not ok 5 - it fits
# Failed test 'it fits'
# at <tmp> line 1
#…
jnthn Xliff: The tests good good now, but lib/Cro/HTTP/Client/CookieJar.pm6 still seems to be a bit off so far as indentation goes :) 18:16
Xliff jnthn: OK. I will look into the indentation, later. I've got errands to run, right now. Thanks for the comment. 18:19
Elronnd can someone explain why this grammar doesn't work properly? sprunge.us/XyucnO 18:41
I want to match an expression like 5 + 6d6 - 7d4
it works fine with only two atoms in the expression, like 5 + 6d6, but when I get up to 3, parsing returns Nil
tobs Elronnd: I have no explanation (yet) but after playing with it a little, I got something that does work sprunge.us/KfvUNr 18:54
sena_kun can anyone help me(a novice) with a little rakudo bug hunt? :) I wanted to look at some testneeded ticket, but github.com/rakudo/rakudo/issues/2901 looks not so hard, just need to know where to look. 18:55
s/ticket/tickets/
tobs Elronnd: I'm fairly sure it has something to do with <atom> recursing into <expr> and longest token matching 18:59
timotimo sena_kun: that looks interesting. your first step could be outputting the --target=ast and --target=optimize with one vs the other 19:06
that should give you some method calls that lead you to interesting code
though it could as well be that it directly compiles to moar bytecode (and what the other backends have) 19:07
sena_kun timotimo, thanks! trying that... 19:10
timotimo if the latter, you'll probably have to look at QASTRegexCompilerMAST at some point 19:12
sena_kun --optimize=0 does not change results, can I expect it isn't an optimizer? 19:13
timotimo usually. though --optimize=off is another valid setting that does a tiny bit different stuff, too
sena_kun ok, I see differences in ast output. let me some time to digest it firstly and think a bit... 19:14
timotimo the qast output is a bit easier to figure out with one of zoffix' tools, i think it's called Q 19:15
rakudo.party/post/Perl-6-Core-Hack...STalicious 19:16
hold on
tobs m: say 'a' ~~ / 'a' & 'a' / # maybe that can help you to narrow it down more
camelia 「a」
timotimo that's not the post that has the tool in it 19:16
github.com/perl6-community-modules/q 19:17
this is the tool i'm refering to. it's in the ecosystem, too
sena_kun well, it seems that the working one compiles into conjseq, and the broken on into concat 19:19
- QAST::Regex(:rxtype(conjseq) :subtype()) a && a
but
- QAST::Regex(:rxtype(concat) :subtype()) a & a
Elronnd tobs: ok, thanks!
sena_kun and it seems to think that `&` is an anon subrule, as it declares it `QAST::Var(lexical &ANON_VAR__1 :decl(statevar))` at the beginning of the Stmts block 19:20
now need to read the article for clues where this code is actually generated... 19:21
'a' & 'a' generates a conj too, but not `a & a` 19:23
robertle DrForr: you around? I am wondering if I can somehow use perl6-commonmark, but somehow intercept/transform certain parts before they are rendered? like e.g. syntax-highlighting a code block 19:24
Elronnd will I get crucified if I call it a pesl instead of a repl? 19:45
because really it's loop { say EVAL prompt } 19:46
sena_kun so `:rxtype<concat>` is generated in nqp, I suspect, around github.com/perl6/nqp/blob/master/s...#L190-L201 area 19:51
ugexe m: Nil = 1 20:21
camelia Cannot modify an immutable Str (Nil)
in block <unit> at <tmp> line 1
ugexe Nil is not Str though
m: "Nil" = 1 20:22
camelia Cannot modify an immutable Str (Nil)
in block <unit> at <tmp> line 1
ugexe probably a low hanging fruit
sena_kun m: class A { has $.a = 'hehe'; method a { say $!a } }; A.new(a => Nil).a; 20:26
camelia (Any)
sena_kun hmm...
m: class A { has $.a = 'hehe'; method a { say $!a } }; A.new(:a<Nil>).a;
camelia Nil
sena_kun it throws an exception at github.com/rakudo/rakudo/blob/762c...il.pm6#L16
github.com/rakudo/rakudo/blob/358d....pm6#L2377 <- but here it somehow doesn't print Nil 20:27
m: class A { has $.a = 'hehe'; method a { say $!a.^name } }; A.new(:a<Nil>).a; 20:28
camelia Str
sena_kun ah, no, here it is, a Str
m: class A { has $.a = 'hehe'; method a { say $!a.^name } }; A.new(a => Nil).a;
camelia Any
sena_kun but this leaves $!a just unassigned...
ugexe++ 20:29
probably worth a "good first ticket"(though I don't see what the solution can be right now), with the log above 20:30
timotimo ugexe: wow that's fascinating
ugexe: but yeah, the default should really not be "value" there :D 20:31
timotimo so putting Nil there potentially gave it the default value? which is a string of value "value" 20:32
sena_kun well, :a<Nil> is a Pair with Str value
so an attribute is not 'Value', but 'Nil', but in the end it is a Str anyway, not Nil 20:33
timotimo ha
i didn't look at that piece of the code yet
sena_kun it would be different with `value => Nil` pair
and that gives us `Any`, because the attribute is really not initialized in this case, I guess 20:34
sena_kun gave up on & bug
timotimo you weren't able to find out where it figured it should declare a '&' variable? 20:34
sena_kun well, I ended up in Grammar.nqp/Actions.nqp in nqp repo, which is really not my thing... Probably. 20:35
timotimo OK
sena_kun I don't mind looking at it a bit more, just don't know how bad it can be, as Perl 6 parsing is... complicated situation. 20:36
timotimo i hope in the future we'll have something in the debugserver that allows for sensible stepping through parsing stuff
we'll most probably need ot change the code-gen to put some extra metadata in the code
but it'd be worth a lot
sena_kun .oO ( and I wasn't able to do `{ nqp::say("this thing foo!") }`(yes, this is a cursed code) in Grammar/Actions.nqp, so 20:37
timotimo right now, it's completely unfeasible to put Grammar::Tracer or even Grammar::Debugger into rakudo's Grammar.nqp
you should be able to use "note"
as a sub
i think "say" got deprecated when we got rid of string-based IO in moarvm
sena_kun I saw prints being invoked when compiled nqp itself, but on `z build rakudo` it says "confused at line 2"(and then my foo-bar line) 20:38
timotimo that's interesting 20:38
you didn't put anything into the Grammar part, right? 20:39
sena_kun I tried to, since I hoped to see what rules are called and at least narrow from 5 things that produce `concat` to a single one
oh, it works with note
that's more interesting 20:40
timotimo you probably already know this, but you'll have to be extra careful putting code blocks into grammars, because code blocks end the "declarative prefix" part of an alternation and thus can change parse results 20:41
sena_kun timotimo, gist.github.com/Altai-man/c9d7c1df...abcf9cbf69 <- something like this is not ok? 20:43
also, now I think it is better to just `note` from Actions code, not Grammar, because grammar may alter options... 20:44
timotimo hm, it has a sequence of || right after it, which i think also terminates the declarative prefix immediately 20:45
in theory it could perhaps take the first part of the || sequence as declarative, but i don't think that's the semantics we've specified for that
sena_kun and no output. :| 20:50
timotimo mhm
it does kind of look like every termish you encounter will have gone through termseq -> termaltseq -> termconjseq -> termalt -> termconj -> termtermish 20:51
so the most interesting part is, did it branch off into any of the [ blah ]* parts of these tokens
sena_kun m: /&& 3/ 20:56
camelia ( no output )
sena_kun : )
sena_kun what a valid syntax to see... 20:57
tadzik :o 20:58
timotimo kind of like 20:59
m: my @foo = ,5
camelia 5===SORRY!5=== Error while compiling <tmp>
Preceding context expects a term, but found infix , instead.
at <tmp>:1
------> 3my @foo = ,7⏏055
timotimo oh, except not allowed here
jnthn It's a special case so when you write a load of | or || alternations, you can line them up vertically have a | before the first one :)
timotimo and you're even allowed to have a | before the first one if you have only the first one 21:00
sena_kun is too shy to point out he knew the syntax already in this warm mood 21:01
timotimo i need a pun to fit the cat picture i took so i can write a blog post about my recent work :| 21:04
life as a perl6 hacker is tough sometimes
sena_kun just go meta
e.g. "And here is our obligatory cat picture just for the sake of it (yes, I wasn't able to find a connection point to use, so here we go):". 21:05
:)
timotimo no, i'm sure i can make it work somehow
sena_kun is going meta for weaklings? 21:06
timotimo "i know writers who use subtext and they're all cowards"
sena_kun it is handy sometimes, when you don't know what to respond and you can always go the "And I had some responses to choose from, but you know, I have any" route, which is a response itsef.
s/any/none/ 21:07
my junctions are not healthy today
timotimo "sorry, i didn't upgrade my charisma stat enough to give you the response i wanted" 21:10
jnthn timotimo: What's the topic of the blog post? :) 22:24
timotimo confprog 22:37
it's related to the grant, though it's not part of the original list of milestones/deliverables
i still think it makes a good work report topic
jnthn "A little paws from the grant work" :P 22:38
timotimo i'll show you the cat picture i'll be using and my current post title :) 22:38
timotimo find it in the slack channel 22:40