»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
TimToady r: my int @array = 1..10; 01:02
camelia rakudo-jvm 44a466: OUTPUT«(timeout)»
..rakudo-parrot 44a466, rakudo-moar 44a466: OUTPUT«No such method 'STORE' for invocant of type 'Int'␤ in block at /tmp/tmpfile:1␤␤»
dalek rl6-roast-data: dd16b36 | coke++ | perl6_pass_rates.csv:
today (automated commit)
03:14
[Coke] m: my $a = "3"; say q{"$a"}; 03:57
ENOCAM?
dalek jo6: 6ae2497 | coke++ | / (2 files):
Add Mojo::Util:: quote/unquote
04:04
BrotherBen Which perl6 features will allow it to become a leading programming langauge for big data analytics ? 04:08
JimmyZ Grammar and thread? 04:09
jercos Enterprise-compliant JVM backend, advanced brace-based code block grouping techniques, modern first-class functions? 04:22
Maximal compatibility with agile development methodologies in a task-oriented goal-based mission-driven environment? 04:23
bonsaikitten buzzword-compliant ChangeLogs 04:26
dalek ast: 0491b90 | larry++ | S15-unicode-information/unimatch-general.t:
add unimatch tests for general categories
05:04
dalek ast: 48eb6c6 | larry++ | S15-unicode-information/unimatch-general.t:
copy-pasto
05:14
TimToady heh, heh, we'll see who's 100% now... :) 05:15
dalek ast: 529cb9c | larry++ | S15-unicode-information/unimatch-general.t:
don't bother trying to match nonchar props
05:52
arnsholt_ MoarVM on the HN frontpage! news.ycombinator.com/item?id=7357670 07:41
brrt hi 08:32
JimmyZ hello 08:35
brrt yay moarvm is getting love on hacker news 08:36
FROGGS yeah :o) 08:38
moritz and no hate so far 08:43
FROGGS somebody needs to reply to the newest reply :/
<TimToady> heh, heh, we'll see who's 100% now... :) <----- lol :o) 08:44
FROGGS okay, I replied 08:50
sergot morning o/ 08:51
FROGGS morning sergot
lizmat FROGGS++ not seeing it yet, though 08:52
FROGGS :o)
lizmat seeing it now :-) 08:53
timotimo the pypy people are right, you know. pypy isn't a VM, it's a language that you can implement a VM + compiler in 10:47
and since the jit is a meta-tracing-jit, it'll trace right through whatever layers you have 10:48
but pypy has some *crazy* compile times :(
tadzik also, they keep saying how production ready it is, but people tried it at $work and all it did was segfault :)
timotimo really? 10:49
tadzik yup
timotimo i've had fantastic experiences with pypy so far
tadzik I don't know the details
timotimo so you may have been doing something spectacularly daring ;)
tadzik I know that they were well aware that linking to C-stuff may not work
or: will not work
timotimo oh, is that CPython stuff? 10:50
like CPython extensions?
brrt timotimo - i don't think you've compiled it yourself then
timotimo brrt: i have!
tadzik well, I assume that since they know that those don't work on PyPy, they wouldn't be saying "but we still tried and yep, didn't work" :)
timotimo because their equivalent to NativeCall is rock solid and even gets some jit love.
tadzik but still, I don't even know which product taht was
brrt … then you must be in the possession of one beastly machine :-P 10:51
timotimo there's CPython extension support in pypy; unfortunately they have to emulate CPython's own internal data structures for extensions that rely on them and that is slow (especially doing the ref counting)
b
brrt: i really did mean crazy bad compile timesn
brrt to me, that is the part that screams 'too clever for their own good' 10:52
timotimo well. i may be biased, but if you ask me, i'll tell you pypy rocks. and i'll tell you any day of the week.
brrt :-) 10:53
don't get me wrong
it is _very_ clever
and it even works
its also humongous and takes well over an hour to compile
timotimo the crazy thing is that the jit really doesn't have to know much about the target language or the vm 10:54
they're doing meta-tracing, we're doing meta-object-programming ;)
brrt and does so only using an earlier pypy because _regular_ python just crashes trying to compile
mop is a much better understood field
timotimo oh, that's not true though 10:55
i've compiled many pypys with CPython
pypy has only been memory-efficient enough to compile itself with reasonable amounts of ram usage for like two or three years now
brrt then again, you must have some beastly machine :-D
or i must have some decidely unbeastly ones
brrt is going lunching 10:57
dalek kudo/nom: 24c94e0 | (Elizabeth Mattijsen)++ | src/core/ (2 files):
Add X::Routine::Banned and ban "length" and "bytes"
10:59
lizmat was inspired by the wording of "length" in S32/Str:167 11:00
timotimo haha 11:04
lizmat: instead of putting a qq in there with text going to column 0 in the second line, why not use auto-unindented heredocs? :) 11:05
that's a features that's wildly underappreciated in perl 6, i find.
lizmat timotimo: last time I tried that in the settings, it didn't work 11:06
does it work now (in the settings, and rather early at that?)
timotimo aaw 11:07
don't know :(
lizmat there's also the matter of the trailing newline when using heredocs 11:12
timotimo oh, right
lizmat or is there a solution for that?
timotimo there should be a :chomp adverb, right?
lizmat I suggested that once, I recall, don't think it got implemented 11:13
doing it as a heredoce gives:
Cannot call ACCEPTS; no signatures match
at src/gen/m-BOOTSTRAP.nqp:2124 (blib/Perl6/BOOTSTRAP.moarvm::30)
when building the setting :-(
timotimo oh, huh
heredocs call accepts?
oh, to find the terminator perhaps 11:14
lizmat probably, somewhere, internally
I have spent too much time altready trying to use real Perl 6 features in the settings
so I'll settle for more nqp like features :-) 11:15
that works
anyway, having a better error message when using bytes or length seemed like a nice thing to have 11:16
timotimo aye
lizmat r: say bytes 1 11:17
camelia rakudo-parrot 44a466, rakudo-jvm 44a466, rakudo-moar 44a466: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Undeclared routine:␤ bytes used at line 1␤␤»
lizmat $ perl6 -e 'say bytes 1'
===SORRY!===
"bytes()" is banned in Perl 6.
Did you mean .encode($encoding).bytes instead?
masak seems a bit harsh. 11:18
FROGGS p: say: anyother one bytes the dust
camelia rakudo-parrot 44a466: OUTPUT«===SORRY!=== Error while compiling /tmp/OnftIbuR_z␤Undeclared routines:␤ anyother used at line 1␤ bytes used at line 1␤ dust used at line 1␤ the used at line 1␤␤»
lizmat better would be to do this at compile time, but I'm afraid that might interfere with any custom defined bytes or length subs/methods 11:19
FROGGS I thought we know at compile time which sub is there?
masak can theoretically do it for subs, not for methods.
FROGGS we don't know that for methods though I think
lizmat looking into making it compile time for subs 11:21
masak can't know it statically, because of late binding of invocant.
lizmat Ah, I see how I can do this
timotimo is "is pure" enough? 11:22
masak r: sub foo {}; sub bar {}; say &foo === &bar; say &foo === &foo 11:25
camelia rakudo-parrot 44a466, rakudo-jvm 44a466, rakudo-moar 44a466: OUTPUT«False␤True␤»
masak r: my @a; for ^2 { @a[$_] = sub foo {} }; say @a[0] === @a[1] 11:25
camelia rakudo-parrot 44a466, rakudo-jvm 44a466, rakudo-moar 44a466: OUTPUT«False␤»
timotimo r: sub explode() is pure { die "dead" }; eval q{ say "beginning"; explode(); say "end" } 11:26
masak r: my @a; for ^2 { @a[$_] = class {} }; say @a[0] === @a[1]
camelia rakudo-moar 44a466: OUTPUT«WARNINGS:␤Useless use of "explode()" in expression "explode()" in sink context (line 1)␤beginning␤dead␤ in sub explode at /tmp/tmpfile:1␤ in block at eval_0:1␤ in any at eval_0:1␤ in sub eval at src/gen/m-CORE.setting:703␤ in sub eva…»
..rakudo-jvm 44a466: OUTPUT«WARNINGS:␤Useless use of "explode()" in expression "explode()" in sink context (line 1)␤beginning␤dead␤ in sub explode at /tmp/tmpfile:1␤ in block at eval_0:1␤ in any at eval_0:1␤ in sub eval at gen/jvm/CORE.setting:703␤ in sub eval a…»
..rakudo-parrot 44a466: OUTPUT«WARNINGS:␤Useless use of "explode()" in expression "explode()" in sink context (line 1)␤beginning␤dead␤ in sub explode at /tmp/tmpfile:1␤ in block at eval_0:1␤ in any at eval_0:1␤ in sub eval at gen/parrot/CORE.setting:705␤ in sub …»
rakudo-parrot 44a466, rakudo-jvm 44a466, rakudo-moar 44a466: OUTPUT«True␤»
masak o.O
timotimo oh, heh. 11:26
masak ok, so there are (in some sense) *two* functions, one for each iteration. but only one class. 11:27
masak r: my @a; for ^2 { @a[$_] = class { has $.x = $_ } }; say @a[0].new.x; say @a[1].new.x 11:28
camelia rakudo-parrot 44a466, rakudo-jvm 44a466, rakudo-moar 44a466: OUTPUT«(Any)␤(Any)␤»
masak heh.
r: my @a; for ^2 { my $i = $_; @a[$_] = class { has $.x = $i } }; say @a[0].new.x; say @a[1].new.x 11:29
camelia rakudo-parrot 44a466, rakudo-jvm 44a466, rakudo-moar 44a466: OUTPUT«1␤1␤»
masak yeah.
timotimo it creates only one class, eh? so not fully closure-ish
masak right.
it doesn't re-clone like it does functions.
timotimo is it the same with roles, btw?
masak yeah.
timotimo well, in that case you can parameterize them 11:30
so that's probably the right way to go if you want something like the example you just had
masak well, then you're talking about the "use" side, not the "declare" side. 11:30
timotimo oh
masak should make a list of all the declare/use pairs in Perl 6 11:36
timotimo hm. is this a problem with perl 6's specification? 11:37
seems a "gotta know this, unfortunately" aspect
on the other hand, if you're constructing classes inside loops and passing them around, you're probably an advanced user and then you'll have that exact thing on your mind already 11:39
mathw it is a little counterintuitive, although part of me's saying WHY ARE YOU EVEN DOING THAT
but that kind of thinking leads to Java, so I'm going to stop there.
timotimo at least we don't have the problem python has where you have to write things like lambda var=var: ... if you want to have a "copy" of the local variable rather than a reference
r: my @lambdas; for ^5 { @lambdas.push: { $_ } }; say @lambdas[0](); say @lambdas[2](); 11:40
camelia rakudo-parrot 24c94e, rakudo-jvm 24c94e, rakudo-moar 24c94e: OUTPUT«0␤2␤» 11:41
timotimo in python, you have to explicitly say "please copy the $_ for my closure", otherwise you'll get 5\n5\n from that
er, i mean 4 and 4
dalek kudo/nom: 318a41a | (Elizabeth Mattijsen)++ | src/ (2 files):
Make banning of length() and bytes() compile time

Now uses the suggested subroutine mechanism for getting the message across rather than actually creating multi subs for length() and bytes()
12:00
lizmat $ perl6 -e 'sub lengte {}; say length 1' 12:02
===SORRY!=== Error while compiling -e
Undeclared routine:
length used at line 1. Did you mean '&lengte', 'chars', 'graphs', 'codes'?
moritz wtf is '&lengte' ? 12:03
oh
moritz actually looks at the code
lizmat to show it will also honour the levenshtein suggestions 12:04
moritz aye, that's way cool
lizmat++
lizmat it's just that I think the & is out of place in the suggestion of &lengte
the message already says it's about routines, so the & is superfluous 12:05
moritz +1
lizmat and just a side-effect of the levenshtein algo
moritz but
m: my $x = &hcars
camelia rakudo-moar 24c94e: OUTPUT«===SORRY!=== Error while compiling /tmp/NgtRBrItQq␤Undeclared name:␤ &hcars used at line 1␤␤»
masak levenshtein++
moritz oh, that one doesn't levenshtein
in this context, the & in the error message would have been highly appropriate 12:06
masak aye.
lizmat ok
masak "print it if the user did"?
lizmat so the chars, graphs, codes would need it also, is what you're saying?
moritz lizmat: no
lizmat: only if the user tried to take a reference to the routine
moritz lizmat: but that case doesn't seem to be levensthein'ed anyway 12:07
m: sub fooooooooobar { }; say &foooooooobar
camelia rakudo-moar 24c94e: OUTPUT«===SORRY!=== Error while compiling /tmp/_F5UcTdNRV␤Undeclared name:␤ &foooooooobar used at line 1␤␤»
moritz nope
lizmat hmm... will look into that while I'm at it
moritz what masak++ suggested is that if the user typed a sigil, the error message should also contain the sigil 12:08
and if the user typed a normal subcall without a sigil, that's what the error message produces
lizmat ok, will see if I can do this 12:09
masak I still have trouble verbalizing it concretely, but there's a principle going on there: 12:25
inside a program's model, you want to Postel it and normalize everything to a single, unambiguous representation.
but in output/view/error messages, you want to present that same information in the way the user expects to see it. 12:26
lizmat fwiw, suggest_routines is not being called in the &length case :-( 12:27
investigating... 12:32
masak lunch & 12:37
lizmat is puzzled by line 3740 in Grammar.nqp: "if $_ lt 'a' {" 12:41
timotimo "if it's not alpha"? 12:42
lizmat that condition seems odd in two ways: I sorta expect "$name" having to be checked
timotimo oh, isn't that about "lower case or upper case"?
lizmat secondly, it seems wrong for &foo
r: say "&length" lt "a"; say "length" lt "a" 12:43
camelia rakudo-parrot 318a41, rakudo-jvm 318a41, rakudo-moar 318a41: OUTPUT«True␤False␤»
timotimo a line above that one seems to assume there is no & in $name 12:44
that may be the cause of the problem
lizmat it's not in this case, but indeed, seems wrong nonetheless 12:44
eh, maybe not 12:45
that's just ignoring a mystery when there's a known sub in scope
timotimo oh!
fair enough, i guess
lizmat I guess we can't have subs with & in their name ? 12:46
timotimo in the middle?
lizmat or in front, aka &&foo
timotimo doesn't seem sensible to me at least
FROGGS std: my &foo 12:47
camelia std 09dda5b: OUTPUT«ok 00:01 125m␤»
FROGGS std: my &foo; &&foo
camelia std 09dda5b: OUTPUT«ok 00:01 126m␤»
FROGGS p: my &foo; &&foo
camelia ( no output )
lizmat std: my &&foo
camelia std 09dda5b: OUTPUT«===SORRY!===␤Cannot declare an indirect variable name at /tmp/ssFbUP4i0o line 1:␤------> my &⏏&foo␤ expecting any of:␤ infix noun␤ subshortname␤ twigil␤Parse failed␤FAILED 00:01 125m␤»
timotimo mhm. that's not really part of the name, i guess; can you debug-print the values of $name that you can come up with in these cases? 12:48
maybe the rest of the grammar that feeds the mistery list strips the sigils before adding the values
FROGGS p: my &foo = -> { -> { say 42 } }; (&foo()) 12:49
camelia ( no output )
FROGGS p: my &foo = -> { -> { say 42 } }; (&foo())()
camelia rakudo-parrot 318a41: OUTPUT«42␤»
FROGGS the desigilname if foo of course 12:50
lizmat I don't think there is a desigilname at that stage yet 12:56
FROGGS yes, at a given point you only have the name starting with & 13:00
timotimo huh 13:07
rosettacode.org/wiki/Twelve_statements#Perl_6 - { all(.[1..12]) === any(True, False) } ← this does not really correspond to "this is a numbered list of 12 statements"
only "entries 1 through 12 are true or false"
lizmat $ perl6 -e 'sub lengte {}; say length(1)' 13:08
===SORRY!=== Error while compiling -e
Undeclared routine:
length used at line 1. Did you mean 'lengte', 'chars', 'graphs', 'codes'?
timotimo so it'd need something like .elems == 13 to be anded into that?
oh nice :)
lizmat $ perl6 -e 'sub lengte {}; say &length(1)'
===SORRY!=== Error while compiling -e
Undeclared routine:
&length used at line 1. Did you mean '&lengte', '&chars', '&graphs', '&codes'?
running spectest now
timotimo r: say 1.so 13:23
camelia rakudo-parrot 318a41, rakudo-jvm 318a41, rakudo-moar 318a41: OUTPUT«True␤»
timotimo i didn't know we have that
r: say 1.not
camelia rakudo-parrot 318a41, rakudo-jvm 318a41, rakudo-moar 318a41: OUTPUT«False␤»
timotimo r: say 1.so.not.so.not.so.not.so.not
camelia rakudo-parrot 318a41, rakudo-jvm 318a41, rakudo-moar 318a41: OUTPUT«True␤» 13:24
dalek kudo/nom: be9ffea | (Elizabeth Mattijsen)++ | src/Perl6/Grammar.nqp:
Suggestions for unknown subs specified with &sigil
kudo/nom: 0a173fa | (Elizabeth Mattijsen)++ | src/Perl6/World.nqp:
Use sigil in suggestions if specified
moritz lizmat: would you please add a changelog entry for that? 13:24
moritz tries to remember to nag committers to do that, and to remeber it himself 13:24
lizmat sure
$ perl6 -e 'sub fooooooooobar { }; say &foooooooobar' 13:25
===SORRY!=== Error while compiling -e
Undeclared routine:
&foooooooobar used at line 1. Did you mean '&fooooooooobar'?
moritz lizmat++
timotimo now we need a routine that makes differences like that easier to spot
moritz :-) 13:26
timotimo "no such routine lo1, did you mean lol?"
moritz colored, character-based diffs
timotimo i'm slightly disappointed that there is no patience diff algorithm implementation for perl 6 13:28
since it's obviously superior to naive diff strategies
and perl 6 is all about taking the superior things from everywhere and combining them into a surprisingly elegant package
dalek kudo/nom: c735e4d | (Elizabeth Mattijsen)++ | docs/ChangeLog:
Changelog entries for suggestion stuff, moritz++
13:30
masak moritz++ # helping people remember to keep the changelog up-to-date 13:39
timotimo hmm 13:46
dalek kudo/nom: 6676f76 | (Elizabeth Mattijsen)++ | src/core/ (2 files):
s/X::Routine::Banned/X::Method::Banned/

Since we only use the exception for methods now
moritz huh? I thought we only use them for *subs*? 13:47
timotimo for subs you get the levenshtein-based "not found" errors 13:48
moritz ah 13:49
ok
timotimo for methods you get "you really didn't mean that"
lizmat at compile time
moritz never mind me then
dalek kudo/nom: 17c92be | moritz++ | docs/ChangeLog:
update ChangeLog
moritz please review and enhance :-)
lizmat cycling& 13:50
masak is it really "banned", though? I would've gone for a term like "tabooed". 13:55
timotimo "thermally discouraged by laser beam"
timotimo has to re-read all the binding syntaxes perl 6 supports
pmurias banned methods are like "foo".length? 13:56
moritz yes
pmurias so they are only raised at compile time if we know the class? 13:57
timotimo not yet
especially since you may have mixed in something with a role 13:58
knowing "the class" at compile time is exceedingly hard
pmurias perl6: class Foo {}; say Foo.length;
camelia rakudo-moar 318a41: OUTPUT«===SORRY!===␤".length" is banned in Perl 6.␤Did you mean .chars, .graphs or .codes instead?␤»
..niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: Unable to resolve method length in type Foo␤ at /tmp/tmpfile line 1 (mainline @ 5) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4595 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4596 (module-CORE @ 576) ␤…»
..rakudo-jvm 318a41: OUTPUT«".length" is banned in Perl 6.␤Did you mean .chars, .graphs or .codes instead?␤ in method gist at gen/jvm/CORE.setting:12398␤ in method gist at gen/jvm/CORE.setting:1053␤ in sub say at gen/jvm/CORE.setting:13305␤ in block at /tmp/tmpfile:1␤␤»
..rakudo-parrot 318a41: OUTPUT«".length" is banned in Perl 6.␤Did you mean .chars, .graphs or .codes instead?␤ in method gist at gen/parrot/CORE.setting:12419␤ in method gist at gen/parrot/CORE.setting:1056␤ in sub say at gen/parrot/CORE.setting:13347␤ in block at /tmp/…»
pmurias rakudo-moar: class Foo {method length {1}}; say Foo.length; 13:59
camelia rakudo-moar 318a41: OUTPUT«1␤»
pmurias rakudo-moar: class Foo {method lengt {1}}; say "here";say Foo.length;
camelia rakudo-moar 318a41: OUTPUT«here␤===SORRY!===␤".length" is banned in Perl 6.␤Did you mean .chars, .graphs or .codes instead?␤»
timotimo one thing i don't quite like about this is that to an introspector, the method *exists* 14:00
masak timotimo: well, it's either that, or insert a special case in the "Method not found" logic. 14:01
moritz that might actually be cleaner, though not as easily extensible 14:02
timotimo is always praising the introspective capabilities of Perl 6 and would be a bit disappointed if there were too many "special cases" like these 14:02
lizmat
.oO( not cycling yet )
14:03
good points, actually
timotimo p: my ("0" => @short, "1" => @long) := (^1).roll(10).categorize({$_})
camelia rakudo-parrot 318a41: OUTPUT«===SORRY!=== Error while compiling /tmp/Wm8EmMrKyV␤Preceding context expects a term, but found infix > instead␤at /tmp/Wm8EmMrKyV:1␤------> my ("0" =>⏏ @short, "1" => @long) := (^1).roll(10).␤»
timotimo how would i do something like that?
lizmat will look at adapting the method not found logic when I'm back
timotimo it wouldn't be terribly bad if i weren't able to construct a signature binding that takes "0" and "1" as named parameters 14:12
i'd like to know if that's the case, though
(also, (^1).roll is prety useless %) ) 14:13
moritz m: sub f(:$0) { } 14:14
camelia rakudo-moar 318a41: OUTPUT«===SORRY!=== Error while compiling /tmp/o_5_IJpu_l␤Cannot declare a numeric parameter␤at /tmp/o_5_IJpu_l:1␤------> sub f(:$0⏏) { }␤»
timotimo i can unpack the hash on the right side and use positional parameters on the left
timotimo i'm wondering: should the code model for IDE support for perl 6 be based on the actual Perl6/Grammar.nqp implementation or would it be sensible to build a fast, but only approximating analysis tool? 14:23
masak I've yet to be convinced it's possible to make such an approximate parse of Perl 6. 14:26
either you know where quotes begin and end or you don't, for example.
what kind of parsing information could you skip and still yield a useful parse of the program?
pmurias timotimo: the ideal solution would be to build a fast Perl6/Grammar.nqp ;)
timotimo masak: BEGIN blocks :) 14:27
masak timotimo: no, you still need to *parse* the BEGIN block.
timotimo r: BEGIN for 1..* { 1 }
camelia rakudo-jvm 318a41, rakudo-moar 318a41: OUTPUT«(timeout)» 14:28
..rakudo-parrot 318a41: OUTPUT«===SORRY!===␤Null PMC access in get_bool()␤»
timotimo ... o_O
pmurias timotimo: the IDE support needs to handle grammar extensions 14:29
timotimo i guess it should, yeah.
in that case, there has to be some kind of sandboxing or something like that 14:30
and something cleverer than RESTRICTED.setting
masak .oO( Parrot can run an infinite loop so fast it results in a Null PMC access! ) 14:31
pmurias timotimo: for reading untrustworthy code some sort of a "safe" mode would be usefull 14:33
nwc10 beat that, Chuck Norris! 14:34
JimmyZ would like stole 'lazy val statement' from scala to rakudo's core.setting to get a faster rakudo startup time 14:35
dalek kudo-star-daily: 3067e83 | coke++ | log/ (5 files):
today (automated commit)
14:49
masak r: my ($x, $y) = 5, $x + 1; say $y 15:06
camelia rakudo-jvm 17c92b, rakudo-moar 17c92b: OUTPUT«use of uninitialized value of type Any in numeric context␤1␤»
..rakudo-parrot 17c92b: OUTPUT«use of uninitialized value of type Any in numeric context in block at /tmp/tmpfile:1␤␤1␤»
masak above the (tiny) WAT of simultaneous assignment.
moritz WAT are you talking about? 15:32
:-)
masak moritz: the (mistaken) expectation that you can use the value 5 in $x to compute the value of $y. 15:34
a lot of other languages work like that.
but they don't have the nice swap feature: ($x, $y) = $y, $x; 15:35
PerlJam masak: "If $x is available for use as soon as it's declared, why can't I use it to compute $y?" 15:38
:-)
masak PerlJam: yes, exactly. 15:39
well, you *can*, but from the perspective of $y, the assignment of 5 to $x hasn't happened yet -- hence the term "simultaneous assignment". 15:41
I would say that in the case of a declaration, simultaneous assignment is more of a hindrance than a help.
but I'm *not* suggesting we should introduce a special case for declarations. :)
nor am I really suggesting we should get rid of simultaneous assignment. it's occasionally useful. 15:42
masak it's another one of those "if I designed a language, I would probably make different trade-offs" 15:42
PerlJam And you'd be WRONG! ;) 15:44
masak yes -- at least in the sense that all languages suck. 15:46
TimToady use ::= if you want left-to-right 16:06
xfix rn: say "a" x 0.5 16:21
camelia rakudo-parrot 17c92b, rakudo-jvm 17c92b, rakudo-moar 17c92b, niecza v24-109-g48a8de3: OUTPUT«␤» 16:22
xfix codegolf.stackexchange.com/a/23386/3103 16:24
I like Perl 6!
TimToady it's pretty ok 16:25
xfix It wins with everything else (let's ignore this -2 polyglot, because it's rule abuse). 16:26
(the rule abuse polyglot thinks that 0 is the only random number between 0 and 255, and outputs nothing) 16:27
(and let's ignore bash fork bomb, because it doesn't solve the task) 16:28
TimToady 9.rand would be 2 characters shorter :)
oh, task requires 255 16:29
nm
xfix Well, it could be 0, with certain rule abuse. 16:31
(to be exact, en.wikipedia.org/wiki/Degenerate_distribution)
":)"256rand* 16:34
oh wait, GolfScript won. Why I haven't noticed the first page.
TimToady oh, given context, ::= won't work on the RHS like that, so nevermind that too :) 16:52
TimToady wow, backlog done before 9am; you guys have been slacking off 16:52
timotimo TimToady: what's your answer to rosettacode.org/wiki/Twelve_statements#Perl_6 not verifying that the number of statements is 12 long? :P 16:53
TimToady I have 3 teeth too. 16:54
but I'd use .end == 12 16:56
timotimo that's better, aye 16:57
TimToady feel free to fix it 16:58
timotimo just putting "and .end == 12" at the end of the closure should be just fine, right? 17:00
TimToady the implementation of narcissistic numbers at gist.github.com/TimToady/9415288 runs my laptop out of memory, and it seems like it shouldn't
(it calculates using base 1000 digits :) 17:01
timotimo it does reach the body of the for loop? 17:02
TimToady sure
timotimo hm, do you really need that "gather take" at the end of the constant narcissistic?
TimToady not really, but without it returns them in batches for some reason 17:03
tried grep but it's slower
timotimo does it run on moar? 17:04
TimToady yes
as you can tell from the name 'digit', was originally doing it 10 at a time, not 1000
timotimo mhm
TimToady and @t was the original @table 17:05
TimToady that runs faster on the small numbers but slower on the big ones 17:05
vendethiel What's the "form" operator in perl6? 17:07
timotimo has no idea what that would be 17:08
TimToady looks like it runs under jvm too
vendethiel <<perl6's "form">>
TimToady what's a 'form' operator?
vendethiel that's what I'm asking :o) 17:09
TimToady where do you see a form operator?
vendethiel TimToady: stackoverflow.com/questions/1823497...l-5-and-6, search.cpan.org/~dconway/Perl6-Form-0.04/Form.pm 17:10
TimToady that's a module, that's not Perl 6
FROGGS timotimo: "cache iterators in encoding_find_*cclass" has hit parrot
timotimo oh!
vendethiel quotes a perl 6 example with "form" in it
timotimo i thought that code was in an unacceptable state, due to a decided lack of thread safety? 17:11
TimToady is it after a 'use Form;' ?
btw, the jvm doesn't seem to leak on the narcissistic proggie
vendethiel TimToady: not in the module docs "perl 6 example"
TimToady: " Perl 6 Form.pm module" 17:12
it just doesn't show it in the code example I guess
TimToady I can assure you there is no 'form' built into Perl 6 :) 17:13
vendethiel yep :-p
timotimo aye, perl 6 is amorph
timotimo heads out
FROGGS TimToady: perhaps there was a "form" builtin back in 2004 that did something Pod-alike? search.cpan.org/~dconway/Perl6-Form-0.04/Form.pm 17:17
TimToady hmm, took the gather/take out of digits and it seems to not be leaking now 17:22
but need to run it into the higher numbers to be sure
iterestingly, the virtual image of java appears to be 20 times that of moar on this, at least in the lower numbers 17:25
*int
oops, moar grew by 1 meg :)
TimToady yeah, taking the gather/take out of digits and using push instead removed the memory leak on moar 17:29
and I'm quite please to see that the resident set of moar is about 1/10 of jvm's 17:30
*pleased
TimToady so it would appear that running thousands of quick little gather/takes is leaking something, maybe in the contination support somewhere 17:33
lemme see if I can reduce it to a test case, after I'm done racing these self-loving numbers 17:35
TimToady indeed, the following leaks very rapidly: 17:46
r: my @bar = (gather take 42) while 1;
camelia rakudo-parrot 17c92b, rakudo-jvm 17c92b, rakudo-moar 17c92b: OUTPUT«(timeout)» 17:46
TimToady (leaks on moar, that is) 17:47
I guess I should say this on #moarvm :) 17:48
since those guys never come over here...
TimToady I see that the Twelve Statements entry was also singed by whoever's browser was turning unicode chars into ? 18:01
jnthn dagurval_: 18:15
oops 18:16
Darn, there's nothing full fart about this train wifi today...
TimToady well, doesn't appear that you can blame sunspots 18:18
jnthn Of course. We blame oraclespots nowadays... 18:20
isBEKaml was there no nqp-2014.02 release? rakudo.org/downloads/nqp
isBEKaml (Hi, BTW) 18:20
TimToady timotimo: while fixing the implication arrow, I took the liberty to pull your .end up to the front, because "there are 12 things and they are all statements" reads better than the other way around 18:27
[Coke] I want an XMPP client in perl 6. 18:43
TimToady wanting it isn't enough--you have to WANT it. 18:44
benabik .WANT 18:45
arnsholt [Coke]: XMPP is XML-based, isn't it? 18:52
lizmat afaik, yes (hence the X in XMPP)
xfix yes 18:57
I have support for it in my IRC bot, and it's XML based. 18:58
dalek kudo/nom: ef8b8f9 | (Elizabeth Mattijsen)++ | src/core/ (2 files):
Ban .length and .bytes from method not found handler

As suggested on #perl6
19:00
colomon lizmat++ # on the loose again 19:04
lizmat loose is right, only needed N iterations to get this right :-) 19:05
TimToady lizmat: it's not right yet :) 19:06
should have .elems in there too :)
lizmat when you're right, you're right :-)
I was also considering doing a levenshtein on the possible method names of the object if method not found 19:08
would that make sense ?
TimToady mebbe, though that won't help if you've called the wrong object :) 19:11
lizmat true, but I think that's a smaller chance than a typo in the method name 19:12
[Coke] has a java project at work that could really benefit from a levenshtein helper on the error messages. 19:16
dalek kudo/nom: 55d5e36 | (Elizabeth Mattijsen)++ | src/ (2 files):
Add elems to suggestion list for length

As pointed out by TimToady++
lizmat I'm starting to wonder whether the levenshtein algo shouldn't be a first class citizen somehow 19:17
instead of being hidden in World.nqp
[Coke] like, @array.leven('guess') == <guess1 guess2 gross> ? 19:18
FROGGS let's do it PHPish and call it str_levenshtein or so :o)
xfix It's levenshtein or similar_text in PHP 19:20
lizmat [Coke]: on the failed method exception, it would become something like $object.methods.leven($.method)
xfix Yeah, there are two functions that do very similar operation.
Except they differ in algorithmic complexity, because, uh, it's PHP. 19:21
dalek kudo/nom: b385720 | (Elizabeth Mattijsen)++ | docs/ChangeLog:
Add Changelog entry for specific length/bytes feedback
19:25
[Coke] lizmat: seems legit. 19:37
isBEKaml Int and Num aren't the same? 19:44
FROGGS no, they even have different names 19:45
like int/double in C
isBEKaml m: gist.github.com/svatsan/9418471 19:46
camelia rakudo-moar 17c92b: OUTPUT«gist not found»
[Coke] m: gist.github.com/svatsan/9418471 19:47
camelia rakudo-moar 17c92b: OUTPUT«gist not found»
[Coke] weird. took a few seconds to load the first time locally, but is pretty zippy now. 19:47
not sure why camelia is complaining.
FROGGS m: gist.github.com/svatsan/9418471 19:49
camelia rakudo-moar 17c92b: OUTPUT«===SORRY!=== Error while compiling /tmp/Q5WuTB2SXK␤Two terms in a row␤at /tmp/Q5WuTB2SXK:1␤------> http⏏://gist.github.com/svatsan/9418471␤ expecting any of:␤ argument list␤ postfix␤ …»
FROGGS hmmm
TimToady isBEKaml: it's an array of floaters, but arrays have integer indices
isBEKaml The reason I posted that gist: I got an error saying something like "Expected Num but got Int instead" for that variable. 19:50
TimToady well, 1..5 produces Ints, not Nums
isBEKaml TimToady: Is there any way I can get a specific type? .WHAT just gave me (array)
TimToady .[0].WHAT 19:51
those Num decls should probably be Numeric instead 19:52
you only care if the type fills the role
well, they should be Real instead
since Numeric includes Complex
m: say Int ~~ Real 19:53
camelia rakudo-moar 17c92b: OUTPUT«True␤»
isBEKaml TimToady: thanks. It was from RC :-) 19:53
rosettacode.org/wiki/Binary_search#Perl_6
TimToady probably from before we had those roles :)
whoever tested it probably used reals instead of integers 19:55
actually, they should allow any type that defines cmp 19:56
TimToady why they do that jig with p $mid when it should just take a comparator function is beyond me 20:00
well, a binary table should know it's comparator in the first place
this should probably be rewritten as a binary table role 20:01
grondilu r: sub is-narcissistic(Int $n) { $n == [+] $n.comb »**» $n.chars }; .say for (grep .&is-narcissistic, 1 .. *)[^10]; 20:08
camelia rakudo-jvm 17c92b: OUTPUT«Nominal type check failed for parameter '$n'␤ in sub is-narcissistic at /tmp/tmpfile:1␤ in block at /tmp/tmpfile:1␤␤»
..rakudo-moar 17c92b: OUTPUT«Nominal type check failed for parameter '$n'; expected Int but got Nil␤ in sub is-narcissistic at /tmp/tmpfile:1␤ in block at /tmp/tmpfile:1␤␤»
..rakudo-parrot 17c92b: OUTPUT«Nominal type check failed for parameter '$n'; expected Int but got Nil instead␤ in sub is-narcissistic at /tmp/tmpfile:1␤ in block at /tmp/tmpfile:1␤␤»
isBEKaml What's a 'binary table' role? I don't seem to find it anywhere... 20:09
TimToady just an array that keeps itself ordered based on the cmp function it already knows, maintaining the ordering invariant so that a binary search always works under that cmp 20:13
seems like a very ordinary generic thing to want 20:14
isBEKaml Well yes, I got confused when you said "this should probably be rewritten as a binary table role" -- so was wondering if there's some role as 'binary table' :-) 20:15
TimToady not yet
TimToady it's very like having generic hashes, except the constraint is it has to support comparison, not just equivalence 20:16
since we have generic hashes, there hasn't been much pressure to write generic binary tables
raydiak camelia is complaining about gists because the regex she uses to pull the 'view raw' url from the gist's page fails due to changes on github 20:23
I see the fix, if someone else wants to test it...not up for configuring my own bot instance right now
raydiak added the PR to perl6/evalbot, either way 20:35
isBEKaml raydiak: I see the fix too - it's some aria.js change that's making camelia to complain.
Your PR assumes that 'title' attribute will always be before 'href' -- we should probably add another case too. 20:37
raydiak isBEKaml: it occured to me, but I'm hoping its done a little more cleanly and correctly in the future (with a module for parsing html), so didn't really make any attempt to further future-proof it 20:42
isBEKaml raydiak: I wondered why there wasn't an HTML parser used, but then it's probably overkill just for fetching a single tag and working it. 20:44
raydiak isBEKaml: agreed, I can only imagine someone didn't want to add another dependency just for that one use 20:49
TimToady grondilu: added a faster version of rosettacode.org/wiki/Narcissistic_d...ber#Perl_6
still takes more than 3 hours to get the first 25 numbers 20:50
masak TimToady: what did you meant at irclog.perlgeek.de/perl6/2014-03-07#i_8399657 ?
r: my ($x, $y) ::= 5, $x + 1; say $y
camelia rakudo-jvm ef8b8f: OUTPUT«(timeout)»
..rakudo-moar ef8b8f: OUTPUT«use of uninitialized value of type Any in numeric context␤1␤» 20:51
..rakudo-parrot ef8b8f: OUTPUT«use of uninitialized value of type Any in numeric context in block at /tmp/tmpfile:1␤␤1␤»
TimToady I retracted it
masak oh.
masak should backlog completely
TimToady r: my ($x, $y) ::= 5, gather take $x + 1; say $y 20:53
camelia rakudo-parrot ef8b8f: OUTPUT«6␤»
..rakudo-jvm ef8b8f, rakudo-moar ef8b8f: OUTPUT«use of uninitialized value of type Any in numeric context␤1␤»
TimToady \o/
r: my ($x, $y) ::= gather take 5, $x + 1; say $y 20:54
camelia rakudo-parrot ef8b8f: OUTPUT«use of uninitialized value of type Any in numeric context in block at /tmp/tmpfile:1␤␤Not enough positional parameters passed; got 1 but expected 2␤ in block at /tmp/tmpfile:1␤␤»
..rakudo-jvm ef8b8f, rakudo-moar ef8b8f: OUTPUT«use of uninitialized value of type Any in numeric context␤Not enough positional parameters passed; got 1 but expected 2␤ in block at /tmp/tmpfile:1␤␤»
TimToady aww
r: my ($x, $y) ::= gather {take 5; take $x + 1}; say $y
camelia rakudo-jvm ef8b8f, rakudo-moar ef8b8f: OUTPUT«use of uninitialized value of type Any in numeric context␤1␤»
..rakudo-parrot ef8b8f: OUTPUT«use of uninitialized value of type Any in numeric context in block at /tmp/tmpfile:1␤␤1␤»
grondilu TimToady: noted. Seems nice.
TimToady why doesn't that one work?
I guess something's not strictly lazy there 20:55
masak TimToady: want me to rakudobugsubmit it?
TimToady not sure
masak branches into two universes, and submits it in one of them 20:56
moritz wouldn't expect signature binding to be that lazy
TimToady r: my ($x, $y) ::= 5, gather take $x + 1; say $y
camelia rakudo-parrot ef8b8f: OUTPUT«6␤»
..rakudo-jvm ef8b8f, rakudo-moar ef8b8f: OUTPUT«use of uninitialized value of type Any in numeric context␤1␤»
TimToady but it's that lazy, on parrot
tadzik can't wait to see which universe he ends up in 20:57
timotimo hey tadzik :)
tadzik probably in both :D
timotimo: heyhye
masak timotimo: ping 20:58
timotimo pong
masak timotimo: isBEKaml's question at irclog.perlgeek.de/perl6/2014-03-07#i_8400645
timotimo oh
i think i made a tarball
probably didn't get anyone to upload it :o 20:59
isBEKaml masak, timotimo: I got it off github releases tab.
masak lizmat++ # github.com/rakudo/rakudo/commit/ef8b8f9cf0
lizmat: I think that's a nicer solution, even if it messes up the method-not-found logic a little.
timotimo t.h8.lv/nqp-2014.02.tar.gz 21:00
tadzik oh, I'm doing a release this month
mishu<TAB><TAB>
masak tadzik: wow, was that an obscure reference to the bot I haven't written yet? :) 21:01
tadzik I want a robot too :P
masak we all do.
tadzik: how about this:
tadzik: we take a weekend sometime, and we flesh out the design during a blitz design session. then we build the thing.
tadzik sounds good to me 21:02
masak tadzik: I have it all pretty planned out alread. I just need to allocate time for it.
already*
tadzik so it's all-ready? :P
masak hehe
all-most
isBEKaml yeah, tadzik just has to show up. SMOP. :P
tadzik :)
I want to see Sweden again
last time it was blizzard-cold 21:03
masak Sweden is really close to Poland.
tadzik it is
masak and it's not cold anymore.
we have spring here now.
tadzik I think there's a boat going there too
arnsholt Norway too. And apparently there's going to be several hours of sun tomorrow \o/
I think we've had something like three sunny days since new year. It's ridiculous 21:04
tadzik well, the year has just started :) 21:05
arnsholt I'd still expect a bit more than three days with sun in two months =p
colomon beautiful sunny day here at my parents', and it's even a bit above freezing. Love these days here, the bright white snow and the bright blue river are a gorgeous contrast.
isBEKaml 5% of sunlight -- fun :-) 21:06
arnsholt In fact, we're already about 16% into the new year
masak arnsholt: might be we here in .se took all the sun. sorry 'bout that.
colomon surprisingly little ice in the river considering the Great Lakes are frozen.
arnsholt masak: Bah! 21:07
isBEKaml arnsholt: then the Finns are worse off than the Nordics. :-) 21:08
masak arnsholt: we should cease this silly rivalry between .no and .se -- how about we re-form the union, and make Gothenburg the capital? :P 21:08
isBEKaml (if my geo-sense is right)
timotimo can somebody upload that tarball for me? 21:09
TimToady masak: we should add a third deck of guns to the ship, too
masak TimToady: ouch. 21:10
:P
masak inspects his national pride for cuts and bruises :) 21:11
moritz TimToady: upload what tarball where?
sorry, meant timotimo
masak TimToady: also, I can guess which museum you've been to. we were there a few months back.
isBEKaml moritz: timotimo was referring to the 2014.02 tarball for nqp for upload to rakudo.org/downloads. 21:12
timotimo he was, aye 21:13
isBEKaml o.O(timotimo's somehow related to Cap'n Crunch "I'm he.") 21:14
timotimo %) 21:15
he-man! :)
moritz and where can I find it? 21:16
colomon " .no and .se -- how about we re-form the union," and become .nose?
isBEKaml yeah, they'd turn into disapproving fellows. Turning up nose to everything. 21:17
moritz ah, found the link in the backlog
uploaded. 21:18
timotimo thank you
it was only a page up :)
masak moritz++ 21:20
arnsholt masak: Excellent idea, everyone'd be equally upset with Gothenburg as capital =D
masak arnsholt: except, I guess, people in Gothenburg, who'd all go "finally!" 21:21
arnsholt Tru dat, but how many people would that be, y'know, in the broader scheme of things? 21:28
masak half a million, give or take.
...about the population of Oslo :P 21:29
arnsholt Not many at all, then ;) 21:30
masak actually, scratch this idea. let's make a Sweden-Denmark-Norway-Iceland union instead. 21:34
tadzik the Cold Fusion
moritz tadzik++
masak hehe 21:36
isBEKaml and they SIN'D. 21:38
tadzik 2 more countries and you'll have DISNEY 21:40
masak .oO( Eritrea and Yemen? ) 21:41
isBEKaml Call Eritrea and Yugoslavia. You'd be then "diverse" group.
TimToady how 'bout East Germany and Yugoslavia? 21:42
isBEKaml or Estonia and Yemen.
colomon is not clear if Yugoslavia actually exists anymore
tadzik Estonia is pretty close
TimToady well, I suggest East Germany because it has the opposite problem to Yugoslavia
masak can I change to Egypt? it would offset the cold a bit.
colomon TimToady: ah, yes, missed that detail in your suggestion. :)
isBEKaml or Ecuador and Yggdrasil :P 21:46
TimToady a line and a tree? 21:48
isBEKaml I was going for a seed and a tree. 21:49
jnthn Darn, weather was nice in Stockholm. Nasty here. 21:52
masak 'night, #perl6 22:06
tadzik good knight
lizmat masak: re lizmat++ # github.com/rakudo/rakudo/commit/ef8b8f9cf0 , looking at ways to handle that the same as sub not found at compile time 22:49
so with levenshtein suggestions: then these particular ones could be added from another data structure (e.g. a hash with special case suggestions) 22:50
sleep& 22:57
lue r: say "ABC" ~~ / <wb> "ABC" <wb> / 23:29
[Coke] wubba wubba
camelia rakudo-jvm b38572: OUTPUT«(timeout)»
..rakudo-parrot b38572, rakudo-moar b38572: OUTPUT«「ABC」␤ wb => 「」␤ wb => 「」␤␤»
lue pm: say 'ABC[]' ~~ /<wb> 'ABC[]' <wb>/
r: say 'ABC[]' ~~ /<wb> 'ABC[]' <wb>/
camelia rakudo-parrot b38572, rakudo-jvm b38572, rakudo-moar b38572: OUTPUT«Nil␤» 23:30
lue Why does it fail when you have funny characters at the end? I was hoping to avoid writing my own "surrounded by spaces or ^/$ " rule 23:31
TimToady I believe wb is defined in terms of \w 23:33
r: say 'ABC[]' ~~ /<|s> 'ABC[]' <|s>/ 23:34
camelia rakudo-parrot b38572, rakudo-jvm b38572, rakudo-moar b38572: OUTPUT«「ABC[]」␤␤»
TimToady r: say ' ABC[] ' ~~ /<|s> 'ABC[]' <|s>/
camelia rakudo-parrot b38572, rakudo-jvm b38572, rakudo-moar b38572: OUTPUT«「ABC[]」␤␤»
lue Ah. Funny thing is, I tried <|w> , but forgot about the other <| rules :)
TimToady I belive <|s> is what yer lookin fer 23:35
timotimo what are those?
TimToady <|x> means a boundary between \x and \X
either way
timotimo why didn't i know about that before?
lue TimToady: I skipped over them because "grapheme" and "codepoint" feel like they could conceivably include whitespace, which I don't want. 23:36
well, maybe not grapheme, but certainly codepoint.
BenGoldberg So it's like perl5's \b, but generalized? Cool.
lue Oh, I see I was taking S05's listing of <| as an exhaustive list. Fixing... 23:37
lue TimToady: IIUC, would <|myrule> check for a boundary between <myrule> and <!myrule> ? 23:40
TimToady well, <+myrule> and <-myrule> maybe 23:41
timotimo huh, + and -?
TimToady I don't know how far it has been generalized
lue TimToady: the spec is way too sparse on <| , that's why I'm asking. 23:42
timotimo there's even more stuff in S05 i don't know about? =o
TimToady the rule definitely has to match something on one side, but maybe not on the negative side
TimToady that doesn't mean it can match with no width if something is there 23:42
lue are the backslash sequences available as single-char rules in general? (e.g. <.h> is just \h )
TimToady no 23:43
TimToady at least, not with the same name 23:43
lue So it's a special case for <| then
TimToady r: say ' ABC[] ' ~~ /<|h> 'ABC[]' <|h>/ 23:44
camelia rakudo-parrot b38572, rakudo-jvm b38572, rakudo-moar b38572: OUTPUT«「ABC[]」␤␤»
dalek ecs: 22231b9 | lue++ | S05-regex.pod:
[S05] Expand information on <|rule> syntax.

Wouldn't want someone thinking that was an exhaustive list, now would we? :)
23:48