»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend! Set by moritz on 22 December 2015. |
|||
00:00
dubi0us joined
00:02
cdg left,
mcmillhj left
00:03
mcmillhj joined
00:04
dubi0us left
00:08
mcmillhj left
00:11
AlexDaniel joined
00:20
Cabanossi left
00:21
Cabanossi joined
00:22
dubi0us_ joined
00:24
lookatme joined
|
|||
lookatme | morning | 00:24 | |
00:26
dubi0us_ left
|
|||
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
00:59
Fong left
|
|||
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 | |
01:02
cdg joined
01:06
cdg left
01:11
dubi0us joined
01:16
dubi0us left
|
|||
llfourn | mvr707: that sounds bad, what's your perl6 --version | 01:16 | |
Morfent | doesn't look like rakudo likes being compiled with clang very much | 01:22 | |
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 | |||
guess i'll build it with gcc | 01:27 | ||
llfourn | I use rakudo on mac built with clang as my main dev setup | 01:28 | |
I rarely have problems that are specific to mac | 01:29 | ||
I did zef install Data::Dump and it worked fine fwiw | |||
01:35
Cabanossi left
01:37
Cabanossi joined
|
|||
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:39 | |
mainly gnu coreutils, but i want to play it safe | 01:40 | ||
llfourn | well sure, all I meant was moarvm/rakudo seems to be fine when compiled with llvm | 01:41 | |
01:42
dubi0us joined
01:45
ilbot3 left
01:46
dubi0us left
01:48
ilbot3 joined,
ChanServ sets mode: +v ilbot3
01:57
aborazmeh joined,
aborazmeh left,
aborazmeh joined
02:02
astj_ joined,
astj left
02:07
noganex joined
02:10
dubi0us joined,
noganex_ left
02:15
Xliff joined
02:17
Xliff_ left
02:27
dubi0us left
02:32
dubi0us joined
02:34
dubi0us_ joined
02:37
dubi0us left
02:44
cdg joined
02:48
cdg left
03:00
Khisanth left
03:13
Khisanth joined
03:15
dubi0us_ left
03:16
gdonald left
03:18
espadrine left
03:23
evanm joined
|
|||
evanm | Can someone explain the following discrepancy to me? | 03:24 | |
m: 0.1e0 + 0.2e0 == 0.3e0 | |||
camelia | WARNINGS for <tmp>: Useless use of "==" in expression "+ 0.2e0 == 0.3e0" in sink context (line 1) |
||
03:24
dubi0us joined
|
|||
evanm | m: say 0.1e0 + 0.2e0 == 0.3e0 | 03:24 | |
camelia | False | ||
evanm | m: say 1e-1 + 2e-1 == 3e-1 | 03:25 | |
camelia | True | ||
evanm | m: say 0.1e0.WHAT | 03:26 | |
camelia | (Num) | ||
evanm | m: say 1e-1.WHAT | ||
camelia | (Num) | ||
zengargoyle | evanm: the original error is just because you didn't 'say' the result. | ||
evanm | zengargoyle: Understood, I'm curious about the arithmetic | 03:27 | |
zengargoyle | ah, | ||
03:28
gdonald joined
|
|||
zengargoyle | m: say 0.1e0 + 0.2e0 =~= 0.3e0 | 03:30 | |
camelia | True | ||
zengargoyle | m: say 0.1e0 + 0.2e0 ≅ 0.3e0 | 03:32 | |
camelia | True | ||
zengargoyle would pass it off to the mysteries of IEEE floating point. | 03:33 | ||
evanm | The equivalent C code gives false in both cases | 03:34 | |
03:34
Cabanossi left
|
|||
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
|
|||
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 | ||
zengargoyle | it may be the floating point library that moarvm uses for all of the fancy math stuff. | ||
evanm | Maybe 1e-1 gets encoded differently from 0.1e0 | ||
03:37
Cabanossi joined
|
|||
AlexDaniel | interesting | 03:37 | |
lookatme | evanm, float number in C is imprecision | ||
evanm | Is there a JVM bot in the channel? Would be curious if it gives same result | ||
zengargoyle | i.e. i'm not sure moar does floaing itself... | ||
AlexDaniel | j: say 0.1e0 + 0.2e0 == 0.3e0 | 03:38 | |
camelia | False | ||
AlexDaniel | j: say 1e-1 + 2e-1 == 3e-1 | ||
camelia | True | ||
lookatme | say (0.1e0 + 0.2e0).WHAT | ||
evalable6 | (Num) | ||
lookatme | say (1e-1 + 2e-1).WHAT | 03:39 | |
evalable6 | (Num) | ||
zengargoyle | m: say 0.1e0 + 0.2e0 | ||
camelia | 0.3 | ||
lookatme | say 1e-1 + 2e-1 | ||
evalable6 | 0.3 | ||
zengargoyle | m: say (0.1e0 + 0.2e0).perl | 03:40 | |
lookatme | say 0.3 == 0.3e0 | ||
camelia | 0.3e0 | ||
evalable6 | True | ||
lookatme | say 0.3 == 3e-1 | ||
evalable6 | False | ||
03:40
cdg left
|
|||
lookatme | Oh, it's totally mess | 03:40 | |
03:40
cdg joined
|
|||
AlexDaniel | ah, okay | 03:40 | |
I see something | |||
m: dd 0.3 | 03:41 | ||
camelia | 0.3 | ||
AlexDaniel | m: dd 3e-1 | ||
camelia | 0.3e0 | ||
lookatme | m: dd 0.3e0 | ||
camelia | 0.3e0 | ||
lookatme | m: say 0.3e0 == 3e-1 | ||
camelia | True | ||
lookatme | m: say 0.3e0 == 3e-1 == 0.3 | 03:42 | |
camelia | True | ||
lookatme | m: say (0.3e0 == 3e-1 == 0.3) | ||
camelia | True | ||
lookatme | IDK, bug ? | ||
03:42
matt_ left
|
|||
AlexDaniel | evanm: I can't really tell if this is something we should fix, but I guess it's worth a ticket | 03:42 | |
evanm: if anything, we will at least have a rejected ticket with a good explanation for future use :) | 03:43 | ||
like, I'm really not expecting equality to work like this with Nums, and Perl 6 provides much better alternatives | |||
so IMO not a big deal at all, even if other languages disagree for some reason | |||
but still, it's worth a ticket :) | 03:44 | ||
evanm | It's not a big deal, I'm just curious what the explanation is | ||
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 | ||
camelia | True | ||
03:48
dubi0us left
|
|||
AlexDaniel | ah wait | 03:48 | |
03:48
Cabanossi left
|
|||
AlexDaniel | m: dd 3e-1 | 03:48 | |
camelia | 0.3e0 | ||
AlexDaniel | m: dd 0.3e0 | ||
camelia | 0.3e0 | ||
03:50
aborazmeh left,
Cabanossi joined
|
|||
AlexDaniel | ye this doesn't help… I see nothing :) | 03:51 | |
(forgot the e0 part… *facepalm*) | |||
03:52
matt_ joined,
matt_ is now known as Guest2731
03:53
vendethiel joined
|
|||
Morfent | there we go, all tests pass with gcc | 03:54 | |
TEttinger | m: dd 0.3e1 | 03:57 | |
camelia | 3e0 | ||
TEttinger | m: say 0.3e1 == 3.0 | ||
camelia | True | ||
TEttinger | m: say 0.3e1 == 3 | ||
camelia | True | ||
TEttinger | m: say 0.5e0 == 0.5 | 03:58 | |
camelia | True | ||
TEttinger | m: say 0.4e0 == 0.4 | ||
camelia | True | ||
TEttinger | m: say 4e-1 == 0.4 | ||
camelia | True | ||
03:58
pilne left
|
|||
TEttinger | m: say 3e-1 == 0.3 | 03:59 | |
camelia | False | ||
TEttinger | ok, I'm chalking it up to floating point weirdness | ||
j: say 3e-1 == 0.3 | |||
camelia | False | ||
03:59
Actualeyes1 joined
04:00
Actualeyes left
|
|||
TEttinger | anyone know how I'd call the Java standard lib method Double.doubleToLongBits(double) via the JVM perl 6? | 04:01 | |
might get a clear answer that way | |||
j: say Double.doubleToLongBits(3e-1) | |||
camelia | 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) | ||
zengargoyle | m: say 0.1e0 + 0.2e0 - 0.3e0 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routine: java used at line 1 |
||
5.55111512312578e-17 | |||
zengargoyle | maybe the actual additions/subtractions/maths move from the simple tests into the realm of weird. | 04:03 | |
TEttinger | zengargoyle: 3e-1 == 0.3 is false | 04:06 | |
evanm | It's my bedtime, but I'll leave you all with this final conundrum: | 04:09 | |
m: say 1e-1 + 2e-1 == 3e-1 | |||
camelia | True | ||
evanm | m: say 1e-1 == 3e-1 - 2e-1 | ||
camelia | False | ||
evanm | g'night! | 04:10 | |
04:10
evanm left
|
|||
TEttinger | m: say 0.1 == 0.3 - 0.2 | 04:11 | |
camelia | True | ||
TEttinger | definitely a difference in how scientific notation works :| | 04:12 | |
skids | scientific notation gets you a float repr. | ||
AlexDaniel | TEttinger: well, that's not very surprising | ||
TEttinger | how so? | 04:13 | |
m: say (0.1 == 0.3 - 0.2) == (1e-1 == 3e-1 - 2e-1) | |||
camelia | False | ||
skids | 0.3 is a Rat. | ||
TEttinger | oh. right the weird names | 04:14 | |
skids | No more weird than Int. | 04:16 | |
FatRat is a bit "weird", but fun. | |||
docs.perl6.org/type/Rational | 04:17 | ||
zengargoyle | m: say 0.1e0 + 0.2e0 | ||
camelia | 0.3 | ||
zengargoyle | m: say 0.1e0 + 0.2e0 - 1e0 | ||
camelia | -0.7 | ||
zengargoyle | m: say 0.1e0 + 0.2e0 - 3e0 | 04:18 | |
camelia | -2.7 | ||
zengargoyle | m: say 0.1e0 + 0.2e0 - 0.3e0 | ||
camelia | 5.55111512312578e-17 | ||
zengargoyle | m: say 0.2e0 - 0.3e0 | 04:19 | |
camelia | -0.1 | ||
skids | Yeah so something is probably cheating by handing back a Rat for 0.1e0 | ||
04:20
Cabanossi left
|
|||
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
|
|||
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. | ||
zengargoyle | ISTR? | 04:22 | |
TEttinger | I Seem To Recall ? | 04:28 | |
04:33
AlexDaniel left
|
|||
skids | Yeah. Though maybe I am recalling wrong. | 04:33 | |
04:33
astj_ left
04:34
astj joined,
vendethiel- joined
|
|||
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:35 | |
04:36
vendethiel left
04:37
xtreak joined
04:39
mr-foobar joined
|
|||
skids | anyway, bedtime for me. | 04:39 | |
04:43
vendethiel- left
04:44
vendethiel joined
04:50
Cabanossi left,
Cabanossi joined
04:55
skids left
04:56
nadim joined
04:58
vendethiel left
05:02
khw left
05:04
lizmat left
05:09
pierre__ left,
Morfent left
05:10
Morfent joined
05:14
cdg left
05:19
Mrofnet joined
05:22
Morfent left
05:23
Moronnt joined
05:25
Mrofnet left
05:28
Morfent joined
05:31
Moronnt left
05:33
Cabanossi left
05:35
Cabanossi joined
05:54
raschipi joined
05:55
raschipi left
05:56
Actualeyes1 left
05:58
|oLa| joined
06:02
lowbro joined,
lowbro left,
lowbro joined
06:04
BenGoldberg left
06:12
Actualeyes joined
06:13
ufobat_ joined
06:14
ufobat_ left
06:21
famrani joined
06:22
pierre__ joined
06:27
andrzejk_ joined,
famrani left
06:33
nadim left
06:34
Cabanossi left
06:36
Cabanossi joined
06:41
domidumont joined
06:42
|oLa| left
06:47
domidumont left
06:48
wamba joined,
domidumont joined
06:51
pierre__ left
07:00
domidumont left
07:01
domidumont joined
|
|||
moritz | I'd argue that the design docs are out of date there | 07:05 | |
07:07
|oLa| joined
07:11
abraxxa joined
07:12
leont left
07:13
Actualeyes left,
|oLa| left
07:14
darutoko joined
07:15
nadim joined,
|oLa| joined
07:16
domidumont left
07:17
parv joined
07:18
domidumont joined
07:28
dakkar joined
07:32
Actualeyes joined,
|oLa| left
07:36
zakharyas joined
07:39
cyphase left
07:40
cyphase joined
07:43
leont joined
07:44
andrzejk_ left,
domidumont left,
domidumont joined
07:46
lizmat joined
07:52
gdonald left
07:54
qwebirc79257 joined,
qwebirc79257 left
07:55
alpha6 joined
07:58
pierre__ joined
08:01
jonas1 joined
08:04
gdonald joined
08:25
leont_ joined,
leont left
|
|||
nadim | Good morning! is there some sugar to declare anonymous subs without using the keyword 'sub'? | 08:30 | |
llfourn | nadim: nope. Not if you want a Sub specifically. | 08:31 | |
if you just want a block you can do my $foo = -> { ... } but that's a Block not a Sub. | 08:32 | ||
08:32
cosimo joined
|
|||
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:33 | |
08:34
cosimo left,
mr-foobar left
08:37
leont_ left
|
|||
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 | |
08:38
cosimo joined,
nicq20 left
|
|||
lizmat | nadim: do you need to be able to return from the sub ? | 08:47 | |
08:48
Cabanossi left
08:50
Cabanossi joined
09:02
astj_ joined,
astj left
09:10
xtreak left
09:11
xtreak joined
09:15
xtreak left
09:19
Cabanossi left
09:20
Cabanossi joined
09:31
mr-foobar joined
09:43
andrzejku left
09:44
lookatme left
09:47
xtreak joined
09:50
Cabanossi left,
Cabanossi joined
10:01
TEttinger left
|
|||
nadim | no | 10:01 | |
lizmat: each sub modifies an object that is in scope | 10:02 | ||
anyway to get the output of dd or have dd write on stderr | 10:03 | ||
10:05
robertle joined
10:12
astj_ left
10:13
astj joined
|
|||
nadim | meh! that already on stderr | 10:13 | |
10:18
Zoffix joined,
rindolf joined
10:20
mr-foobar left
10:22
nadim left,
astj left
10:24
mr-foobar joined
10:29
xtreak left
10:35
Cabanossi left,
Cabanossi joined
10:41
andrzejku joined
10:43
gregf_ joined
10:44
astj joined
10:47
astj left,
astj joined
10:51
astj left
10:55
eyck joined
11:04
astj joined
11:06
astj left
11:11
famrani joined
|
|||
tbrowder | hi #perl6 | 11:11 | |
11:13
famrani left
|
|||
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:16 | |
Freudian slip: s/perl5/perl6 | 11:17 | ||
11:17
pierre__ left
11:30
xtreak joined,
parv left
|
|||
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:32 | |
11:32
xtreak left
11:37
astj joined
11:40
astj left
|
|||
llfourn | tbrowder: CompUnit::Util doesn't move any files it just helps you introspect modules and helps you export their symbols | 11:47 | |
11:53
astj joined
12:02
astj left,
astj joined
|
|||
llfourn | tbrowder: btw you might wanna ask module installing questions on #perl6-toolchain | 12:03 | |
12:04
gdonald left,
gdonald joined
12:07
astj left
12:08
domidumont left,
raschipi joined
|
|||
tbrowder | llfourn: thnx | 12:11 | |
12:15
araraloren joined
|
|||
araraloren | evening | 12:15 | |
raschipi | o/ | 12:16 | |
araraloren | so so so Hot!! | ||
12:20
mr-foobar left
12:21
ctilmes joined
12:25
mr-foobar joined
|
|||
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: gist.github.com/zoffixznet/46ae8dd...f60f82a179 | 12:30 | |
yoleaux | Zoffix: I'll pass your message to evanm. | ||
12:30
astj joined
|
|||
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:31 | |
Zoffix writes into his private bug stash for later pondering | 12:32 | ||
12:33
astj left
12:34
cgfbee left
|
|||
Zoffix | m: say 1.0e-1 + 2.0e-1 == 3.0e-1; | 12:34 | |
camelia | True | ||
Zoffix | m: $ = .3e0; say 1.0e-1 + 2.0e-1 == 3.0e-1; | ||
camelia | False | ||
Zoffix | :) | ||
12:35
deep-book-gk_ joined
|
|||
araraloren | @_@ | 12:36 | |
jnthn | Oh, the joy of floating point... | 12:37 | |
Zoffix | \o/ | ||
12:37
deep-book-gk_ left
|
|||
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 | |
I could use long gather/take, but I wanted it to look smart | |||
Zoffix | Voldenet: how did you come to conclusion that it's not what it's doing now? | 12:39 | |
(that it doesn't stop when it found any matching stuff) | |||
12:39
cgfbee joined
|
|||
jnthn | refresh if @inputs.first($last > *.IO.changed); # a way without junctional stuff | 12:40 | |
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 | ||
oh well | 12:42 | ||
Voldenet | but I guess .first works well for my case, thanks | ||
Zoffix | m: sub foo ($n) { say "in"; True}; if foo (^3).map({say "map"; $_}).any {say "z"} | 12:43 | |
camelia | map map map in in in z |
||
12:43
araraloren left
|
|||
moritz | m: sub foo ($n) { say "in"; True}; say so (^3).map(&foo).any | 12:44 | |
camelia | in in in True |
||
moritz | so, junctions are eager? | ||
Zoffix would've expected the threading to shortcurcuit | |||
jnthn | I think this simply boils down to Junctions not being lazy | ||
Zoffix | I see | ||
jnthn | Junction.ACCEPTS will short-circuit | 12:45 | |
'cus at that point it knows it can just produce a boolean | |||
Voldenet | m: say so (^3).lazy.map({say "map"; $_}).any | ||
camelia | map map map True |
||
jnthn | but .any needs to make and hand back a junction | ||
Voldenet | i'd think this would be lazier though | ||
Zoffix | m: sub foo ($n) { say "in"; True}; say 42 ~~ <a b c>.any | ||
camelia | False | ||
Zoffix | m: sub foo ($n) { say "in"; True}; say *.&foo ~~ <a b c>.any | 12:46 | |
camelia | 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… |
||
Zoffix | bah, screw it | ||
jnthn | Voldenet: .lazy can't force things downstream that aren't themselves lazy to magically be so | ||
Junction simply isn't implemented as a lazy data structure on the inside. | 12:47 | ||
12:49
Cabanossi left
|
|||
Zoffix | m: sub foo ($n) { say "in"; $n.so}; say (&foo, &foo, &foo, &foo).any.ACCEPTS: 42 | 12:50 | |
camelia | in True |
||
Zoffix | m: sub foo ($n) { say "in"; $n.so}; say (&foo, &foo, &foo, &foo).all.ACCEPTS: 42 | ||
camelia | in in in in True |
||
Zoffix | there. Proved :) | ||
12:50
Cabanossi joined
|
|||
jnthn | :) | 12:52 | |
12:52
cdg joined
|
|||
Voldenet | It makes sense, not very DWIMy though | 12:52 | |
I'd expect `(^100).any(* > 5)` instead of `(^100).first(* > 5)` | 12:53 | ||
12:54
mcmillhj joined,
nicq20 joined
|
|||
Voldenet | m: my $i; say so (^100).map({ ++$i; $_ }).map(* > 4).any; say $i | 12:55 | |
camelia | True 100 |
||
12:56
araraloren joined
|
|||
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 | |
m: my $i; say so (^100).map({ ++$i; $_ }).grep(* > 4); say $i | |||
camelia | True 6 |
||
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 | |
is | |||
\o | 13:01 | ||
13:01
Zoffix left
|
|||
Voldenet | Ah, it's my problem for applying C#'s terminology into perl, where Any just does that :P | 13:01 | |
13:02
astj joined
13:04
evanm joined,
astj left
|
|||
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: gist.github.com/zoffixznet/46ae8dd...f60f82a179 | ||
evanm | As a user, I would expect the floating-point parser to create the same binary representation as C | 13:13 | |
13:13
pierre__ joined
13:16
astj joined
|
|||
evanm | Relevant: en.wikipedia.org/wiki/IEEE_754#Cha...esentation | 13:20 | |
13:22
Zoffix joined
|
|||
Zoffix | evanm: yeah, I think I see where the bug is at. Gonna try a commit soon | 13:23 | |
13:23
cdg_ joined
13:24
dubi0us joined,
dubi0us left
|
|||
Zoffix | ... and possibly one of the "noise in rats" bugs too :/ | 13:25 | |
13:25
cdg left
|
|||
Zoffix | m: dd 1.3333333333333333333333333.nude | 13:26 | |
camelia | (13333333333333333333333333, 10000000000000000905969664) | ||
Zoffix | this one. (though untested yet; just by reading the code I think that might get fixed) | 13:27 | |
13:27
astj left,
dubi0us joined
13:28
dubi0us left
13:29
astj joined
|
|||
[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:31 | |
13:33
domidumont joined
|
|||
Zoffix | "This representation (P6int) cannot unbox to other types (for type BOOTInt)" | 13:33 | |
booo | |||
lizmat | [Coke]: do we include docs with R* ? | ||
[Coke] | Dunno for sure, but I think so | 13:34 | |
Zoffix | Yes | ||
[Coke] | ISTR someone just complaining that p6doc didn't work in an R* on mac only | ||
13:35
Cabanossi left
13:36
Cabanossi joined
|
|||
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 | |
It's pointing to nqp::divIn op | |||
nqp::div_In even | 13:39 | ||
lizmat | that would be my guess | ||
13:39
ggoebel joined
|
|||
Zoffix | oh dam. it would help if I were editing the actual sources instead of gen/moar files -_- | 13:40 | |
evanm | [Coke]: R* on mac does not include docs; p6doc anything returns an error. | 13:43 | |
[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 :-/ | |||
Zoffix | cpan@perlbuild4~/CPANPRC/rakudo (nom)$ ./perl6 -e 'm: dd 1.3333333333333333333333333.nude' | 13:44 | |
(13333333333333333333333333, 10000000000000000000000000) | |||
But the num issue is still there :P | |||
evanm: what's your rt username? | 13:46 | ||
evanm | Zoffix: "evanm" | 13:47 | |
Zoffix | says couldn't find it... What's your email for the account? | 13:48 | |
k, I think you should be able to add information to tickets now | 13:50 | ||
evanm | Zoffix: Thanks. I now see an option for "New Ticket" but I don't see a way to browse all tickets. | 13:52 | |
13:52
domidumont left
|
|||
Zoffix | Do you see anything on rt.perl.org/ ? | 13:53 | |
Or on rt.perl.org/Search/Results.html?Qu...talled%27) | |||
tangent to the discussion, you can browse open tickets on perl6.fail/ | |||
evanm | Zoffix: Both links redirect me to rt.perl.org/SelfService/, which shows me an "Open tickets" heading with a "My open tickets" subheading | 13:55 | |
(and no tickets) | |||
rindolf | Hi all! Can anyone tell me how to make this p6 code faster in rakudo/moar? www.shlomifish.org/Files/files/text...mif-p6.txt ; this runs much faster - github.com/shlomif/project-euler/b...43_v2.bash | ||
Zoffix | evanm: unsure. Maybe [Coke] would know more | 13:56 | |
13:56
yoleaux left
13:57
cdg_ left
13:58
lowbro left
|
|||
evanm | [Coke]: It looks like I can comment on tickets now, just no way to browse them :-( | 14:00 | |
[Coke] | did you get a response to your bug admin ticket? | 14:04 | |
rindolf: you can use --profile to find where time is being spent. | 14:05 | ||
rindolf | [Coke]: thanks | 14:06 | |
evanm | [Coke]: I have not gotten a response to my admin ticket, Zoffix has been helping me here | ||
[Coke] | ok. Add this information to your admin ticket. | 14:07 | |
It's not going to get any less broken until they look at it. | |||
(and they are an all volunteer staff, same as us) | 14:08 | ||
14:11
araraloren left
|
|||
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 | |
14:12
skids joined
14:14
Popov_ joined
|
|||
[Coke] | It should have immediately returned an rt receipt, just like a rakudobug ticket. | 14:14 | |
please forward me a copy of the email, I'll try to open a ticket on your behalf. | 14:15 | ||
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 | ||
evanm | stmuk_: Thanks for the info, fingers crossed the RT gods can figure it out though :-) | 14:19 | |
14:23
araraloren joined
|
|||
[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:32 | |
14:33
Cabanossi left
14:35
AlexDaniel joined
14:36
Cabanossi joined
|
|||
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. | ||
Zoffix & | 14:37 | ||
14:38
Zoffix left
|
|||
evanm | [Coke]: thx | 14:39 | |
14:40
araraloren_ joined
|
|||
rindolf | [Coke]: I got this - www.shlomifish.org/Files/files/text...#/routines | 14:41 | |
[Coke]: converting to div= and mod did not improve the speed | |||
14:43
araraloren left
14:45
mcmillhj left
|
|||
[Coke] | I assume you need to test out this particular algorithm. (in general, you'd use is_prime for primality testing) | 14:45 | |
14:45
mcmillhj joined
|
|||
[Coke] | Looks like you're doing a ton of GC runs. | 14:46 | |
you also hit several deopt targets; if your numeric types are changing, that might trigger a deopt. | 14:47 | ||
14:50
mr-fooba_ joined
|
|||
[Coke] | why do you have ?0 and ?1 ? just use True and False. | 14:50 | |
I suspect those are having to translate compile time ints to runtime Bools. | 14:51 | ||
just use the boolean literals. | |||
rindolf | [Coke]: ah. | ||
14:51
jonas1 left,
mr-foobar left
|
|||
[Coke] | with a limit of 10K instead of 2M, that shaves off .1s | 14:52 | |
might improve your GC usage, also. | |||
rindolf | [Coke]: perhaps i should port the factorisation routine from github.com/shlomif/project-euler/b..._v1.py#L10 | 14:53 | |
14:53
donaldh joined
|
|||
[Coke] | It's not going to help me at all. :) | 14:53 | |
Morfent | dealing with gc is definitely not very fun | 14:54 | |
[Coke] | why do you create an array of @values in factor() and then always just take the last element? | 14:56 | |
seems like you could ditch the array, use a scalar and just overwrite instead of pushing to it. | |||
I'm also confused by having an attribute for primesieve (a class) that's defined as an array. | 14:57 | ||
(is it supposed to be an array of sieves?) | 14:58 | ||
15:00
DBeepBeep joined
15:06
DBeepBeep left
|
|||
Morfent | unrelated, but is there anything i should improve in this? hastebin.com/inoraraqep.rb | 15:09 | |
i'm writing some tools for managing bsd ports to learn perl | 15:10 | ||
timotimo | you're using rb as highlighter? %) | 15:12 | |
Morfent | nah, that's hastebin being dumb about language detection | 15:13 | |
timotimo | your grepDirs could be much simpler | ||
my @dirs = grep *.d, @paths | |||
the result of the code you give to grep isn't what ends up in the resulting list | 15:14 | ||
so there's no difference between "$_ if $_.d" and "$_.d" (as long as $_ itself is always True) | |||
and i'm not sure why you use := in method new | |||
15:15
geekosaur left
|
|||
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 | |
you can just @matches.append(@catMatches) | |||
15:15
geekosaur joined
|
|||
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:16 | |
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 - www.shlomifish.org/Files/files/text...mif-p6.txt | ||
timotimo | that's all that comes to mind right now | ||
Morfent: does that help? :) | |||
15:18
Popov_ left
|
|||
Morfent | that's really helpful | 15:18 | |
timotimo | you're welcome :D | ||
oh | |||
something else important | |||
15:18
Cabanossi left
|
|||
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 | ||
camelia | -9223372036854775808..9223372036854775807 | ||
timotimo | m: class A { has IO::Path @.cats; method new { my @cats = "foo".IO, "bar".IO; self.bless(:@cats) } }; A.new | 15:20 | |
camelia | 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 |
||
timotimo | m: class A { has IO::Path @.cats; method new { my IO::Path @cats = "foo".IO, "bar".IO; self.bless(:@cats) } }; A.new | ||
camelia | 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
|
|||
timotimo | huh. | 15:21 | |
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:23 | |
15:24
Zoffix joined
|
|||
Zoffix | timotimo: restricted bot | 15:24 | |
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! | ||
yes, the restricted setting | |||
gets me every single time | |||
Morfent | use strict? | 15:27 | |
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
|
|||
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:30 | |
i'm guessing that's not the case | 15:31 | ||
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 - www.shlomifish.org/Files/files/text...#/routines | ||
Morfent | it doesn't, since it didn't affect the values of @matches with relative paths | 15:33 | |
i'm handling getting the path past /usr/ports wrong | 15:34 | ||
Zoffix | Morfent: what's that code do? search for files in /usr/ports with basename that matches $query? | 15:37 | |
Morfent | it searches for dirs within dirs of /usr/ports whose basename include $query | 15:38 | |
the first layer of dirs are just categories of ports | |||
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 | ||
like perl 5.26 is in /usr/ports/lang/perl5.26.0 | |||
but the query should only match the last dir's name | 15:41 | ||
i could use $match.substr('/usr/ports/'.chars) to display that, but it feels a bit hacky | 15:44 | ||
Zoffix | There are 1 ports with names matching "perl": | 15:46 | |
/usr/ports/lang/perl5 | |||
Morfent: is that what the output needs to be? Or does it need to say "lang/perl5" only? | |||
15:47
yoleaux joined
15:48
ChanServ sets mode: +v yoleaux
|
|||
Morfent | this is what i want it to display hastebin.com/foxofirape.scala | 15:48 | |
b2gills | Morfent: my @matches = []; doesn't do what you think it does, it adds an empty array to @matches | 15:50 | |
Zoffix | Morfent: this probably does what you want: gist.github.com/zoffixznet/1203c8a...beaa57684c | 15:51 | |
b2gills: nah, it'd need a comma for that to happen | |||
b2gills | It still isn't a good idea | 15:52 | |
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 | ||
'/usr/ports/'.IO.dir.grep: *.d; | |||
Actually, I think he wants the entire directory tree minus files | 15:54 | ||
Zoffix | He? :) | ||
Zoffix goes back to lurking | 15:55 | ||
15:55
abraxxa left
|
|||
Zoffix | \o | 15:55 | |
15:55
Zoffix left
|
|||
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 | ||
Morfent | nah, i'm a guy | ||
15:57
donaldh left
|
|||
Morfent | dw about it | 15:57 | |
b2gills | We have had, and continue to have plenty of people here that aren't male | 15:58 | |
Morfent | ...oh | ||
b2gills | We try to be as inclusive as possible, we even hug trolls | 15:59 | |
Morfent | that's pretty good | 16:00 | |
16:02
kurahaupo joined
|
|||
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:04 | |
not awful as in out of being mean i should say | 16:06 | ||
araraloren_ | night | ||
16:06
pierre__ left
|
|||
b2gills | How many levels deep do you need | 16:06 | |
16:06
araraloren_ left
|
|||
Morfent | ...i phrased that badly, but anyway | 16:06 | |
16:07
cdg joined
16:08
gabiruh joined
16:09
robertle left
16:13
rblackwe joined
16:15
cdg_ joined
16:17
evanm left,
cdg left
16:26
BenGoldberg joined
|
|||
b2gills | Morfent: How about something more like: gist.github.com/b2gills/089854ad23...416e585f7a | 16:26 | |
16:28
evanm joined
16:29
DBeepBeep joined
|
|||
DBeepBeep | Is there a way to run to run a shell command without waiting for it? | 16:30 | |
I'm trying to do 'qqx{ogg123 -q $file-path &};', but I don't want to wait for it to finish. | |||
16:32
evanm left
|
|||
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:33
Cabanossi left
|
|||
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 | ||
Morfent | that's surprising | ||
16:35
Cabanossi joined
|
|||
Morfent | i like the idea of allowing regex for searches | 16:35 | |
16:39
dakkar left
|
|||
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 | |
along with having regex searches be possible | |||
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' | ||
nicq20 | TimToady: Oh, that makes sense. Thanks! | 16:50 | |
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:53 | |
though it would be parameterized for "for @x { ... say $_ ... }" | 16:54 | ||
so there's a bit of dwimmery going on in there | |||
alternately, you can look at the bare if as something like "if $x -> $_ = OUTER::<$_> {...}" but I suspect we optimize that away | 16:56 | ||
actually, no, it can't do that, or $_ would get rebound badly, so never mind | |||
TimToady wanders off for more coffee | 16:57 | ||
TimToady certainly hasn't had enough coffee to actually go and reread the code :) | |||
nicq20 | llfourn: Thanks for your help! That has made this a lot easier. :) | 17:00 | |
17:00
gdonald left
17:03
wamba left
|
|||
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:06 | |
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:08 | ||
17:09
cosimo left
|
|||
timotimo | huh, that's strange | 17:09 | |
does it also take effect after these curlies? | |||
17:10
evanm joined
|
|||
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. | ||
TimToady | and it's smart enough not to call <.ws> twice in the same spot | ||
what if you just stick an extra statement between? | 17:12 | ||
or say "use Module;;" | |||
17:13
gdonald joined
|
|||
nicq20 | That does not seem to work. | 17:13 | |
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 | ||
I assume you're just adding a multi to the comment category? | 17:18 | ||
nicq20 | I define `token comment:sym<smc> {...}` and `token comment:sym<#>`. | 17:20 | |
I wanted to over-ride 'comment:sym<#>' | 17:21 | ||
You can find it here: github.com/nicqrocks/perl6-smart-c...rammar.pm6 | 17:23 | ||
TimToady | using after is usually a mistake, in general | 17:24 | |
dunno that it's related to your issue though | |||
nicq20 | I was having trouble figuring out how to tell it to look for 1..2 or 6..* '#' in a row without it. | 17:26 | |
17:27
|oLa| joined
|
|||
TimToady | it's usually better to rely on LTM for such decisions | 17:27 | |
but something else in the grammar might be making assumptions somewhere | 17:28 | ||
nicq20 | LTM? | ||
TimToady | it's not like we have a lot of experience with gazillions of slangs yet :) | ||
longest toke matching | |||
*token | |||
nicq20 | Ah, ok. | ||
TimToady | which is why the original # rule has a {} in the middle, or the \N* would count as part of the longest token | 17:30 | |
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 | ||
nicq20 | I originally had it as a single |, but I would get an 'Invalid to edge 0 in NFA statelist' error. | 17:32 | |
timotimo | that's an internal error that points to a bug in rakudo, i'd claim | 17:34 | |
TimToady | yeah, that's a "shouldn't happen" | 17:35 | |
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 | ||
TimToady is working up to some changes there, so tends to notice activity there | 17:37 | ||
17:37
nicq20-mobile joined,
nicq20 left
|
|||
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
17:45
DBeepBeep left,
espadrine joined
17:46
nicq20-mobile left,
setty1 joined
17:49
wamba joined,
escherlat joined
|
|||
ingy | what's the best way to do something like `$.foo = undef` ? | 17:53 | |
17:54
nicq20_mobile left,
nicq20-mobile joined
|
|||
geekosaur | Nil, I think | 17:55 | |
(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
sherwool left
|
|||
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... | ||
ingy | geekosaur: that works for me | 17:57 | |
zengargoyle | (return the current value of $.foo while also setting $.foo = Nil) | ||
TimToady | something like: return $.foo.clone; LEAVE $.foo = Nil | ||
or just use a temp var to clone it | 17:58 | ||
ingy is programming for $work in FanLang which only "feels" like Perl6 :) | 17:59 | ||
zengargoyle | thanks much. | ||
ingy | but Nil is supported and does what I want. | ||
17:59
zakharyas left
|
|||
ingy | I'm looking forward to seeing FanLang open sourced. | 18:00 | |
18:01
domidumont joined
|
|||
evanm | Hi, I'm working on a wrapper for libxlsxwriter, anyone care to critique? github.com/evanmiller/XLSX-Writer | 18:04 | |
(My first attempt at a Perl 6 library...) | |||
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:08 | |
the modules.perl6.org/todo/zengargoyle page is still showing my modules as missing a MANIFEST even though they have a MANIFEST... | 18:10 | ||
.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
|
|||
zengargoyle thinks it may be a bit to early in the whole CPAN thing to be set in stone yet. | 18:14 | ||
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... | ||
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:25 | |
skaji | zeng Do you want mi6 togenerate MANIFEST files? | 18:28 | |
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:29 | |
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 | ||
zengargoyle | but the thing you did with 'eq' and MANIFEST.SKIP breaks if you try to use regex in the same way. | 18:31 | |
skaji | zengargoyle: I think we can change it:) | 18:32 | |
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.... | ||
just keep it in mind i guess. :) | 18:34 | ||
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 | ||
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:38 | ||
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. | ||
RT131409 | 18:41 | ||
synopsebot6 | Link: rt.perl.org/rt3/Public/Bug/Display...?id=131409 | ||
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 | |
Is there any semantic difference between `is native(LIB) {...}` and `is native(LIB) {*}` btw? | |||
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 * | ||
it's also shorter :) | |||
b2gills | It works just as well if it is empty | ||
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' | ||
TimToady | and bare {} kind looks like an empty hash | ||
*kinda | 18:45 | ||
even though it's illegal at that spot, it still lights off some unnecessary neurons | |||
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.: github.com/rakudo/rakudo/blob/nom/...re/Proc.pm | ||
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"? | ||
TimToady | yes, in that case it really is a stub | ||
b2gills | m: class Foo { method bar() {...} }; Foo.bar() | 18:48 | |
camelia | Stub code executed in method bar at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
TimToady | m: class Foo { ... }; Foo.new | ||
camelia | 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… |
||
zengargoyle | skaji: cool, i was working on patch and got sidetracked by bug. :) | ||
TimToady | good :) | 18:49 | |
18:49
nicq20_mobile joined
|
|||
TimToady | m: class Foo { * }; Foo.new | 18:49 | |
camelia | ( no output ) | ||
zengargoyle | skaji: and don't want to turn it into distzilla monstrosity. :P | ||
TimToady | arguably should say 'Useless use of whatever' | ||
b2gills | evanm: I don't understand what you meant by “in case these functions ever have return codes” | 18:50 | |
18:50
rumble joined
|
|||
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 | |
so I don't see much problem | |||
zengargoyle | skaji: but really waiting for CPAN thing to be sorted out a bit more. | ||
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 | ||
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:51
nicq20-mobile left
|
|||
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) | ||
TimToady | geekosaur: that's what a forward declaration means, not implemented yet | ||
and we specifically disallow the semicolon notation there | 18:53 | ||
evanm | b2gills: Oh, okay. NativeCall always tends to be more magical than I expect :-) | ||
TimToady | that would be p5-think :) | ||
or C, or most every other C-derived language... | |||
m: class Foo; | |||
camelia | 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> |
||
TimToady | m: unit class Foo; class Bar; | 18:54 | |
camelia | 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> |
||
TimToady | to catch both of those thinkos, we require {...} | ||
18:57
mr-fooba_ left
|
|||
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 | |
This also makes it possible to make libs/modules from other languages seem as if they were actually written in Perl 6 | |||
18:59
grumble left,
rumble is now known as grumble
19:00
nicq20_mobile left
19:01
nicq20-mobile joined,
nicq20-mobile left
|
|||
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:02 | |
19:03
mcmillhj left,
mcmillhj joined
|
|||
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 | |
19:04
nicq20 joined,
pmurias joined
|
|||
[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? | ||
evanm | [Coke]: thanks! | ||
19:06
nhywyll joined
|
|||
ingy | pmurias: yes. | 19:06 | |
b2gills | I haven't done much with NativeCall myself | ||
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 | ||
TimToady | it will be interesting to see how much FanLang trades correctness for speed :) | ||
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 | ||
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 | ||
kybr | evanm: i think i'm experienceing the callback+pointer pain. | 19:11 | |
evanm | kybr: This is basically the wall I hit: stackoverflow.com/questions/433708...l-callback | 19:12 | |
kybr | i'm trying to make callbacks work for liblo and PortAudio c libraries. | ||
ingy | pmurias: FanLang is very proper subset except in the grammar{...} syntax. That looks a lot like Pegex :) | ||
19:14
zakharyas joined
|
|||
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:14 | |
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 ) | ||
ingy | b2gills: yeah | ||
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" | ||
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 | ||
ingy | can you `use` something that changes the syntax of `grammar`? | ||
evanm | kybr: I ran into similar issues, at least with the stack unwind | 19:17 | |
The issue for me was using an incorrect function signature | |||
19:18
nhywyll left
|
|||
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. | ||
ingy | ie: use Grammar::Pegex; grammar Foo { a: b | c; b: /foo/; c: /bar/ } | ||
b2gills | The only thing I know of that is in the area of other parsers is github.com/drforr/perl6-ANTLR4 | ||
19:19
mcmillhj left
|
|||
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. | ||
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 | ||
and arguably it shouldn't be a thing except by jumping through hoops; .WHERE is mostly for debugging | |||
evanm | geekosaur: I'm just dreaming here :-) | ||
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
BenGoldberg left
|
|||
evanm | Usually in C you pass in a pointer to your custom struct, and do a cast within the callback | 19:21 | |
ingy | pmurias: but using a slang module would only change things lexically, right? | 19:22 | |
pmurias | ingy: yes | ||
b2gills | A Slang module can basically do anything it wants to with the rest of the file | 19:24 | |
pmurias | ingy: what would be the benefit for using 'grammar' instead of a different keyword (like 'parser') for Pegex-style grammars? | 19:25 | |
s/for/of/ | |||
ingy | so maybe we should just add a slang `use Grammar::Resty;` to the top of our `unit grammar` files | 19:26 | |
pmurias: 6 of 1 | |||
19:27
g0d355__ left
|
|||
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 | ||
without a slang as well | |||
pmurias | ingy: '6 of 1'? | 19:28 | |
[Coke] | pmurias: 1/2 dozen of another. | ||
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 | ||
b2gills: yeah | |||
19:29
andrzejk_ joined
|
|||
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:30 | |
ingy | yep | 19:31 | |
19:31
darutoko left
19:33
leont_ joined
|
|||
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:35 | |
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:36 | |
ingy | pmurias: you mean a super set of FanLang? | 19:37 | |
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
|
|||
pmurias | it being the language you switch to after 'use Grammar::Resty' | 19:39 | |
19:39
agentzh left,
agentzh joined,
mcmillhj joined
|
|||
ingy | agentzh arrives :) | 19:39 | |
agentzh | halo | ||
pmurias | hello | 19:40 | |
agentzh | we're having a lot of fun hacking in our perl 6 dialect for real products. | ||
ingy | we were just talking about FanLang. Mostly open sourcing it eventually and also making it a proper subset of p6 | ||
agentzh | ingy has been helping us a lot with fanlang hacking. | ||
pmurias | agentzh: great to see Perl 6 being used in production :) | 19:41 | |
19:41
domidumont left
|
|||
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 | ||
agentzh | i mean the performance. | ||
and compiling is much faster than rakudo as well. | 19:42 | ||
and fanlang is still *unoptimized* :) | |||
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 | ||
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. | ||
a self-hosting fanlang. | |||
ingy: i don't quite like the boilerplate code to be 100% compatible with perl 6 though. | 19:44 | ||
ingy: it's similar to p5's "use v5.10.1; user strict; use warnings;" boilerplate. | |||
b2gills | Rakudo is only partially self-hosted itself | ||
agentzh | fanlang will be 100%. | 19:45 | |
pmurias | agentzh: do fanlang files have a file extension? | ||
agentzh | .fan | ||
obviously :) | |||
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 ) |
||
ingy | but it gets better and better | ||
agentzh | lol, yeah, it's a young language. | ||
ingy | haha | ||
agentzh | just 7 months old, | ||
maybe? | |||
ingy | think you started in Dec? | ||
totally amazing how much works | 19:47 | ||
agentzh | i started hacking on fanlang from scratch since the late Nov, 2016. | ||
pmurias | agentzh: having fanlang assume the files it gets are in FanLang without boilerplate seems sane | ||
19:47
AlexDaniel left
|
|||
agentzh | pmurias: *nod* | 19:47 | |
we keep calling it a "perl 6 dialect" instead of a "perl 6 subset" or "perl 6". | |||
19:47
AlexDaniel joined
|
|||
ingy | I just used $* today for first time | 19:48 | |
agentzh loves the perl 6 idea as a whole since 2012. | |||
ingy | also found a bug in $* :) | ||
agentzh | pull requests welcome! :D | ||
ingy | ;) | ||
moritz wants to create a hybrid between Python and Perl 6 some day | |||
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. | ||
moritz | with mostly python syntax, but explicit declarations and grandual types | ||
and first-class regexes and grammars | |||
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 | ||
ingy | moritz: look at CoffeeScript syntax. Much better than Python imho :) | ||
agentzh | b2gills: seriously? rewrites also count :) | ||
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 | ||
ingy | every word has subtle implications when you say something about Perl 6 :P | ||
agentzh | our company is also sponsoring optimizations inside the luajit internals to make our fanlang run faster and faster. | 19:52 | |
the goal is to make luajit a good common language runtime for dynamic langauges. | |||
similar to the vision of parrot. | |||
or roarvm if i'm not mistaken. | |||
b2gills | oooh that means Factorial will also be faster | ||
ingy | agentzh: near C speeds, right? | ||
agentzh | well, i hope. | 19:53 | |
b2gills | *Factorio | ||
19:53
dha joined
|
|||
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 | ||
agentzh | b2gills: our fanlang codo base is usually above 1000 LOC. | ||
some are 6K LOC. | |||
ingy | (in p5 obviously) | 19:54 | |
pmurias | agentzh: moarvm is heavily designed towards running Perl 6 | ||
agentzh: JVM with (Graal + Truffle) is implementing the parrot vision | |||
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 | |
19:55
BenGoldberg joined
|
|||
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:57 | |
b2gills | evanm: If you **really really* want to be in the loop then watching on #perl6-dev might be advisable | 19:58 | |
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. | ||
It's not terrible language to write by hand either, but definitely not 1337 enough for Ingy | 20:00 | ||
20:02
agentzh left
|
|||
b2gills | The biggest thing that I think would annoy me is 1 based array indexing | 20:09 | |
20:10
robertle joined
20:11
cpage__ joined,
cpage_ left,
cpage__ is now known as cpage_
20:12
leont_ left
20:19
Cabanossi left,
TEttinger joined
20:20
Cabanossi joined
|
|||
ingy | b2gills: I know it sounds crazy, but its really not that bad at all | 20:22 | |
20:23
rindolf left
|
|||
geekosaur | we older types are kinda used to context switching on that | 20:25 | |
since a number f older languages used 1-based | |||
20:25
agentzh joined
|
|||
agentzh | pmurias: i love little powerful things that can fit nicely in a small box. | 20:25 | |
and we can also have full control over it when things go south. | |||
debugging JVM internal issues can never be easy or fun. | |||
ingy | b2gills: speaking of that, I find it annoying that $1 became $0 in p6 :) | 20:27 | |
agentzh | the whole libluajit.so is only 496KB without debug symbols. | 20:28 | |
ingy | hmm I read it was 400k | 20:29 | |
must be outdated reading | |||
agentzh | LuaJIT 2.0's libluajit.so is 456KB. | 20:30 | |
2.1 has got a lot more new features. | |||
geekosaur is still on 1.5 for some things... | |||
agentzh | wow | ||
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) | ||
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:37 | |
agentzh | like pypy's approach? | 20:39 | |
pmurias | vaguely in the same direction | 20:40 | |
agentzh | it does seem like the ultimate speedy approach. | 20:41 | |
*does not seem like | |||
20:41
pierre__ joined
|
|||
agentzh | though it's much easier in engineering. | 20:41 | |
we're also into custom JIT compilers for things like regexes. | |||
much smaller languages. | 20:42 | ||
so it can do a much better job than luajit's jit. | |||
20:43
evanm left
|
|||
agentzh | we also use tinycc's libtcc for quick & dirty C code AOT compilation at runtime. | 20:43 | |
not the best speed, but good enough for many things. | |||
tcc is also very small. | 20:44 | ||
*libtcc | |||
agentzh is a minimalist. | |||
ingy | yes, he writes new languages to write new languages in :D | ||
agentzh | lol | 20:45 | |
kybr | is there a way to tell moar to trace? | ||
20:45
pierre__ left
|
|||
ingy | fine by me. I'm getting to work on half a dozen new languages using a Perl 6 dialect. Life is good. | 20:48 | |
20:49
Cabanossi left
20:51
Cabanossi joined,
nicq20 left
|
|||
b2gills | ingy: well $0 is short for $/[0] so it does in a way make more sense than leaving it as $1 | 20:53 | |
ingy | b2gills: sure but other langs return a $/-like thing where 0 == whole match and 1.. are the captures | 20:54 | |
and they probably took a cue from perl5 | |||
even bash's BASH_REMATCH starts at 1 | 20:55 | ||
and bash regex support came from p5 | |||
b2gills | m: 'abc' ~~ / . <( . )> (.)/; say ~$/; say $0 | ||
camelia | b 「c」 |
||
ingy | so kinda funny for p6 to stab the followers of perl in the back :D | ||
b2gills | If you are always following, you are never leading | 20:56 | |
20:56
zakharyas left
|
|||
ingy | even when you are backtracking | 20:57 | |
20:57
agentzh left
|
|||
ingy | fwiw I hate the ~= syntax in Lua | 20:58 | |
b2gills | m: 'abc' ~~ / $<foo> = [.] <( . )> (.)/; say ~$<foo>; say ~$/; say ~$0 | ||
camelia | a b c |
||
20:59
dha left
|
|||
b2gills | I prefer the Perl 6 way of having ! be a meta operator that you can apply to any diffy infix operator | 21:03 | |
Which is why I have some dislike for != | |||
It's confusing because &[!=] and &[!==] are equivalent, and &[!===] means something different | 21:05 | ||
pmurias | ingy: does fanlang use bignums? | ||
21:13
mcmillhj left,
raschipi left
21:24
evanm joined
21:25
pmurias left
21:29
evanm left
21:30
skids left
21:38
colomon_ joined
21:39
colomon left,
colomon_ is now known as colomon
21:52
andrzejk_ left
21:55
setty1 left
22:03
Cabanossi left
22:06
Cabanossi joined
22:12
cpage_ left
22:16
robertle left
22:39
perl6hobo joined
|
|||
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 | |
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
|
|||
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 | ||
it will compile a rakudo for you that has the path you wish for baked in | |||
22:48
Cabanossi left
|
|||
perl6hobo | Awesome thank you. I will look into WiX. | 22:48 | |
22:48
_28_ria left
|
|||
yoleaux | eveo: Zoffix fix xt on docbuild | 22:48 | |
22:50
_28_ria joined
|
|||
timotimo | eco: wix | 22:50 | |
github.com/jnthn/p6-app-installermaker-wix - perl6hobo, this one | |||
WiX is just a thing that builds msi files from a little specification file | |||
22:51
Cabanossi joined
|
|||
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 | ||
perl6hobo | Thank you so much for the help. It looks like exactly what I need. | 22:54 | |
22:58
skids joined
22:59
cpage_ left
23:02
cpage_ joined
23:12
Morfent left
23:13
Morfent joined
23:16
|oLa| left
23:33
Cabanossi left
23:35
Cabanossi joined
23:39
skids left
|