Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-07-13

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:00 dubi0us joined #perl6
00:03 mcmillhj joined #perl6
00:11 AlexDaniel joined #perl6
00:21 Cabanossi joined #perl6
00:22 dubi0us_ joined #perl6
00:24 lookatme joined #perl6
00:24 lookatme morning
00:33 llfourn .tell nicq20 yeah actually I was giving you bad advice. The hack you should actually be trying is $*W.cur_lexpad() instead of $*CURPAD.
00:33 yoleaux llfourn: I'll pass your message to nicq20.
00:41 pierre__ joined #perl6
01:02 mvr707 "zef install Data::Dump" produces "MoarVM panic: Internal error: Unwound entire stack and missed handler" and immediate retry installs fine, on Ubuntu 16.04
01:02 cdg joined #perl6
01:11 dubi0us joined #perl6
01:16 llfourn mvr707: that sounds bad, what's your perl6 --version
01:22 Morfent doesn't look like rakudo likes being compiled with clang very much
01:22 Morfent there's a mitigation in one of the tests you can run while compiling it from source for it, but it's specific to mac
01:27 Morfent guess i'll build it with gcc
01:28 llfourn I use rakudo on mac built with clang as my main dev setup
01:29 llfourn I rarely have problems that are specific to mac
01:29 llfourn I did zef install Data::Dump and it worked fine fwiw
01:37 Cabanossi joined #perl6
01:39 Morfent eh, i find there are certain ports i need to compile with gcc in order for them to work more optimally or function at all
01:40 Morfent mainly gnu coreutils, but i want to play it safe
01:41 llfourn well sure, all I meant was moarvm/rakudo seems to be fine when compiled with llvm
01:47 dubi0us joined #perl6
01:48 ilbot3 joined #perl6
01:48 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!
01:57 aborazmeh joined #perl6
01:57 aborazmeh joined #perl6
02:02 astj_ joined #perl6
02:07 noganex joined #perl6
02:10 dubi0us joined #perl6
02:15 Xliff joined #perl6
02:32 dubi0us joined #perl6
02:34 dubi0us_ joined #perl6
02:44 cdg joined #perl6
03:13 Khisanth joined #perl6
03:23 evanm joined #perl6
03:24 evanm Can someone explain the following discrepancy to me?
03:24 evanm m: 0.1e0  + 0.2e0 == 0.3e0
03:24 camelia rakudo-moar c86090: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "==" in expression "+ 0.2e0 == 0.3e0" in sink context (line 1)␤»
03:24 dubi0us joined #perl6
03:24 evanm m: say 0.1e0  + 0.2e0 == 0.3e0
03:24 camelia rakudo-moar c86090: OUTPUT: «False␤»
03:25 evanm m: say  1e-1 + 2e-1 == 3e-1
03:25 camelia rakudo-moar c86090: OUTPUT: «True␤»
03:26 evanm m: say 0.1e0.WHAT
03:26 camelia rakudo-moar c86090: OUTPUT: «(Num)␤»
03:26 evanm m: say 1e-1.WHAT
03:26 camelia rakudo-moar c86090: OUTPUT: «(Num)␤»
03:26 zengargoyle evanm: the original error is just because you didn't 'say' the result.
03:27 evanm zengargoyle: Understood, I'm curious about the arithmetic
03:27 zengargoyle ah,
03:28 gdonald joined #perl6
03:30 zengargoyle m: say 0.1e0  + 0.2e0 =~= 0.3e0
03:30 camelia rakudo-moar c86090: OUTPUT: «True␤»
03:32 zengargoyle m: say 0.1e0  + 0.2e0 ≅ 0.3e0
03:32 camelia rakudo-moar c86090: OUTPUT: «True␤»
03:33 * zengargoyle would pass it off to the mysteries of IEEE floating point.
03:34 evanm The equivalent C code gives false in both cases
03:35 evanm I understand the floating point explanation for 0.1e0  + 0.2e0 != 0.3e0
03:35 zengargoyle hrmm, docs search for epsilon return nothing.
03:36 cdg joined #perl6
03:36 zengargoyle ah, then i truly have no idea. :)
03:36 evanm Well, epsilon should only apply for =~=, otherwise I think it should give the IEEE answer
03:36 zengargoyle it may be the floating point library that moarvm uses for all of the fancy math stuff.
03:36 evanm Maybe 1e-1 gets encoded differently from 0.1e0
03:37 Cabanossi joined #perl6
03:37 AlexDaniel interesting
03:37 lookatme evanm, float number in C is imprecision
03:37 evanm Is there a JVM bot in the channel? Would be curious if it gives same result
03:37 zengargoyle i.e. i'm not sure moar does floaing itself...
03:38 AlexDaniel j: say 0.1e0  + 0.2e0 == 0.3e0
03:38 camelia rakudo-jvm c86090: OUTPUT: «False␤»
03:38 AlexDaniel j: say  1e-1 + 2e-1 == 3e-1
03:38 camelia rakudo-jvm c86090: OUTPUT: «True␤»
03:38 lookatme say (0.1e0  + 0.2e0).WHAT
03:38 evalable6 lookatme, rakudo-moar c86090e35: OUTPUT: «(Num)»
03:39 lookatme say  (1e-1 + 2e-1).WHAT
03:39 evalable6 lookatme, rakudo-moar c86090e35: OUTPUT: «(Num)»
03:39 zengargoyle m: say 0.1e0  + 0.2e0
03:39 camelia rakudo-moar c86090: OUTPUT: «0.3␤»
03:39 lookatme say  1e-1 + 2e-1
03:39 evalable6 lookatme, rakudo-moar c86090e35: OUTPUT: «0.3»
03:40 zengargoyle m: say (0.1e0  + 0.2e0).perl
03:40 lookatme say 0.3 == 0.3e0
03:40 camelia rakudo-moar c86090: OUTPUT: «0.3e0␤»
03:40 evalable6 lookatme, rakudo-moar c86090e35: OUTPUT: «True»
03:40 lookatme say 0.3 == 3e-1
03:40 evalable6 lookatme, rakudo-moar c86090e35: OUTPUT: «False»
03:40 lookatme Oh, it's totally mess
03:40 cdg joined #perl6
03:40 AlexDaniel ah, okay
03:40 AlexDaniel I see something
03:41 AlexDaniel m: dd 0.3
03:41 camelia rakudo-moar c86090: OUTPUT: «0.3␤»
03:41 AlexDaniel m: dd 3e-1
03:41 camelia rakudo-moar c86090: OUTPUT: «0.3e0␤»
03:41 lookatme m: dd 0.3e0
03:41 camelia rakudo-moar c86090: OUTPUT: «0.3e0␤»
03:41 lookatme m: say 0.3e0 == 3e-1
03:41 camelia rakudo-moar c86090: OUTPUT: «True␤»
03:42 lookatme m: say 0.3e0 == 3e-1 == 0.3
03:42 camelia rakudo-moar c86090: OUTPUT: «True␤»
03:42 lookatme m: say (0.3e0 == 3e-1 == 0.3)
03:42 camelia rakudo-moar c86090: OUTPUT: «True␤»
03:42 lookatme IDK, bug ?
03:42 AlexDaniel evanm: I can't really tell if this is something we should fix, but I guess it's worth a ticket
03:43 AlexDaniel evanm: if anything, we will at least have a rejected ticket with a good explanation for future use :)
03:43 AlexDaniel like, I'm really not expecting equality to work like this with Nums, and Perl 6 provides much better alternatives
03:43 AlexDaniel so IMO not a big deal at all, even if other languages disagree for some reason
03:44 AlexDaniel but still, it's worth a ticket :)
03:44 evanm It's not a big deal, I'm just curious what the explanation is
03:45 evanm I'll bother IRC tomorrow and open a ticket if I don't get an adequate answer
03:45 zengargoyle m: say 1e0 - 1e0 == 0e0
03:45 camelia rakudo-moar c86090: OUTPUT: «True␤»
03:48 AlexDaniel ah wait
03:48 AlexDaniel m: dd 3e-1
03:48 camelia rakudo-moar c86090: OUTPUT: «0.3e0␤»
03:48 AlexDaniel m: dd 0.3e0
03:48 camelia rakudo-moar c86090: OUTPUT: «0.3e0␤»
03:50 Cabanossi joined #perl6
03:51 AlexDaniel ye this doesn't help… I see nothing :)
03:51 AlexDaniel (forgot the e0 part… *facepalm*)
03:52 matt_ joined #perl6
03:53 vendethiel joined #perl6
03:54 Morfent there we go, all tests pass with gcc
03:57 TEttinger m: dd 0.3e1
03:57 camelia rakudo-moar c86090: OUTPUT: «3e0␤»
03:57 TEttinger m: say 0.3e1 == 3.0
03:57 camelia rakudo-moar c86090: OUTPUT: «True␤»
03:57 TEttinger m: say 0.3e1 == 3
03:57 camelia rakudo-moar c86090: OUTPUT: «True␤»
03:58 TEttinger m: say 0.5e0 == 0.5
03:58 camelia rakudo-moar c86090: OUTPUT: «True␤»
03:58 TEttinger m: say 0.4e0 == 0.4
03:58 camelia rakudo-moar c86090: OUTPUT: «True␤»
03:58 TEttinger m: say 4e-1 == 0.4
03:58 camelia rakudo-moar c86090: OUTPUT: «True␤»
03:59 TEttinger m: say 3e-1 == 0.3
03:59 camelia rakudo-moar c86090: OUTPUT: «False␤»
03:59 TEttinger ok, I'm chalking it up to floating point weirdness
03:59 TEttinger j: say 3e-1 == 0.3
03:59 camelia rakudo-jvm c86090: OUTPUT: «False␤»
03:59 Actualeyes1 joined #perl6
04:01 TEttinger anyone know how I'd call the Java standard lib method Double.doubleToLongBits(double) via the JVM perl 6?
04:01 TEttinger might get a clear answer that way
04:01 TEttinger j: say Double.doubleToLongBits(3e-1)
04:02 camelia rakudo-jvm c86090: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤    Double used at line 1␤␤»
04:02 TEttinger j: say java.lang.Double.doubleToLongBits(3e-1)
04:02 zengargoyle m: say 0.1e0 + 0.2e0 - 0.3e0
04:02 camelia rakudo-jvm c86090: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    java used at line 1␤␤»
04:02 camelia rakudo-moar c86090: OUTPUT: «5.55111512312578e-17␤»
04:03 zengargoyle maybe the actual additions/subtractions/maths move from the simple tests into the realm of weird.
04:06 TEttinger zengargoyle: 3e-1 == 0.3 is false
04:09 evanm It's my bedtime, but I'll leave you all with this final conundrum:
04:09 evanm m: say 1e-1 + 2e-1 == 3e-1
04:09 camelia rakudo-moar c86090: OUTPUT: «True␤»
04:09 evanm m: say 1e-1 == 3e-1 - 2e-1
04:09 camelia rakudo-moar c86090: OUTPUT: «False␤»
04:10 evanm g'night!
04:11 TEttinger m: say 0.1 == 0.3 - 0.2
04:11 camelia rakudo-moar c86090: OUTPUT: «True␤»
04:12 TEttinger definitely a difference in how scientific notation works :|
04:12 skids scientific notation gets you a float repr.
04:12 AlexDaniel TEttinger: well, that's not very surprising
04:13 TEttinger how so?
04:13 TEttinger m: say (0.1 == 0.3 - 0.2) == (1e-1 == 3e-1 - 2e-1)
04:13 camelia rakudo-moar c86090: OUTPUT: «False␤»
04:13 skids 0.3 is a Rat.
04:14 TEttinger oh. right the weird names
04:16 skids No more weird than Int.
04:16 skids FatRat is a bit "weird", but fun.
04:17 skids https://docs.perl6.org/type/Rational
04:17 zengargoyle m: say 0.1e0 + 0.2e0
04:17 camelia rakudo-moar c86090: OUTPUT: «0.3␤»
04:17 zengargoyle m: say 0.1e0 + 0.2e0 - 1e0
04:17 camelia rakudo-moar c86090: OUTPUT: «-0.7␤»
04:18 zengargoyle m: say 0.1e0 + 0.2e0 - 3e0
04:18 camelia rakudo-moar c86090: OUTPUT: «-2.7␤»
04:18 zengargoyle m: say 0.1e0 + 0.2e0 - 0.3e0
04:18 camelia rakudo-moar c86090: OUTPUT: «5.55111512312578e-17␤»
04:19 zengargoyle m: say 0.2e0 - 0.3e0
04:19 camelia rakudo-moar c86090: OUTPUT: «-0.1␤»
04:19 skids Yeah so something is probably cheating by handing back a Rat for 0.1e0
04:20 zengargoyle i wonder if Num does some special things when a simple answer is possible before going full IEEE float
04:20 skids I don't believe it should.
04:21 Cabanossi joined #perl6
04:21 zengargoyle like for e0 and e-1 that have be tested so far in the convo...
04:21 skids ISTR scientific notation is supposed to predicatbly give you a floating point Num.
04:22 zengargoyle ISTR?
04:28 TEttinger I Seem To Recall ?
04:33 skids Yeah.  Though maybe I am recalling wrong.
04:34 astj joined #perl6
04:34 vendethiel- joined #perl6
04:35 skids S02/exponentials mentions the 'e' format and then ends with "In all these cases, the type produced will be the narrowest of..." which could be intentionally including the 'e' formats or that could have been an oversight.
04:37 xtreak joined #perl6
04:39 mr-foobar joined #perl6
04:39 skids anyway, bedtime for me.
04:44 vendethiel joined #perl6
04:50 Cabanossi joined #perl6
04:56 nadim joined #perl6
05:10 Morfent joined #perl6
05:19 Mrofnet joined #perl6
05:23 Moronnt joined #perl6
05:28 Morfent joined #perl6
05:35 Cabanossi joined #perl6
05:54 raschipi joined #perl6
05:58 |oLa| joined #perl6
06:02 lowbro joined #perl6
06:02 lowbro joined #perl6
06:12 Actualeyes joined #perl6
06:13 ufobat_ joined #perl6
06:21 famrani joined #perl6
06:22 pierre__ joined #perl6
06:27 andrzejk_ joined #perl6
06:36 Cabanossi joined #perl6
06:41 domidumont joined #perl6
06:48 wamba joined #perl6
06:48 domidumont joined #perl6
07:01 domidumont joined #perl6
07:05 moritz I'd argue that the design docs are out of date there
07:07 |oLa| joined #perl6
07:11 abraxxa joined #perl6
07:14 darutoko joined #perl6
07:15 nadim joined #perl6
07:15 |oLa| joined #perl6
07:17 parv joined #perl6
07:18 domidumont joined #perl6
07:28 dakkar joined #perl6
07:32 Actualeyes joined #perl6
07:36 zakharyas joined #perl6
07:40 cyphase joined #perl6
07:43 leont joined #perl6
07:44 domidumont joined #perl6
07:46 lizmat joined #perl6
07:54 qwebirc79257 joined #perl6
07:55 alpha6 joined #perl6
07:58 pierre__ joined #perl6
08:01 jonas1 joined #perl6
08:04 gdonald joined #perl6
08:25 leont_ joined #perl6
08:30 nadim Good morning!  is there some sugar to declare anonymous subs without using the keyword 'sub'?
08:31 llfourn nadim: nope. Not if you want a Sub specifically.
08:32 llfourn if you just want a block you can do my $foo = -> { ... } but that's a Block not a Sub.
08:32 cosimo joined #perl6
08:33 nadim I have a list of subs that fir on one line and that 'sub' at least it is clear what it iI process in a loop, wanted it to lok a tad cleaner. But I'll live with 'sub', it makes the intent clear.
08:38 nadim Euu that was one mangled answer ^.  I have a list of subs that are one line long, they are used in a loop.  'sub' is at least very clear about the intent.
08:38 cosimo joined #perl6
08:47 lizmat nadim: do you need to be able to return from the sub ?
08:50 Cabanossi joined #perl6
09:02 astj_ joined #perl6
09:11 xtreak joined #perl6
09:20 Cabanossi joined #perl6
09:31 mr-foobar joined #perl6
09:47 xtreak joined #perl6
09:50 Cabanossi joined #perl6
10:01 nadim no
10:02 nadim lizmat: each sub modifies an object that is in scope
10:03 nadim anyway to get the output of dd or have dd write on stderr
10:05 robertle joined #perl6
10:13 astj joined #perl6
10:13 nadim meh! that already on stderr
10:18 Zoffix joined #perl6
10:18 rindolf joined #perl6
10:24 mr-foobar joined #perl6
10:35 Cabanossi joined #perl6
10:41 andrzejku joined #perl6
10:43 gregf_ joined #perl6
10:44 astj joined #perl6
10:47 astj joined #perl6
10:55 eyck joined #perl6
11:04 astj joined #perl6
11:11 famrani joined #perl6
11:11 tbrowder hi #perl6
11:16 tbrowder i'm working on the rakudo build system and regularly install to a new system directory separate from my main rakudo installation. i will be installing a new zef there, too, but want to use my other existing modules. i assume i can modify PERL6LIB to point to the main rakudo perl5/share library. does anyone forsee any problems with that? (of course the PATH will point first to the test rakudo installation.)
11:17 tbrowder Freudian slip: s/perl5/perl6
11:30 xtreak joined #perl6
11:32 tbrowder llfourn: it looks like your CompUnit::Util may be able to move the rakudo CompUnits in the install dir to another location. is that possible?
11:37 astj joined #perl6
11:47 llfourn tbrowder: CompUnit::Util doesn't move any files it just helps you introspect modules and helps you export their symbols
11:53 astj joined #perl6
12:02 astj joined #perl6
12:03 llfourn tbrowder: btw you might wanna ask module installing questions on #perl6-toolchain
12:04 gdonald left #perl6
12:04 gdonald joined #perl6
12:08 raschipi joined #perl6
12:11 tbrowder llfourn: thnx
12:15 araraloren joined #perl6
12:15 araraloren evening
12:16 raschipi o/
12:16 araraloren so so so Hot!!
12:21 ctilmes joined #perl6
12:25 mr-foobar joined #perl6
12:30 Zoffix .tell evanm "Can someone explain the following discrepancy to me?" I'd say it's a buggish behaviour, mostly because a result of untouched pure expression can actually be affected based on whether you wrote 1.0e-1 or 0.1e0 in your code (they get cached). Here's the equivalent C code to how we parse our nums and it has the same discrepancy: https://gist.github.com/zoffixznet/46ae8dd7d85096d58dc557f60f82a179
12:30 yoleaux Zoffix: I'll pass your message to evanm.
12:30 astj joined #perl6
12:31 Zoffix The .3e0 == .3 vs 3e-1 == .3 is very likely the same cause. The rat version just gets converted to num with 3/10
12:32 * Zoffix writes into his private bug stash for later pondering
12:34 Zoffix m:           say 1.0e-1 + 2.0e-1 == 3.0e-1;
12:34 camelia rakudo-moar 5196e0: OUTPUT: «True␤»
12:34 Zoffix m: $ = .3e0; say 1.0e-1 + 2.0e-1 == 3.0e-1;
12:34 camelia rakudo-moar 5196e0: OUTPUT: «False␤»
12:34 Zoffix :)
12:35 deep-book-gk_ joined #perl6
12:36 araraloren @_@
12:37 jnthn Oh, the joy of floating point...
12:37 Zoffix \o/
12:37 deep-book-gk_ left #perl6
12:38 Voldenet how can I write `if $last > @inputs.map(*.IO.changed).any { refresh(); }` in a way where "any" gets executed only until it's true?
12:38 Voldenet I could use long gather/take, but I wanted it to look smart
12:39 Zoffix Voldenet: how did you come to conclusion that it's not what it's doing now?
12:39 Zoffix (that it doesn't stop when it found any matching stuff)
12:39 cgfbee joined #perl6
12:40 jnthn refresh if @inputs.first($last > *.IO.changed); # a way without junctional stuff
12:41 Voldenet Zoffix: well, it actually stops, but map works for the whole array before, so it touches those files without any need
12:41 Zoffix huh
12:42 Zoffix oh well
12:42 Voldenet but I guess .first works well for my case, thanks
12:43 Zoffix m: sub foo ($n) { say "in"; True}; if foo (^3).map({say "map"; $_}).any {say "z"}
12:43 camelia rakudo-moar 5196e0: OUTPUT: «map␤map␤map␤in␤in␤in␤z␤»
12:44 moritz m: sub foo ($n) { say "in"; True}; say so  (^3).map(&foo).any
12:44 camelia rakudo-moar 5196e0: OUTPUT: «in␤in␤in␤True␤»
12:44 moritz so, junctions are eager?
12:44 * Zoffix would've expected the threading to shortcurcuit
12:44 jnthn I think this simply boils down to Junctions not being lazy
12:44 Zoffix I see
12:45 jnthn Junction.ACCEPTS will short-circuit
12:45 jnthn 'cus at that point it knows it can just produce a boolean
12:45 Voldenet m: say so (^3).lazy.map({say "map"; $_}).any
12:45 camelia rakudo-moar 5196e0: OUTPUT: «map␤map␤map␤True␤»
12:45 jnthn but .any needs to make and hand back a junction
12:45 Voldenet i'd think this would be lazier though
12:45 Zoffix m: sub foo ($n) { say "in"; True}; say 42 ~~ <a b c>.any
12:45 camelia rakudo-moar 5196e0: OUTPUT: «False␤»
12:46 Zoffix m: sub foo ($n) { say "in"; True}; say *.&foo ~~ <a b c>.any
12:46 camelia rakudo-moar 5196e0: OUTPUT: «WhateverCode object coerced to string (please use .gist or .perl to do that)␤  in block <unit> at <tmp> line 1␤WhateverCode object coerced to string (please use .gist or .perl to do that)␤  in block <unit> at <tmp> line 1␤WhateverCode object coer…»
12:46 Zoffix bah, screw it
12:46 jnthn Voldenet: .lazy can't force things downstream that aren't themselves lazy to magically be so
12:47 jnthn Junction simply isn't implemented as a lazy data structure on the inside.
12:50 Zoffix m: sub foo ($n) { say "in"; $n.so}; say (&foo, &foo, &foo, &foo).any.ACCEPTS: 42
12:50 camelia rakudo-moar 5196e0: OUTPUT: «in␤True␤»
12:50 Zoffix m: sub foo ($n) { say "in"; $n.so}; say (&foo, &foo, &foo, &foo).all.ACCEPTS: 42
12:50 camelia rakudo-moar 5196e0: OUTPUT: «in␤in␤in␤in␤True␤»
12:50 Zoffix there. Proved :)
12:50 Cabanossi joined #perl6
12:52 jnthn :)
12:52 cdg joined #perl6
12:52 Voldenet It makes sense, not very DWIMy though
12:53 Voldenet I'd expect `(^100).any(* > 5)` instead of `(^100).first(* > 5)`
12:54 mcmillhj joined #perl6
12:54 nicq20 joined #perl6
12:55 Voldenet m: my $i; say so (^100).map({ ++$i; $_ }).map(* > 4).any; say $i
12:55 camelia rakudo-moar c16334: OUTPUT: «True␤100␤»
12:56 araraloren joined #perl6
12:58 Zoffix Voldenet: you don't need an 'any' there at all. In fact, if you change the last map to .grep you'd get the lazy execution you seek, since it'll rely on the Seqs to figure out the Bool
12:58 Zoffix m: my $i; say so (^100).map({ ++$i; $_ }).grep(* > 4); say $i
12:58 camelia rakudo-moar c16334: OUTPUT: «True␤6␤»
12:59 Zoffix Where's .any produces a Junction. And it'd need some sort of a crystal ball to know what the final form of the wanted result
12:59 Zoffix is
13:01 Zoffix \o
13:01 Zoffix left #perl6
13:01 Voldenet Ah, it's my problem for applying C#'s terminology into perl, where Any just does that :P
13:02 astj joined #perl6
13:04 evanm joined #perl6
13:09 evanm Zoffix: Catching up on the log now, thanks for the explanation!
13:09 yoleaux 12:30Z <Zoffix> evanm: "Can someone explain the following discrepancy to me?" I'd say it's a buggish behaviour, mostly because a result of untouched pure expression can actually be affected based on whether you wrote 1.0e-1 or 0.1e0 in your code (they get cached). Here's the equivalent C code to how we parse our nums and it has the same discrepancy: https://gist.github.com/zoffixznet/46ae8dd7d85096d58dc557f60f82a179
13:13 evanm As a user, I would expect the floating-point parser to create the same binary representation as C
13:13 pierre__ joined #perl6
13:16 astj joined #perl6
13:20 evanm Relevant: https://en.wikipedia.org/wiki/IEEE_754#Character_representation
13:22 Zoffix joined #perl6
13:23 Zoffix evanm: yeah, I think I see where the bug is at. Gonna try a commit soon
13:23 cdg_ joined #perl6
13:24 dubi0us joined #perl6
13:25 Zoffix ... and possibly one of the "noise in rats" bugs too :/
13:26 Zoffix m: dd 1.3333333333333333333333333.nude
13:26 camelia rakudo-moar c16334: OUTPUT: «(13333333333333333333333333, 10000000000000000905969664)␤»
13:27 Zoffix this one. (though untested yet; just by reading the code I think that might get fixed)
13:27 dubi0us joined #perl6
13:29 astj joined #perl6
13:31 [Coke] one of the things we should do on the road to 6.d is improve the state of the docs. We have over 260 open issues at the moment, 167 which are mainly about missing or unclear docs.
13:33 domidumont joined #perl6
13:33 Zoffix "This representation (P6int) cannot unbox to other types (for type BOOTInt)"
13:33 Zoffix booo
13:33 lizmat [Coke]: do we include docs with R* ?
13:34 [Coke] Dunno for sure, but I think so
13:34 Zoffix Yes
13:34 [Coke] ISTR someone just complaining that p6doc didn't work in an R* on mac only
13:36 Cabanossi joined #perl6
13:38 Zoffix What does "This representation (P6int) cannot unbox to other types (for type BOOTInt)" mean? It's trying to unbox a BOOTint to P6int?
13:38 Zoffix It's pointing to nqp::divIn op
13:39 Zoffix nqp::div_In even
13:39 lizmat that would be my guess
13:39 ggoebel joined #perl6
13:40 Zoffix oh dam. it would help if I were editing the actual sources instead of gen/moar files -_-
13:43 evanm [Coke]: R* on mac does not include docs; p6doc anything returns an error.
13:43 evanm [Coke]: I've been trying to add information about this to the bug tracker, but my newbie account seems to be wedged with no permissions :-/
13:44 Zoffix cpan@perlbuild4~/CPANPRC/rakudo (nom)$ ./perl6 -e 'm: dd 1.3333333333333333333333333.nude'
13:44 Zoffix (13333333333333333333333333, 10000000000000000000000000)
13:44 Zoffix But the num issue is still there :P
13:46 Zoffix evanm: what's your rt username?
13:47 evanm Zoffix: "evanm"
13:48 Zoffix says couldn't find it... What's your email for the account?
13:50 Zoffix k, I think you should be able to add information to tickets now
13:52 evanm Zoffix: Thanks. I now see an option for "New Ticket" but I don't see a way to browse all tickets.
13:53 Zoffix Do you see anything on https://rt.perl.org/ ?
13:53 Zoffix Or on https://rt.perl.org/Search/Results.html?Query=Queue%20%3D%20%27perl6%27%20AND%20(Status%20%3D%20%27new%27%20OR%20Status%20%3D%20%27open%27%20OR%20Status%20%3D%20%27stalled%27)
13:53 Zoffix tangent to the discussion, you can browse open tickets on https://perl6.fail/
13:55 evanm Zoffix: Both links redirect me to https://rt.perl.org/SelfService/, which shows me an "Open tickets" heading with a "My open tickets" subheading
13:55 evanm (and no tickets)
13:55 rindolf Hi all! Can anyone tell me how to make this p6 code faster in rakudo/moar? http://www.shlomifish.org/Files/files/text/prob343-shlomif-p6.txt ; this runs much faster - https://github.com/shlomif/project-euler/blob/master/project-euler/343/euler_343_v2.bash
13:56 Zoffix evanm: unsure. Maybe [Coke] would know more
14:00 evanm [Coke]: It looks like I can comment on tickets now, just no way to browse them :-(
14:04 [Coke] did you get a response to your bug admin ticket?
14:05 [Coke] rindolf: you can use --profile to find where time is being spent.
14:06 rindolf [Coke]: thanks
14:06 evanm [Coke]: I have not gotten a response to my admin ticket, Zoffix has been helping me here
14:07 [Coke] ok. Add this information to your admin ticket.
14:07 [Coke] It's not going to get any less broken until they look at it.
14:08 [Coke] (and they are an all volunteer staff, same as us)
14:12 evanm [Coke]: Thanks. How do I add information to the ticket? I sent it in as an email but have not received any confirmation or ticket number
14:12 skids joined #perl6
14:14 Popov_ joined #perl6
14:14 [Coke] It should have immediately returned an rt receipt, just like a rakudobug ticket.
14:15 [Coke] please forward me a copy of the email, I'll try to open a ticket on your behalf.
14:17 evanm [Coke]: Thank you. PM me your email address.
14:17 stmuk_ evanm: I lost the ability to browse RT on one accn and had to open a new bitcard accn to use it
14:19 evanm stmuk_: Thanks for the info, fingers crossed the RT gods can figure it out though :-)
14:23 araraloren joined #perl6
14:32 [Coke] evanm: I also did not get an immediate RT ACK back; tried again without another ticket ID in the subject, still no response.
14:35 AlexDaniel joined #perl6
14:36 Cabanossi joined #perl6
14:36 Zoffix evanm: never mind, no current fix for the num issue. Gonna dig into IEEE 2008-754 some time later and fix it then
14:36 [Coke] I've pinged one of the bugadmins outside of RT to check.
14:37 * Zoffix &
14:38 Zoffix left #perl6
14:39 evanm [Coke]: thx
14:40 araraloren_ joined #perl6
14:41 rindolf [Coke]: I got this - http://www.shlomifish.org/Files/files/text/profile-1499955874.08284.html#/routines
14:41 rindolf [Coke]: converting to div= and mod did not improve the speed
14:45 [Coke] I assume you need to test out this particular algorithm. (in general, you'd use is_prime for primality testing)
14:45 mcmillhj joined #perl6
14:46 [Coke] Looks like you're doing a ton of GC runs.
14:47 [Coke] you also hit several deopt targets; if your numeric types are changing, that might trigger a deopt.
14:50 mr-fooba_ joined #perl6
14:50 [Coke] why do you have ?0 and ?1 ? just use True and False.
14:51 [Coke] I suspect those are having to translate compile time ints to runtime Bools.
14:51 [Coke] just use the boolean literals.
14:51 rindolf [Coke]: ah.
14:52 [Coke] with a limit of 10K instead of 2M, that shaves off .1s
14:52 [Coke] might improve your GC usage, also.
14:53 rindolf [Coke]: perhaps i should port the factorisation routine from https://github.com/shlomif/project-euler/blob/master/project-euler/343/euler_343_v1.py#L10
14:53 donaldh joined #perl6
14:53 [Coke] It's  not going to help me at all. :)
14:54 Morfent dealing with gc is definitely not very fun
14:56 [Coke] why do you create an array of @values in factor() and then always just take the last element?
14:56 [Coke] seems like you could ditch the array, use a scalar and just overwrite instead of pushing to it.
14:57 [Coke] I'm also confused by having an attribute for primesieve (a class) that's defined as an array.
14:58 [Coke] (is it supposed to be an array of sieves?)
15:00 DBeepBeep joined #perl6
15:06 DBeepBeep left #perl6
15:09 Morfent unrelated, but is there anything i should improve in this? https://hastebin.com/inoraraqep.rb
15:10 Morfent i'm writing some tools for managing bsd ports to learn perl
15:12 timotimo you're using rb as highlighter? %)
15:13 Morfent nah, that's hastebin being dumb about language detection
15:13 timotimo your grepDirs could be much simpler
15:13 timotimo my @dirs = grep *.d, @paths
15:14 timotimo the result of the code you give to grep isn't what ends up in the resulting list
15:14 timotimo so there's no difference between "$_ if $_.d" and "$_.d" (as long as $_ itself is always True)
15:14 timotimo and i'm not sure why you use := in method new
15:15 timotimo you can append a list of things to an array with the append method, so you don't have to @matches = flat @matches, @catMatches
15:15 timotimo you can just @matches.append(@catMatches)
15:15 geekosaur joined #perl6
15:16 timotimo also, you'll want to double-check if @catMatches contains what you think it does, because again the $_.relative inside grep's code block doesn't change the result
15:17 timotimo and instead of concatenating strings left and right of @matches.elems, you can just write @matches.elems() inside the "" string (the () at the end makes it interpolate)
15:17 rindolf [Coke]: I now have this code - http://www.shlomifish.org/Files/files/text/prob343-shlomif-p6.txt
15:17 timotimo that's all that comes to mind right now
15:17 timotimo Morfent: does that help? :)
15:18 Morfent that's really helpful
15:18 timotimo you're welcome :D
15:18 timotimo oh
15:18 timotimo something else important
15:19 timotimo if you declare "has IO::Path @.cats", you will have to actually create a "my IO::Path @cats", else it won't let you put that stuff in, i don't think
15:19 [Coke] m: say int.Range
15:19 camelia rakudo-moar f6e25b: OUTPUT: «-9223372036854775808..9223372036854775807␤»
15:20 timotimo m: class A { has IO::Path @.cats; method new { my @cats = "foo".IO, "bar".IO; self.bless(:@cats) } }; A.new
15:20 camelia rakudo-moar f6e25b: OUTPUT: «Type check failed in assignment to @!cats; expected IO::Path but got IO::Path.new("foo", :...␤  in method new at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
15:20 timotimo m: class A { has IO::Path @.cats; method new { my IO::Path @cats = "foo".IO, "bar".IO; self.bless(:@cats) } }; A.new
15:20 camelia rakudo-moar f6e25b: OUTPUT: «Type check failed in assignment to @cats; expected IO::Path but got IO::Path.new("foo", :...␤  in method new at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
15:21 Cabanossi joined #perl6
15:21 timotimo huh.
15:23 Morfent yeah, i was having a lot of problems with that, but somehow the way i handle it with grepDirs stops that error from showing up
15:24 Zoffix joined #perl6
15:24 Zoffix timotimo: restricted bot
15:25 Morfent i want to be able to cache @cats to allow multiple searches to be run at a time without needing to get the dir's contents each time, but that might not be as slow to handle in perl compared to other languages i've written in
15:25 timotimo oh!
15:25 timotimo yes, the restricted setting
15:25 timotimo gets me every single time
15:27 Morfent use strict?
15:28 Zoffix Morfent: no, the bot is restricted and some types are not real types you get in normal Rakudo. Like IO::Path. Which is why the code above errors out.
15:28 Morfent ah
15:28 khw joined #perl6
15:30 Morfent oh, for why i was using := in the new method, i thought it'd keep the values bound to $cwd and @cats after they leave the method
15:31 Morfent i'm guessing that's not the case
15:32 Zoffix Morfent: you kinda sorta have a bug in that code. You're changing global value of $*CWD, so any other code will have different $*CWD after calling your code (and I don't see why it needs to be changed at all)
15:32 rindolf [Coke]: now I am getting this profile info - http://www.shlomifish.org/Files/files/text/profile-1499959533.49994.html#/routines
15:33 Morfent it doesn't, since it didn't affect the values of @matches with relative paths
15:34 Morfent i'm handling getting the path past /usr/ports wrong
15:37 Zoffix Morfent: what's that code do? search for files in /usr/ports with basename that matches $query?
15:38 Morfent it searches for dirs within dirs of /usr/ports whose basename include $query
15:38 Morfent the first layer of dirs are just categories of ports
15:40 Morfent what i'm trying to do is include both the name of the category dir and the port dir to make it clearer what the port's purpose is
15:40 Morfent like perl 5.26 is in /usr/ports/lang/perl5.26.0
15:41 Morfent but the query should only match the last dir's name
15:44 Morfent i could use $match.substr('/usr/ports/'.chars) to display that, but it feels a bit hacky
15:46 Zoffix There are 1 ports with names matching "perl":
15:46 Zoffix /usr/ports/lang/perl5
15:46 Zoffix Morfent: is that what the output needs to be? Or does it need to say "lang/perl5" only?
15:47 yoleaux joined #perl6
15:48 Morfent this is what i want it to display https://hastebin.com/foxofirape.scala
15:50 b2gills Morfent:  my @matches = []; doesn't do what you think it does, it adds an empty array to @matches
15:51 Zoffix Morfent: this probably does what you want: https://gist.github.com/zoffixznet/1203c8a3b93421bdd79fa3beaa57684c
15:51 Zoffix b2gills: nah, it'd need a comma for that to happen
15:52 b2gills It still isn't a good idea
15:53 Zoffix Morfent: so basically, forget $*CWD, you don't need to touch it. On instantiation it loads all the cats 'cause you gonna search them anyway; otherwise you could move the .map bit on @!cats into method name. And the rest is all the same as your old code, I guess
15:53 b2gills Must have been a bit of Perl 5 think leaking in
15:53 b2gills '/usr/ports/'.IO.dir.grep: *.d;
15:54 b2gills Actually, I think he wants the entire directory tree minus files
15:54 Zoffix He? :)
15:55 * Zoffix goes back to lurking
15:55 Zoffix \o
15:55 Zoffix left #perl6
15:57 Morfent yeah, $*CWD would've introduced some problems later on if i kept it
15:57 b2gills I should have stated Morfent; sorry if I used the wrong gender pronoun
15:57 Morfent nah, i'm a guy
15:57 Morfent dw about it
15:58 b2gills We have had, and continue to have plenty of people here that aren't male
15:58 Morfent ...oh
15:59 b2gills We try to be as inclusive as possible, we even hug trolls
16:00 Morfent that's pretty good
16:02 kurahaupo joined #perl6
16:04 Morfent i mean, you guys have already been a huge help, and turning people away over things that may bother them like that would be awful
16:06 Morfent not awful as in out of being mean i should say
16:06 araraloren_ night
16:06 b2gills How many levels deep do you need
16:06 Morfent ...i phrased that badly, but anyway
16:07 cdg joined #perl6
16:08 gabiruh joined #perl6
16:13 rblackwe joined #perl6
16:15 cdg_ joined #perl6
16:26 BenGoldberg joined #perl6
16:26 b2gills Morfent: How about something more like: https://gist.github.com/b2gills/089854ad236635279ec7ff416e585f7a
16:28 evanm joined #perl6
16:29 DBeepBeep joined #perl6
16:30 DBeepBeep Is there a way to run to run a shell command without waiting for it?
16:30 DBeepBeep I'm trying to do 'qqx{ogg123 -q $file-path &};', but I don't want to wait for it to finish.
16:33 nicq20 In the main grammar, what is a xblock and pblock?
16:33 yoleaux 00:33Z <llfourn> nicq20: yeah actually I was giving you bad advice. The hack you should actually be trying is $*W.cur_lexpad() instead of $*CURPAD.
16:34 Morfent i was going to ask if mutating arrays/lists/seqs like that would leak like in some other languages, but from what i can tell from google they don't
16:34 raschipi DBeepBeep: Proc:Async
16:34 Morfent that's surprising
16:35 Cabanossi joined #perl6
16:35 Morfent i like the idea of allowing regex for searches
16:47 Morfent i think i'll try a mix of that and zoffix's code, since i think it makes more sense the way he declared /usr/ports and @cats without the need for the new method, but keeping it a unit class would make more sense in the long run
16:47 Morfent along with having regex searches be possible
16:47 TimToady nicq20: a pblock is a parameterized block, such as with -> $x, while an xblock is one of those with an expression in front of it for things like 'if' and 'for'
16:50 nicq20 TimToady: Oh, that makes sense. Thanks!
16:53 TimToady I should say, pblock is more like parameterizable, since the block in "if $x {... say $_ ... }" is not, in fact, parameterized just becuase there's a $_ there
16:54 TimToady though it would be parameterized for "for @x { ... say $_ ... }"
16:54 TimToady so there's a bit of dwimmery going on in there
16:56 TimToady alternately, you can look at the bare if as something like "if $x -> $_ = OUTER::<$_> {...}" but I suspect we optimize that away
16:56 TimToady actually, no, it can't do that, or $_ would get rebound badly, so never mind
16:57 * TimToady wanders off for more coffee
16:57 * TimToady certainly hasn't had enough coffee to actually go and reread the code :)
17:00 nicq20 llfourn: Thanks for your help! That has made this a lot easier. :)
17:06 nicq20 Well this is interesting. I made a slang that will affect comments, but it only seems to work when inside of another block. :/
17:08 nicq20 So if I say `use Module; #Foo` it does not take effect. However, if I say `use Module; { #Foo }` the Slang does take effect.
17:09 timotimo huh, that's strange
17:09 timotimo does it also take effect after these curlies?
17:10 evanm joined #perl6
17:11 TimToady perhaps 'use Module;' has already eaten the ws that would trigger <.ws>
17:11 nicq20 Yep. Seems to start taking affect after using making a block.
17:11 TimToady and it's smart enough not to call <.ws> twice in the same spot
17:12 TimToady what if you just stick an extra statement between?
17:12 TimToady or say "use Module;;"
17:13 gdonald joined #perl6
17:13 nicq20 That does not seem to work.
17:17 nicq20 Oh, boy. This is kind of weird. It only seems to work when placed after a '{'. Let me try a few more tests.
17:17 TimToady well, bear in mind that #Foo is gonna be a line-end comment if <.ws> slurps it before your new rule is installed
17:18 TimToady I assume you're just adding a multi to the comment category?
17:20 nicq20 I define `token comment:sym<smc> {...}` and `token comment:sym<#>`.
17:21 nicq20 I wanted to over-ride 'comment:sym<#>'
17:23 nicq20 You can find it here: https://github.com/nicqrocks/perl6-smart-comments/blob/master/lib/Smart/Comments/Grammar.pm6
17:24 TimToady using after is usually a mistake, in general
17:24 TimToady dunno that it's related to your issue though
17:26 nicq20 I was having trouble figuring out how to tell it to look for 1..2 or 6..* '#' in a row without it.
17:27 |oLa| joined #perl6
17:27 TimToady it's usually better to rely on LTM for such decisions
17:28 TimToady but something else in the grammar might be making assumptions somewhere
17:28 nicq20 LTM?
17:28 TimToady it's not like we have a lot of experience with gazillions of slangs yet :)
17:28 TimToady longest toke matching
17:28 TimToady *token
17:28 nicq20 Ah, ok.
17:30 TimToady which is why the original # rule has a {} in the middle, or the \N* would count as part of the longest token
17:31 zengargoyle so, did i read it right?  there was a bit of funny going on in the floating point stuff?
17:31 TimToady the use of || also defeats LTM for the second part, so that could be an issue as well
17:32 nicq20 I originally had it as a single |, but I would get an 'Invalid to edge 0 in NFA statelist' error.
17:34 timotimo that's an internal error that points to a bug in rakudo, i'd claim
17:35 TimToady yeah, that's a "shouldn't happen"
17:36 nicq20 Should probably mention then I'm running on 2017.05
17:36 TimToady don't think anybody's changed the NFA code since then
17:37 * TimToady is working up to some changes there, so tends to notice activity there
17:37 nicq20-mobile joined #perl6
17:39 TimToady though certainly something could have snuck under my radar, since I've declared irc bankruptcy a time or two since then
17:39 * TimToady still feels like he has to backlog everything, which is part of why he's been rather unproductive of late...
17:41 nicq20_mobile joined #perl6
17:45 espadrine joined #perl6
17:46 setty1 joined #perl6
17:49 wamba joined #perl6
17:49 escherlat joined #perl6
17:53 ingy what's the best way to do something like `$.foo = undef` ?
17:54 nicq20-mobile joined #perl6
17:55 geekosaur Nil, I think
17:55 geekosaur (will actually set it to its default, but in general that's correct anyway; if it has a default, setting it to a type object is usually the wrong thing to do)
17:56 geekosaur otherwise you set it to a type object, the appropriate one if you know it, otherwise try Any
17:56 zengargoyle what's the best way to do something like `return $.foo:undef` like maybe you could with `return %<foo>:delete` like...
17:57 ingy geekosaur: that works for me
17:57 zengargoyle (return the current value of $.foo while also setting $.foo = Nil)
17:57 TimToady something like: return $.foo.clone; LEAVE $.foo = Nil
17:58 TimToady or just use a temp var to clone it
17:59 * ingy is programming for $work in FanLang which only "feels" like Perl6 :)
17:59 zengargoyle thanks much.
17:59 ingy but Nil is supported and does what I want.
18:00 ingy I'm looking forward to seeing FanLang open sourced.
18:01 domidumont joined #perl6
18:04 evanm Hi, I'm working on a wrapper for libxlsxwriter, anyone care to critique? https://github.com/evanmiller/XLSX-Writer
18:04 evanm (My first attempt at a Perl 6 library...)
18:08 zengargoyle has it been decided yet whether or not a MANIFEST file is part of the Perl 6 on CPAN thing or a part of the ecosystem in general?
18:10 zengargoyle the http://modules.perl6.org/todo/zengargoyle page is still showing my modules as missing a MANIFEST even though they have a MANIFEST...
18:13 zengargoyle .ask skaji i think you're the mi6 creator, last i checked it used a MANIFEST.SKIP file against a `git ls-files` to build a CPAN tarball, but didn't actually generate a MANIFEST file...
18:13 yoleaux zengargoyle: I'll pass your message to skaji.
18:13 pilne joined #perl6
18:14 * zengargoyle thinks it may be a bit to early in the whole CPAN thing to be set in stone yet.
18:17 skaji mi6 does not generate MANIFEST files
18:17 yoleaux 18:13Z <zengargoyle> skaji: i think you're the mi6 creator, last i checked it used a MANIFEST.SKIP file against a `git ls-files` to build a CPAN tarball, but didn't actually generate a MANIFEST file...
18:25 zengargoyle skaji: i do not know yet how CPAN will handle Perl 6.  most p5 module authoring tools build the MANIFEST automatically.  at least i don't remember ever writing one myself.
18:28 skaji zeng Do you want mi6 togenerate MANIFEST files?
18:29 zengargoyle skaji: but i guess it all depends on whether MANIFEST is going to be an expected part of a dist or not.  so i'm just asking and waiting for now. :)
18:30 zengargoyle i started to modify mi6 but ran into a bug in rakudo so stopped. :)  MANIFEST.SKIP should take some sort of regex or glob pattern match rather than just an 'eq' test. :)
18:30 TimToady evanm: looks fine to me
18:31 zengargoyle but the thing you did with 'eq' and MANIFEST.SKIP breaks if you try to use regex in the same way.
18:32 skaji zengargoyle: I think we can change it:)
18:33 evanm TimToady: thanks! Is there a "best practices" somewhere for writing module documentation?
18:33 zengargoyle skaji: i'm not sure if i'd change it until somebody decides whether or not we need a MANIFEST file at all....
18:34 zengargoyle just keep it in mind i guess. :)
18:36 skaji zengargoyle: I mean I can change mi6 to take care of regexp in MANIFEST.skip
18:36 zengargoyle another skaji++ for mi6 in general
18:38 zengargoyle skaji: that would be cool for me at least, sometimes i have a './corpus/' directory with tons of files for author-ish testing that don't need to be distributed in dist.
18:39 b2gills evanm: In many cases you can have native subs as methods `method set-bold() is native(LIB) is symbol('format_set_bold') { }`
18:39 zengargoyle be warned though, there's a bug with closures over * ~~ /$regex/ so it won't work the same way you use 'eq' now.
18:41 zengargoyle RT131409
18:41 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=131409
18:42 evanm b2gills: Thanks for the tip, I wasn't aware of that. I think  I'd rather leave it as-is for consistency, and in case these functions ever have return codes
18:42 evanm Is there any semantic difference between `is native(LIB) {...}` and `is native(LIB) {*}` btw?
18:43 b2gills The stuff inside of {} is ignored as long as it is valid Perl 6 code
18:43 TimToady ... tends to mean "stub" rather than "defined elsewhere", so I'd prefer *
18:43 TimToady it's also shorter :)
18:43 b2gills It works just as well if it is empty
18:44 TimToady we use * in subs to indicate delegation, so it's kinda documentation
18:44 geekosaur but the {*} is a good quick-glance 'this is foreign'
18:44 TimToady and bare {} kind looks like an empty hash
18:45 TimToady *kinda
18:45 TimToady even though it's illegal at that spot, it still lights off some unnecessary neurons
18:46 b2gills I think that putting something in there is better than nothing for Real Code™
18:46 evanm Ok. I've also seen { ... } in class declarations, e.g.:  https://github.com/rakudo/rakudo/blob/nom/src/core/Proc.pm
18:47 skaji zengargoyle: patches welcome. You don't need to use whateverstar to fit existing mi6 code (you can use sub {} instead).
18:47 evanm Is that a forward declaration? Telling the compiler "Trust me, this is a class"?
18:47 TimToady yes, in that case it really is a stub
18:48 b2gills m: class Foo { method bar() {...} }; Foo.bar()
18:48 camelia rakudo-moar f6e25b: OUTPUT: «Stub code executed␤  in method bar at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
18:48 TimToady m: class Foo { ... }; Foo.new
18:48 camelia rakudo-moar f6e25b: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤The following packages were stubbed but not defined:␤    Foo␤at <tmp>:1␤------> 3class Foo { ... }; Foo.new7⏏5<EOL>␤    expecting any of:␤        statement end␤        statement modifier…»
18:48 zengargoyle skaji: cool, i was working on patch and got sidetracked by bug. :)
18:49 TimToady good :)
18:49 nicq20_mobile joined #perl6
18:49 TimToady m: class Foo { * }; Foo.new
18:49 camelia rakudo-moar f6e25b: ( no output )
18:49 zengargoyle skaji: and don't want to turn it into distzilla monstrosity. :P
18:49 TimToady arguably should say 'Useless use of whatever'
18:50 b2gills evanm: I don't understand what you meant by “in case these functions ever have return codes”
18:50 rumble joined #perl6
18:51 TimToady if you had to do translation on the return, you could just turn the sub into a wrapper rather than a direct native call
18:51 TimToady so I don't see much problem
18:51 zengargoyle skaji: but really waiting for CPAN thing to be sorted out a bit more.
18:51 evanm b2gills: right now format_set_bold returns nothing. If it returns an integer (error value) in the future, that I want wrapped in an Error enum, I think I'd have to rewrite it
18:51 geekosaur a forward decl would be 'class Foo;' iirc. ... means it's there so the code will compile but it's not implemented yet, so it throws if instantiated
18:52 b2gills It should work just fine if you declared it as returning an enum
18:52 geekosaur (because in some sense defining a class mutates the 'language'; later code will parse differently if a name is known to be a class vs. something else)
18:52 TimToady geekosaur: that's what a forward declaration means, not implemented yet
18:53 TimToady and we specifically disallow the semicolon notation there
18:53 evanm b2gills: Oh, okay. NativeCall always tends to be more magical than I expect :-)
18:53 TimToady that would be p5-think :)
18:53 TimToady or C, or most every other C-derived language...
18:53 TimToady m: class Foo;
18:53 camelia rakudo-moar 8d5f33: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Semicolon form of 'class' without 'unit' is illegal.  You probably want to use 'unit class'␤at <tmp>:1␤------> 3class Foo;7⏏5<EOL>␤»
18:54 TimToady m: unit class Foo; class Bar;
18:54 camelia rakudo-moar 8d5f33: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Too late for unit-scoped class definition;␤Please use the block form.␤at <tmp>:1␤------> 3unit class Foo; class Bar;7⏏5<EOL>␤»
18:54 TimToady to catch both of those thinkos, we require {...}
18:58 b2gills evenm: Part of the reason Perl 6 is designed the way it is, is to make it easy to integrate new ideas into the language as if they have always been there
18:58 b2gills This also makes it possible to make libs/modules from other languages seem as if they were actually written in Perl 6
19:01 nicq20-mobile joined #perl6
19:02 evanm NativeCall is very nice. My only qualms are inability to pass/return structs by value, and (seeming) inability to marshal a Perl object to a context pointer for callback-based APIs
19:03 mcmillhj joined #perl6
19:04 evanm I managed to work around the struct issue with some horrible calling-convention hacks, but the pointer thing has been a pain point
19:04 nicq20 joined #perl6
19:04 pmurias joined #perl6
19:05 [Coke] evanm, Zoffix: emails to the bugadmins no longer send autoreplies. it's in their queue.
19:05 pmurias ingy: are there plans for FanLang to be open sources?
19:05 evanm [Coke]: thanks!
19:06 nhywyll joined #perl6
19:06 ingy pmurias: yes.
19:06 b2gills I haven't done much with NativeCall myself
19:08 pmurias ingy: in the far future or soonish? ;)
19:08 b2gills I think FanLang would be a good opportunity to get narrative going about how we will spec languages that are a subset of full Perl 6
19:08 TimToady it will be interesting to see how much FanLang trades correctness for speed :)
19:09 pmurias b2gills: FanLang wasn't a proper subset the last time I saw snippets of it
19:09 b2gills I would like if someone created a really limited fully static version that compiles directly into machine code
19:10 ingy pmurias: I would expect FanLang to be opensourced in some form this year. agenetzh wants it to be self-hosted first.
19:10 b2gills Rakudo isn't even a proper subset of Perl 6
19:11 kybr evanm: i think i'm experienceing the callback+pointer pain.
19:12 evanm kybr: This is basically the wall I hit: https://stackoverflow.com/questions/43370856/how-can-i-pass-a-perl-6-object-through-a-nativecall-callback
19:12 kybr i'm trying to make callbacks work for liblo and PortAudio c libraries.
19:12 ingy pmurias: FanLang is very proper subset except in the grammar{...} syntax. That looks a lot like Pegex :)
19:14 zakharyas joined #perl6
19:14 evanm kybr: I think you can hack around it with closures? It started to really complicate the object model / class hierarchy so I gave up
19:15 ingy TimToady: I know that correctness is very important.
19:15 b2gills If we really cared, they could have `pegex Foo {...}` instead of `grammar Foo {...}` ( I don't think we will care though )
19:15 ingy b2gills: yeah
19:16 ingy maybe we should do that to make it a proper subset.
19:16 kybr evanm: thanks. i don't know what to do with "MoarVM panic: Unhandled exception: Cannot invoke null object" and "Internal error: Unwound entire stack and missed handler"
19:16 evanm kybr: What I'd really like is a like an UNWHERE and a way to tell the GC not to touch an object while I'm doing stuff
19:16 ingy can you `use` something that changes the syntax of `grammar`?
19:17 evanm kybr: I ran into similar issues, at least with the stack unwind
19:17 evanm The issue for me was using an incorrect function signature
19:18 nhywyll left #perl6
19:18 pmurias ingy: if a different keyword was used for Pegex-style grammars it would be possible for someone else to add 'Perl6-style grammars'
19:18 kybr what's UNWHERE? yeah. marking objects as don't-gc would be nice. i'm still just learning the language and using nativecall.
19:18 ingy ie: use Grammar::Pegex; grammar Foo { a: b | c; b: /foo/; c: /bar/ }
19:18 b2gills The only thing I know of that is in the area of other parsers is https://github.com/drforr/perl6-ANTLR4
19:19 evanm kybr: I made up UNWHERE, basically I want the inverse of .WHERE
19:19 kybr i'm still a little fuzzy on how to line up clanguage signatures and perl6 nativecall types.
19:20 b2gills I'm sure if someone wrote a Slang they could make it so that the grammar keyword was used for writing in another parser language
19:20 geekosaur evanm, I don't think that's a thing unless you can abuse NativeCall
19:20 geekosaur and arguably it shouldn't be a thing except by jumping through hoops; .WHERE is mostly for debugging
19:20 evanm geekosaur: I'm just dreaming here :-)
19:21 evanm Many C APIs are oriented around callbacks with a generic context pointer
19:21 b2gills There may be something in one of the Inline::* modules that will help you come up with some ideas about how to work with NativeCall
19:21 evanm Usually in C you pass in a pointer to your custom struct, and do a cast within the callback
19:22 ingy pmurias: but using a slang module would only change things lexically, right?
19:22 pmurias ingy: yes
19:24 b2gills A Slang module can basically do anything it wants to with the rest of the file
19:25 pmurias ingy: what would be the benefit for using 'grammar' instead of a different keyword (like 'parser') for Pegex-style grammars?
19:25 pmurias s/for/of/
19:26 ingy so maybe we should just add a slang `use Grammar::Resty;` to the top of our `unit grammar` files
19:26 ingy pmurias: 6 of 1
19:27 b2gills I was just going to say something along those lines
19:27 ingy well if we used a different keyword, it's no longer a subset
19:27 ingy without a slang as well
19:28 pmurias ingy: '6 of 1'?
19:28 [Coke] pmurias: 1/2 dozen of another.
19:29 b2gills FanLang could just error out (or warn) if it sees a grammar but doesn't see a `use Grammar::Resty`
19:29 ingy I was trying to say either way is fine, but now I thing keeping `grammar` is slightly better
19:29 ingy b2gills: yeah
19:29 andrzejk_ joined #perl6
19:30 b2gills In FanLang that could be more of a pragma, and an identical Perl 6 module could swap out the default parser for one that works with FanLang's syntax
19:31 ingy yep
19:33 leont_ joined #perl6
19:35 pmurias ingy: you can you both a slang and a different keyword, that way Perl6 with 'use Grammar::Resty' would be a super set of Perl 6
19:36 b2gills This is part of what I was saying about getting a narrative going for subset languages. It also matters for new implementations as well (they will have to start out as a subset)
19:37 ingy pmurias: you mean a super set of FanLang?
19:38 ingy I don't see how it matters which keyword we use...
19:38 pmurias ingy: it would be a super set of both FanLang and Perl6
19:38 agentzh joined #perl6
19:39 pmurias it being the language you switch to after 'use Grammar::Resty'
19:39 agentzh joined #perl6
19:39 mcmillhj joined #perl6
19:39 ingy agentzh arrives :)
19:39 agentzh halo
19:40 pmurias hello
19:40 agentzh we're having a lot of fun hacking in our perl 6 dialect for real products.
19:40 ingy we were just talking about FanLang. Mostly open sourcing it eventually and also making it a proper subset of p6
19:40 agentzh ingy has been helping us a lot with fanlang hacking.
19:41 pmurias agentzh: great to see Perl 6 being used in production :)
19:41 agentzh yeah, fanlang's emitted code is at the same level of perl 5 and sometimes even faster.
19:41 ingy like if we started unit grammar files with a slang module: `use Grammar::Syntax::FanLang;` or somesuch
19:41 agentzh i mean the performance.
19:42 agentzh and compiling is much faster than rakudo as well.
19:42 agentzh and fanlang is still *unoptimized* :)
19:42 b2gills I think dealing with partial implementations, and subset languages as if they were Slangs is a very interesting idea that should be explored further
19:43 ingy I am hoping to start work on self-hosting FanLang soon.
19:43 agentzh yeah, that'll open the door for our first open sourced version of fanlang.
19:43 agentzh a self-hosting fanlang.
19:44 agentzh ingy: i don't quite like the boilerplate code to be 100% compatible with perl 6 though.
19:44 agentzh ingy: it's similar to p5's "use v5.10.1; user strict; use warnings;" boilerplate.
19:44 b2gills Rakudo is only partially self-hosted itself
19:45 agentzh fanlang will be 100%.
19:45 pmurias agentzh: do fanlang files have a file extension?
19:45 agentzh .fan
19:45 agentzh obviously :)
19:46 ingy I have to say that working every day in FanLang is awesome about 80% of the time. 80% of the time its like real Perl6. 20% it's a new language with bugs.
19:46 b2gills .oO( that's .fan-tastic )
19:46 ingy but it gets better and better
19:46 agentzh lol, yeah, it's a young language.
19:46 ingy haha
19:46 agentzh just 7 months old,
19:46 agentzh maybe?
19:46 ingy think you started in Dec?
19:47 ingy totally amazing how much works
19:47 agentzh i started hacking on fanlang from scratch since the late Nov, 2016.
19:47 pmurias agentzh: having fanlang assume the files it gets are in FanLang without boilerplate seems sane
19:47 agentzh pmurias: *nod*
19:47 agentzh we keep calling it a "perl 6 dialect" instead of a "perl 6 subset" or "perl 6".
19:47 AlexDaniel joined #perl6
19:48 ingy I just used $* today for first time
19:48 * agentzh loves the perl 6 idea as a whole since 2012.
19:48 ingy also found a bug in $* :)
19:48 agentzh pull requests welcome! :D
19:48 ingy ;)
19:48 * moritz wants to create a hybrid between Python and Perl 6 some day
19:49 pmurias what I'm suggesting is that if it uses a different keyword than grammar for it's Pegex-style grammars it should be possible to have a Perl 6 slang that's a superset of both Perl6 and Fanlang
19:49 agentzh moritz: well, we'll probably create a python compiler targeting openresty/luajit in a similar way to fanlang.
19:49 moritz with mostly python syntax, but explicit declarations and grandual types
19:49 moritz and first-class regexes and grammars
19:50 agentzh moritz: and such a py on luajit compiler will surely be written in fanlang :D
19:50 b2gills Perl 6 is technically only about 18 months old itself
19:50 ingy moritz: look at CoffeeScript syntax. Much better than Python imho :)
19:50 agentzh b2gills: seriously? rewrites also count :)
19:51 moritz b2gills: I think you're confusing birth with age of legality here :-)
19:51 b2gills Perl 6 was officially released 2015-12-25, everything before that was it's gestation stage
19:51 ingy every word has subtle implications when you say something about Perl 6 :P
19:52 agentzh our company is also sponsoring optimizations inside the luajit internals to make our fanlang run faster and faster.
19:52 agentzh the goal is to make luajit a good common language runtime for dynamic langauges.
19:52 agentzh similar to the vision of parrot.
19:52 agentzh or roarvm if i'm not mistaken.
19:52 b2gills oooh that means Factorial will also be faster
19:52 ingy agentzh: near C speeds, right?
19:53 agentzh well, i hope.
19:53 b2gills *Factorio
19:53 dha joined #perl6
19:53 agentzh b2gills: we are more interested in real world production apps' performance though.
19:53 ingy I want to try making an Inline::LuaJIT so I can write XS modules in Lua instead of C
19:53 agentzh b2gills: our fanlang codo base is usually above 1000 LOC.
19:53 agentzh some are 6K LOC.
19:54 ingy (in p5 obviously)
19:54 pmurias agentzh: moarvm is heavily designed towards running Perl 6
19:54 pmurias agentzh: JVM with (Graal + Truffle) is implementing the parrot vision
19:55 b2gills I've heard talk about Lua being used for ZFS which would effect the performance of everything running on FreeBSD that has to access files
19:55 BenGoldberg joined #perl6
19:57 evanm The R* release notes mention "non-blocking I/O (in progress)" as an upcoming feature... does anyone know what's in the works there?
19:58 b2gills evanm: If you **really really* want to be in the loop then watching on #perl6-dev might be advisable
19:59 evanm b2gills: Good idea, I guess I'll skim through the IRC logs to start :-)
19:59 ingy Lua is probably my favorite syntax to generate. The grammar is such that you don't need statement endings and such. A lot harder to mess up than other langs.
20:00 ingy It's not terrible language to write by hand either, but definitely not 1337 enough for Ingy
20:09 b2gills The biggest thing that I think would annoy me is 1 based array indexing
20:10 robertle joined #perl6
20:11 cpage__ joined #perl6
20:19 TEttinger joined #perl6
20:20 Cabanossi joined #perl6
20:22 ingy b2gills: I know it sounds crazy, but its really not that bad at all
20:25 geekosaur we older types are kinda used to context switching on that
20:25 geekosaur since a number f older languages used 1-based
20:25 agentzh joined #perl6
20:25 agentzh pmurias: i love little powerful things that can fit nicely in a small box.
20:25 agentzh and we can also have full control over it when things go south.
20:25 agentzh debugging JVM internal issues can never be easy or fun.
20:27 ingy b2gills: speaking of that, I find it annoying that $1 became $0 in p6 :)
20:28 agentzh the whole libluajit.so is only 496KB without debug symbols.
20:29 ingy hmm I read it was 400k
20:29 ingy must be outdated reading
20:30 agentzh LuaJIT 2.0's libluajit.so is 456KB.
20:30 agentzh 2.1 has got a lot more new features.
20:30 * geekosaur is still on 1.5 for some things...
20:30 agentzh wow
20:32 ingy I wonder if 500k is too much overhead for doing p5 XS modules in Lua
20:32 geekosaur hm, actually no. I remembered the 5 but it's the shlib version which is disjoint. (dcss incompatible with the newer JIT memory handling)
20:37 pmurias agentzh: the Graal + Truffle approach is the opposite of small/controlled things as they give you clever tools that turns your interpreter into a custom jit
20:39 agentzh like pypy's approach?
20:40 pmurias vaguely in the same direction
20:41 agentzh it does seem like the ultimate speedy approach.
20:41 agentzh *does not seem like
20:41 pierre__ joined #perl6
20:41 agentzh though it's much easier in engineering.
20:41 agentzh we're also into custom JIT compilers for things like regexes.
20:42 agentzh much smaller languages.
20:42 agentzh so it can do a much better job than luajit's jit.
20:43 agentzh we also use tinycc's libtcc for quick & dirty C code AOT compilation at runtime.
20:43 agentzh not the best speed, but good enough for many things.
20:44 agentzh tcc is also very small.
20:44 agentzh *libtcc
20:44 * agentzh is a minimalist.
20:44 ingy yes, he writes new languages to write new languages in :D
20:45 agentzh lol
20:45 kybr is there a way to tell moar to trace?
20:48 ingy fine by me. I'm getting to work on half a dozen new languages using a Perl 6 dialect. Life is good.
20:51 Cabanossi joined #perl6
20:53 b2gills ingy: well $0 is short for $/[0] so it does in a way make more sense than leaving it as $1
20:54 ingy b2gills: sure but other langs return a $/-like thing where 0 == whole match and 1.. are the captures
20:54 ingy and they probably took a cue from perl5
20:55 ingy even bash's BASH_REMATCH starts at 1
20:55 ingy and bash regex support came from p5
20:55 b2gills m: 'abc' ~~ / . <( . )> (.)/; say ~$/; say $0
20:55 camelia rakudo-moar 8d5f33: OUTPUT: «b␤「c」␤»
20:55 ingy so kinda funny for p6 to stab the followers of perl in the back :D
20:56 b2gills If you are always following, you are never leading
20:57 ingy even when you are backtracking
20:58 ingy fwiw I hate the ~= syntax in Lua
20:58 b2gills m: 'abc' ~~ / $<foo> = [.] <( . )> (.)/; say ~$<foo>; say ~$/; say ~$0
20:58 camelia rakudo-moar 8d5f33: OUTPUT: «a␤b␤c␤»
21:03 b2gills I prefer the Perl 6 way of having ! be a meta operator that you can apply to any diffy infix operator
21:03 b2gills Which is why I have some dislike for !=
21:05 b2gills It's confusing because &[!=] and &[!==] are equivalent, and &[!===] means something different
21:05 pmurias ingy: does fanlang use bignums?
21:24 evanm joined #perl6
21:38 colomon_ joined #perl6
22:06 Cabanossi joined #perl6
22:39 perl6hobo joined #perl6
22:44 perl6hobo Hello... I'm very new to Perl 6. I'm doing some intial research into using the langauge and running into some difficulty with some basics. I'm on Windows 10.
22:44 perl6hobo First of many questions I'm sure... The rakudo-star-2017.04.2-x86_64 (JIT).msi installer forces the install to C:\rakudo\, I cannot see a way to have a different location. If it cannot be relocated, how can software developed with it be distributed?
22:46 cpage_ joined #perl6
22:47 perl6hobo Typically, I would expect to bundle the VM, my software and any dependencies together in folder that could be zipped up and sent to another computer to be unzipped wherever it appropriate. This keeps dependancies all together and minimal surprises later. Am I missing something here for deployment?
22:47 timotimo you can use the WiX installermaker for that purpose
22:47 timotimo it will compile a rakudo for you that has the path you wish for baked in
22:48 perl6hobo Awesome thank you. I will look into WiX.
22:48 yoleaux eveo: Zoffix fix xt on docbuild
22:50 _28_ria joined #perl6
22:50 timotimo eco: wix
22:50 timotimo https://github.com/jnthn/p6-app-installermaker-wix  -  perl6hobo, this one
22:50 timotimo WiX is just a thing that builds msi files from a little specification file
22:51 Cabanossi joined #perl6
22:53 perl6hobo Do you happen to know if there are any issues with multiple applications installed using the WiX installermaker running on the same computer?
22:53 timotimo shouldn't be a problem at all
22:54 perl6hobo Thank you so much for the help. It looks like exactly what I need.
22:58 skids joined #perl6
23:02 cpage_ joined #perl6
23:13 Morfent joined #perl6
23:35 Cabanossi joined #perl6

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

Perl 6 | Reference Documentation | Rakudo