»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend! Set by sorear on 4 February 2011. |
|||
00:01
not_gerd left
00:02
dayangkun joined
|
|||
quester | Does anyone recall if Perl6 was ever intended to have lazy strings? For example, this xor's a list with an indefinite number of copies of a key... | 00:08 | |
r: say <a b c> xx * Z~^ <0 0 0 4 4 4 8>; | 00:09 | ||
p6eval | rakudo 932bc5: OUTPUT«Q R S U V W Y» | ||
sorear | quester: that has been intended in the past, I think | ||
diakopter | I also remember it | ||
sorear | we've also talked about a 'Cat' type which is functionally identical to Str but lazy | ||
quester | Ah, so NYI, but possibly coming in the future when there are enough tuits? | 00:10 | |
colomon | jnthn++ | ||
quester | r: say "abc" x * Z~^ "0004448"; | ||
p6eval | rakudo 932bc5: OUTPUT«0004448» | ||
quester | Oh. Thanks, sorear++, I found it in S03, "The count may not be * because Perl 6 does not support infinite strings.... [which] may someday be emulated with cat($string xx *), in which case $string x * may be a shorthand for that. | 00:15 | |
... so not yet specified. | 00:16 | ||
00:18
msuszczy joined
00:21
pmurias left
00:34
aindilis left
00:44
aindilis joined
00:45
kaare_ joined
00:50
msuszczy left,
ssds joined
00:51
marloshouse joined,
ssds left
00:57
thou_ joined,
adu joined
01:00
thou left
01:05
anuby joined
|
|||
colomon | rn: say $_ if $_.is-prime for 1 .. 10; | 01:05 | |
p6eval | rakudo 932bc5, niecza v24-23-g0520c7c: OUTPUT«2357» | ||
colomon | rn: say $_ if $_.is-prime for 1 .. 10; | ||
p6eval | rakudo 932bc5, niecza v24-23-g0520c7c: OUTPUT«2357» | ||
colomon | rn: say $_ if $_.is-prime for 1 .. 10; | 01:06 | |
p6eval | rakudo 932bc5, niecza v24-23-g0520c7c: OUTPUT«2357» | ||
colomon | rn: say $_ if $_.is-prime for 1 .. 10; | ||
p6eval | rakudo 932bc5, niecza v24-23-g0520c7c: OUTPUT«2357» | ||
colomon | rn: say $_ if $_.is-prime for 1 .. 10; say $_ if $_.is-prime for 1 .. 10; say $_ if $_.is-prime for 1 .. 10; | 01:07 | |
p6eval | rakudo 932bc5, niecza v24-23-g0520c7c: OUTPUT«235723572357» | ||
01:08
hypolin joined
|
|||
colomon | I get the same results Ovid reported, where Rakudo sometimes reports 2 3 5 7 for that and sometimes 2 3 4 5 6 7 8 9 10 | 01:08 | |
I've seen brokenness in is-prime on my platform before, but previously assumed it was always broken and had something to do with what C libraries I had installed (like Unicode issues sometimes do). | 01:09 | ||
benabik | Isn't is-prime probabilistic? ;-) | 01:10 | |
diakopter | that's an interesting bug | 01:11 | |
colomon: does it happen with much larger numbers input too? | 01:12 | ||
colomon | I believe so. | ||
benabik: yes, but it should fail less frequently than cosmic rays make memory bits swap on your computer. ;) | 01:13 | ||
rn: say 45724385972894572891.is-prime | |||
p6eval | rakudo 932bc5, niecza v24-23-g0520c7c: OUTPUT«False» | ||
colomon | I get true locally | ||
diakopter | always? | ||
colomon | seemed like I was before, but I just restarted p6 and it was False the first 3 times and then True the fourth. | 01:14 | |
diakopter | rn: while 1 { say 'OOPS' if 45724385972894572891.is-prime } | ||
p6eval | rakudo 932bc5, niecza v24-23-g0520c7c: OUTPUT«(timeout)» | ||
diakopter | rn: while 1 { say 'OOPS' if 4.is-prime } | 01:15 | |
p6eval | rakudo 932bc5, niecza v24-23-g0520c7c: OUTPUT«(timeout)» | ||
rjbs | jnthn++ # enjoying seeing updates about jvm port | 01:18 | |
01:19
kaare_ left
|
|||
diakopter | colomon: after it starts being wrong, does %% still work? | 01:20 | |
colomon | to a quick check, yes. | 01:21 | |
it seems like the pattern of failures is consistent? I just did it again with that same number, and it was three falses and then True just like before. | 01:22 | ||
diakopter | o_O | ||
colomon | makes me wonder if it is running out of randomness or something. | ||
diakopter | heh | ||
self-modifying math system.. | 01:23 | ||
TimToady | but the algorithm used just uses the first N primes as "random" numbers, so it seems as though the table of primes is getting clobbered somehow | ||
01:24
adu left
|
|||
TimToady | also, 4 should never be prime because it does trial division by the first N primes too | 01:24 | |
colomon | I'm trying to track down NQP's implementation now. | ||
nqp_bigint_is_prime special-cases 1, which is why that always works. | 01:26 | ||
TimToady | I thought rakudo was using libtommath's primality tester | ||
colomon | seems like it's actually libtommath which is failing? | ||
either that or there's something more subtle going on. | 01:27 | ||
TimToady | somebody's trying to cache something, and botching it? | ||
colomon | that's what I meant by more subtle. | 01:28 | |
diakopter | colomon: is it always in the repl? | ||
colomon | I'm not seeing any sign of that in the code, mind you. | ||
diakopter: no, I've gotten it running spectest as well | |||
TimToady | could GC be clobbering libtommath's prime table somehow? | 01:29 | |
diakopter | colomon: are you on Windows? | ||
I can't reproduce it here | 01:30 | ||
TimToady | could throw a check in libtommath that its table still has the right primes in it | ||
colomon | nope, OS X | ||
I was wondering if I should try running REPL with valgrind turned on? if it's memory clobbering that might detect it. | |||
when I do make t/spec/S32-num/is-prime.t tests 1 & 2 consistently fail, everything else passes. | 01:31 | ||
which is kind of unlike the REPL behavior, because there it seems it's later tests which fail more consistently. | |||
it looks like NQP has it's own copy of libtommath, so it's probably not a bad install of one on my system. | 01:33 | ||
why don't I just try running under gdb? | 01:34 | ||
benabik | breakpoints are your friend? | ||
Alternatively rakudo's debugger. | |||
diakopter | or both? | 01:35 | |
colomon | rakudo's debugger is too high level, I think. I'm going to look at the C code. | ||
and fail. | |||
breakpoint didn't get hit. now trying to add a printf to the libtommath code. | 01:37 | ||
though I have to say I'm not clear on how to recompile that. :\ | 01:39 | ||
01:44
MikeFair left
01:46
MikeFair joined
|
|||
quester | colomon: I'm running under Linux and not seeing any failures. | 01:49 | |
diakopter: Are on on Windows, Linux, or other? | |||
diakopter | win8 | ||
64 | |||
quester | Oh, right, my Linux is 64 bit too (Fedora 17, kernel 3.7.6). | 01:50 | |
01:54
PacoAir left
|
|||
census | yay windows! :) | 01:54 | |
colomon | valgrind generates a gazillion errors, but it looks like they are mostly garbage collection things. | 02:00 | |
quester | Good night, #perl6. Good hunting, colomon++ | 02:03 | |
02:05
quester left
|
|||
colomon wishes moritz was awake. | 02:11 | ||
I tried adding nok 45724385972894572891.is-prime, "45724385972894572891 is not prime"; four times to is-prime.t. If I put it as tests 3-6, it works. If I put it first in the file (tests 1-4) it fails every time. | 02:17 | ||
Guess that suggests the error depends on more than just calls to is-prime. | 02:18 | ||
Judging by errors in valgrind, there is a bunch of GC before the first (correct) result in the REPL, then nothing for the next two (correct) results, then another burst of GC before the first wrong answer. | 02:28 | ||
02:42
s1n joined
02:54
FROGGS_ joined
02:58
FROGGS left
03:02
census left
|
|||
[Coke] | r: my $a = /a/; say $a; | 03:07 | |
p6eval | rakudo 932bc5: OUTPUT«» | ||
[Coke] | anyway to get something like "a" back out of that? | ||
r: my $a = /a/; say $a.^methods; | 03:08 | ||
p6eval | rakudo 932bc5: OUTPUT«No such method 'gist' for invocant of type 'Sub' in method gist at src/gen/CORE.setting:5131 in sub say at src/gen/CORE.setting:7601 in block at /tmp/IvHmXFebun:1» | ||
dalek | ast: 658c88c | (Solomon Foster)++ | S32-num/is-prime.t: Add a lot of tests for 45724385972894572891.is-prime, because it |
||
colomon | yeah, Linux seems to work fine for me. | 03:13 | |
[Coke] | r: my $a="a"; my $b = eval "/$a/"; say $b ~~ "whoa"; | 03:21 | |
p6eval | rakudo 932bc5: OUTPUT«False» | ||
colomon is out of ideas. | |||
colomon is out of whisky | 03:23 | ||
(in the glass, plenty in the cupboard) | |||
labster | Which is worse? | ||
benabik | Are those related? | ||
geekosaur puts on "Whisky In The Jar" | |||
labster | how can I test if something is a basic type, like Array or Bool? | 03:24 | |
colomon is afraid he is going to have to learn "Whisky in the Jar" for St. Patrick's Day | 03:25 | ||
labster | old code has ~~ Any, which matches just about anything. | ||
colomon | what do you mean by "basic type"? | 03:26 | |
03:26
dukeleto left
03:27
dukeleto joined
|
|||
colomon | you might get by with ~~ Cool | 03:27 | |
but even then, it's certainly possible for a user-created class to be Cool, they just aren't by default | |||
or possibly better question (trying to think like TimToady), why do you want to know if something is a "basic type"? | 03:28 | ||
labster | Okay, the code I'm looking at wants to take strings as parameters, but if it's something like Array or Hash, use that class to create a new object. | ||
colomon | to create a new string or some other sort of object? | ||
labster | it's Text::CSV, so yeah, basically. | 03:29 | |
colomon | one sec, want to check on my son. | 03:30 | |
03:31
orafu left,
orafu joined
|
|||
colomon | seems like you would want a case for each type you want to represent specially, and let everything else just use .Str or .perl or something? | 03:32 | |
labster | maybe I'll just check !~~ Str instead. | 03:33 | |
03:33
Dave joined
03:34
Dave is now known as Guest49257
|
|||
labster | This is masak's code, but I think the general idea is parse($data, output => MyArray) is as valid as the built-in option parse($data, output => 'hashes') | 03:34 | |
03:37
dayangkun left
03:38
daniel-s joined
|
|||
labster | I'll probably go with the string comparison option because Str.new is going to choke on having a list of hash arguments anyway. | 03:38 | |
[Coke] | ok, github.com/coke/p6-lingua-en-syllable is now usable. | 03:39 | |
03:39
Guest49257 left
|
|||
[Coke] | This is a cleaned up version of the one I used in the p6cc (also bugfixes) | 03:40 | |
colomon | [Coke]++ | 03:42 | |
labster | nice work | 03:45 | |
.oO ( would a Japanese syllable counter just be $kana.chars? ) | 03:46 | ||
[Coke] | mmheheh. | 03:49 | |
03:49
adu joined
03:52
xiaq joined
|
|||
colomon | $syl -= @SubSyl.grep( $word ~~ * ); | 03:53 | |
my $syl = @AddSyl.grep($word ~~ *) - @SubSyl.grep( $word ~~ * ); | |||
[Coke] | yah, it was a very simplistic translation of the p5 code. | 03:56 | |
03:58
dayangkun joined
|
|||
[Coke] | colomon: that matches every regex. | 04:00 | |
colomon | [Coke]: yeah, I'm trying to figure out how to do it correctly now. :) | ||
actually cloned your repo and started hacking. | |||
[Coke] | mmhehehe. | 04:01 | |
04:07
adu left
|
|||
colomon | okay, interesting | 04:07 | |
@AddSyl.grep(-> $re { $word ~~ $re }) works great | |||
@AddSyl.grep({ $word ~~ $_ }) does not work, nor does $word ~~ * | 04:08 | ||
04:08
adu joined
|
|||
[Coke] | ok. updated to: | 04:10 | |
my $syl = @AddSyl.grep(-> $re {$word ~~ $re}) - | 04:11 | ||
@SubSyl.grep(-> $re {$word ~~ $re}); | |||
colomon | This code needs more tests! | 04:12 | |
[Coke] | ... Hey, the p5 version only tested "hoopty" | 04:13 | |
colomon | gist.github.com/colomon/4970109 is what I ended up with | ||
[Coke] | (I'll let you make a pull request if you like, including the grep addition.) | 04:14 | |
I'll apply it, but only if you can combine the first 3 lines into a chained method call! | |||
colomon | new version: gist.github.com/colomon/4970109 | 04:26 | |
if you haven't changed it on your own by morning, I might remember to make a pull request. right now I'm going to bed. :) | 04:29 | ||
swarley | You know, the day that i get the audio shield for my arduino is of course the day that their website goes down | 04:37 | |
Looks like no documentation for me | |||
04:39
adu left
|
|||
dalek | ecs: a3b902f | larry++ | S32-setting-library/Containers.pod: don't really need a .powerset method also, allow a too-bit range to stop at size of the container |
04:39 | |
TimToady | s/too-bit/too-big/, gah | ||
swarley | Cross your fingers and hope the word nazis of the internet don't find you | 04:40 | |
[Coke] | colomon++ #updated | ||
04:43
Chillance left
04:49
preflex_ joined
04:50
preflex left,
preflex_ is now known as preflex
05:01
awwaiid joined
05:02
dayangkun left
05:03
dayangkun joined
05:12
adu joined
05:17
xinming_ joined,
simcop2387 left
05:18
simcop2387 joined
05:20
xinming left
05:27
adu left
|
|||
labster | phenny: tell masak I sent a pull request for Text::CSV to fix support for output to arbitrary type objects. 12 more tests now pass (mainly because t/04-output.t died in the middle), but output=>'hashes' is still broken. | 05:41 | |
phenny | labster: I'll pass that on when masak is around. | ||
dalek | ecs: 6fa36ad | larry++ | S32-setting-library/Containers.pod: nah, just default it to the powerset Upon mature consideration, the powerset is the best default, if for no other reason than it will force some people to consider the degenerate case of 0 elements. |
05:53 | |
06:11
xiaq left
|
|||
dalek | p/target-pbc: 97fd401 | moritz++ | src/QAST/ (3 files): [QAST dumper] include a bit more info |
06:17 | |
p/target-pbc: b1258d7 | jnthn++ | tools/ (2 files): Revert "Merge remote-tracking branch 'origin/spacey'" This reverts commit 1db6167740f7306a0e3acf04ccb15dfcc27c3dcb, reversing changes made to c9bc4a25ba2ca57e3642dbe870da31fd1b661322. |
|||
p/target-pbc: 0514fec | jnthn++ | src/NQP/ (2 files): Remove a now-unused option. |
|||
p/target-pbc: 1e0a374 | jnthn++ | src/NQP/Actions.pm: Remove a redundant load. |
|||
p/target-pbc: c6832d5 | jnthn++ | src/NQP/Actions.pm: Add a way to specify a custom regex lib. Useful for nqp-jvm while it only has the runtime part of it. |
|||
p/target-pbc: b19dbc1 | (Gerhard R)++ | / (7 files): Merge branch 'master' into target-pbc |
|||
06:28
SamuraiJack joined
06:32
lustlife joined
06:51
xinming_ left
06:52
xinming joined
06:56
Khisanth left
07:06
labster left
07:12
Khisanth joined
07:17
PacoAir joined
07:35
ggoebel_ left
07:46
am0c joined
|
|||
moritz | \o | 07:48 | |
07:56
kre joined,
kre is now known as Guest51384
|
|||
Guest51384 | perl6: say "1".WHICH | 07:57 | |
p6eval | rakudo 932bc5: OUTPUT«Str|1» | ||
..niecza v24-23-g0520c7c: OUTPUT«str|1[2D49A800]» | |||
07:58
SamuraiJack_ joined
08:00
SamuraiJack left
08:02
PacoAir left
|
|||
dalek | kudo/optimizer-void-context: a5a3718 | moritz++ | src/Perl6/Optimizer.pm: steal match widening from rakudo-debugger now "23 + 4" in sink context reports the whole expression, not just the operator |
08:02 | |
moritz | all spectest pass on this branch | 08:38 | |
jnthn: want do a code review of the optimizer-void-context branch? any objections to merging? | 08:39 | ||
and: other ideas what do with the void context analysis? | 08:40 | ||
maybe warning about variables in sink context | 08:41 | ||
nwc10 | moritz: is there any sort of benchmark that demonstrates where it gains? | 08:44 | |
nwc10 isn't competant to review it | |||
moritz | nwc10: no. The stuff so far is about the warnings, not about optimizations | 08:46 | |
nwc10 | aha | 08:47 | |
08:51
Guest51384 left
|
|||
moritz | (some of the patches involve adding source (file, line) info to some nodes, so we might even use a bit more memory than before) | 08:52 | |
apt-get upgrade gives me a new perl 5 version. I'm scared. | 08:53 | ||
jnthn: and I'm increasingly wishing for $!dba attribute or so in QAST::Node, because variables can compile to QAST::Vars and calls and all that stuff | 09:00 | ||
and literals to QAST::Want | 09:01 | ||
or should I reuse the existing hash component? | |||
09:03
s1n left
09:06
dukeleto left
09:07
dukeleto joined
|
|||
nwc10 blocks on /dev/pun, and doesn't seen to have a /dev/upun | 09:15 | ||
09:17
not_gerd joined
|
|||
not_gerd | o/ | 09:17 | |
moritz | TODO: write a tool that derives many cheap puns from a sngle pun idea :-) | ||
nwc10 | moritz: is my search on your IRC logger making it very busy? | 09:20 | |
09:21
SamuraiJack__ joined,
SamuraiJack__ left
|
|||
moritz | nwc10: should just keep one core busy | 09:21 | |
09:21
SamuraiJack_ left,
SamuraiJack__ joined
|
|||
moritz | and maybe a bit disc IO | 09:22 | |
not_gerd | could someone check if nqp/examples/load_bytecode.nqp is supposed to work right now? | ||
FROGGS_ | ./nqp examples/load_bytecode.nqp | 09:23 | |
Error while compiling block : ResizableStringArray: Can't shift from an empty array! | |||
moritz | though it's on my TODO to put the data into a proper search index | ||
FROGGS_ | not_gerd^^ | ||
not_gerd | FROGGS_: thanks, so not my fault | ||
09:41
chromis joined
09:47
pmurias joined
|
|||
dalek | p-jvm-prep: aba0d5c | (Paweł Murias)++ | t/ (2 files): In qast_trig.t compare to a given epsilon as we get slightly different results for different implementations of trigonometric functions. Add qast_output_is_approx to t/helper.t we use for that. |
09:47 | |
kudo-js: 8259a46 | (Paweł Murias)++ | / (5 files): Implement nqp::sleep (using node module sleep) and nqp::exit. |
09:55 | ||
kudo-js: e650024 | (Paweł Murias)++ | / (4 files): Pass t/qast_trig.t from nqp-jvm. |
|||
pmurias | one qast_*.t test remaining ;) | 09:56 | |
10:01
hypolin left
10:03
chromis left
10:04
arlinius left
10:07
kaare_ joined
10:08
mmcleric left
|
|||
FROGGS_ | nr: my @var = <a b c>; say "a0" ~~ /@var[0]/ | 10:09 | |
p6eval | niecza v24-23-g0520c7c: OUTPUT«Potential difficulties: Apparent subscript will be treated as regex at /tmp/hAPNnXGPBS line 1:------> my @var = <a b c>; say "a0" ~~ /@var⏏[0]/「a0」» | ||
..rakudo 932bc5: OUTPUT«Potential difficulties: Apparent subscript will be treated as regex at /tmp/0RbZGE0pw0:1 ------> my @var = <a b c>; say "a0" ~~ /@var⏏[0]/#<failed match>» | |||
10:10
FROGGS_ is now known as FROGGS
10:14
anuby left
10:15
am0c left
10:18
arlinius joined
|
|||
tadzik | hello hello | 10:24 | |
10:27
muixirt joined
|
|||
muixirt | good morning | 10:28 | |
FROGGS | morning | ||
10:30
spider-mario joined
|
|||
muixirt | minor complaint: nqp/docs/bootstrapping.pod talks about nqp-rx and is probably outdated, and in general the different text formats there (pod, markdown, plain text) | 10:31 | |
dalek | p/target-pbc: 7cd9056 | (Gerhard R)++ | src/HLL/Compiler.pm: integrate PBC generation more naturally into HLL::Compiler |
10:34 | |
FROGGS | muixirt: can you supply a patch? | 10:35 | |
muixirt | FROGGS: I leave that to the experts ;-) | 10:38 | |
FROGGS | meh :o) | ||
10:38
mberends left
10:39
mberends joined
10:47
dayangkun left
|
|||
dvj | rakudo: class a { has @.b; }; $c = a.new; $c.b = qw{hello world}; | 10:50 | |
p6eval | rakudo 932bc5: OUTPUT«===SORRY!===Variable '$c' is not declaredat /tmp/gzFGrYfptG:1------> class a { has @.b; }; $c⏏ = a.new; $c.b = qw{hello world}; expecting any of: postfix» | ||
dvj | rakudo: class a { has @.b; }; my $c = a.new; $c.b = qw{hello world}; | ||
p6eval | rakudo 932bc5: ( no output ) | ||
FROGGS | that NFA stuff is not a LHF, right? ó.ò | 10:52 | |
rakudo: class a { has @.b; }; my $c = a.new; $c.b = qw{hello world}; say $c.b | 10:53 | ||
p6eval | rakudo 932bc5: OUTPUT«hello world» | ||
moritz | FROGGS: what NFA stuff? | 10:58 | |
FROGGS | arrays in regexes | ||
dvj | rakudo: class a { has $.b; }; sub c (:$d = False) { a.new.b = $d }; c(); | 11:00 | |
p6eval | rakudo 932bc5: OUTPUT«Cannot assign to a readonly variable or a value in sub c at /tmp/1iZbpwWujP:1 in block at /tmp/1iZbpwWujP:1» | ||
dvj | why am I getting that error? | ||
moritz | FROGGS: might not be | ||
FROGGS | moritz: jnthn told me that it should be | ||
moritz | FROGGS: he knows better than me, I think | ||
FROGGS | /@a/ should be /| @a/ by default | 11:01 | |
moritz | dvj: because you can't write to an accessor of an attribute, unless you mark it as 'is rw' | ||
FROGGS | and you can switch to sequential matching by doing / || @a / | ||
that's what my local changes are doing right now | |||
moritz | (note that list assignment is a different beast, which is why you don't get an error with @ sigils) | ||
dvj | moritz: ok, thanks! | 11:02 | |
moritz | dvj: the attribute itself (ie not the accessor) is known inside the class as $!b | ||
not_gerd | if anyone is bored, try fixing `make test` on github.com/gerdr/rakudo/tree/target-pbc using github.com/perl6/nqp/tree/target-pbc | ||
jnthn | moritz: I will take a look over it soon | 11:03 | |
(the optimizer branch) | |||
nwc10 | good pm, jnthn | ||
FROGGS | .oO( an optimistic branch? ) |
11:04 | |
jnthn | o/ nwc10 | ||
not_gerd | jnthn: nqp --target=pbc does work for simple stuff, but I couldn't get Rakudo to build yet replacing the two step process (nqp/parrot) with a single one | 11:05 | |
jnthn: also, my patched Rakudo fails some tests :( | 11:06 | ||
moritz | I thought it didn't even build? | 11:09 | |
not_gerd | moritz: it builds as long as and don't use nqp --target=pbc | ||
the branch makes 2 changes, really: use whiteknight's PackfileView instead of EvalPMCs and add a new frontend target | 11:10 | ||
you can build Rakudo using the former (with failing tests) but not yet the latter | 11:11 | ||
jnthn | moritz: ah, it wasn't actually that big a diff between nom and the branch. Just read thorugh it. Didn't spot anything that gave me concern. | 11:12 | |
moritz: Does it catch this case: | |||
my $x = 1, 2, 3; | |||
jnthn didn't see anything to suggest it does | 11:13 | ||
not_gerd: Maybe try taking a file that won't work with --target=pbc and stripping stuff out of it until it works. May give some hints. | 11:20 | ||
not_gerd | jnthn: wild guess is that it might be related to library loading, but the simple example from nqp/examples actually failes on standard NQP as well ;) | 11:23 | |
dvj | rakudo: my Bool $a; my @b = <1 2 3>; $a = '2' eq any @b; | 11:24 | |
p6eval | rakudo 932bc5: OUTPUT«Type check failed in assignment to '$a'; expected 'Bool' but got 'Bool' in block at src/gen/CORE.setting:2166 in sub AUTOTHREAD at src/gen/CORE.setting:2158 in block at /tmp/sJX_9t5mxj:1» | ||
dvj | expected bool, got bool? | ||
FROGGS | rakudo: my Bool $a; my @b = <1 2 3>; say '2' eq any @b; | 11:25 | |
p6eval | rakudo 932bc5: OUTPUT«any(False, True, False)» | ||
jnthn | It should indeed fail. I think the error reporting is busted. | ||
FROGGS | rakudo: my Bool $a; my @b = <1 2 3>; say ('2' eq any @b).WHAT; | 11:26 | |
p6eval | rakudo 932bc5: OUTPUT«Junction()» | ||
dvj | I thought that was a correct way of checking if an element is in a list | 11:27 | |
FROGGS | rakudo: my Bool $a; my @b = <1 2 3>; $a = ('2' eq any @b).Bool; | ||
p6eval | rakudo 932bc5: ( no output ) | ||
jnthn | dvj: It is, but the result is not a Bool | ||
dvj | is any similar to variant one would use in C++? | ||
jnthn | It's makes a type called a Junction | 11:29 | |
Any operation that you do against a Junction automatically distributes, so '2' eq $some_junction produces a Junction of booleans. Put that in a boolean context and it collapses to a single true/false value. Of course, optimization may make the collapse instant when it knows there is a boolean context in place | 11:31 | ||
dvj | interesting :) | ||
pmurias | jnthn: how do junctions fit into QAST/sixmodel? | 11:33 | |
moritz | pmurias: they are handled at the Perl 6 / CORE level | ||
ie there's a separate type Junction, which is handled like any other by QAST | 11:34 | ||
pmurias | multis do the autothreading? | ||
jnthn | It's a multi-dispatch failover, yes | ||
And in the single dispatch case, a binding failover. | |||
pmurias | and when calling a method? | 11:35 | |
jnthn | That's single dispatch :) | ||
Oh, you mean calling a method on a junction? | |||
iirc, that's handled by the fallback mechanism. | |||
All 3 of these code paths lead to the same place, though. | |||
11:36
msuszczy joined
|
|||
jnthn | r: my Bool $a; my @b = <1 2 3>; try { $a = ('2' eq any @b).^name; }; say $!.perl | 11:37 | |
p6eval | rakudo 932bc5: OUTPUT«X::TypeCheck::Assignment.new(symbol => "\$a", operation => "assignment", got => "Junction", expected => Bool)» | ||
jnthn | oh, fail | 11:38 | |
r: my Bool $a; my @b = <1 2 3>; try { $a = ('2' eq any @b); }; say $!.perl | |||
p6eval | rakudo 932bc5: OUTPUT«X::TypeCheck::Assignment.new(symbol => "\$a", operation => "assignment", got => Bool::False, expected => Bool)» | ||
jnthn | Hm, so it's wrong before we even get the exception object constructed. | ||
moritz | huh, what's wrong? | ||
assignment isn't coercion | 11:39 | ||
you need to coerce yourself | |||
FROGGS | well, the exception object doesnt do much magic, right? | ||
moritz | r: my Bool $a; my @b = <1 2 3>; $a = so '2' eq any @b; say $a | ||
p6eval | rakudo 932bc5: OUTPUT«True» | ||
jnthn | moritz: The error message | ||
moritz: It should say got => Junction or so | 11:40 | ||
moritz | oh, it did so in the first one | ||
but not in the second | |||
right | |||
jnthn | yes, because I tried to assign .^name which is a Str :) | ||
Well, the got seems to be the value | |||
oh, I found it... | |||
%c_ex<X::TypeCheck::Assignment> := sub ($symbol, $got, $expected) | 11:41 | ||
moritz | well yes | ||
jnthn | That'll auto-thread :) | ||
moritz | that needs a Mu or Two | ||
jnthn | aye :) | ||
moritz guilty as charged | |||
jnthn | Any reason it is a sub, not just a pointy? | ||
oh, the trait | |||
jnthn adds Mu and builds | 11:42 | ||
11:42
dukeleto left
|
|||
FROGGS | bad dukeleto! | 11:42 | |
11:42
dukeleto joined
|
|||
jnthn | > my Bool $a; my @b = <1 2 3>; $a = '2' eq any @b; | 11:45 | |
Type check failed in assignment to '$a'; expected 'Bool' but got 'Junction' | |||
\o/ | |||
moritz | \o/ | ||
FROGGS | .oO( it should automatically open a ticket if $expected and $got are equal... ) |
11:47 | |
moritz | FROGGS: not at all | ||
not_gerd | FROGGS: you're thinking too small: it should fix the bug and send a pull request! | ||
FROGGS | :o) | ||
moritz: why? | |||
maybe it should check for open tickets first *g* | |||
moritz | r: class A { }; my A $x = do { my class A { }; A.new } | 11:48 | |
p6eval | rakudo 932bc5: OUTPUT«Type check failed in assignment to '$x'; expected 'A' but got 'A' in block at /tmp/BhzbwVxDIO:1» | ||
moritz | that's correct | ||
FROGGS | it is, yes | ||
11:48
daniel-s left
|
|||
FROGGS | then it should check if the types are the identical | 11:48 | |
not just their name | |||
not_gerd broke bootstrapping | 11:49 | ||
how did Münchhausen do that again? | |||
masak | afternoon, #perl6 | 11:51 | |
phenny | masak: 05:41Z <labster> tell masak I sent a pull request for Text::CSV to fix support for output to arbitrary type objects. 12 more tests now pass (mainly because t/04-output.t died in the middle), but output=>'hashes' is still broken. | ||
FROGGS | hi masak | 11:52 | |
masak | phenny: tell labster can I deny that pull request? '$output eqv Any' looks unidiomatic to me -- shouldn't it ve '$output === Any'? same with '$output.not' -- shouldn't it be '!$output'? beyond that, it looks fine. | 11:55 | |
phenny | masak: I'll pass that on when labster is around. | ||
jnthn | .oO( working > idiomatic... ) |
11:56 | |
masak | yes, which is why I didn't *close* the pull request. | ||
jnthn | r: say Any !~~ / 'RT #67234' / | 12:00 | |
p6eval | rakudo 932bc5: OUTPUT«use of uninitialized value of type Any in string context in any at src/gen/BOOTSTRAP.pm:99True» | ||
masak | fwiw, I cannot reproduce Ovid's rt.perl.org/rt3//Public/Bug/Displa...?id=116777 ;) | 12:13 | |
phenny: tell labster nvm, I pulled and fixed those myself. :) keep up the good work! | 12:21 | ||
phenny | masak: I'll pass that on when labster is around. | ||
jnthn | masak++ | 12:23 | |
colomon | masak: what platform are you using? | 12:25 | |
colomon has no trouble reproducing Ovid's bug on his OS X Rakudo build, as documented at length in the #perl6 backlog. | 12:26 | ||
arnsholt | Weirdness. I mean, yes we're using a probabilistic primality test, but it shouldn't be -that- weird | 12:27 | |
masak | TimToady++ # making .combinations default to the power set | ||
12:28
PacoAir joined
|
|||
masak | colomon: I'm on a Debian 64-bit VM inside a Windows 7 host. | 12:28 | |
12:28
pmurias left
|
|||
masak | my hardware is some Intel thing from HP. | 12:28 | |
colomon | I don't know what Ovid is using, but every Linux box we tested last night worked fine. | 12:29 | |
the other possibility is it depends on what version of libtommath you're calling. does NPQ always use the one included with it? | 12:30 | ||
not_gerd | oO( Ovid uses a quantum computer ) | 12:31 | |
jnthn | Yes, should do. | ||
12:33
census joined
|
|||
arnsholt | I can try to reproduce on my Mac later tonight | 12:34 | |
masak | not_gerd: Münchhausen never really documented his bootstrapping method. likely his technique was very ad-hoc. | 12:39 | |
12:40
PacoAir left,
census_ joined,
PacoAir joined
12:41
census left
12:49
protist joined
|
|||
dalek | p/target-pbc: 6fc76a3 | (Gerhard R)++ | src/stage0/ (9 files): rebootstrap so we can build on parrot branch eval_pmc |
12:49 | |
12:57
census_ left
12:59
census joined
|
|||
FROGGS | nr: say "aabbbcccc" ~~ / [a|cccc|aab] / # it will never match "cccc" because it already stared matching from "a", right? | 13:14 | |
p6eval | rakudo 932bc5, niecza v24-23-g0520c7c: OUTPUT«「aab」» | ||
FROGGS | and that is how it is meant to be? | 13:15 | |
moritz | yes | 13:16 | |
FROGGS | k, thanks | ||
moritz | left-most match principle applies even before LTM | ||
13:20
PacoAir left
13:21
PacoAir joined
|
|||
FROGGS | nqp: my @a := <a cccc aab>; say("aabbbcccc" ~~ / @a /) | 13:22 | |
p6eval | nqp: OUTPUT«aab» | ||
FROGGS | then thats already enough? | ||
moritz | yes | ||
FROGGS | then I just need to implement the ||@a switch | ||
cool | |||
13:30
daniel-s joined
|
|||
moritz | r: my @a = <a aab>; say 'aabb' ~~ / @a / | 13:31 | |
p6eval | rakudo 932bc5: OUTPUT«#<failed match>» | ||
FROGGS | didnt push yet | 13:34 | |
13:40
cobra joined
13:43
protist left
13:46
Tedd1 joined
13:49
ssds joined
13:50
census left
13:52
spider-mario left,
SunilJoshi joined,
msuszczy left
|
|||
masak | whoa. 114 comments. www.reddit.com/r/programming/commen...d_as_perl/ | 14:11 | |
does anyone know whether this is true? it's nothing I've heard before. www.reddit.com/r/programming/commen...rl/c8glc7f | 14:15 | ||
14:16
SunilJoshi left
|
|||
masak | I remember there being some weirdness in the selection of talks, which inadvertently affected Perl 6 talks. but I don't think it was a deliberate *policy*. | 14:16 | |
14:16
ElDiabolo joined
14:18
curtispoe joined
|
|||
masak | (also, how come even when reddit threads generate a lot of discussion on Perl 6, they are never actually about the thing the blog post was about?) | 14:19 | |
ElDiabolo | Is there a standard way to create a perl6 module skeleton yet ? | ||
Hi masak | |||
jnthn | A tool, or a guide for how to do it? wiki.perl6.org/Create%20and%20Distr...%20Modules provides the latter. | ||
ElDiabolo | jnthn, A tool would be preferable, but that will do, too. | 14:20 | |
14:21
Psyche^ joined
|
|||
curtispoe | Hi all. I'm digging into the red-black tree code in Perl 6 and trying to figure out the correct way of describing 'my $tree = Any'. Is that saying we're assigning the Any class to the $tree scalar? | 14:22 | |
14:22
dukeleto left,
dukeleto joined
14:24
Patterner left,
Psyche^ is now known as Patterner
|
|||
jnthn | "class object" isn't quite accurate; Any is a type object, which represents the type Any. It has the same type as an instance of Any; the the closest thing to class object is the meta-object, which is what holds information about methods and so forth. | 14:25 | |
curtispoe | Cheers for that. | 14:26 | |
jnthn | Another way of thinking about it is that it's a typed undef. | ||
curtispoe | Also, can anyone else replicate this bug? It always happens to me after the *third* time I ask for primes: rt.perl.org/rt3//Public/Bug/Displa...?id=116777 | ||
masak | ElDiabolo: hi. thanks for the email. I'll reply to it shortly. | ||
jnthn | Some people could reproduce the bug, other people couldn't. I'm not sure we've managed to spot a pattern yet... | 14:27 | |
14:27
jac50 joined
|
|||
curtispoe | And I want to apologize to any Perl 6 hackers who feel like I dumped on them when I started the Perl 7 firestorm. That was very poorly thought out on my part :( | 14:27 | |
masak | curtispoe: think of 'Any' as the new 'undef'. every class has its own type object, which stands in as 'the undefined value' for that type. | ||
curtispoe: there's a fair bit of backlog about your bug report, fwiw. | 14:28 | ||
curtispoe: irclog.perlgeek.de/perl6/2013-02-17 | |||
jnthn | I did it 20 times in the repl and can't reproduce here...maybe I can find myself an environment where I can do so. | 14:29 | |
masak | curtispoe: re Perl 7, I was surprised to see the initial blog post, because it's so evidently a crap idea from my perspective. but I like where it's currently heading with mst++'s "Pumpkin Perl" proposal. | ||
curtispoe | Yes, I was totally brain-dead in my initial discussion and I regret it, but I'm happy to see that there might be a positive takeaway for the issue. | 14:30 | |
I'm currently writing up a post about Perl 6 and explaining the red-black tree implementation to try to put something positive about Perl 6 out there. I really like what I'm seeing. | 14:31 | ||
masak | my takeaway from FOSDEM is that people really liked what they were seeing. | 14:33 | |
it's nice sometimes to be reminded of the significant improvement to Perl 5 that Perl 6 represents. it's easy to forget if all you see is Perl 6 all day. :) | |||
curtispoe | jnthn: I love seeing your work on the JVM recently. Are you willing to speculate on a timeframe for a full(ish) port of Rakudo? | 14:34 | |
e.g., when can people start reliably using it? | |||
masak | in some sense, it's rather useless to post historical retrospectives on reddit, because all they do is parrot the common outsider beliefs about the unviability of Perl and/or Perl 6. | 14:35 | |
moritz | masak: I disagree. There are usually many people who read the article, even if they don't comment | 14:36 | |
masak | hm, that is true. | ||
moritz | often you see perl posts with positive reputation but lots of troll comments | ||
curtispoe | masak: agreed about the improvement that Perl 6 represents. If we can get the performance up there and include concurrency, it could really be a game-change. I don't think any major dynamic language has a working concurrency model. | ||
moritz | and the positive reputation is proof that more people liked it than not | ||
masak | wow, it got 140 points. \o/ | 14:37 | |
moritz++ # seeing silver linings | |||
curtispoe | perl6: say "testing" | ||
p6eval | rakudo 932bc5, niecza v24-23-g0520c7c: OUTPUT«testing» | ||
curtispoe | perl6: say ($_ if $_.is-prime for 1..5).join(',');say ($_ if $_.is-prime for 1..5).join(',');say ($_ if $_.is-prime for 1..5).join(',');say ($_ if $_.is-prime for 1..5).join(','); | ||
p6eval | rakudo 932bc5, niecza v24-23-g0520c7c: OUTPUT«2,3,52,3,52,3,52,3,5» | ||
curtispoe | Ok, on my box that repeats 2,3,4,5 on four lines. | 14:39 | |
jnthn | curtispoe: I think NQP will reach the point of being able to cross-compile itself to the JVM within a month from now. It's quite hard for me to give a good prediction on Rakudo. My goal is that it's in a good state ahead of the summer conference season. | ||
curtispoe | jnthn: thanks. Can I post that to my blog? | ||
jnthn | Well, the channel is logged, so I guess I already just said it publicly :P | ||
masak | curtispoe: today's backlog also concludes that the bug is platform-related. | ||
jnthn | masak: Oh, did we nail down any specifics? | ||
curtispoe: Anyway, so long as it's clear it's an estimate... Also it's not just "port Rakudo", it's "make sure the ecosystem can cope" | 14:40 | ||
masak | jnthn: no. arnsholt said he'll try on a Mac. | 14:41 | |
14:41
shinobicl joined
|
|||
jnthn | masak: OK. I didn't hit it here | 14:42 | |
colomon | curtispoe: what platform are you using to get the is-prime bug? I can definitely see it on my Mac, but my Linux box works fine. | ||
curtispoe | OS X. | 14:43 | |
jnthn | colomon: How much RAM to those two have, ooc? | ||
curtispoe | Darwin Ovid.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64 | ||
jnthn | *do | ||
colomon | jnthn: 8 gigs each | ||
jnthn | OK | ||
curtispoe | And I have 4 gigs of RAM. | ||
moritz | jnthn: did you get around to review my branch yet? | ||
jnthn | irclog.perlgeek.de/perl6/2013-02-17#i_6463574 | 14:44 | |
moritz: "Didn't spot anything that gave me concern" = "yes, you can merge it" :) | 14:45 | ||
moritz | 4GB or RAM, linux amd64, can't reproduce the is-prime bug | ||
jnthn | OK, smaller memory systems GC more often... | ||
Can somebody who can reproduce it perhaps try parrot -G perl6.pbc code-that-does-it.p6 | 14:46 | ||
Which will run without GC. If it still happens, we know it's not GC related. | |||
moritz | fwiw my branch doesn't catch "my $x = 1, 2, 3;" | ||
colomon | jnthn: when I valgrinded it, it definitely seemed like there was a GC run before the results changed for the worst. | ||
14:46
s1n joined
|
|||
moritz | because = is not pure, so it doesn't complain about infix:<,> in void context | 14:46 | |
colomon | jnthn: on it | 14:47 | |
jnthn | moritz: But the precedence is (my $x = 1), 2, 3 | ||
Oh, I see what you're saying. | |||
moritz | jnthn: yes | ||
1, die 2 | |||
is also a , in void context we don't complain about | |||
colomon | jnthn: with parrot -G it runs successfully | ||
jnthn | Urgh. | ||
moritz | I could make it complain, but I'm not sure it's a good idea | ||
jnthn | std: my $x = 1, 2, 3; | 14:48 | |
p6eval | std 7551b8f: OUTPUT«ok 00:00 43m» | ||
jnthn | Hm, I thought it warned on that one. | ||
moritz: I'm mostly thinking of trying to catch a common thinko. | |||
The optimizer may not bet the place to do it, though. | 14:49 | ||
colomon | jnthn: if I use the parrot invocation with -G, it works. parrot invocation without -G, 19 fails. (That's on S32-num/is-prime.t.) | ||
moritz | jnthn: I might experiment with more agressive warnings later, but first I want to see how the community responds to the new warnings | 14:52 | |
jnthn | moritz: +1 | 14:53 | |
14:54
mtk left
|
|||
geekosaur generally thinks more warnings == good | 14:54 | ||
moritz | geekosaur: well yes, if you get a low rate of false positives | ||
geekosaur | point | 14:55 | |
dalek | kudo/nom: a10db62 | moritz++ | src/Perl6/Optimizer.pm: try to track void context in the optimizer does not work yet, it seems to consider all string literals in void context. No idea why :( d2795bb | moritz++ | docs/ChangeLog: update ChangeLog with new warnings |
||
14:55
dalek left
|
|||
geekosaur , speaking of, updates rakudo and niecza | 14:55 | ||
moritz | and in theory, the warnings are perfect and never give fals positives. But we all know how theory turns out sometimes :-) | 14:56 | |
good bye dalek | |||
14:56
dalek joined,
ChanServ sets mode: +v dalek
14:58
mtk joined
|
|||
14:59
spider-mario joined
15:00
mtk left
|
|||
geekosaur | hrm, how do I make the rakudo build check compilers all over again? I upgraded os and xcode since last time I built it, it's looking for /usr/bin/gcc-4.2 still | 15:03 | |
15:03
mtk joined
|
|||
moritz | geekosaur: rakudo gets its configuration from parrot | 15:04 | |
geekosaur: so one way is to delete the installed parrot, and then do a perl Configure.pl --gen-parrot in rakudo | 15:05 | ||
geekosaur | I did the --gen-parrot, guess I need to nuke the existing | ||
moritz | right | ||
15:06
mtk left
15:07
mtk joined,
thou_ left
15:17
s1n left
15:20
mtk left
15:21
SamuraiJack joined
15:23
SamuraiJack__ left
15:24
mtk joined
15:33
b1rkh0ff joined
15:40
cobra left
|
|||
moritz | www.perlmonks.org/?node_id=1019130 # another fun discussion about advancing Perl 5. LanX++ for not talking about naming :-) | 15:40 | |
masak | moritz++ # reply | 15:42 | |
moritz: fwiw, I'm not sure "evolvement" (in the last paragraph) is the word you're looking for. | 15:44 | ||
rjbs | moritz++ # good reply | ||
and the word you wanted is probably "evolution" | 15:45 | ||
masak | oh! yes. the closest I got to guessing the meaning was "involvement". but it didn't feel right. | 15:48 | |
curtispoe | Terminology question: for the red-black tree code, we have the following signature: multi balance(B, [R, [R,$a,$x,$b], $y, $c ], $pivot, $right);. The [] aren't being used here for a sub signature, but to assist in the pattern matching. What is this usage called and where is it documented? | 15:50 | |
s/sub signature/sub-signature/ | |||
jnthn | It is a sub-signature | ||
masak | and it's documented in S06. | 15:51 | |
jnthn | In a multiple dispatch, sub-signatures function as tie-breakers | ||
curtispoe | Ah, I thought sub-signatures required a named variable before them. | ||
Cheers for that. | |||
masak | nope. | ||
let me get you a closer reference. | |||
jnthn | No, if you don't care to name the unpackee you don't have to | ||
er, maybe don't use the word unpackee :) | |||
"original argument" or something is probably better :) | 15:52 | ||
moritz | curtispoe: I even blogged about sub-signatures recently: perlgeek.de/blog-en/perl-6/2013-pat...ching.html | ||
curtispoe | moritz: yes, that's what first pointed me to the red-black tree example I'm writing up. | 15:53 | |
moritz | ah, but I didn't mention that it works without variables too | ||
probably because I wasn't aware of it :-) | |||
I should retro-add it | 15:54 | ||
masak | colomon: "Unpacking array parameters" in S06 finds you a good clarification. | ||
er, curtispoe, not colomon. | |||
curtispoe | :) | ||
colomon | :) | 15:55 | |
jnthn | If you're curious how it works: it coerces the incoming argument to a Capture and then recurses into the signature binding process. | ||
So all the stuff you know how to do in a normal signature, you can also do in a sub-signature. | |||
dalek | p/target-pbc: de66164 | (Gerhard R)++ | src/ (3 files): untangle code |
15:58 | |
p/target-pbc: 4068cef | (Gerhard R)++ | t/ (4 files): adjust tests |
|||
p/target-pbc: 7fef0cc | (Gerhard R)++ | src/stage0/ (9 files): rebootstrap |
|||
masak | jnthn: with the extra niceness that you can bind names down in a sub-siggy, and they remain bound even in your routine. but maybe that falls out from the simple fact that sub-signatures are not scopes. :) | 16:00 | |
jnthn | Yeah, they all declare in the current lexical scope | 16:03 | |
And don't introduce new scopes | |||
Really you're just building up a data structure that the binder walks over. | |||
curtispoe | Out of curiosity, are sub signatures powerful enough that I could use them to get rid of the "when" statements in the red-black tree example? (via extra multis) rosettacode.org/wiki/Pattern_matching#Perl_6 | 16:04 | |
moritz | curtispoe: you could, with multi ins( $x, @s [$col, $a, $y where { $x before $y }, $b] ) | 16:05 | |
16:05
SamuraiJack_ joined
|
|||
curtispoe | OK, I was hoping that was the case, but I wasn't sure. | 16:05 | |
16:06
SamuraiJack left
|
|||
not_gerd | jnthn: all tests pass with --target=pbc | 16:07 | |
see github.com/rakudo/rakudo/pull/102 | |||
would be nicde if someone would pull it into a branch so others can (spec)test more easily | |||
^nice | |||
masak | curtispoe: yes, but multi dispatch has "nice" properties when you're doing nominal type checking, but is basically equivalent to a series of "when"s when you're doing "where" checking. | 16:10 | |
16:10
Chillance joined
|
|||
moritz | right, that's why we don't recommend excessive use of where in signatures | 16:14 | |
16:17
ElDiabolo left
16:20
ElDiabolo joined
|
|||
colomon | using a bunch of wheres would be significantly less efficient than using whens, yes? | 16:21 | |
masak | well, at least as long as the "where"s are evaluated at least twice, as they are now :P | 16:22 | |
colomon | wouldn't it also force the signature to bind multiple times? | 16:23 | |
masak | maybe -- could you explain your reasoning? | ||
jnthn | Yes, if you have two signatures that differ only by a where clause deep in an unpack, it's verifying the thing as a whole each time. | 16:24 | |
colomon | well, if you've got multi ins( $x, @s [$col, $a, $y, $b] where blah).... what jnthn said. | ||
is "deep in an unpack" important there? | 16:25 | ||
ElDiabolo | masak, Is ESQL (for Embedded SQL) a reasonable name ? Sounds a bit like Haskell, which is also cool. | ||
masak | probably not, but it does make it worse. | ||
ElDiabolo: dang, I should really reply to that email, shouldn't it? doing it now. | |||
moritz | yes, because it tries the binding of the inner signatures for every multi candidates | ||
16:25
zby_home joined
|
|||
moritz | *candidate | 16:25 | |
jnthn | colomon: Not really, just emphasizing the scenario where it's most obviously wasteful | ||
colomon | gotcha. | 16:26 | |
ElDiabolo | masak, Never mind. There isn't much in it by now. | ||
moritz | also you can retro-name it to "Extended" if you want :-) | 16:27 | |
16:27
am0c joined
|
|||
masak | ElDiabolo: email sent. | 16:35 | |
ElDiabolo: I have some syntax reservations that I managed to get down on paper. probably easier to explain over email than here. | 16:36 | ||
ElDiabolo: that said, feel free to continue the discussion either here or via email. | |||
16:37
jac50 left,
jac50 joined
16:38
dukeleto left,
dukeleto joined
16:41
muixirt left
16:46
thou joined
16:49
xinming left
16:56
census joined,
xinming joined
16:58
James_ joined,
James_ is now known as Guest76939
|
|||
census | hi! | 16:59 | |
17:01
jac50 left
17:02
shinobicl left
|
|||
masak | hi, census. | 17:02 | |
census | all quiet on the western front? | 17:03 | |
moritz | not quite quiet | 17:07 | |
17:08
xenoterracide left
|
|||
masak | census: did you come here to ask whether it's all quiet? | 17:10 | |
17:12
xenoterracide joined
|
|||
moritz | r: 1 + 2; say 42 | 17:13 | |
p6eval | rakudo d2795b: OUTPUT«WARNINGS:Useless use of constant expression "1 + 2" in sink context (line 1)42» | ||
moritz | r: q[1]; say 42 | 17:15 | |
p6eval | rakudo d2795b: OUTPUT«WARNINGS:Useless use of constant string "1" in sink context (line 1)42» | ||
moritz | I should probably change that use to use q[1] instead of "1" | 17:16 | |
r: my $x = 42; $x; say $x | |||
p6eval | rakudo d2795b: OUTPUT«42» | ||
moritz | huh, I thought that one too warned | ||
oh, I never pushed that patch :/ | 17:17 | ||
masak | moritz++ # constant warnings | ||
moritz | prepare for more :-) | 17:18 | |
census | no, i didn't do that. i came to say hello! but nobody said hello back | ||
except for you | |||
moritz | census: I'm sure people would greet you more friendly if you contributed more to on-topic discussions here | 17:19 | |
17:19
ssds is now known as msuszczy
|
|||
masak | +1 | 17:19 | |
census | thank you for the pointer. i will work on that | 17:20 | |
[Coke] | I have a mac. what needs reproducing? | ||
moritz | [Coke]: run ($_ if $_.is-prime for 1 .. 10 ); a few times in a row in the REPL | 17:21 | |
masak | [Coke]: rt.perl.org/rt3/Ticket/Display.html?id=116777 | ||
17:22
xenoterracide left,
xenoterracide joined
|
|||
benabik | Gives me 2..10 on run #3. (OS X) | 17:22 | |
17:23
msuszczy left
17:24
ssds joined
|
|||
benabik | runs 3,4,5,7,9,10... then I got bored. | 17:25 | |
moritz | benabik: how much memory does your machine have? | ||
benabik | moritz: 8 GiB | ||
Although I wonder how much Parrot thinks I have. ISTR Parrot misestimating it. | 17:26 | ||
17:26
ssds left,
ssds joined
|
|||
moritz will try at $work tomorrow, with 8GB ram and linux amd64 | 17:26 | ||
benabik | Yes. Parrot's method of getting memory size is capped at 2GB on OS X. | 17:28 | |
(So it runs GC more often.) | 17:29 | ||
17:29
msuszczy joined
|
|||
[Coke] | moritz: yes, I can duplicate that. | 17:30 | |
moritz | too bad parrot doesn't respect ulimits when determining memory size | 17:31 | |
the it would be much, much easier to simulate machines with smaller memory (no VM needed) | |||
17:31
ssds left
|
|||
moritz | *then | 17:31 | |
17:31
msuszczy left
17:32
ssds joined
|
|||
[Coke] | There is an open feature request to have a command line option to parrot to say how much memory to use (ala the jvm) | 17:32 | |
moritz | that too would be a good idea | 17:33 | |
masak | ...though respecting ulimit sounds like a good idea, too ;) | ||
moritz opens another ticket for that | |||
benabik | Checking limit inside Parrot_sysmem_amount is probably easier than figuring out how to cap total allocations. | 17:35 | |
*ulimit | |||
moritz | yes, that's what I mean | 17:37 | |
man getrlimit | |||
17:37
ssds left,
ssds joined
|
|||
benabik | If I wasn't up to my eyeballs in homework, I'd do it. Place to add it is src/platform/*/sysmem.c, Parrot_sysmem_amount | 17:38 | |
moritz | I've opened github.com/parrot/parrot/issues/935 | 17:40 | |
17:40
ssds left
17:41
ssds joined
|
|||
colomon | "Parrot's method of getting memory size is capped at 2GB on OS X." Wait, is this why I have trouble getting Rakudo to handle big files on my machine? | 17:41 | |
moritz | possibly :-) | ||
benabik | It would cause Parrot to GC far more frequently. | ||
Shouldn't cap memory allocations or anything like that. | |||
colomon | I'm guessing running super slow from GCing all the time would be nearly indistinguishable from running super slow because of lowmemory... | 17:44 | |
17:44
adu joined
|
|||
benabik | There's a different function to use, but it's not available on all OS X. Nobody's spent the time to create code that works for both me and kid51. :-D | 17:46 | |
17:46
ssds left
17:47
ssds joined
|
|||
pmichaud | I sent a message to the issue ticket, but memory limits was also covered in issue #795. | 17:47 | |
You can also probably check the #parrot logs around the timeframe of #795 for more details. | 17:48 | ||
colomon | I've been wondering if this bug has always been there in is-prime, or if it is a recent thing. | 17:49 | |
masak | pmichaud! \o/ | ||
pmichaud | good morning, #perl6 | ||
jnthn | o/ pmichaud | ||
not_gerd | good morning ;) | ||
raiph_ | hi #perl6 | ||
is github currently using a p5 highlighter on p6 code? | 17:50 | ||
colomon | benabik: is there a way to hardcode the limit on Parrot, so we can see if Linux has the same sort of problems OS X does if it's running out of memory? | 17:51 | |
argh, end of that sentence was incoherent. | |||
benabik | colomon: Change Parrot_sysmem_amount to `return SMALLNUMBER` | ||
masak | raiph_: I'm assuming so. | ||
17:52
ssds left,
ssds joined
17:53
census left
17:54
alec__ joined
17:55
ssds left,
ssds joined
|
|||
colomon | If I'm using Parrot built by Rakudo's Configure.pl and I rebuild that Parrot by using make in its directory, how do I then rebuild Rakudo? | 17:57 | |
colomon cannot believe he has not run into trying to do this before.... | |||
raiph_ | masak: thanks; I've just found the answer and yes, it's currently same as perl5 | ||
17:57
ssds left
|
|||
arnsholt | colomon: Remake NQP and then Rakudo, probably | 17:58 | |
17:58
alec__ left
|
|||
not_gerd | colomon: just `make` or if that doesn't work `perl Configure.pl --with-parrot=... --gen-nqp` | 17:59 | |
FROGGS | "make realclean" maybe before "make" | ||
dalek | albot: 3819da9 | thundergnat++ | lib/EvalbotExecuter.pm: Update lib/EvalbotExecuter.pm Update evalbot to deal with new URL scheme for gists. |
18:04 | |
18:05
shinobicl joined
|
|||
moritz | thundergnat++ | 18:06 | |
masak | TimToady will be pleased. he evals gists quite a bit :) | 18:07 | |
colomon | I think I've got it rebuilt, and it doesn't seem to make any difference on Linux. | 18:10 | |
Guess that's not wildly surprising if it's really a memory error. | |||
not_gerd | bye, #perl6 | 18:18 | |
18:18
not_gerd left
18:20
James_ joined,
James_ is now known as Guest31828
18:21
arlinius left
18:22
daxim joined,
dukeleto left,
Guest76939 left
18:23
dukeleto joined
|
|||
benabik | colomon: I didn't think that was it. Just more "oh, yeah, this thing is still broken on OS X" | 18:25 | |
18:30
mberends left
18:31
mmcleric joined
18:41
rindolf joined
18:48
arlinius joined
18:53
domidumont joined
19:01
Guest31828 left,
Guest31828 joined
|
|||
masak | "Simple Generators v. Lazy Evaluation" -- interesting and not too complicated. okmij.org/ftp/continuations/PPYield/ | 19:04 | |
19:04
domidumont left
19:06
domidumont joined
19:10
spider-mario left
19:11
labster joined
|
|||
labster | good morning #perl6 (yes, still technically morning here) | 19:12 | |
phenny | labster: 11:55Z <masak> tell labster can I deny that pull request? '$output eqv Any' looks unidiomatic to me -- shouldn't it ve '$output === Any'? same with '$output.not' -- shouldn't it be '!$output'? beyond that, it looks fine. | ||
labster: 12:21Z <masak> tell labster nvm, I pulled and fixed those myself. :) keep up the good work! | |||
FROGGS | labster: it's always morning in UTG | 19:13 | |
UGT | |||
labster looks at wikipedia: Unified Tasmania Green party? | 19:14 | ||
I didn't think it was that far south to get the midnight sun down there. | 19:15 | ||
masak | labster: thinkmoult.com/ugt.html | ||
19:18
SamuraiJack_ left
|
|||
labster | Thanks for fixing my idiom. I think that just comes from reading a lot of code in a language, and I certainly need to read more in Perl 6. | 19:18 | |
masak | 'eqv' is for deep equality, fwiw. | 19:19 | |
I practically never see .not in code. | |||
and prefix:<!> feels "safer" somehow, as it doesn't require that method to be there. | |||
labster | That just came because I was switching between .defined and .not until I got the behavior I wanted. | 19:20 | |
jnthn | r: say Mu.^methods | ||
p6eval | rakudo d2795b: OUTPUT«ACCEPTS WHERE WHICH take WHY Bool so not defined new CREATE bless BUILDALL BUILD_LEAST_DERIVED Numeric Real Str Stringy item say print gist perl DUMP DUMP-ID isa does can clone Capture Method+{<anon>}.new() dispatch:<::> Method+{<anon>}.new() Method+{<anon>}.new() … | ||
jnthn | r: say Mu.^methods.grep(*.name eq 'not') | 19:21 | |
p6eval | rakudo d2795b: OUTPUT«not» | ||
jnthn | masak: YOu should fear .not :) | ||
uh, should .not fear | |||
labster | self.not.fear but fear(self)? | 19:22 | |
masak | ok. still gonna stick to ! :P | ||
labster: I tend to use 'defined $x' instead of '$x.defined', too :) but that one is more debatable. | |||
moritz | I use $x.defined, because you can use it in lists | 19:23 | |
foo(defined $x, $y) vs. foo($x.defined, $y) | |||
dalek | p: 54985c7 | jnthn++ | src/ (6 files): Eliminate a bunch of pir::. |
||
p: 3c896f1 | jnthn++ | t/nqp/62-subst.t: Update test to not pass due to a PCC fail. Something that takes no parameters will not check that it got none. Fixing the test, rather than porting the bug. |
|||
p: d47185c | jnthn++ | src/core/Regex.pm: Further portability tweak. |
|||
p-jvm-prep: 1a5005a | jnthn++ | nqp-src/NQPCORE.setting: Add match and subst to the setting. |
|||
p-jvm-prep: cf179ce | jnthn++ | t/nqp/62-subst.t: Pass 62-subst.t. |
|||
19:25
Guest31828 is now known as jac50
|
|||
nwc10 | yay, another test file | 19:27 | |
7 left? | |||
masak | GlitchMr: when you link to my blog post in glitchmr.github.com/perl-6-changes-2013W07.html , do you think you could link to the post and not to the blog? | 19:28 | |
jnthn | nwc10: aye | ||
nwc10 | the small problem with 4 being a prime every so often | 19:29 | |
it's old. | |||
building the revision of Rakudo that first added it | |||
but 2012.10 was a problem | |||
GlitchMr | masak, haven't noticed | 19:30 | |
Should be fixed when GitHub will rebuild my blog | 19:31 | ||
masak | thank you. | ||
jnthn | To anybody who either knows or knows how to use Google better than me: what's the best way to take a Unicode character name and turn it into the appropriate character in Java? :) | ||
nwc10 | shell out to Perl? :-) | 19:32 | |
GlitchMr | I know how to convert character to Unicode name... | ||
You could try using site.icu-project.org/, by the way | 19:33 | ||
It has entire Unicode table. | |||
masak | I'm reaching the same answer. | ||
19:33
dukeleto left
|
|||
colomon | nwc10++ # researching history of is-prime bug | 19:33 | |
19:34
dukeleto joined
|
|||
jnthn | GlitchMr: Yes, I know it can go in the other direction | 19:34 | |
GlitchMr: Which makes me think you should be able to do the other thing too | |||
GlitchMr | Well, technically you could initialize entire table, but that would be slow. | 19:35 | |
And waste lots of memory. | |||
masak | jnthn: I'll ask on ##java | ||
jnthn | GlitchMr: Well, can do it on first request | 19:36 | |
It's not like we need to do this unless somebody actually writes a program containing \c[PILE OF POO] or so | |||
masak | jnthn: well, of course building a hash table of All The Characters would work. | 19:37 | |
jnthn | masak: Yes, my question was more "a better way than the obvious". :) | ||
nwc10 | oooh. 4 is a prime on FreeBSD after a while | ||
you have to be *more* persistent | 19:38 | ||
that's on spectre | |||
persist further, it isn't | 19:39 | ||
persist further, it is | |||
no obvious periodicity | |||
rindolf | Hi all. | ||
Hi jnthn , masak GlitchMr | 19:40 | ||
GlitchMr | Hi | ||
nwc10 | -G cures all | ||
jnthn | o/ rindolf | ||
arnsholt | jnthn: You'd think there would be some way to query the Unicode DB from JAva, but on second thought, I wouldn't be surprised if the solution ends up being creating something for NQP | 19:41 | |
jnthn | *nod* | 19:42 | |
I don't need it right now, I'm just looking through where the HLL libs use pir:: | |||
nwc10 | OK, 4 is sometimes a prime at 2e336562bdca282c537dba70577d1ad7bfa6e0b8 | 19:43 | |
that's the commit where Moritz added is-prime | |||
GlitchMr | Just wondering, how Perl 6 on Parrot does that. | ||
jnthn | GlitchMr: ICU | ||
GlitchMr | Because I'm sure \C[] has to do it somehow. | ||
Isn't ICU available on Java too? | |||
colomon | nwc10: 4 is reliably not prime before that? | ||
nwc10 | nqp similiary 21st-September-like c458a08a723a58146ae9b3fd7fb72198691de337 | ||
jnthn | It doesn't do it on my build 'cus I don't have a build with ICU | ||
colomon | nwc10: or is that the first one with is-prime? | ||
nwc10 | colomon: before that, who knows. There was no is-prime method | ||
yep | |||
jnthn | GlitchMr: I don't want to pull in the whole of ICU just for one very rarely used feature. | ||
nwc10 | parrot at the 4.8.0 release | ||
jnthn | That's more wasteful than building the hash table of all the chars :) | 19:44 | |
rindolf | jnthn: what's up? | ||
jnthn | rindolf: Not much, just hacking and eating icecream :) | ||
rindolf | jnthn: what kind of Icecream? | ||
colomon | nwc10: okay, so it's always been broken. that's more of a pain (because we can't trace the problem to a single change) but it's still useful information to knmow. nwc10++ | 19:45 | |
*knoiw | |||
*knbow | |||
*know | |||
sigh | |||
nwc10 | yes, sigh | ||
I agree. | |||
it's not a regression | |||
however, *also*, I can replicate it on a FreeBSD machine | |||
it's not just OS X | |||
jnthn | rindolf: Strawberry | 19:46 | |
rindolf | jnthn: ah. | ||
GlitchMr | Well, the hax could be to initialize tables when using \C[] using the long loop. | ||
19:47
shinobicl left
|
|||
arnsholt | jnthn: I guess one way would be to sort the characters by name and store it in fixed-width format and mmap the file (Java lets you mmap, no?) | 19:48 | |
And then binary search and possibly a small cache | |||
nwc10 | or make a trie | 19:49 | |
arnsholt | Yeah, a trie might be the most compact storage | 19:50 | |
jnthn | Yeah | 19:51 | |
Don't want to spend a load of time on it, but if somebody wants to trie something clever I'll be happy to use it :) | 19:52 | ||
Not going to block on it for a bit :) | |||
nwc10 | OK, I can't build 2e336562bdca282c537dba70577d1ad7bfa6e0b8 on FreeBSD (add expmod and is-prime) | 19:53 | |
explosive backtrace from compiling src/gen/BOOTSTRAP.pm | |||
I can build that revision on OS X | |||
jnthn | pmichaud: HLL::Compiler manages to load all of dumper.pbc, PGE/dumper.pbc, PCT/Dumper.pbc and Parrot/Exception.pbc | ||
pmichaud: Don't suppose you recall anything about the history of that and if any are just bogus/unrequired? | 19:54 | ||
19:54
arlinius left
|
|||
masak | "This article is about a tree data structure. For the French commune, see Trie-sur-Baïse." :) | 20:09 | |
someone should make a tumbler about funny Wikipedia sentences. | 20:10 | ||
also, does anyone else think that both pronunciations of "trie" are silly? | |||
20:11
bruges left
|
|||
pmichaud | back again | 20:11 | |
jnthn: looking | |||
jnthn: the dumper stuff was (is?) the thing that handled --target=past and --target=parse output | 20:12 | ||
I think I might have replaced most of it | |||
jnthn | ah, ok | ||
20:12
bruges joined
|
|||
jnthn | I tossed the Parrot/Exception.pbc seemingly without problems | 20:12 | |
pmichaud | looks like Parrot's dumper is still used in src/HLL/Compiler.pm | 20:13 | |
well, still referenced, at any rate | |||
looking | |||
jnthn | Yes, 3 different dumper-related PBCs are loadbytecode'd :) | ||
pmichaud | no, I mean it actually references the _dumper function | ||
jnthn | Ah, ok | 20:14 | |
pmichaud | method dumper at src/HLL/Compiler.pm:444 | ||
if we can replace that with a nqp-only version, we can eliminate the parrot stuff. | |||
Or we can ignore the --target=parse or --target=past stuff. | 20:15 | ||
I did a start on dumping capabilities in src/core/NQPMu.pm | |||
method __dump is there | 20:16 | ||
(which is what Parrot's Data::Dumper uses) | |||
anyway, I'd be fine with a HLL::Dumper module. | 20:17 | ||
or a NQP::Dumper one. | |||
20:22
jac50 left,
jac50 joined
20:25
salv01 left
|
|||
dalek | p: 4500780 | jnthn++ | src/HLL/Compiler.pm: Remove one seemingly unrequired loadbytecode. |
20:26 | |
p: 26b0b8e | jnthn++ | src/QAST/Operations.nqp: Map some more SC related ops. |
|||
p: 90f5160 | jnthn++ | src/ (4 files): More pir:: => nqp::. |
|||
nwc10 | 4 is a prime some of the time on FreeBSD with: This is perl6 version 2012.10 built on parrot 4.4.0 revision RELEASE_4_4_0 | 20:39 | |
but not with -G | |||
moritz | "4 is a prime" would be a nice band name | 20:42 | |
masak | :D | 20:43 | |
and then they get rid of their band member "-G" | |||
jnthn | Or they only use 5 of the guitar strings...not the G string. | 20:44 | |
tadzik | 5 other, you mean :) | ||
curtispoe | To atone for my sins, I've decided to start blogging more about Perl 6. I've written up an explanation of how Perl 6's red-black tree code works. I would be delighted if anyone could spot errors and correct me: blogs.perl.org/users/ovid/2013/02/r...ained.html | ||
tadzik | if they used only the G string they could call themselves a G-unit (ohoho) | ||
masak | curtispoe++ | ||
masak reads | 20:45 | ||
moritz | jnthn: one of the dumpers might be unnecessary, now that QAST is dumped with the QAST::Node.dump method | ||
jnthn | Also, is it me or does --target=parse give a lot too much info? | ||
I mean...I'm not quite sure when I do --target=parse I want to know the set of integers on the bstack... :) | |||
moritz | um, a lot too little, because it usually dies before getting to the interesting parts | 20:46 | |
but also too much, yes :-) | |||
20:47
pmurias joined
|
|||
jnthn | Well, we probably don't want to go dumping what hangs off the .ast also :) | 20:47 | |
Since if you wanted that you'd look at --target=past ;) | |||
Also, we should maybe call that just ast | |||
moritz | agreed | 20:49 | |
on both accounts | |||
masak | curtispoe: looks nice. | 20:50 | |
curtispoe: I'm actually not sure why, in this case, a dedicated sentinel value was not used in place of Any. | 20:51 | ||
curtispoe | masak: thanks! It took quite a bit of time to put together. I have to say that I'm quite impressed with where Perl 6 is. | ||
masak | but I have the feeling that TimToady likes to use the type objects as sentinels :) | ||
curtispoe | masak: that was one area of the code I was the most unclear about. | ||
masak | know, though, that something like this coulda worked, too: | ||
r: constant RedBlackSentinel = {} | 20:52 | ||
p6eval | rakudo d2795b: ( no output ) | ||
masak | ...or whatever name you'd give it. | ||
(and yes, "expressivity" is a word) :) | 20:54 | ||
jnthn | curtispoe++ # nice post | 20:56 | |
masak | I also can't help thinking about ADTs when I see this example. I wonder if we'll ever get good AST support into Perl 6 (preferably through a module). the nice semantic advantage would be if it could be somewhat clever about making sure that all cases of the ADT were always covered in a 'given' statement. | ||
or in a set of multis. | |||
curtispoe | Thanks jnthn. | ||
jnthn | masak: good AST support? Ain't that your job? ;) | 20:57 | |
masak | er. ADT! | ||
:P | |||
masak looks around shiftily | |||
jnthn | :) | ||
the keys are like, right next to each other | 20:58 | ||
:P | |||
masak | yed! | 20:59 | |
20:59
adu left
|
|||
pmurias | masak: how would the ADT be different from classes? | 21:01 | |
moritz was think more of haskell-y types | |||
masak | pmurias: they're quite different in nature. | 21:02 | |
moritz | rbtree = JustANode | Node rbtree:left rbtree:right Color | ||
of course I can't remember the proper syntax | |||
masak | data Tree = Empty | Leaf Int | Node Tree Tree | 21:03 | |
for example. | |||
21:03
am0c left
|
|||
masak | pmurias: classes are all about (hidden) data and (public) behavior. ADTs are all about (public) data. | 21:03 | |
...to a first approximation. | 21:04 | ||
shachaf | Well, you can sort of represent both sides of the expression problem with ADTs. | ||
pmurias | class Tree {};class Empty is Tree {};class Leaf is Tree {has Int $.val};class Node is Tree {has Tree $.left;has Tree $.right} | ||
nwc10 | jnthn: the state of tests is stable | ||
(I believe that pun is reused) | |||
21:05
jac50 left
|
|||
shachaf | E.g. these are both valid representations for a shape: data Shape = Circle Double | Rectangle Double Double; data Shape = Shape { area :: Double, perimeter :: Double } | 21:05 | |
jnthn | nwc10: You're get horse if you keep reporting this often :P | ||
shachaf | One of them is about what a shape "is" and the other one is about what you can do with it. | ||
masak | ...destructuring is an important aspect of ADTs. | ||
nwc10 | jnthn: possibly | ||
I did get a sore throat after reading too many chapters of Winne-the-Pooh | |||
masak | i.e. in guards, you can destructure right into an ADT, just like we do with subsignatures. | 21:06 | |
nwc10 | jnthn: as I said earlier, I'm blocking on /dev/pun, and don't seem to have /dev/upun | ||
masak | pmurias: that's mainly what's missing from your converstion to classes, fwiw. | ||
moritz | curtispoe++ # very nice blog post | ||
nwc10 | floging a dead meme | ||
masak | pmurias: no simple way to destructure that. | ||
nwc10 | er, flogging I think. My fingers can't spell | ||
masak | yes, "flogging". | ||
curtispoe | I probably should have started with something a bit simpler :) | ||
masak | nwc10: and nice way to bring up the horse topic again :P | 21:07 | |
moritz | no, it's great | ||
rindolf | shachaf: hi. | 21:09 | |
shachaf | hi | ||
pmurias | masak: so what we are missing is a more concise syntax for definition, and a destructuring syntax? | ||
curtispoe | Is there anything in Perl 6 which is equivalent to SQL's NULL? I would love to have an "UNKNOWN" type which is comparable to nothing. That avoids many subtle bugs that crop up in Perl 5 (see blogs.perl.org/users/ovid/2010/12/a...dance.html for background if that didn't make sense). | 21:10 | |
moritz | curtispoe: I dimly recall reading in the specs that comparing anything to an undefined value should fail(), and a Failure in boolean context is always False | 21:12 | |
masak | pmurias: yes. and a way for the compiler to assert that 'given' statements have complete coverage. | ||
moritz | curtispoe: but that's not implemented, and probably contradicts much of the current feeling of Perl 6 | ||
jnthn | r: sub anagram(*@a) { [eqv] (.subst(' ', '').comb.sort.item for @a).lol }; say anagram('hamburgers', 'shergars bum') | ||
p6eval | rakudo d2795b: OUTPUT«True» | 21:13 | |
jnthn | nwc10: ^^ ;) | ||
curtispoe | moritz: but that sort of contradicts three-valued logic. "my @chosen = $_ where $_.salary < 50000 for @employees" would return employees with an UNKNOWN salary, yes? | 21:14 | |
s/where/if/ | 21:15 | ||
moritz | no, if Any < 50000 returned a Failure, then the 'if' evaluates to false | ||
tadzik | wouldn't Failure in numeric be 0? | ||
moritz | tadzik: no, either blow up or propagate as Failure | ||
japhb | jnthn, that anagram cannot be correct. Too many 's's. | 21:16 | |
tadzik | ah, right | ||
moritz | unless it's .handled | ||
21:16
pmurias left
|
|||
jnthn | japhb: Oh...hm, so howe'd I get my anagram checker wrong.. :) | 21:17 | |
japhb | Did you mean to .sort.item, or was there supposed to be a .join in there? | 21:18 | |
jnthn | I meant to sort the letters then itemize... | ||
Oh, hm | |||
moritz | the .item takes care that the [eqv] doesn't flatten it out | ||
jnthn | :) | ||
moritz | a .join would have worked too | ||
jnthn | Yeah, but then I did a .lol on the outside too | ||
moritz | eqv doesn't care if it works on a two lists of chars, or on two strings | 21:19 | |
jnthn | r: say 'hamburgers'.comb.sort.item | ||
p6eval | rakudo d2795b: OUTPUT«a b e g h m r r s u» | 21:20 | |
moritz | r: say 'hamburgers'.comb.sort.join | ||
p6eval | rakudo d2795b: OUTPUT«abeghmrrsu» | ||
jnthn | oh, it was my .lol that screwed it up | 21:23 | |
r: sub anagram(*@a) { [eqv] (.subst(' ', '').comb.sort.item for @a) }; say anagram('hamburgers', 'shergars bum') | |||
p6eval | rakudo d2795b: OUTPUT«False» | ||
jnthn | r: sub anagram(*@a) { [eqv] (.subst(' ', '').comb.sort.item for @a) }; say anagram('hamburgers', 'shergar bum') | ||
p6eval | rakudo d2795b: OUTPUT«True» | ||
jnthn | Better. | ||
masak | r: sub infix:<ana>($l, $r) { [eq] ($l, $r)>>.comb>>.sort>>.join }; say 'hamburgers' ana 'shergar bum' | ||
p6eval | rakudo d2795b: OUTPUT«False» | ||
masak | r: sub infix:<ana>($l, $r) { [eq] ($l, $r)>>.comb(/\w/)>>.sort>>.join }; say 'hamburgers' ana 'shergar bum' | 21:24 | |
p6eval | rakudo d2795b: OUTPUT«False» | ||
masak | dang. | ||
r: say ('hamburgers', 'shergar bum')>>.comb(/\w/)>>.sort.perl | |||
p6eval | rakudo d2795b: OUTPUT«(("h",), ("a",), ("m",), ("b",), ("u",), ("r",), ("g",), ("e",), ("r",), ("s",), ("s",), ("h",), ("e",), ("r",), ("g",), ("a",), ("r",), ("b",), ("u",), ("m",))» | 21:25 | |
masak | hrm. | ||
jnthn | Remeains of the time when >> was spec'd to recurse into iterables, I think. | ||
masak | oh :( | ||
curtispoe | r: my @a = (6,2,Any,7);my @less = ($_ if $_ < 6 for @a); say @less.perl; | ||
p6eval | rakudo d2795b: OUTPUT«use of uninitialized value of type Str in string context in block at /tmp/v_HV9YduUh:1use of uninitialized variable of type Any in numeric context in block at /tmp/v_HV9YduUh:1Array.new(2, Any)» | ||
masak | r: say ('hamburgers', 'shergar bum')>>.comb(/\w/).map({ .sort }).perl | ||
p6eval | rakudo d2795b: OUTPUT«(("h",), ("a",), ("m",), ("b",), ("u",), ("r",), ("g",), ("e",), ("r",), ("s",), ("s",), ("h",), ("e",), ("r",), ("g",), ("a",), ("r",), ("b",), ("u",), ("m",)).list» | ||
moritz | r: sub infix:<ana>($a, $b) { [eq] ($a, $b).map: *.comb.sort.join }; 'hamburgers' ana ''shergar bum' | 21:26 | |
p6eval | rakudo d2795b: OUTPUT«===SORRY!===Two terms in a rowat /tmp/tIi4lbY1Vi:1------> *.comb.sort.join }; 'hamburgers' ana ''⏏shergar bum' expecting any of: postfix infix or meta-infix infix stopper statement end … | ||
moritz | r: sub infix:<ana>($a, $b) { [eq] ($a, $b).map: *.comb.sort.join }; 'hamburgers' ana 'shergar bum' | ||
p6eval | rakudo d2795b: ( no output ) | ||
moritz | r: sub infix:<ana>($a, $b) { [eq] ($a, $b).map: *.comb.sort.join }; say 'hamburgers' ana 'shergar bum' | ||
p6eval | rakudo d2795b: OUTPUT«False» | ||
curtispoe | moritz: that's the problem I'm referring to. 'Any' is not "less than" 6 because its value is unknown. That could cause weird bugs to propagate. I'd like to know how I could cleanly work around that. | ||
jnthn | r: sub infix:<ana> { [eq] (.comb(/\w/).sort.join for @_ }; say 'hamburgers' ana 'shergar bum' | ||
p6eval | rakudo d2795b: OUTPUT«===SORRY!===Unable to parse expression in parenthesized expression; couldn't find final ')'at /tmp/JLHCt1QnXW:1------> a> { [eq] (.comb(/\w/).sort.join for @_ ⏏}; say 'hamburgers' ana 'shergar bum' expecting any of: … | ||
moritz | curtispoe: as I said, it's not implemented (and might not ever be) | 21:27 | |
jnthn | r: sub infix:<ana> { [eq] (.comb(/\w/).sort.join for @_) }; say 'hamburgers' ana 'shergar bum' | ||
p6eval | rakudo d2795b: OUTPUT«True» | ||
jnthn | masak: That's the shortest I can think of :) | ||
moritz | curtispoe: currently I'm not aware of a good solution | ||
curtispoe | moritz: OK. Thanks. | ||
jnthn | masak: 'cus it gets rid of the parameter list :) | ||
curtispoe | Er, don't we have a comparable role in Perl 6? If so, an "unknown" type could have its own comparable method that always returns false. | 21:28 | |
curtispoe is just wildly guessing here. | |||
moritz | curtispoe: comparison is done via subs, not methods | 21:29 | |
colomon | n: sub infix:<ana>($a, $b) { my $a-bag = $a.comb(/\w/).bag; my $b-bag = $b.comb(/\w/).bag; $a-bag ≼ $b-bag && $b-bag ≼ $a-bag; } say 'hamburgers' ana 'shergar bum' | ||
p6eval | niecza v24-23-g0520c7c: OUTPUT«===SORRY!===Strange text after block (missing comma, semicolon, comment marker?) at /tmp/nR5gDtchn5 line 1:------> g; $a-bag ≼ $b-bag && $b-bag ≼ $a-bag; }⏏ say 'hamburgers' ana 'shergar bum'Parse failed»… | ||
moritz | curtispoe: you could just add an UNKNOWN type, and two multis for each comparison operator | ||
colomon | n: sub infix:<ana>($a, $b) { my $a-bag = $a.comb(/\w/).bag; my $b-bag = $b.comb(/\w/).bag; $a-bag ≼ $b-bag && $b-bag ≼ $a-bag; }; say 'hamburgers' ana 'shergar bum' | ||
p6eval | niecza v24-23-g0520c7c: OUTPUT«True» | ||
colomon | n: sub infix:<ana>($a, $b) { my $a-bag = $a.comb(/\w/).bag; my $b-bag = $b.comb(/\w/).bag; $a-bag ≼ $b-bag && $b-bag ≼ $a-bag; }; say 'hamburgers' ana 'shergar bu' | 21:30 | |
p6eval | niecza v24-23-g0520c7c: OUTPUT«False» | ||
moritz | class UNKNOWN { }; multi infix:<==>(UNKNOWN, $) { False }; | ||
colomon: can't you compare bags with eqv? | |||
colomon | moritz: only in theory, at least in niecza | 21:31 | |
moritz | and then do it with all operators, and the other way around too | ||
21:31
domidumont left
|
|||
colomon | n: sub infix:<ana>($a, $b) { my $a-bag = $a.comb(/\w/).bag; my $b-bag = $b.comb(/\w/).bag; $a-bag eqv $b-bag; }; say 'hamburgers' ana 'shergar bu' | 21:31 | |
p6eval | niecza v24-23-g0520c7c: OUTPUT«Unhandled exception: Parameter '' in 'Bag.gist' requires a defined argument at /home/p6eval/niecza/lib/CORE.setting line 0 (Bag.gist @ 1)  at /home/p6eval/niecza/lib/CORE.setting line 3349 (infix:<eqv> @ 4)  at /tmp/xN28TMG8_u line 1 (infix:<ana> @ 1… | ||
colomon | r: sub infix:<ana>($a, $b) { my $a-bag = $a.comb(/\w/).bag; my $b-bag = $b.comb(/\w/).bag; $a-bag eqv $b-bag; }; say 'hamburgers' ana 'shergar bu' | ||
p6eval | rakudo d2795b: OUTPUT«False» | ||
colomon | r: sub infix:<ana>($a, $b) { my $a-bag = $a.comb(/\w/).bag; my $b-bag = $b.comb(/\w/).bag; $a-bag eqv $b-bag; }; say 'hamburgers' ana 'shergar bum' | ||
p6eval | rakudo d2795b: OUTPUT«False» | ||
colomon | moritz: doesn't appear to work in rakudo? | ||
moritz | probably NYI | 21:32 | |
dalek | p: 8740c50 | moritz++ | / (2 files): remove pir::escape call |
21:33 | |
colomon | moritz: TimToady had code for it in his initial version of Set, but it doesn't work with Niecza, alas. | ||
it's in the code commented out. | |||
curtispoe | Good night from Paris! | 21:40 | |
21:40
curtispoe left
|
|||
masak | ooh, bags. | 21:42 | |
colomon++ | |||
21:47
donaldh joined
|
|||
jnthn | git st | 21:51 | |
oops | |||
dalek | p: 5265cf6 | jnthn++ | src/HLL/Compiler.pm: Seems PGE/Dumper.pbc is not used. |
21:52 | |
p: 9c9d7bc | jnthn++ | src/QAST/Operations.nqp: Another missing SC op mapping. |
|||
p: 77bd4eb | jnthn++ | src/NQP/World.pm: Replace a couple of QAST::VM with QAST::Op. |
|||
p: c484723 | jnthn++ | src/QAST/Operations.nqp: A couple more coderef op mappings. |
|||
p: afbe2be | jnthn++ | src/NQP/World.pm: Get rid of another QAST::VM. Seems this is one of, if not the last QAST::VM node in code-gen that should be portable. Of course, still a bunch of pir:: and Q:PIR uses to go. |
|||
21:53
kaare_ left
21:54
arlinius joined
21:56
zby_home left
22:00
donaldh left
22:03
ElDiabolo left,
lustlife left
22:10
donaldh joined
22:17
dukeleto left,
dukeleto joined
22:33
bluescreen10 joined
|
|||
jnthn | pmichaud: About MARKED and MARKER, currently they are stored in a global. We get some bugs because an eval in a BEGIN block, for example, doesn't get a separate set of marks, or other such oddness. Any objections to storing the mark hash in ParseShared (and thus once per parse)? | 22:37 | |
22:39
xinming left
|
|||
felher | Oh, coool. A .combinations method. This will boost some of the RC examples, I bet. | 22:41 | |
22:41
xinming joined
|
|||
colomon | felher: once someone gets around to implementing it. | 22:41 | |
felher | colomon: right :) | 22:42 | |
dalek | p: 32a218b | jnthn++ | src/HLL/Grammar.pm: Eliminate Q:PIR in starter/stopper. Took a simpler approach than the kboga++ patches for these two. |
22:43 | |
p: 98a623e | jnthn++ | src/HLL/Grammar.pm: Port HLL::Grammar.O to NQP. Mostly from kboga++'s pull request, with a few tweaks and some use of native types. |
|||
22:44
donaldh left
|
|||
felher | good night, #perl6 :) | 22:46 | |
colomon | \o | 22:47 | |
masak | jnthn++ # .O | 22:50 | |
22:51
PacoAir left
|
|||
masak | "He must, so to speak, throw away the ladder after he has climbed up it." -- the PIR->nqp conversions always remind me of en.wikipedia.org/wiki/Lie-to-child...27s_ladder | 22:52 | |
dalek | rl6-most-wanted: 63fd354 | (Geoffrey Broadwell)++ | tools/prettify-json: Add a tools/ directory, containing a simple JSON prettifier to make it easier to look up details in the perl6-module-list |
23:00 | |
rl6-most-wanted: 5166372 | (Geoffrey Broadwell)++ | most-wanted/modules.md: Note that JSON handling has a partial implementation in JSON::Tiny |
|||
lue | std: say#`[]42; | 23:02 | |
p6eval | std 7551b8f: OUTPUT«===SORRY!===Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument at /tmp/APQv68VBpI line 1:------> say⏏#`[]42;Two terms in a row (listop with args requires whitespace… | ||
lue | rn: say#`[]42; | ||
p6eval | niecza v24-23-g0520c7c: OUTPUT«===SORRY!===Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument at /tmp/rBwXOXua6u line 1:------> say⏏#`[]42;Two terms in a row (listop with args requir… | ||
..rakudo d2795b: OUTPUT«===SORRY!===Two terms in a rowat /tmp/jsjAUwIf7M:1------> say#`[]⏏42; expecting any of: argument list postfix infix or meta-infix infix stopper statement end statement modif… | |||
lue | That's interesting. (I was testing to see if #`[] would act like whitespace there, just ooc) | 23:03 | |
masak | lue: I can see the argument for that, yes. | 23:04 | |
lue: and the implementations seem to disagree a bit on what went wrong. | |||
'night, #perl6 | |||
lue | well, STD and Niecza agree with each other, at least. | ||
jnthn | No, they both say ttiar | ||
lue | knight, masak | 23:05 | |
jnthn: std and niecza "bare say" in addition | |||
jnthn | lue: Right | ||
But it's the ttiar that kills the parse in both, it seems | |||
lue | rn: say() 42 | 23:06 | |
p6eval | rakudo d2795b: OUTPUT«===SORRY!===Two terms in a rowat /tmp/BsXStBXxgn:1------> say() ⏏42 expecting any of: postfix infix or meta-infix infix stopper statement end statement modifier statement mo… | ||
..niecza v24-23-g0520c7c: OUTPUT«===SORRY!===Two terms in a row at /tmp/hEtL28UANk line 1:------> say() ⏏42Parse failed» | |||
23:08
lee_ joined
|
|||
lue | Do you think #`[] should count as whitespace there? I personally don't see why not, but there might be a good reason against that which I'm missing. | 23:09 | |
jnthn | std: say\#`[]42; | 23:12 | |
p6eval | std 7551b8f: OUTPUT«===SORRY!===Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument at /tmp/6r3tVI8C8F line 1:------> say⏏\#`[]42;Two terms in a row (listop with args requires whitespac… | ||
jnthn | ah, not that | 23:13 | |
Well, not sure how it should be done. :) | |||
It seems all the implementations consistently treat it as not whitespace though. | |||
lue | are you sure #`[] is the second term and not 42? | 23:14 | |
jnthn | Oh, I think the 42 is what it hits and gets confused over | 23:16 | |
std: say#`[] 42; | 23:17 | ||
p6eval | std 7551b8f: OUTPUT«===SORRY!===Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument at /tmp/becfNwccC3 line 1:------> say⏏#`[] 42;Two terms in a row (listop with args requires whitespac… | ||
jnthn | oh, maybe not | ||
std: say #`[] 42; | |||
p6eval | std 7551b8f: OUTPUT«ok 00:00 41m» | ||
jnthn | std: say #`[]42; | ||
p6eval | std 7551b8f: OUTPUT«ok 00:00 41m» | ||
lue | r: say#`[] 42; | ||
p6eval | rakudo d2795b: OUTPUT«===SORRY!===Two terms in a rowat /tmp/SeMHRiQ_Lv:1------> say#`[] ⏏42; expecting any of: argument list postfix infix or meta-infix infix stopper statement end statement modi… | ||
lue | rakudo gets confused on 42, it seems. (While everyone else trips on #`[]) | 23:18 | |
jnthn | I have a slight suspicion that it's more a reporting issue | 23:21 | |
lue | Makes sense. | 23:22 | |
jnthn | Hm, I thought it was gonna be that ws localized the highwater position and Rakudo doesn't | ||
23:24
rindolf left
|
|||
lue | I wonder what about say#`[] 42 causes it to act like a combination of say; 42 and say() 42 | 23:25 | |
dalek | rl6-roast-data: 9721f17 | coke++ | / (4 files): today (automated commit) |
23:35 | |
kudo/nom: 10dac76 | jnthn++ | src/Perl6/ (2 files): Support for nqp::const. |
23:43 | ||
kudo/nom: b9ee89a | jnthn++ | / (9 files): Some pir:: => nqp:: for the setting. |
|||
jnthn | sleep, 'ngiht | 23:45 | |
lue | knight jnthn o/ | 23:47 | |
23:51
dayangkun joined
|
|||
dalek | rl6-most-wanted: f7d5012 | (Geoffrey Broadwell)++ | most-wanted/modules.md: Clean up UI section of modules.md a bit |
23:52 | |
rl6-most-wanted: 1712b68 | (Geoffrey Broadwell)++ | most-wanted/modules.md: Start working through task-belike-* data-sources |
|||
23:52
thou left
|