Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-07-03

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:05 dubi0us joined #perl6
00:07 kurahaupo_ joined #perl6
00:14 dubi0us joined #perl6
00:23 dubi0us joined #perl6
00:32 dubi0us joined #perl6
00:38 Sgeo_ joined #perl6
00:41 dubi0us joined #perl6
00:45 lookatme joined #perl6
00:45 bwisti joined #perl6
00:45 lookatme morning
01:00 dubi0us joined #perl6
01:02 skids joined #perl6
01:07 astj joined #perl6
01:07 raschipi joined #perl6
01:08 grondilu joined #perl6
01:09 dubi0us joined #perl6
01:18 dubi0us joined #perl6
01:25 Geth ¦ ecosystem: scmorrison++ created pull request #349: Uzu migrated to github
01:25 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/pull/349
01:27 dubi0us joined #perl6
01:37 dubi0us joined #perl6
01:48 Cabanossi joined #perl6
01:57 dubi0us joined #perl6
01:57 dubi0us_ joined #perl6
02:02 Sgeo joined #perl6
02:14 dubi0us joined #perl6
02:19 dubi0us joined #perl6
02:19 noganex joined #perl6
02:21 parv joined #perl6
02:24 dubi0us joined #perl6
02:26 dubi0us joined #perl6
02:28 dubi0us joined #perl6
02:28 dubi0us_ joined #perl6
02:46 BenGoldberg joined #perl6
02:48 Cabanossi joined #perl6
02:50 seatek joined #perl6
03:14 seatek joined #perl6
03:18 Cabanossi joined #perl6
03:26 dubi0us joined #perl6
03:42 dubi0us joined #perl6
03:48 Cabanossi joined #perl6
03:57 dubi0us joined #perl6
04:02 Cabanossi joined #perl6
04:02 astj joined #perl6
04:11 dubi0us joined #perl6
04:17 dubi0us joined #perl6
04:27 dubi0us joined #perl6
04:37 dubi0us joined #perl6
04:49 curan joined #perl6
04:55 Mithaldu joined #perl6
04:58 dubi0us joined #perl6
05:01 astj joined #perl6
05:01 Cabanossi joined #perl6
05:19 lookatme joined #perl6
05:25 kaare_ joined #perl6
05:30 Geth ¦ ecosystem: 0b28ab15db | (Sam Morrison)++ | META.list
05:30 Geth ¦ ecosystem: AWS::Pricing META.info > META6.json
05:30 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/0b28ab15db
05:30 Geth ¦ ecosystem: 78e99866dd | (Sam Morrison)++ | 7 files
05:30 Geth ¦ ecosystem: Uzu migrated to github
05:30 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/78e99866dd
05:30 Geth ¦ ecosystem: 068ee70275 | (Moritz Lenz)++ (committed using GitHub Web editor) | META.list
05:30 Geth ¦ ecosystem: Merge pull request #349 from scmorrison/master
05:30 Geth ¦ ecosystem:
05:30 Geth ¦ ecosystem: Uzu migrated to github
05:30 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/068ee70275
05:46 dubi0us joined #perl6
05:49 lookatme joined #perl6
05:55 lowbro joined #perl6
05:55 lowbro joined #perl6
06:01 wamba joined #perl6
06:01 dubi0us joined #perl6
06:12 dubi0us joined #perl6
06:34 abraxxa joined #perl6
06:37 dubi0us joined #perl6
06:45 ufobat joined #perl6
06:45 ufobat timotimo, so what could i do to resolve this?
06:45 ufobat file a bugreport, or?
06:47 Cabanossi joined #perl6
06:49 domidumont joined #perl6
06:54 domidumont joined #perl6
07:00 astj_ joined #perl6
07:02 darutoko joined #perl6
07:15 lookatme joined #perl6
07:16 Cabanossi joined #perl6
07:18 dubi0us joined #perl6
07:27 dubi0us joined #perl6
07:35 nattefrost joined #perl6
07:37 seatek joined #perl6
07:42 rindolf joined #perl6
07:43 ufobat joined #perl6
07:47 zakharyas joined #perl6
07:47 Cabanossi joined #perl6
07:47 domidumont joined #perl6
08:03 jonas1 joined #perl6
08:03 mr-foobar joined #perl6
08:05 nattefrost joined #perl6
08:08 dubi0us joined #perl6
08:08 tokomer joined #perl6
08:10 dakkar joined #perl6
08:21 dubi0us joined #perl6
08:24 [particle] joined #perl6
08:26 robertle joined #perl6
08:33 dct joined #perl6
08:35 dubi0us joined #perl6
08:47 dubi0us joined #perl6
08:57 rindolf joined #perl6
09:02 Cabanossi joined #perl6
09:11 dubi0us joined #perl6
09:12 parv joined #perl6
09:21 dubi0us joined #perl6
09:22 nattefrost_ joined #perl6
09:28 tokomer_ joined #perl6
09:31 dubi0us joined #perl6
09:33 broquaint joined #perl6
09:47 dubi0us joined #perl6
10:07 dubi0us joined #perl6
10:08 astj joined #perl6
10:12 pecastro joined #perl6
10:37 dubi0us joined #perl6
10:47 Cabanossi joined #perl6
10:57 dubi0us joined #perl6
11:00 ChoHag joined #perl6
11:03 cog__ joined #perl6
11:09 zakharyas joined #perl6
11:12 pmurias joined #perl6
11:12 dubi0us joined #perl6
11:17 dubi0us_ joined #perl6
11:37 MasterDuke joined #perl6
11:37 dubi0us_ joined #perl6
11:46 Cabanossi joined #perl6
11:58 zengargoyle joined #perl6
12:12 dubi0us joined #perl6
12:13 pmurias joined #perl6
12:18 dubi0us joined #perl6
12:18 raschipi joined #perl6
12:19 bjz joined #perl6
12:29 araraloren joined #perl6
12:30 dubi0us joined #perl6
12:35 TreyHarris joined #perl6
12:46 Cabanossi joined #perl6
12:51 sftp joined #perl6
12:57 Khisanth joined #perl6
13:08 bjz_ joined #perl6
13:12 wamba joined #perl6
13:15 andrzejku_ hi
13:16 andrzejku_ I want to ask something you
13:16 andrzejku_ x)
13:16 Cabanossi joined #perl6
13:23 lizmat andrzejku_: what was the question
13:24 dubi0us joined #perl6
13:27 andrzejku_ I am doing small script for the personal use, but I got idea how to move into commercial way however it is very experimental if someone can review my code from time to time I would be happy
13:27 andrzejku_ it is perl6
13:31 bjz joined #perl6
13:34 raschipi joined #perl6
13:36 lizmat andrzejku_: is it gistable ?
13:38 andrzejku_ lizmat, yes but it is private
13:39 lizmat do I need to sign an NDA ?
13:40 andrzejku_ lizmat, no I don't think so D:
13:40 lizmat ok, then make a proivat
13:41 lizmat private gist and send me the url in a privmsg
13:48 dubi0us joined #perl6
13:55 dubi0us joined #perl6
13:59 dogbert17 joined #perl6
14:00 dogbert17 .seen moritz
14:00 yoleaux I saw moritz 2 Jul 2017 20:35Z in #perl6: <moritz> you're welcome
14:01 dubi0us joined #perl6
14:02 dubi0us joined #perl6
14:03 lucasb joined #perl6
14:05 * moritz last saw moritz when looking at the keyboard, and noticing his hands there
14:07 dogbert17 moritz: do you think that I could take relevant parts of the material from http://design.perl6.org/S26.html#Pod_comments and add to the recently commited doc for Pod::Block::Comment?
14:11 dogbert17 the Pod documentation at docs.perl6.org is currentlu a bit lacking IMHO
14:11 dogbert17 *currently
14:16 dogbert17 hmm, otoh there's quite a bit of documentation here, https://docs.perl6.org/language/pod#Pod_comments, perhaps that's enough
14:19 * moritz nods his head
14:22 dogbert17 so perhaps the class documentation can stay the way it is, i.e. somewhat terse
14:24 dogbert17 will add a few more missing classes to the doc, e.g. Table
14:39 Geth ¦ doc: b7f3f2c34d | (Jan-Olof Hendig)++ | doc/Type/Pod/Block/Table.pod6
14:39 Geth ¦ doc: Added docs for Pod::Block::Table
14:39 Geth ¦ doc: review: https://github.com/perl6/doc/commit/b7f3f2c34d
14:43 dogbert17 m: dd $=POD
14:43 camelia rakudo-moar a7b230: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Pod variable $=POD not yet implemented. Sorry.␤at <tmp>:1␤------> 3dd $=POD7⏏5<EOL>␤»
14:43 dogbert17 :(
14:46 dubi0us joined #perl6
14:47 cdg joined #perl6
14:49 linuksz joined #perl6
14:52 dubi0us joined #perl6
14:55 MilkmanDan joined #perl6
14:58 dubi0us joined #perl6
14:59 melezhik Hi!
14:59 melezhik Say I handle in CATCH block, how can I print the stacktrace?
15:00 melezhik .Str.say is not enough for me ...
15:00 timotimo https://docs.perl6.org/type/Exception#method_backtrace
15:01 melezhik handle -> handle an exception
15:01 melezhik thanks timotimo: will take a look
15:01 jnthn .say (without the .Str) includes a bt too, iirc
15:03 melezhik ok jnthn: thanks , this one works
15:13 raschipi melezhik: it's not much a stacktrace in p6 because the frames may be moved to the heap if they are closed over (turned into a closure). That's why it's called "backtrace".
15:13 melezhik ok, thanks I'm awared now
15:13 raschipi If that doesn't make sense, just ignore it.
15:14 raschipi I just said it so you're more likely to remember the name next time you need it.
15:14 melezhik yeah, it's not that important in my case, I only want to get as much as possible at the log in case any errors, and this seems work for  me
15:14 melezhik ok, sure
15:15 melezhik thanks for clarification
15:21 alimon joined #perl6
15:25 xtreak_ joined #perl6
15:29 travis-ci joined #perl6
15:29 travis-ci Doc build errored. Jan-Olof Hendig 'Added docs for Pod::Block::Table'
15:29 travis-ci https://travis-ci.org/perl6/doc/builds/249657419 https://github.com/perl6/doc/compare/88421a484ba1...b7f3f2c34d0a
15:29 travis-ci left #perl6
15:35 khw joined #perl6
15:38 cdg joined #perl6
15:41 ptolemarch joined #perl6
15:46 Cabanossi joined #perl6
15:47 TimToady joined #perl6
15:51 nicq20 joined #perl6
15:57 mr-foobar joined #perl6
16:03 Skarsnik joined #perl6
16:04 Skarsnik Hello
16:07 timotimo yo!
16:07 troys joined #perl6
16:08 Skarsnik I am curious, is there a map of the nqp function? I am trying to find die
16:09 lichtkind joined #perl6
16:09 timotimo you mean nqp::blah to moar instruction to moarvm source code?
16:09 timotimo https://github.com/MoarVM/MoarVM/blob/master/src/core/interp.c#L1217
16:09 timotimo it's just MVM_exception_die that gets called
16:10 jnthn Or if nqp:: op docs, there's docs in the NQP repo on many of them
16:12 Skarsnik I don't know, I am trying to find what get called when there is a nqp::die ^^
16:12 Skarsnik I am trying to figure https://rt.perl.org/Ticket/Display.html?id=127345
16:14 ChoHag joined #perl6
16:14 timotimo does it actually have a proper line annotation for that piece of code, or do we pretend it's the same line?
16:18 timotimo you'd be able to figure this out with writing it to an mbc file and moar --dump ing that
16:21 sftp joined #perl6
16:24 mienaikage joined #perl6
16:31 robertle joined #perl6
16:34 Geth ¦ doc: 55e1043268 | (Jan-Olof Hendig)++ | doc/Type/Supply.pod6
16:34 Geth ¦ doc: Expanded the documentation for 'stable'. timotimo++, jnthn++
16:34 Geth ¦ doc: review: https://github.com/perl6/doc/commit/55e1043268
16:39 dubi0us joined #perl6
16:44 Skarsnik timotimo, not sure how to dump thing with moar
16:47 Cabanossi joined #perl6
16:48 raschipi Skarsnik: moar --dump
16:48 MasterDuke Skarsnik: perl6 --target=mbc --output=foo.mbc -e 'say "hi"'; moar --dump foo.mbc
16:48 Skarsnik Oh thx :)
16:50 tadzik joined #perl6
16:50 mack[m] joined #perl6
16:50 Matthew[m] joined #perl6
16:50 unclechu joined #perl6
16:50 ilmari[m] joined #perl6
16:50 dp[m] joined #perl6
16:50 CIAvash[m] joined #perl6
16:50 xui_nya[m] joined #perl6
16:51 linuksz joined #perl6
16:53 linuksz how can i pass an object to a subroutine?
16:55 mst the_sub($the_object);
16:55 linuksz my $scalar = MyObject.new;
16:56 linuksz MySub($scalar);
16:56 setty1 joined #perl6
16:56 linuksz it passes a reference, don't it?
16:58 raschipi the signature of the subroutine will determine how it's passed
16:59 linuksz what should be the signature for passing the object, not $scalar
16:59 linuksz ?
17:00 raschipi If $scalar has the object in it, that's the object.
17:01 linuksz i have two arrays @first_array contains pointers for objects. i want modify these objects with a subroutine and make a @second_array, that contains the modified object
17:01 raschipi If you want a copy, use 'is copy', if you want to change it in place, use 'is rw'.
17:02 linuksz but it modifies the scalar containing the reference, don't?
17:02 linuksz i want to modify a copy of the object
17:03 linuksz if ($scalar is copy), it makes two reference for the same object, don't?
17:03 raschipi No, it will copy the object. The derreference is automatic.
17:03 timotimo uh
17:04 raschipi Maybe I'm confused too?
17:04 timotimo m: class Test { has $.foo is rw }; sub changetest($param is copy) { $param.foo = 99 }; my $thing = Test.new(foo => 1); say $thing.perl; changetest($thing); say $thing.perl
17:04 camelia rakudo-moar a7b230: OUTPUT: «Test.new(foo => 1)␤Test.new(foo => 99)␤»
17:04 timotimo it only copies the scalar variable
17:05 raschipi Oh, OK. I'm the one confused.
17:05 timotimo normally you get a read-only "copy" of the container, so you can't change the variable's contents
17:06 timotimo with "is copy" you get a read-write copy of the container, so you can change what the variable contains
17:06 raschipi But the objects have a separate property that says if you can write to them or not.
17:06 timotimo and with "is rw" you get the variable without the read-only change, so whatever you change the variable to will also change on the caller's side
17:07 timotimo only the scalar variables have that
17:07 grumble joined #perl6
17:07 linuksz ok, but if it is copy, or rw, it will change the object, or the scalar containing the reference?
17:07 timotimo well, attributes like "$.foo" in my example also have the "is rw" flag you can set
17:07 timotimo this is only about the variable, i.e. "what does the variable reference"
17:08 timotimo objects have to implement any change-prevention themselves
17:09 lambd0x joined #perl6
17:13 raschipi linuksz: So, every object has a .clone method that returns a shallow copy. Maybe that's what you want?
17:15 cdg joined #perl6
17:16 cdg joined #perl6
17:16 linuksz yes.
17:23 dubi0us joined #perl6
17:25 travis-ci joined #perl6
17:25 travis-ci Doc build errored. Jan-Olof Hendig 'Expanded the documentation for 'stable'. timotimo++, jnthn++'
17:25 travis-ci https://travis-ci.org/perl6/doc/builds/249700224 https://github.com/perl6/doc/compare/b7f3f2c34d0a...55e104326896
17:25 travis-ci left #perl6
17:25 mr-foobar joined #perl6
17:26 timotimo looks like it just hung
17:29 Skarsnik timotimo, no annotation for an instruction at the line that has the second part of the if condition
17:30 timotimo aha
17:30 timotimo in that case that's because we don't keep line numbers around for every kind of qast node
17:31 kyan joined #perl6
17:32 Skarsnik so it's in the parser, where the ast is created?
17:33 lambd0x Hi there. I've after testing what I reported yesterday regarding win use of perl6 with zef module manager. http://paste.ubuntu.com/25012613/. It fails for the last version either using rakudobrew or the latest release of Rakudo Star (2 releases ago)
17:33 timotimo either that or the compiler where the .node attribute of the relevant nodes are ignored
17:34 Skarsnik brb dinner
17:35 timotimo can you have a look if "zef --debug update" has more interesting output?
17:35 timotimo oh
17:35 timotimo if things go correct it doesn't output anything form e
17:36 timotimo aha, it's ZEF_PLUGIN_DEBUG
17:36 timotimo lambd0x: can you set that env var to 1 or so and see what it outputs
17:38 lambd0x timotimo: how should I do it?
17:38 lambd0x timotimo: never done it before :P
17:38 timotimo env ZEF_PLUGIN_DEBUG=yes zef update
17:39 lambd0x timotimo: ok :D
17:39 timotimo most shells let you do that wihtout writing "env" in front
17:39 lambd0x will be right back
17:44 Lambd0x joined #perl6
17:45 Lambd0x Hi. In Win I suppose there isn't a way to set env var for zef or it's  different.
17:46 timotimo oh
17:46 timotimo i think you just have to write set ZEF_PLUGIN_DEBUG=yes
17:46 timotimo and in the next line the zef command
17:47 Cabanossi joined #perl6
17:48 Lambd0x didn't work. I had tried it too already :D
17:48 timotimo :(
17:48 timotimo i don't know how to windowses
17:48 Lambd0x haha
17:49 Lambd0x It's a bit tricky this problem
17:49 timotimo it should be easy to do :\
17:50 bjz joined #perl6
17:50 Lambd0x I will try getting a Bash environment for windows to see if then I'm able to do this.
17:52 timotimo huggable: windows
17:52 huggable timotimo, nothing found
17:52 timotimo huggable: bash on windows
17:52 huggable timotimo, nothing found
17:52 timotimo hrm
17:53 timotimo there's a command you have to run to allow it to work with executable stack disabled
17:53 timotimo but i can't find it right now
18:07 Skarsnik hm
18:07 Skarsnik skarsnik@debian:~/perl6/rakudo$ ./install/bin/perl6 --target=ast --output=foo.ast piko.p6
18:07 Skarsnik ===SORRY!===
18:07 Skarsnik cannot stringify this
18:07 geekosaur huggable, bash on windows :is: sudo execstack -c /usr/lib/libmoar.so
18:07 huggable geekosaur, Added bash on windows as sudo execstack -c /usr/lib/libmoar.so
18:07 Skarsnik is that a bug or I am just doing something bad?
18:07 geekosaur (it's in there as "win10 bash")
18:08 timotimo seems like we just don't support --output with --target=ast
18:11 Skarsnik I guess it only keep the line for statement in QAST::Op(if) <sunk> :statement_id<?> if 1 eq 2 \n\t|| $a.piko
18:11 Skarsnik ?
18:14 zengargoyle what's a -- (foo => $bar)x!!$bar -- replacement in a function call as a named param?
18:14 timotimo i think we only keep Stmt and/or Stmts
18:14 timotimo zengargoyle: what? :)
18:15 bwisti joined #perl6
18:15 zengargoyle do-something( a=>"b", (c=>$x)x!!$x );   only do c=>$x if $x is true/defined/exists
18:16 timotimo i wonder where that syntax comes from
18:16 timotimo anyway, you'd |%($x ?? c => $x !! ()) probably
18:17 Skarsnik do you want the ast output?
18:17 zengargoyle the p5 Enterprise (NC-1701) operator is '()x!!'
18:17 timotimo some kind of flattening of a hash in any case
18:18 zengargoyle i thought i saw a cool ( .... if .... ) sort of construct somewhere.  prolly from Zoffix :)
18:20 timotimo oh, yeah, you can put that inside the ( ), too
18:20 timotimo m: say (a => 1 if 1)
18:20 camelia rakudo-moar a7b230: OUTPUT: «a => 1␤»
18:21 Lambd0x timotimo: https://pastebin.com/SwGUPWNd
18:22 timotimo Possible Spam Detected  -  fantastic
18:22 Lambd0x it seems to require: wget and curl. But Rakudo Star didn't come with it.
18:23 dubi0us joined #perl6
18:23 timotimo no, not "and"
18:23 timotimo it just uses the powershell web request thing instead
18:24 Lambd0x it also says metacpan plugin is not enabled hence it fails at last
18:25 dct joined #perl6
18:26 timotimo i don't know what's wrong there, it should be able to grab that five just fine?
18:26 timotimo the ecosystems/master/cpan.json
18:26 dubi0us joined #perl6
18:27 zengargoyle timotimo++  both ??!! and if work inside |%() but if is a few chars shorter. :)
18:28 Lambd0x timotimo I said it appears to be tricky.
18:29 linuksz how can i print of an object's variable's value?
18:29 linuksz m: class Test { has $.var }; my $object = Test.new($var => "nothing"); say "$object.var"
18:29 camelia rakudo-moar a7b230: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$var' is not declared. Did you mean '&VAR'?␤at <tmp>:1␤------> 3st { has $.var }; my $object = Test.new(7⏏5$var => "nothing"); say "$object.var"␤»
18:29 timotimo you have to spell it var => "nothing"
18:29 geekosaur m: class Test { has $.var }; my $object = Test.new(var => "nothing"); say "$object.var.WHAT"
18:29 camelia rakudo-moar a7b230: OUTPUT: «Test<34265360>.var.WHAT␤»
18:29 geekosaur heh
18:29 timotimo and in the quotation marks you will have to put () after the method call
18:29 geekosaur m: class Test { has $.var }; my $object = Test.new(var => "nothing"); say $object.var.WHAT
18:29 camelia rakudo-moar a7b230: OUTPUT: «(Str)␤»
18:29 timotimo or it won't interpolate
18:30 ChoHag joined #perl6
18:30 linuksz m: class Test { has $.var }; my $object = Test.new(var => "nothing"); say "$object.var"
18:30 camelia rakudo-moar a7b230: OUTPUT: «Test<36350176>.var␤»
18:31 linuksz i want it to say "nothing"
18:31 geekosaur m: class Test { has $.var }; my $object = Test.new(var => "nothing"); say $object.var
18:31 camelia rakudo-moar a7b230: OUTPUT: «nothing␤»
18:31 geekosaur m: class Test { has $.var }; my $object = Test.new(var => "nothing"); say "$object.var()"
18:31 camelia rakudo-moar a7b230: OUTPUT: «nothing␤»
18:31 moritz say "$object.var()" should also work
18:31 evalable6 moritz, rakudo-moar a7b2304e7: OUTPUT: «(exit code 1) ===SORRY!=== Error while compiling /tmp/Tld6f2faVL␤Variable '$object' is not declared␤at /tmp/Tld6f2faVL:1␤------> say "⏏$object.var()" should also work»
18:31 * moritz too slow
18:31 moritz evalable6: I didn't want it evaluated
18:31 evalable6 moritz, Full output: https://gist.github.com/c7749a13e6165cab3dd6c4fd4197b5c8
18:31 evalable6 moritz, rakudo-moar a7b2304e7: OUTPUT: «(exit code 1) ===SORRY!=== Error while compiling /tmp/DWM3WFRqms␤Undecla…»
18:31 geekosaur heh
18:32 geekosaur m: class Test { has $.var }; my $object = Test.new(var => "nothing"); say "{$object.var}"
18:32 camelia rakudo-moar a7b230: OUTPUT: «nothing␤»
18:32 linuksz thanks
18:33 timotimo you have to say "thanks for nothing" :D
18:33 MilkmanDan joined #perl6
18:34 espadrine joined #perl6
18:42 ufobat joined #perl6
18:47 dubi0us joined #perl6
18:47 dubi0us joined #perl6
18:54 mr-foobar joined #perl6
18:56 FROGGS joined #perl6
19:00 domidumont joined #perl6
19:06 skids joined #perl6
19:09 andrzejku joined #perl6
19:14 andrzejku do you know something about equivalent numpy for perl6?
19:23 Skarsnik interesting skarsnik@debian:~/perl6/rakudo$ ack-grep "annotated" give me some definition but never a use for the method
19:25 dct joined #perl6
19:25 MasterDuke Skarsnik: try src/vm/moar/QAST/QASTCompilerMAST.nqp:2053: in NQP
19:26 moritz that's the definition, not a use
19:26 moritz which seems to be Skarsnik's point
19:26 moritz yes, looks like dead code
19:27 MasterDuke oops, reading comprehension fail
19:27 Skarsnik and I don't find a call for annotate('line' or annotate('file'
19:30 mr-foobar joined #perl6
19:30 dubi0us joined #perl6
19:32 dubi0us_ joined #perl6
19:33 MasterDuke an annotate method is called in rakudo and nqp in a bunch of different places
19:33 MasterDuke src/mast/compiler.c:935-936: in MoarVM also looks to be marking file/line info
19:34 Skarsnik annotate yes
19:34 Skarsnik but not annotated
19:35 MasterDuke right, don't see any .annotated( method calls anywhere
19:38 dubi0us joined #perl6
19:38 El_Che andrzejku: if you come to yapce, Dana Jacobsen is the man to talk about that
19:38 yoleaux 2 Jul 2017 00:52Z <zengargoyle> El_Che: you might want to add at least the site directory to PATH so that scripts intalled by zef can be found.
19:38 yoleaux 2 Jul 2017 01:20Z <zengargoyle> El_Che: do you want 2 different install_zef scripts?
19:42 tomaw joined #perl6
19:45 dubi0us joined #perl6
19:48 timotimo melezhik: we have shaped native arrays, which is much like a numpy ndarray
19:48 timotimo melezhik: and a lot of functions numpy offers you can just do with hyper operators and such
19:49 Sgeo_ joined #perl6
19:49 dubi0us joined #perl6
19:51 pilne joined #perl6
19:57 mr-foobar joined #perl6
19:59 TEttinger joined #perl6
20:00 dubi0us_ joined #perl6
20:01 Cabanossi joined #perl6
20:03 tomaw joined #perl6
20:06 tomaw joined #perl6
20:26 kybr what is the difference between Num and num?
20:27 mr-foobar joined #perl6
20:28 Skarsnik num is probably a native type
20:30 kybr okay. i'm playing with an example that's using SDL2::Raw and NativeCall, so probably one of those is defining num?
20:34 Skarsnik hm
20:34 Skarsnik should probably be num32 or num64? I don't remember much
20:35 Skarsnik num exist I think
20:35 Skarsnik m: my num $b = 42; say $b;
20:35 camelia rakudo-moar a7b230: OUTPUT: «This type cannot unbox to a native number: P6opaque, Int␤  in block <unit> at <tmp> line 1␤␤»
20:35 Skarsnik m: my num32 $b = 42; say $b;
20:35 camelia rakudo-moar a7b230: OUTPUT: «This type cannot unbox to a native number: P6opaque, Int␤  in block <unit> at <tmp> line 1␤␤»
20:36 Skarsnik m: my num32 $b = 42; say $b;
20:36 camelia rakudo-moar a7b230: OUTPUT: «This type cannot unbox to a native number: P6opaque, Int␤  in block <unit> at <tmp> line 1␤␤»
20:36 raschipi m: my num $b = 42e0; say $b;
20:36 camelia rakudo-moar a7b230: OUTPUT: «42␤»
20:36 raschipi m: my num $b = 42e0; say $b;
20:36 camelia rakudo-moar a7b230: OUTPUT: «42␤»
20:36 Skarsnik yeah this notation
20:36 Skarsnik m: use NativeCall; sub foo is native(num $a);
20:36 camelia rakudo-moar a7b230: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3use NativeCall; sub foo is native(num7⏏5 $a);␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statement mo…»
20:37 pmurias joined #perl6
20:37 Skarsnik m: use NativeCall; sub is native foo(num $a);
20:37 camelia rakudo-moar a7b230: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3use NativeCall; sub is7⏏5 native foo(num $a);␤    expecting any of:␤        new name to be defined␤»
20:37 raschipi 42e0 is mantissa 42 and exponent 0, which has the value 42 * 10 ** 0
20:37 Skarsnik m: use NativeCall; sub foo(num $a) is native;
20:37 camelia rakudo-moar a7b230: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤A unit-scoped sub definition is not allowed except on a MAIN sub;␤Please use the block form.␤at <tmp>:1␤------> 3e NativeCall; sub foo(num $a) is native;7⏏5<EOL>␤»
20:38 Skarsnik m: use NativeCall; sub foo(num $a) is native{ * };
20:38 camelia rakudo-moar a7b230: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤A unit-scoped sub definition is not allowed except on a MAIN sub;␤Please use the block form.␤at <tmp>:1␤------> 3iveCall; sub foo(num $a) is native{ * };7⏏5<EOL>␤»
20:38 Skarsnik whatever I don't remember xD
20:38 Skarsnik but Nativecall will warn you if you put a bad type in a native sub
20:39 kybr okay. thanks. FYI, i was looking at this: http://www.perlmonks.org/?node_id=1167456
20:42 geekosaur space needed
20:42 geekosaur it thinks the {*} is a parameter to 'is native'
20:43 dubi0us joined #perl6
20:43 geekosaur and it does need a parameter, which is the C symbol
20:52 Skarsnik I think it's ... not *
20:55 geekosaur * is correct for the body. not correct for the is native(what)
20:56 geekosaur and the is native ate the { * } as a parameter because you needed a space before it to indicate it was not a parameter to 'is native', so then the compiler complained that the *sub* had no block
20:57 geekosaur sorry, the parameter isn;t a symbol, it's a shared object
20:57 geekosaur is native('foo') => look for libfoo.so, libfoo.dylib, or foo.dll depending on platform
20:57 mr-foobar joined #perl6
21:02 Cabanossi joined #perl6
21:02 Skarsnik m: use NativeCall; sub foo(num $a) is native { * };
21:02 camelia rakudo-moar a7b230: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Cannot resolve caller infix:<==>(NQPMu, Int); none of these signatures match:␤    ($?)␤    (\a, \b)␤    (Real \a, Real \b)␤    (Int:D \a, Int:D \b)␤    (int $a, int $b)␤    (Num:D \a, Num:D \b …»
21:02 Skarsnik oh right the space
21:03 Skarsnik m: use NativeCall; sub foo(num $a) is native("foo") { * };
21:03 camelia rakudo-moar a7b230: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Cannot resolve caller infix:<==>(NQPMu, Int); none of these signatures match:␤    ($?)␤    (\a, \b)␤    (Real \a, Real \b)␤    (Int:D \a, Int:D \b)␤    (int $a, int $b)␤    (Num:D \a, Num:D \b …»
21:05 bjz joined #perl6
21:06 geekosaur now I think we have an LTA...
21:06 geekosaur m: use NativeCall; sub foo(num32 $a) is native("foo") { * };
21:06 camelia rakudo-moar a7b230: ( no output )
21:07 geekosaur LTA for a bad native type
21:08 Skarsnik hm
21:09 Skarsnik probably my code
21:09 Skarsnik should have been seen at the test?
21:12 _p____ joined #perl6
21:13 TimToady joined #perl6
21:13 _p____ Hey is there a reason why the page http://rakudo.org/how-to-get-rakudo/ says the latest rakudo star is 2017.01 but in the download directory I can see  2017.04.2 ?
21:15 _p____ ( I mean the release for windows )
21:20 Skarsnik hm
21:27 mr-foobar joined #perl6
21:27 timotimo yeah, that looks kinda wrong
21:27 Skarsnik I got a lot of Parse errors: No plan found in TAP output
21:27 Skarsnik for Nativecall test when running make test
21:28 timotimo thankfully the download gives you the right file
21:28 timotimo Skarsnik: that's a crash before the "plan" has been output
21:29 Skarsnik /04-nativecall/16-rt125408.t ............ Dubious, test returned 1 (wstat 256, 0x100)
21:29 Skarsnik No subtests run
21:29 Skarsnik is that a crash too?
21:30 timotimo looks like
21:33 Skarsnik nvm I mess up my rakudo x)
21:35 Skarsnik m: use NativeCall; sub badnum2(num $a)  { * };
21:35 camelia rakudo-moar a7b230: ( no output )
21:36 Skarsnik m: use NativeCall :All; sub badnum2(num $a)  { * }; check_routine_sanity(&badnum2);
21:36 camelia rakudo-moar a7b230: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Error while importing from 'NativeCall': no such tag 'All'␤at <tmp>:1␤------> 3use NativeCall :All7⏏5; sub badnum2(num $a)  { * }; check_rout␤»
21:37 Skarsnik m: use NativeCall :ALL; sub badnum2(num $a)  { * }; check_routine_sanity(&badnum2);
21:37 camelia rakudo-moar a7b230: OUTPUT: «Cannot resolve caller infix:<==>(NQPMu, Int); none of these signatures match:␤    ($?)␤    (\a, \b)␤    (Real \a, Real \b)␤    (Int:D \a, Int:D \b)␤    (int $a, int $b)␤    (Num:D \a, Num:D \b --> Bool)␤    (num $a, num $b --> Bool)␤    (…»
21:37 _p____ timotimo: true but I had 2017.01 and was checking the page without even bothering to click the linking thinking the windows release was delayed... until today
21:37 Skarsnik interesting, the test does not fail
21:38 Skarsnik m: use NativeCall :ALL; sub badnum2(num $a)  { * }; CONTROL { when CX::Warn { .die } }; check_routine_sanity(&badnum2);
21:38 camelia rakudo-moar a7b230: OUTPUT: «Cannot resolve caller infix:<==>(NQPMu, Int); none of these signatures match:␤    ($?)␤    (\a, \b)␤    (Real \a, Real \b)␤    (Int:D \a, Int:D \b)␤    (int $a, int $b)␤    (Num:D \a, Num:D \b --> Bool)␤    (num $a, num $b --> Bool)␤    (…»
21:38 lucasb joined #perl6
21:40 Skarsnik I am confused, why camelia fail on that but the test does not fail
21:40 timotimo yeah, let me have a look
21:40 _p____ anyway, looking forward to jnthn's IO improvement in the next release hopefully.
21:40 _p____ Cheers
21:41 Skarsnik ok it fail when using from the command line
21:43 timotimo i updated the download page up on rakudo.org
21:44 user3 joined #perl6
21:45 geekosaur joined #perl6
21:45 Skarsnik nvm
21:46 Skarsnik the test expect a die xD
21:46 user3 why doesn't this code work at the command line(it works when put in a file): perl6 -e "'myfile'.IO.lines ~~ m:g/mypattern/; for @$/ -> $x {say ~$x}"
21:47 geekosaur because you are on a unix and shells interpolate $ in double quoted strings
21:48 geekosaur so the shell ate both the '$x's
21:48 user3 ok, let met try again...
21:48 geekosaur (or a unixy shell on windows)
21:49 user3 good. I've fixed it and it works now: perl6 -e '"myfile".IO.lines ~~ m:g/mypattern/; for @$/ -> $x {say ~$x}'
21:50 user3 I just exchanged the quotes
21:50 user3 lol
21:51 Skarsnik m: say num.HOW.^can("nativesize");
21:51 camelia rakudo-moar a7b230: OUTPUT: «nativesize␤»
21:51 user3 by the way, is @$/ ther best way to get the results from a m:g match?
21:52 Skarsnik m: say num.HOW.^can("nativesize"); say num.HOW.^nativesize;
21:52 camelia rakudo-moar a7b230: OUTPUT: «nativesize␤X::Method::NotFound exception produced no message␤  in block <unit> at <tmp> line 1␤␤»
21:52 Skarsnik Did this stuff get changed somehow?
21:54 Skarsnik m: say num32.HOW.^can("nativesize"); say num32.HOW.^nativesize;
21:54 camelia rakudo-moar a7b230: OUTPUT: «nativesize␤X::Method::NotFound exception produced no message␤  in block <unit> at <tmp> line 1␤␤»
21:54 Skarsnik m: say num32.HOW.^can("nativesize"); say num32.^nativesize;
21:54 camelia rakudo-moar a7b230: OUTPUT: «nativesize␤32␤»
21:55 Skarsnik m: say num.HOW.^can("nativesize"); say num.^nativesize;
21:55 camelia rakudo-moar a7b230: OUTPUT: «nativesize␤No such method 'gist' for invocant of type 'NQPMu'. Did you mean 'isa'?␤  in block <unit> at <tmp> line 1␤␤»
21:55 Skarsnik should the .^can("nativesize") return false? I think it was the old behavior?
21:57 geekosaur that, or nativesize should produce a perl6 undef instead of an NQP undef
21:57 geekosaur or possibly both
21:58 Skarsnik I use it to check for valid type in NC
21:58 Skarsnik return False if T.HOW.^can("nativesize") && T.^nativesize == 0; #to disting int and int32 for example
21:58 Skarsnik it's this line that produce the infix error
22:00 geekosaur right. it could be argued either way, either all types implement nativesize but it should be either (Int) or a Failure; or it should not exist. I suspect internals are cleaner if it is always defined though
22:00 geekosaur er, if .^nativesize method always exists
22:00 geekosaur but it should produce something more p6-friendly
22:01 sacomo joined #perl6
22:02 Skarsnik using Int is bad
22:04 Skarsnik if you want an example of why https://gist.github.com/Skarsnik/d4e9b31b2859114ac643 ^^
22:04 seatek joined #perl6
22:05 geekosaur er? this is not that case
22:05 geekosaur nativesize is implemented by the MOP, not by a dylib
22:05 Skarsnik I know, but it show why accepting Int in native sub is bad ^^
22:06 Skarsnik anyway, checking for nativesize was my hacky way to disting int and int32, but now it return always something with can
22:08 geekosaur right, I'm saying the new case is to see if the result of ^nativesize is defined
22:08 geekosaur except that it's producing an NQP undef instead of a perl 6 undef, so it explodes
22:09 Skarsnik It's compile time check, I don't remember if you can check for def or not
22:09 lizmat and another Perl 6 Weekly hits the net: https://p6weekly.wordpress.com/2017/07/03/2017-27-inching-on-speed/
22:09 Skarsnik this code was very annoying to write
22:09 Skarsnik nice :)
22:10 geekosaur in that case it's even worse that it is producing NQPMu instead of something you can test
22:10 Skarsnik m: say int.^nativesize === Mu:U;
22:10 camelia rakudo-moar a7b230: OUTPUT: «Cannot resolve caller infix:<===>(NQPMu, Mu:U); none of these signatures match:␤    ($?)␤    (\a, \b)␤    (Int:D \a, Int:D \b)␤    (int $a, int $b)␤    (Num:D \a, Num:D \b)␤    (num \a, num \b --> Bool)␤    (Str:D \a, Str:D \b --> Bool)␤ …»
22:14 Skarsnik damn, time to go to bed
22:14 Skarsnik will check more this tomorrow
22:14 geekosaur m: say int.^nativesize === NQPMu;
22:14 camelia rakudo-moar a7b230: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤    NQPMu used at line 1␤␤»
22:15 geekosaur figures
22:15 geekosaur oh
22:15 geekosaur m: use MONKEY-GUTS; say int.^nativesize === NQPMu;
22:15 camelia rakudo-moar a7b230: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤    NQPMu used at line 1␤␤»
22:15 geekosaur sigh
22:16 geekosaur m: use MONKEY-GUTS; say nqp::defined(int.^nativesize)
22:16 camelia rakudo-moar a7b230: OUTPUT: «0␤»
22:17 timotimo the best thing is how it interprets the ~ in the shell's prompt as "strike through all the following lines please"
22:18 geekosaur .tell Skarsnik use MONKEY-GUTS; say nqp::defined(int.^nativesize) #`{ which is why it should be a p6 undef not nqp }
22:18 yoleaux geekosaur: I'll pass your message to Skarsnik.
22:26 mr-foobar joined #perl6
22:47 Cabanossi joined #perl6
22:54 AlexDani` joined #perl6
22:56 raschipi joined #perl6
22:56 mr-foobar joined #perl6
23:10 BenGoldberg joined #perl6
23:11 mr-foobar joined #perl6
23:14 Praise joined #perl6
23:27 cyphase joined #perl6
23:29 doks joined #perl6
23:44 mr-foobar joined #perl6

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

Perl 6 | Reference Documentation | Rakudo