»ö« 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:05 Chillance left 00:19 cognominal left
skids r: sub p (*@a) { a(@a); }; proto sub a (|c) { "dispatcher".say; {*} }; multi sub a (*@a) {sink for (@a) { a($_) }}; multi sub a (Int $i) { }; multi sub a ($a) { $a.perl.say; die("wantedInt"); };a(3); p(3); 00:20
p6eval rakudo 935c90: OUTPUT«dispatcher␤dispatcher␤[3]␤wantedInt␤ in sub a at /tmp/X1ckBTjz1W:1␤ in sub a at /tmp/X1ckBTjz1W:1␤ in sub p at /tmp/X1ckBTjz1W:1␤ in block at /tmp/X1ckBTjz1W:1␤␤»
00:22 Targen joined 00:27 dayangkun joined 00:42 krunen left 00:43 krunen joined 00:49 awwaiid left 00:55 doomrobo joined 00:56 awwaiid joined 00:58 doomrobo left 01:01 Subterra left 01:05 Ayiko joined 01:06 anuby joined
swarley What is the build chain recommended to build parrot/nqp/rakudo natively under windows? 01:11
diakopter what compiler would you like to use? microsoft? msvc is the one jnthn and I use on Windows 01:12
last time I tried gcc/strawberry, I couldn't get it to work for the life of me
rurban maintains the cygwin parrot; I bet it works there 01:13
01:19 atrodo left 01:22 hypolin joined
benabik has used Strawberry Perl to build Parrot and Rakudo 01:39
(Although not terribly recently, I'll admit.)
skids r: role A { method a {...} }; role B does A { }; role C does B { method a { "OHAI".say } }; class D does C { }; my D $f .= new(); # OK, as expected 01:40
p6eval rakudo 935c90: ( no output )
swarley Im using strawberry perl right now
skids r: role A { method a {...} }; role B does A { }; # Rakudo seems to want to pun this even when not used
p6eval rakudo 935c90: OUTPUT«Method 'a' must be implemented by B because it is required by a role␤current instr.: '' pc 24148 (src/gen/perl6-metamodel.pir:10984) (src/gen/Metamodel.pm:2187)␤called from Sub 'compose_method_table' pc 23943 (src/gen/perl6-metamodel.pir:10913) (src/gen/Metamodel.p…
swarley I use strawberry on windows 01:41
I dislike activestate
skids r: role A { method a {...} }; role B does A { }; 1; # ...but it seems to be due to the final sink context
p6eval rakudo 935c90: ( no output )
01:42 mynameis joined
benabik I think I just used Strawberry and msysgit. I don't _think_ I needed anything else. 01:43
swarley I'm using powershell and strawberry right now 01:44
lets see how it goes
tests for parrot seem to be passing
what is gmake by the way/
benabik GNU make 01:45
swarley ah
benabik (usually)
swarley I've never seen another make.. well cmake
But I rarely see that used
benabik There's nmake on Windows and BSD Make. I've seen other makes on things like Solaris (although they may use GNU now). 01:47
Generally there's no certainty what make is, but gmake is always GNU.
swarley It fails to build nqp 01:55
/usr/bin/sh: line 0: cd: srcpmc: No such file or directory
gmake: *** [src\pmc\nqp_group.dll] Error 1
benabik I'm guessing that the Makefile got src\pmc from somewhere, but Strawberry's make doesn't understand backslashes. 02:01
swarley it works up until that specific one 02:08
02:19 FROGGS_ joined 02:22 FROGGS left 02:48 szbalint joined 02:50 Su-Shee left
swarley Swarley@OcctaviasViolin /cygdrive/c/Users/Swarley/Documents/GitHub/rakudo/nqp/parrot 02:52
$ make install
', needed by `src/pmc/addrregistry.o'. Stop.rot/memory.h
What kind of error is that??
geekosaur one with a control-m in the middle 02:53
something expecting unix style line endings got a dos line ending instead
swarley i did `make distclean' and now i get this 02:56
CONST_STRING split across lines at 461 in src/string/api.c
03:03 japhb_ left 03:06 xinming_ left
swarley nqp: say("hello" ~~ s/l/r/g); 03:24
p6eval nqp: OUTPUT«Divide by zero␤current instr.: '' pc 114 ((file unknown):64) (/tmp/Wi6x2I0hGw:1)␤»
TimToady n: say("hello" ~~ s/l/r/g); 03:25
p6eval niecza v24-18-gaf64300: OUTPUT«===SORRY!===␤␤Unsupported use of suffix regex modifiers; in Perl 6 please use prefix adverbs at /tmp/YPgT99eXie line 1:␤------> say("hello" ~~ s/l/r/g⏏);␤Other potential difficulties:␤ Unsupported use of /g; in Perl 6 …
swarley r: my $foo = "hello"; $foo ~~ s/l/r/g; say $foo; # Works in perl5 with the equivalent expressions 03:26
p6eval rakudo 935c90: OUTPUT«===SORRY!===␤Unsupported use of /g; in Perl 6 please use :g␤at /tmp/5QCHSOy5bW:1␤------> my $foo = "hello"; $foo ~~ s/l/r/g⏏; say $foo; # Works in perl5 with the eq␤»
swarley So.. what should i use instead of /g? 03:27
oh
:g
uhm.. How do I use :g? 03:28
TimToady nr: say("hello" ~~ s:g/l/r/); 03:29
p6eval niecza v24-18-gaf64300: OUTPUT«Unhandled exception: Writing to readonly scalar␤ at /home/p6eval/niecza/lib/CORE.setting line 593 (Cool.subst @ 88) ␤ at /tmp/uCSjS87C3G line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4218 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/C…
..rakudo 935c90: OUTPUT«Cannot assign to a non-container␤ in sub infix:<=> at src/gen/CORE.setting:12434␤ in block at /tmp/zpTeDrW8Hf:1␤␤»
TimToady nr: $_ = "hello"; s:g/l/r/; .say
p6eval rakudo 935c90, niecza v24-18-gaf64300: OUTPUT«herro␤»
swarley ah 03:30
nqp: my $test := "hello"; $test ~~ s:g/l/r/; say($test)
p6eval nqp: OUTPUT«Confused at line 2, near "$test ~~ s"␤current instr.: 'panic' pc 13207 (src/stage2/gen/NQPHLL.pir:4680) (src/stage2/gen/NQPHLL.pm:328)␤»
swarley sighs
TimToady nr: my $test := "hello"; $test ~~ s:g/l/r/; say($test) 03:31
swarley I suppose I'll write my own gsub then
p6eval rakudo 935c90: OUTPUT«Cannot assign to a non-container␤ in sub infix:<=> at src/gen/CORE.setting:12434␤ in block at /tmp/scmR2cMj6Q:1␤␤»
..niecza v24-18-gaf64300: OUTPUT«Unhandled exception: Writing to readonly scalar␤ at /home/p6eval/niecza/lib/CORE.setting line 593 (Cool.subst @ 88) ␤ at /tmp/onm5UnZxNK line 1 (mainline @ 4) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4218 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/C…
TimToady nr: my $test = "hello"; $test ~~ s:g/l/r/; say($test)
p6eval rakudo 935c90, niecza v24-18-gaf64300: OUTPUT«herro␤»
TimToady nqp doesn't have assignment, so can't actually set a mutable container 03:32
swarley Well, I'm trying to change all occurances of ' (not \') to \'
TimToady nqp: my $test := "hello"; say $test.subst(/l/, 'r', :g); 03:34
p6eval nqp: OUTPUT«Confused at line 2, near "say $test."␤current instr.: 'panic' pc 13207 (src/stage2/gen/NQPHLL.pir:4680) (src/stage2/gen/NQPHLL.pm:328)␤»
TimToady nqp: my $test := "hello"; say($test.subst(/l/, 'r', :g));
p6eval nqp: OUTPUT«Method 'subst' not found for invocant of class 'String'␤current instr.: '' pc 117 ((file unknown):60) (/tmp/L3neICYvi9:1)␤»
TimToady is not quite an nqp expert 03:35
swarley I would understand if it didn't modify the value
but it seems odd to be missing to many standard functions
03:35 hulu joined
benabik NQP is the minimum needed to implement Rakudo, so it's 'missing' alot. 03:36
swarley So I notice
TimToady prefers Perl 6 :)
hulu helo
what does 'my @digits = roll 4, 1..9;' mean?
benabik nqp: subst('hello', /l/, 'r', :global) 03:37
p6eval nqp: ( no output )
swarley I like NQP, don't get me wrong. If it was a full implementation of the syntax handling, i'd reinvent the wheel each time i needed it if i needed to
benabik nqp: say(subst('hello', /l/, 'r', :global))
p6eval nqp: OUTPUT«herro␤»
benabik swarley: ^
03:37 adu joined
swarley oh thank you benabik 03:37
benabik ack is your friend. (Found it with ack subst)
swarley does that modify the value of the first argument or return a new value? 03:38
benabik Appears to return a new value.
hulu who can help me
swarley nqp: my $foo = "bar"; subst($foo, /r/,'z'); say($foo)
p6eval nqp: OUTPUT«Assignment ("=") not supported in NQP, use ":=" instead at line 2, near " \"bar\"; su"␤current instr.: 'panic' pc 13207 (src/stage2/gen/NQPHLL.pir:4680) (src/stage2/gen/NQPHLL.pm:328)␤»
benabik r: my @digits = roll 4, 1..9; say @digits
p6eval rakudo 935c90: OUTPUT«3 7 9 5␤»
swarley nqp: my $foo := "bar"; subst($foo, /r/,'z'); say($foo)
p6eval nqp: OUTPUT«bar␤»
swarley Okay, just returns the value
I should have known that anyway
adu omg, I just blew my mind 03:39
the reason why closures are so powerful is that they're the procedural equivalent of XML 03:40
hulu benabik: what does 'roll' mean?
benabik hulu: roll is like rolling a die. roll( N, @list ) returns N random selections from the list (or more OO: @list.roll(N))
swarley nqp: my $str = "'hello world'!"; say("'{subst($str, /<!after \\> \'/, "\\'", :global)}'")
p6eval nqp: OUTPUT«Assignment ("=") not supported in NQP, use ":=" instead at line 2, near " \"'hello w"␤current instr.: 'panic' pc 13207 (src/stage2/gen/NQPHLL.pir:4680) (src/stage2/gen/NQPHLL.pm:328)␤»
swarley nqp: my $str := "'hello world'!"; say("'{subst($str, /<!after \\> \'/, "\\'", :global)}'")
p6eval nqp: OUTPUT«Could not find sub cuid_1_1360035592.93306␤current instr.: '' pc 653 ((file unknown):148248208) (/tmp/dtF26ZLVCc:1)␤»
swarley oh, i need to include QRegex for after i think.. 03:41
swarley goes to msg
or maybe not 03:42
nqp: /<!after foo>/ 03:45
p6eval nqp: ( no output )
swarley okay, so that's not the issue
hulu benabik: what does '?Exp24' mean? 03:47
benabik hulu: Convert Exp24 to a boolean, although it seems like odd P6 code. 03:48
03:49 diakopte1 joined 03:54 wtw left 03:55 xinming joined
swarley x`Alright, I finally got an answer 03:55
nqp: my $old_str := "'hello \\\'world\\\'!\'"; my $str := subst(subst($old_str, /\\/, "\\\\", :global), /\'/, "\\'", :global); say("'{$str}'")
p6eval nqp: OUTPUT«'\'hello \\\'world\\\'!\''␤»
swarley 'hello \'world\'! 03:56
04:06 preflex_ joined 04:07 preflex left, preflex_ is now known as preflex 04:14 viewonly joined 04:24 wtw joined 04:29 sevin joined 04:34 lorn left 04:35 lorn joined, diakopte1 is now known as diakopter 04:42 lorn left 04:43 lorn joined 05:01 sevin left
hulu grammar Exp24 { token TOP { ^ <exp> $ } token exp { <term> [ <op> <term> ]* } token term { '(' <exp> ')' | \d } token op { '+' | '-' | '*' | '/' } } 05:06
what's does '3 + 5' mean?
r: grammar Exp24 { token TOP { ^ <exp> $ } token exp { <term> [ <op> <term> ]* } token term { '(' <exp> ')' | \d } token op { '+' | '-' | '*' | '/' } }; Exp24.parse('3+5'); 05:09
p6eval rakudo 935c90: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/p8QSCCsI6F:1␤------> Exp24 { token TOP { ^ <exp> $ } ⏏token exp { <term> [ <op> <term> ]* } ␤ expecting any of:␤ statement list␤ prefix or term␤ prefix or…
hulu r: grammar Exp24 { token TOP { ^ <exp> $ } token exp { <term> [ <op> <term> ]* } token term { '(' <exp> ')' | \d } token op { '+' | '-' | '*' | '/' } }; ?Exp24.parse('3+5');
p6eval rakudo 935c90: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/ESj0IW1Gg8:1␤------> Exp24 { token TOP { ^ <exp> $ } ⏏token exp { <term> [ <op> <term> ]* } ␤ expecting any of:␤ statement list␤ prefix or term␤ prefix or…
hulu benabik: why ‘3+5’ not parse 05:10
mst hulu: '3 + 5'
perhaps
hulu r: grammar Exp24 { token TOP { ^ <exp> $ } token exp { <term> [ <op> <term> ]* } token term { '(' <exp> ')' | \d } token op { '+' | '-' | '*' | '/' } }; ?Exp24.parse('3 + 5');
p6eval rakudo 935c90: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/_8yY2nU7zX:1␤------> Exp24 { token TOP { ^ <exp> $ } ⏏token exp { <term> [ <op> <term> ]* } ␤ expecting any of:␤ statement list␤ prefix or term␤ prefix or…
skids hulu: when you put things all on one line, curly braces that normally end constructs need a ; after them.
geekosaur you're not getting that far; it's throwing an error in the middle of your definitions
hulu r: grammar Exp24 { token TOP { ^ <exp> $ } ; token exp { <term> [ <op> <term> ]* } ; token term { '(' <exp> ')' | \d }; token op { '+' | '-' | '*' | '/' } ;}; ?Exp24.parse('3 + 5'); 05:11
p6eval rakudo 935c90: ( no output )
hulu r: grammar Exp24 { token TOP { ^ <exp> $ } ; token exp { <term> [ <op> <term> ]* } ; token term { '(' <exp> ')' | \d }; token op { '+' | '-' | '*' | '/' } ;}; say ?Exp24.parse('3 + 5');
p6eval rakudo 935c90: OUTPUT«False␤»
hulu skids: why not parse
mst hulu: maybe take back out the spaces I suggested ? 05:12
hulu r: grammar Exp24 { token TOP { ^ <exp> $ } ; token exp { <term> [ <op> <term> ]* } ; token term { '(' <exp> ')' | \d }; token op { '+' | '-' | '*' | '/' } ;}; say ?Exp24.parse('3+5');
p6eval rakudo 935c90: OUTPUT«True␤» 05:13
mst I misunderstood the problem before, sorry
hulu thx
skids tokens are not :sigspace
mst skids: that was my fault, I misunderstood earlier and suggested the spaces in the string to parse
skids ah 05:14
05:16 adu left 05:18 xinming_ joined 05:21 xinming left 05:22 sevin joined
hulu repeat while --$b { .say for "&b($b) on the wall", b($b), 'Take one down, pass it around', "&b($b-1) on the wall", ''; } 05:35
what does '&b($b)' mean 05:36
sub b($b) { "$b bottle{'s'.substr($b == 1)} of beer"; };repeat while --$b { .say for "&b($b) on the wall", b($b), 'Take one down, pass it around', "&b($b-1) on the wall", ''; } 05:37
mst: what does '&b($b)' mean?
benabik hulu: Call sub b with argument $b. & is the sigil for a function.
hulu benabik: why not 'b($b)' 05:38
benabik In code you don't generally need the &, but in a string you do.
hulu benabik: ic
benabik: thx
benabik hulu: np
05:39 skids left 05:46 colomon left 05:57 marloshouse left, marloshouse joined 05:59 colomon joined 06:05 SamuraiJack joined 06:18 Patterner left 06:19 Psyche^ joined, Psyche^ is now known as Patterner 06:26 FROGGS_ left, krunen left 06:37 sevin left 06:38 sevin joined 06:39 FROGGS_ joined, am0c joined 06:42 kaleem joined 06:46 benabik left 06:47 benabik joined, domidumont joined 06:51 FROGGS_ is now known as FROGGS
FROGGS morning 06:52
moritz \o morning 07:00
FROGGS nr: my @var = <a b c>; say "b" ~~ / @var /
p6eval rakudo 935c90: OUTPUT«#<failed match>␤»
..niecza v24-18-gaf64300: OUTPUT«#<match from(0) to(1) text(b) pos([].list) named({}.hash)>␤»
FROGGS nr: my @var = <a b c>; say "abc" ~~ / @var /
p6eval niecza v24-18-gaf64300: OUTPUT«#<match from(0) to(1) text(a) pos([].list) named({}.hash)>␤»
..rakudo 935c90: OUTPUT«#<failed match>␤»
FROGGS nr: my @var = <a b c>; say "abc" ~~ / @var+ / 07:01
p6eval niecza v24-18-gaf64300: OUTPUT«#<match from(0) to(3) text(abc) pos([].list) named({}.hash)>␤»
..rakudo 935c90: OUTPUT«#<failed match>␤»
FROGGS cool
07:01 quester joined
FROGGS nr: say "abc" ~~ / @( <a b c> )+ / 07:01
p6eval rakudo 935c90: OUTPUT«===SORRY!===␤Unrecognized regex metacharacter @ (must be quoted to match literally)␤at /tmp/nGlhM5uDEJ:1␤------> say "abc" ~~ / ⏏@( <a b c> )+ /␤Unable to parse regex; couldn't find final '/'␤at /tmp/nGlhM5uDEJ:1␤------> sa… 07:02
..niecza v24-18-gaf64300: OUTPUT«#<match from(0) to(3) text(abc) pos([].list) named({}.hash)>␤»
FROGGS array interpolation still doesnt work locally with my changes to nom 07:03
only $( ... ) is working
dunno what %( ... ) should do 07:04
07:04 alec left, alec__1 joined
FROGGS maybe ... 07:05
n: my %var = ( a => b ); say "abc" ~~ / %var<a> /
p6eval niecza v24-18-gaf64300: OUTPUT«===SORRY!===␤␤Only $ and @ variables may be used in regexes for now at /tmp/hVtxku9evh line 1:␤------> y %var = ( a => b ); say "abc" ~~ / %var⏏<a> /␤␤Undeclared routine:␤ 'b' used at line 1␤␤Potential difficulties:␤ A…
07:05 domidumont left
FROGGS n: my %var = ( a => "b" ); say "abc" ~~ / %var<a> / 07:05
p6eval niecza v24-18-gaf64300: OUTPUT«===SORRY!===␤␤Only $ and @ variables may be used in regexes for now at /tmp/ZugQXJyYLI line 1:␤------> %var = ( a => "b" ); say "abc" ~~ / %var⏏<a> /␤␤Potential difficulties:␤ Apparent subscript will be treated as rege…
FROGGS weird 07:06
07:06 sevin left 07:13 alec__1 is now known as alec, sevin joined 07:17 sevin_ joined 07:18 sevin left 07:21 alec is now known as ohrmazd 07:27 xiaoyafeng joined 07:35 ohrmazd is now known as alec, xiaoyafeng left 07:38 am0c left, am0c joined
diakopter .. .. . ... . . . .... . . . . . 07:47
07:51 domidumont joined
moritz iis se ee h e e e e e ? 07:52
tadzik good morning
moritz good morning tadzik 07:53
sorear mornign 07:55
FROGGS o/
07:58 krunen joined, domidumont left 07:59 domidumont joined 08:05 dayangkun left 08:06 dayangkun joined 08:12 quester left 08:19 sevin_ left 08:20 sevin_ joined 08:21 daxim joined 08:31 bruges_ joined, bruges left 08:40 Pompel joined, nebuchadnezzar joined 08:41 sorear left 08:45 s0rear joined
tadzik for you, fellow vim-junkies: twitter.com/null 09:01
er, what
09:01 hoelzro|away is now known as hoelzro
tadzik that was supposed to be valloric.github.com/YouCompleteMe/ :) 09:01
hoelzro tadzik: ah, I saw that, but I haven't read about it yet 09:04
tadzik it takes some effort to get running, but I'd say it's worth it 09:06
vim could use some package manager that's not completely horrible :)
09:08 fhelmberger joined
hoelzro heh 09:09
09:10 s0rear is now known as sorear 09:15 am0c left 09:23 krunen left 09:26 sevin_ left 09:34 mynameis left, sqirrel joined 09:35 xinming_ left, xinming joined
tadzik oh hm, my nqp-jvm patches are both wrong :| 09:36
09:43 benabik left, benabik joined 09:44 Psyche^ joined 09:48 Patterner left, fgomez left, Psyche^ is now known as Patterner 09:54 dakkar joined 09:55 sizz_ left 09:56 sizz joined
masak mornin', #perl6 10:00
tadzik morning' masak' 10:02
hulu @quantities Z @bottles Z @actions Z @quantities[1 .. *] Z @bottles[1 .. *] 10:03
10:03 hypolin left
hulu benabik: what does '1 .. *' mean? 10:04
moritz it's an infinite range starting from 1 10:05
hulu moritz: what does 'infinite range' mean? 10:06
10:06 szbalint left, szbalint joined 10:07 xinming left
moritz hulu: which part are you having trouble with? 'infinite' or 'range'? 10:07
hulu infinite
moritz it doesn't have an end
it goes one forever
hulu for @quantities Z @bottles Z @actions Z @quantities[1 .. *] Z @bottles[1 .. *] -> $a, $b, $c, $d, $e { say "$a $b of beer on the wall"; say "$a $b of beer"; say $c; say "$d $e of beer on the wall\n"; } 10:08
moritz: please look at this
10:08 xinming joined
moritz looks at it 10:09
tadzik masak: I have a shiny new rakudobug for you
masak ooh
tadzik r: sub prefix:<\o/>($) { }
p6eval rakudo 935c90: OUTPUT«Null PMC access in find_method('clone')␤ in block at /tmp/1ZhASdkYfl:1␤␤»
10:09 kivutar joined
masak when I make a language, I'm going to avoid the word "infinite". it's often more a question of "unbound". 10:09
er, "unbounded".
masak submits rakudobug
r: sub prefix:<\p>($) {} 10:10
p6eval rakudo 935c90: OUTPUT«Null PMC access in find_method('clone')␤ in block at /tmp/bUTogzfhSm:1␤␤»
masak r: sub prefix:<\a>($) {}
p6eval rakudo 935c90: OUTPUT«Null PMC access in find_method('clone')␤ in block at /tmp/mgwCG0Vtyl:1␤␤»
masak r: sub prefix:<\\>($) {}
p6eval rakudo 935c90: OUTPUT«Null PMC access in find_method('clone')␤ in block at /tmp/J8FFRNqtwK:1␤␤»
masak r: sub prefix:<q>($) {}
p6eval rakudo 935c90: ( no output )
masak ok, backslashes in preifx ops. got it.
r: sub postfix:<\\>($) {}
p6eval rakudo 935c90: OUTPUT«Null PMC access in find_method('clone')␤ in block at /tmp/eWTbkYG8X8:1␤␤»
masak r: sub infix:<\\>($) {}
p6eval rakudo 935c90: OUTPUT«Null PMC access in find_method('clone')␤ in block at /tmp/zadixk05uL:1␤␤»
masak submits rakudobug 10:11
10:14 hulu left 10:15 hulu joined 10:16 anuby left
hulu masak: 'Adding to an entry that is not in the hash yet will cause that entry to spring into existence just-in-time, with a value starting at zero.' 这句话中文怎么说? 10:18
masak hulu: 坚持住,我将它翻译。 10:20
hulu masak: 谢谢 10:21
moritz: what does 'infinite range' mean?
FROGGS r: say -Inf .. Inf 10:22
p6eval rakudo 935c90: OUTPUT«-Inf..Inf␤»
moritz hulu: didn't we have that discussion a while ago?
masak moritz: I think hulu doesn't understand the word "infinite".
hulu for @quantities Z @bottles Z @actions Z @quantities[1 .. *] Z @bottles[1 .. *] -> $a, $b, $c, $d, $e { say "$a $b of beer on the wall"; say "$a $b of beer"; say $c; say "$d $e of beer on the wall\n"; }
masak: 我无法理解这句 10:23
masak no no wait
hulu: 如果你这样做 'my %h; %h<foo> += 42', 那么这个值 %h<foo> 被自动设置为0前增加了42 10:24
hulu: 你明白吗?我明白的说吗? 10:25
hulu spring into existence just-in-time 是什么意思?
masak hulu: 开始存在,在最后一刻 10:26
moritz masak: which is why I've tried to explain it 10:27
masak moritz: nodnod. it didn't stick.
for whatever reason.
communication is hard ;)
hulu with a value starting at zero 什么意思 10:28
masak: 请看看是什么意思
masak hulu: %h<foo> 从0开始 10:29
hulu 我试着翻译一下
au 对哈希表内的某个项目进行增值,如果该项目不存在,哈希表会先自动将该项目设为零。
phenny au: 15 Jan 18:50Z <[Coke]> tell au cleaned up pugs, we're back up to 38.55%
masak au: thank you.
au np :p 10:30
hulu au: thx
masak au: and now I feel a little embarrassed... I'm leaning heavily on GT here, and probably making a mess of word order and tone and word choice. *^_^*
hulu au: that entry to spring into existence just-in-time 什么意思 10:31
sorear au! \o/
arnsholt masak: Still better than the rest of us =)
au 该项目在用到时,会预先自动生成。
masak heh, hulu likes to make sure he really understood... :)
au yeah, there's no easy zh equiv of just-in-time
masak ah, there's the problem, then ;) 10:32
au the literal rendering is probably 「值到用时方生成」 after 「书到用时上网找」
masak hulu: "just-in-time" means 在最后的时刻
hulu 我不理解 spring into existence
au except that, literally, means "at the armageddon" 10:33
masak au: that's a bit too late :P
sorear just in time is a bit of a funny idiom anyway. I wonder if there are other common ways of handling things like that
masak though kind of a nice feature...
au hulu: spring = 跳, into = 进, existence = 存在
spring into existence = 生成
sorear i wonder what they do with Gödel's completeness theorem?
masak sorear: what's the connection to just-in-time? 10:34
sorear masak: every consistant set of axioms can be realized using a model (set of objects + relations), the basic idea is to lazily construct objects while taking a countable closure 10:35
it's interesting because it's not a temporal/dynamic process at all
but it has the same character of only caring about concepts which are in a sense accessible
masak hm... never thought of it that way. nice. 10:36
I've only recently started using "model" in that way, though. it feels very central to programming, somehow.
where does "taking a countable closure" come in? when is that done? 10:37
hulu au: 我试着翻译一下:向哈希结构中添加一个不存在的项目,将导致这个项目在最后时刻以零为值创建
sorear masak: A countable closure covers all possible finite sequences of deductions.
masak yes, I realize that.
so it's what you construct when you somehow want to talk about the whole model... 10:38
sorear unlike autovivification, which only closes over the single path which is taken
au hulu: that's fine, except "add to an entry" here means "increment / 增值 / 递加 (+=, ++)" not "adding an entry "assignment / 赋值 / 添加"
masak sorear: ah!
there's the connection :)
hulu au: 谢谢 10:39
masak au++
au hulu: 没事儿 :)
hulu au: for @quantities Z @bottles Z @actions Z @quantities[1 .. *] Z @bottles[1 .. *] -> $a, $b, $c, $d, $e { say "$a $b of beer on the wall"; say "$a $b of beer"; say $c; say "$d $e of beer on the wall\n"; } 10:43
au: 这段程序中的 1 .. * 是什么意思
au hulu: 建构一个 range 区间序列,以 integer 整数为值,下限为 1,没有上限。 10:44
hulu au: 没有上限,如何停止?
masak moritz: <au> "...and there is no upper limit", <hulu> "if there's no upper limit, how to stop?" -- seems there was a conceptual difficulty in understanding. 10:45
au 因为是用作阵列索引,@quantities 内元素用完时就会停止。
masak ...which ties nicely into what sorear said about finite deductions inside a countable closure. :) 10:46
au yup.
hulu au: 什么是 阵列索引
au hulu: 阵列结构一般以整数为索引,相当于哈希结构的键。 10:47
masak heh. I usually assume array knowledge and explain hashes using it, not the other way around. ;)
au assumes very little :)
masak :P 10:48
hulu: a range only specifies the two endpoints. it doesn't force you to count from one to the other. 10:49
...which would, indeed, take a very long time. 10:50
hulu r: my @quantities = (99 ... 1), 'No more', 99; my @bottles = 'bottles' xx 98, 'bottle', 'bottles' xx 2; my @actions = 'Take one down, pass it around' xx 99, 'Go to the store, buy some more';say @quantities Z @bottles Z @actions Z @quantities[1 .. *] Z @bottles[1 .. *]; 10:52
p6eval rakudo 935c90: OUTPUT«99 bottles Take one down, pass it around 98 bottles 98 bottles Take one down, pass it around 97 bottles 97 bottles Take one down, pass it around 96 bottles 96 bottles Take one down, pass it around 95 bottles 95 bottles Take one down, pass it around 94 bottles 94 bo…
sorear A range is just a pair endowed with semantics. 10:57
r: my $r = 2 .. "green"; $r.end
p6eval rakudo 935c90: OUTPUT«Cannot call 'Real'; none of these signatures match:␤:(Mu:U \v: Mu *%_)␤␤ in method Real at src/gen/CORE.setting:872␤ in method Real at src/gen/CORE.setting:2391␤ in method new at src/gen/CORE.setting:5255␤ in sub infix:<..> at src/gen/CORE.setting:5436␤ in blo…
moritz that's LTA 10:59
hulu r: my @quantities = (99 ... 1), 'No more', 99; my @bottles = 'bottles' xx 98, 'bottle', 'bottles' xx 2; my @actions = 'Take one down, pass it around' xx 99, 'Go to the store, buy some more'; #for @quantities Z @bottles Z @actions Z # @quantities[1 .. *] Z @bottles[1 .. *] # -> $a, $b, $c, $d, $e { for @quantities Z @bottles Z @actions -> $a, $b, $c { say "$a $b of beer on the wall"; say "$a $b of beer"; say $c; # say "$d $e of
p6eval rakudo 935c90: ( no output )
hulu r: my @quantities = (99 ... 1), 'No more', 99; my @bottles = 'bottles' xx 98, 'bottle', 'bottles' xx 2; my @actions = 'Take one down, pass it around' xx 99, 'Go to the store, buy some more'; for @quantities Z @bottles Z @actions -> $a, $b, $c { say "$a $b of beer on the wall"; say "$a $b of beer"; say $c; } 11:00
p6eval rakudo 935c90: OUTPUT«99 bottles of beer on the wall␤99 bottles of beer␤Take one down, pass it around␤98 bottles of beer on the wall␤98 bottles of beer␤Take one down, pass it around␤97 bottles of beer on the wall␤97 bottles of beer␤Take one down, pass it around␤96 bottles of beer on the…
masak hehe, I read sorear's "just a pair" comment, and then apparently thought exactly the same thing as moritz did. :P 11:01
moritz hulu: do you know any other programming languages?
masak surely the things in the pair need to be "on the same continuum" in some sense?
hulu moritz: 3,5
moritz hulu: which languages? 11:02
hulu C
c++
python
ruby
java
masak is Ruby the .5 ?
oh wait, that's five languages.
au it's a range :p
masak :P
au ...expressed as a pair, endowed with semantics 11:03
hulu au: 我还是不理解 for @quantities Z @bottles Z @actions Z @quantities[1 .. *] Z @bottles[1 .. *] 11:04
au: @quantities和@quantities[1 .. *]有什么不同 11:06
11:07 SmokeMachine joined
hulu moritz: what diff between @quantities @quantities[1 .. *] 11:07
masak I find the "endowed with semantics" much too weak. that could be either an ADT or an OO class. 11:08
moritz hulu: @quantities[1 .. *] misses the first element (index 0)
masak also, it correctly describes a complex number just as much as a range. and those are quite different.
moritz my @quant = <a b c d>; say @quant; say @quant[1..*]
r: my @quant = <a b c d>; say @quant; say @quant[1..*] 11:09
p6eval rakudo 935c90: OUTPUT«a b c d␤b c d␤»
masak moritz++ # pedagogic
moritz r: my @quant = <a b c d>; say @quant Z~ @quant[1..*]
p6eval rakudo 935c90: OUTPUT«ab bc cd␤»
moritz kinda likes that idiom 11:10
11:10 Su-Shee_ joined
moritz masak: I hereby officially inform you that I'm impatient regarding the p6cc reviews 11:10
:-)
masak noted.
hulu moritz: thx
11:11 Su-Shee_ is now known as Su-Shee
masak moritz: FOSDEM/Brussels took too many cycles for me to look at it then. but I'll have some time today. will report progress later this evening. 11:11
by the way, it was lovely to have a Perl 6 presence at FOSDEM. we should do that again. 11:12
r: my @quant = <a b c d>; say @quant Z~ @quant.rotate 11:13
p6eval rakudo 935c90: OUTPUT«ab bc cd da␤»
masak likes that idiom ;)
11:14 kivutar left 11:15 marloshouse left
moritz aye, that one is nice too 11:15
11:15 marloshouse joined
masak r: my @quant = <a b c d>; say @quant Z~ @quant.reverse 11:17
p6eval rakudo 935c90: OUTPUT«ad bc cb da␤»
masak r: my @quant = <a b c d>; say @quant Z~ @quant.pick(*)
p6eval rakudo 935c90: OUTPUT«aa bc cd db␤»
hulu r: my @quantities = (99 ... 1), 'No more', 99; my @bottles = 'bottles' xx 98, 'bottle', 'bottles' xx 2; my @actions = 'Take one down, pass it around' xx 99, 'Go to the store, buy some more'; for @quantities Z @bottles Z @actions Z @quantities[1 .. *] Z @bottles[1 .. *] -> $a, $b, $c, $d, $e { say $a, $b, $c, $d, $e; } 11:18
p6eval rakudo 935c90: OUTPUT«99bottlesTake one down, pass it around98bottles␤98bottlesTake one down, pass it around97bottles␤97bottlesTake one down, pass it around96bottles␤96bottlesTake one down, pass it around95bottles␤95bottlesTake one down, pass it around94bottles␤94bottlesTake one down, p…
Juerd Nice. 11:20
hulu my @quant = <a b c d>; say @quant Z @quant.reverse Z @quant 11:21
r: my @quant = <a b c d>; say @quant Z @quant.reverse Z @quant
p6eval rakudo 935c90: OUTPUT«a d a b c b c b c d a d␤»
hulu r: my @quant = <a b c d>; say @quant Z @quant.reverse Z @quant: 11:22
p6eval rakudo 935c90: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/GM7Tmgz5Jz:1␤------> d>; say @quant Z @quant.reverse Z @quant⏏:␤ expecting any of:␤ postfix␤ infix or meta-infix␤ infix stopper␤ statement end␤ statem…
hulu r: my @quant = <a b c d>; say @quant Z @quant.reverse Z @quant;
p6eval rakudo 935c90: OUTPUT«a d a b c b c b c d a d␤»
hulu r: my @quant = <a b c d>; say @quant Z~ @quant.reverse Z~ @quant;
p6eval rakudo 935c90: OUTPUT«ada bcb cbc dad␤» 11:23
masak hulu: Z makes a list of separate items, Z~ concatenates things. 11:26
hulu masak: ic 11:36
masak: thx
masak np :) 11:38
hulu r: say [+] .words for lines 11:42
p6eval rakudo 935c90: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏Land' (indicated by ⏏)␤current instr.: 'throw' pc 332433 (src/gen/CORE.setting.pir:149253) (src/gen/CORE.setting:9296)␤called from Sub 'Numeric' pc 363983 (src/gen/CORE.setting…
hulu au: [+] <2 3 4>;[+] .words for <2 3 4> 有什么不同? 11:45
r: [+] .words for <2 3 4>
p6eval rakudo 935c90: ( no output )
hulu r: say [+] .words for <2 3 4>
p6eval rakudo 935c90: OUTPUT«2␤3␤4␤»
hulu masak: what does 'say [+] .words for <2 3 4>' mean? 11:46
who can help me 11:51
what does 'say [+] .words for <2 3 4>' mean? 11:52
masak hulu: let's look at '[+] .words for lines' instead. it makes more sense. 12:01
hulu: it means "read all the lines of $*IN" (lines), "split each line into words" (.words for), and "convert all the words to numbers and sum them" ([+]) 12:02
r: say [+] 10, 2000, 4_000_000 12:03
p6eval rakudo 935c90: OUTPUT«4002010␤»
masak r: say "Beverly Hills", [+] <10 200 90_000> 12:04
p6eval rakudo 935c90: OUTPUT«Beverly Hills90210␤»
masak r: say "Beverly Hills, ", [+] <10 200 90_000>
p6eval rakudo 935c90: OUTPUT«Beverly Hills, 90210␤»
masak r: .say for "Observe how this sentence is split up into parts".words 12:05
p6eval rakudo 935c90: OUTPUT«Observe␤how␤this␤sentence␤is␤split␤up␤into␤parts␤»
masak hulu: does that answer your question?
12:09 dayangkun left
masak today's autopun spotting: twitter.com/luqui/status/298739823492079616 12:10
12:12 kresike joined
kresike hello all you happy perl6 people 12:12
12:20 kivutar joined 12:22 dayangkun joined, brrt joined
masak kresike! \o/ 12:26
kresike masak, o/ 12:27
long time no see !
hulu r: [+] .words for lines 12:29
p6eval rakudo 935c90: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏Land' (indicated by ⏏)␤current instr.: 'throw' pc 332433 (src/gen/CORE.setting.pir:149253) (src/gen/CORE.setting:9296)␤called from Sub 'Numeric' pc 363983 (src/gen/CORE.setting…
hulu r: say [+] .words for lines 12:30
p6eval rakudo 935c90: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏Land' (indicated by ⏏)␤current instr.: 'throw' pc 332433 (src/gen/CORE.setting.pir:149253) (src/gen/CORE.setting:9296)␤called from Sub 'Numeric' pc 363983 (src/gen/CORE.setting…
hulu masak: why this not run
12:36 shinobicl joined
moritz it runs 12:43
but it dies when trying to convert the word 'Land' to a number 12:44
hulu moritz: ?
moritz as the error message tells you
FROGGS r: say [+] .words for lines
p6eval rakudo 935c90: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏Land' (indicated by ⏏)␤current instr.: 'throw' pc 332433 (src/gen/CORE.setting.pir:149253) (src/gen/CORE.setting:9296)␤called from Sub 'Numeric' pc 363983 (src/gen/CORE.setting…
FROGGS r: say .words for lines
p6eval rakudo 935c90: OUTPUT«Land der Berge, Land am Strome,␤Land der Äcker, Land der Dome,␤Land der Hämmer, zukunftsreich!␤Heimat bist du großer Söhne,␤Volk, begnadet für das Schöne,␤vielgerühmtes Österreich,␤vielgerühmtes Österreich!␤␤Heiß umfehdet, wild umstritten␤liegst dem Erdteil du inmi…
FROGGS you can't sum words
12:45 benabik left
FROGGS r: say 'Land' + 'der' 12:45
p6eval rakudo 935c90: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏Land' (indicated by ⏏)␤ in method Numeric at src/gen/CORE.setting:10508␤ in sub infix:<+> at src/gen/CORE.setting:2834␤ in sub infix:<+> at src/gen/CORE.setting:2834␤ in bl…
hulu how to do
FROGGS to do what?
hulu [+]
FROGGS well, it works on numbers
moritz hulu: what do you want the output to be? 12:46
hulu words of line
nwc10 masak: sorry if this is a FAQ - why thie *Austrian* national anthem?
FROGGS you just want to split a line to a list of words?
12:47 kaleem left
FROGGS hulu^^ 12:47
moritz hulu: do you want to know the number of words per line?
nwc10: I think it's vaguely related to the YAPC::EU in Vienna
but the details are lost in the mists of time 12:48
hulu moritz: rosettacode.org/wiki/A%2BB#Perl_6 12:49
moritz hulu: well yes, you can sum them, but only if the words in the input are actually numbers 12:50
hulu r: say [+] .words for "1 2"
p6eval rakudo 935c90: OUTPUT«3␤»
FROGGS r: say [+] .words for "1 2 3 4 5 6 7 8"
p6eval rakudo 935c90: OUTPUT«36␤»
hulu moritz: why lines not run 12:51
12:52 shinobicl left, shinobicl joined
moritz hulu: lines() reads from standard input 12:52
hulu: and what it reads there aren't numbers
r: say [+] .words for "these are not numbers"
p6eval rakudo 935c90: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏these' (indicated by ⏏)␤current instr.: 'throw' pc 332433 (src/gen/CORE.setting.pir:149253) (src/gen/CORE.setting:9296)␤called from Sub 'Numeric' pc 363983 (src/gen/CORE.settin…
nwc10 moritz: mists of time, and incomplete version control history imports. But it was in 2009: irclog.perlgeek.de/perl6/2009-04-30#i_1108448 12:53
hulu moritz: i c 12:54
nwc10 which is 1 month after the QA hackathon in Birmingham
moritz nwc10: I must protest the "incomplete version control history imports": github.com/perl6/evalbot/commit/8e...c9ccf90e37 12:55
nwc10 you got me there 12:58
but the searches don't find that
hulu moritz: sub accum ($n is copy) { sub { $n += $^x } };my $a = accum 5; $a(4.5); say $a(.5); 13:04
masak nwc10: for a very silly reason: this blog post. strangelyconsistent.org/blog/the-to...s-of-proto
hulu why 10, not 5.5
nwc10 aha. :-) 13:05
TimToady masak: "infinite" vs "unbounded": your precision is obscure and confusing to newbies, and if we're going to banish concepts like infinity because of mere physical limitations, our dictionary will be sadly depleted
hulu who can help me 13:06
masak TimToady: you have a point.
13:07 sftp left
masak hulu: because you initialize $n to 5, add 4.5 (so we're up to 9.5) and then add .5 (so we're up to 10). the 10 is returned. 13:07
FROGGS hulu: 5 + 4.5 + 0.5
masak hulu: your questions seem related less to how Perl 6 works and more to how programs work. 13:08
TimToady: that said, many times it feels like what we want to say (especially when we do '*' and not 'Inf', which I think turned out to be more common that anticipated), is "just keep going", not "this one goes up to infinity". 13:09
hulu masak: 哪句是初始化 $n
masak hulu: ah, I see what's going on.
hulu: you're confused as to the nature of closures.
I have *no* idea how to explain closures to you across the very narrow inter-language bandwidth we've established. :/ 13:10
even though I understand them well at this point myself.
hulu FROGGS: where initialize $n to 5 13:12
FROGGS: wher initialize $n to 5
masak hulu: 'accum 5' and '$n is copy'. 13:13
FROGGS right
masak peeps, I'm watching www.infoq.com/presentations/Thinkin...rogramming -- heartily recommended to anyone who's interested in parallelism.
FROGGS sorry for the delay, I'm doing hundreds of things at once 13:14
masak it's a Guy Steele talk.
hulu masak: $n is copy 是产生拷贝,如何 能继续 +4.5+.5
13:14 FROGGS left
masak hulu: because closures. 13:15
hulu: which I can't explain to you, because there is not enough bandwidth.
I *can* show how they work empirically, but I can't explain. 13:16
hulu masak: thx 13:17
masak r: sub make-counter { my $i = 0; return { ++$i } }; my $c1 = make-counter(); say $c1(); say $c1(); say $c1()
p6eval rakudo 935c90: OUTPUT«1␤2␤3␤»
masak r: sub make-counter { my $i = 0; return { ++$i } }; my $c1 = make-counter(); my $c2 = make-counter(); $c1(); $c1(); $c2(); $c1()
p6eval rakudo 935c90: ( no output )
masak r: sub make-counter { my $i = 0; return { ++$i } }; my $c1 = make-counter(); my $c2 = make-counter(); say $c1(); say $c1(); say $c2(); say $c1()
p6eval rakudo 935c90: OUTPUT«1␤2␤1␤3␤»
masak hulu: study that. when you understand why that works, you'll understand closures, and your own example. 13:18
hulu: it's also explained at the end of S04, but I wouldn't recommend that explanation. it's not for the faint of heart.
TimToady
.oO(The Zen master hit the student on the head with a closure, and then the student was enlightened.)
13:19
masak :P
hulu masak: closures 的意思是闭包
masak according to GT, yes. 13:20
but I would need something au-complete to verify it for sure.
hulu au: sub accum ($n is copy) { sub { $n += $^x } };my $a = accum 5; $a(4.5); say $a(.5); 为什么是 10 13:21
masak hulu: here's the important bit: a closure *remembers its environment* and all the variables (like $n) that's in it, between calls. 13:22
in the end that is 为什么是 10.
if you want it to be 5.5, remove the '$a(4.5)' bit in the middle :P 13:23
hulu masak: 我还是看不懂
masak: my $a = accum 5; 是什么意思 13:24
13:25 _jaldhar left
masak hulu: 'accum 5' calls the subroutine &accum, passing in the value 5, which is then stored in $n. the 'is copy' means that it's a "new" 5 being stored in $n. 13:27
au hulu: the ruby equivalent is
def accum n; lambda { |x| n += x }; end; a = accum 5; a.call 4.5; puts a.call 0.5
TimToady masak: I usually say "an arbitrary number of" when I feel uncomfy with "infinite"
hulu masak: 我还是不明白 13:28
TimToady arbitrary is an arbitrary word, but at least it's un-self-negated as limitless or unbounded are
masak TimToady: yes, that rings a little of induction, I guess.
hulu: I told you we didn't have enough bandwidth for me to explaing this. :/ 13:29
explain*
13:29 felipe joined
masak there's something weird about closures, such that they go wildly against your intuitions as a BASIC or C or Assembly programmer, but they're actually fundamentally *simple*. 13:30
people have to go through the same kind of trial by fire as with git, coming out the other end having essentially unlearned some stuff. 13:31
au hulu: try tc.wangchao.net.cn/bbs/detail_69548.html 13:32
13:33 lizmat left
masak when I explain this in class, I usually go: "what's the shape of an array? it's a sequence of elements." -- "what's the shape of a hash? it's an unordered collection of key/value pairs". 13:33
"what's the shape of a routine? it's a signature, a body, and *an environment*".
that last bit is what makes closures work.
TimToady a set of bindings, a set of not-yet-bound-ings, and the desired relationship between them :) 13:34
au ((n)->(n+=)) 5 => .. 4.5; .. 0.5 |> console.log # livescript version, fwiw 13:35
masak lambda calculus has made me a better programmer.
TimToady refrains from asking masak++ to define "better" 13:36
masak ;) 13:37
the axes I was thinking of were a linear combination of "able to design programs" and "able to reason about behavior". 13:38
TimToady but perhaps not "able to explain your program easily to some person on IRC" :) 13:40
ss/some person/some arbitrary person/ :)
hulu au: 我想问一下 $n 是如何在 my $a = accum 6;$a(4.5); say $a(.5); 之间传递的。 13:41
13:43 hoelzro is now known as hoelzro|away
TimToady has never seen someone try to learn programming by proceeding through an RC page in alphabetical order before 13:43
au hulu: accum() 运行时,记住了参数 $n 的值,并且传回一个新定义的函式物件给 $a。之后呼叫 $a 时,該函式可以直接存取定義時的 $n 變數。這個機制稱為「閉包」。請見以上網址。
TimToady it's kinda refreshingly different 13:44
au well, agentzh started by, iirc, transcribing Synopses to paper by hand
TimToady in a difficult sort of way
masak TimToady: I'm not sure closures can be explained. I teach them regularly, but I always get the impression that when people get it, they get it because of themselves, not because of me. 13:45
hulu au: 之后呼叫 $a 时,該函式可以直接存取定義時的 $n 變數 什么意思? 13:46
clkao iirc SICP has pretty figures about closures 13:47
au hulu: 請見以上網址 wj.cnblogs.com/archive/2006/04/22/381851.html ... 在构造函数内,内部函数总是可以访问函数外部的变量和参数的。就算在内部函数return后,闭包内的所有变量都会被保存起来,就好像一个上下文一样。
brrt closures kill the nice stack behavior that you would otherwise have in c-like-language
s
Juerd TimToady: My most important resource when learning Perl was perlfunc.
TimToady masak: all containers have to be elaborated/initialized, it's just that closure are inside out, and are elaborated/initialized with their outsides 13:48
au hulu: 这概念用 IRC 著实没法讲清楚,很抱歉。
masak TimToady: I guess that's why they're useful for IoC.
Juerd TimToady: I simply started there, and read it from top to bottom, so in alphabetical order. After reading it, I had a HUGE list of things that I didn't understand, which I then looked up in other perldocs.
TimToady: Then, I read perlfunc again and I could make a lot more sense of it.
masak brrt: yes, they do. but the model they replace it with, while less simple, feels like "the next step up", and is occasionally *really* useful. 13:49
TimToady Juerd: that's how I learned things when I was younger
au <- pretty much did the same thing as Juerd ... haven't read the Camel book until 2005 or so
masak hm, would it be possible to create a lambda calculus without closure semantics? would it still be Turing complete?
Juerd TimToady: I still learn like this, only now my primary focus is syntax, not functions. 13:50
Perl's to blame for that, I'm sure.
brrt masak, its true, i think closures are really useful and nice 13:51
but
they can be prohibitively painful
13:52 kaleem joined
au masak: sure, it's called Combinatory logic 13:52
(or, more specifically, SKI calculus) 13:53
masak oh, right.
and that feels equal in power. which makes sense, because the Turing machine doesn't think in closures either. 13:54
13:54 atrodo joined 13:57 sftp joined 13:58 denisboyun joined 13:59 domidumont left 14:05 denisboyun left
masak wonderful, Guy Steele defines algebraic properties in terms of what things don't matter. 14:06
14:07 b1rkh0ff left
masak "associative: grouping doesn't matter" -- "commutative: order doesn't matter" -- "idempotent: duplicates don't matter" -- "identity: this value doesn't matter" -- "zero: other values don't matter" 14:07
very nice.
tadzik curious 14:08
14:08 denisboyun joined 14:09 FROGGS joined, PZt left 14:15 denisboyun__ joined 14:16 denisboyun left, arnsholt left 14:18 PacoAir joined 14:19 b1rkh0ff joined 14:20 denisboyun__ left 14:21 xinming left, FROGGS left, xinming joined 14:22 FROGGS[mobile] joined, bluescreen10 joined
FROGGS[mobile] airports are boring 14:23
14:23 PacoAir left, PacoAir joined, domidumont joined
masak FROGGS[mobile]: sethgodin.typepad.com/seths_blog/20...orts-.html 14:26
wow, someone should do search.cpan.org/dist/Acme-Pythonic/...ythonic.pm as soon as we have savvy enough slangs, and then blog about why slangs are better than source filters ;) 14:36
14:37 fgomez joined 14:39 krunen joined 14:41 kaare_ joined 14:42 kivutar left 14:45 denisboyun joined 14:49 denisboyun left 14:53 stopbit joined 14:54 denisboyun_ joined
diakopter masak: all Turing machines run on Chuck Norris' brain 14:58
brrt chuck norris is the reference turing machine
14:58 kaleem left
masak :) 14:58
Turing machines work because Chuck Norris allows them to do so. 14:59
brrt turing completeness is a subset of norris-completeness 15:00
15:02 denisboyun_ left
FROGGS[mobile] :op 15:11
15:13 arlinius joined, kivutar joined 15:15 FROGGS[mobile] left, hoelzro|away is now known as hoelzro 15:18 skids joined 15:20 fgomez left 15:22 tojatoja joined 15:41 Targen left 15:45 isBEKaml joined 15:49 hulu left 15:50 kresike left
isBEKaml hello, #perl6! 15:50
masak isBEKaml! \o/
sorear: in the category of sets, why are singletons terminal objects? 15:51
15:51 am0c joined
masak more specifically, what is the unique morphism leading to a singleton object? 15:51
isBEKaml Categorical greetings, masak! :) 15:54
hoelzro greeting :: IO () 15:55
masak monomorphic salutations!
isBEKaml
.oO(Greetings are perpetually trapped in IO monad)
15:56
15:57 steven__1 left 15:58 steven__ joined, tojatoja left
isBEKaml acm.wustl.edu/functional/io-monad.jpg =) 16:03
16:04 MAAHZSY joined
masak aww 16:08
yes, it's a little-known fact, that the inside of the IO monad looks like a shower. 16:09
isBEKaml that's why people do unsafePerformIO? :P 16:12
16:15 kivutar left
masak I doubt that. under the analogy, unsafePerformIO needs to look like a shower with pipes exposed or something. 16:16
isBEKaml I could pull in another analogy, but it won't be safe on IRC. :) 16:20
masak unsafeAnalogyIO 16:21
isBEKaml eggjactly 16:27
16:37 MikeFair__ left, MikeFair_ joined 16:43 spider-mario joined, domidumont left
jnthn fail, I was reading day's hot shoe on the subway and I missed my stop... 16:48
phenny jnthn: 04 Feb 22:52Z <tadzik> tell jnthn deletepos pullrequested as well :)
masak jnthn: that's how interesting the backlog is! :P 16:49
isBEKaml jnthn: day's hot "shoe" ? 16:50
16:51 Su-Shee left
masak isBEKaml: IR clogs are warm, because infrared is warm. 16:51
isBEKaml: "IR clogs", "IRC logs". bad pun. 16:52
groan now.
hoelzro haha, IR clogs
isBEKaml groans
hoelzro nightvision clogs.
grondilu r: say (pi+20)**i 16:53
p6eval rakudo 935c90: OUTPUT«-0.99999999924368-3.88926694022219e-05i␤»
isBEKaml r: my $foo = 4.0 * atan(1.0); say $foo; 16:54
p6eval rakudo 935c90: OUTPUT«3.14159265358979␤»
16:55 FROGGS joined, cognominal joined
FROGGS masak: would it be possible to do Inline::C as a slang? 16:58
are there resources about slangs?
couldn't find any right now
16:58 SunilJoshi joined
isBEKaml r: my $foo = 4.0 * atan(1.0); say $foo; ($foo == pi).say 16:59
p6eval rakudo 935c90: OUTPUT«3.14159265358979␤True␤»
masak FROGGS: we don't know nearly enough about slangs yet. 17:00
17:00 brrt left
FROGGS k 17:02
17:02 daxim left
GlitchMr- .u į 17:04
phenny U+012F LATIN SMALL LETTER I WITH OGONEK (į)
GlitchMr- .u ǫ̈
phenny U+01EB LATIN SMALL LETTER O WITH OGONEK (ǫ)
U+0308 COMBINING DIAERESIS (◌̈)
jnthn FROGGS: Yes, if only we knew how slangs worked ;)
17:05 SunilJoshi1 joined, SunilJoshi left
FROGGS no specs? 17:08
sounds like a job for TimToady++
:o)
GlitchMr- .u fi
phenny U+FB01 LATIN SMALL LIGATURE FI (fi)
GlitchMr- rn: 'fi' ~~ m:i/ fi /
p6eval rakudo 935c90, niecza v24-18-gaf64300: ( no output )
GlitchMr- rn: say 'fi' ~~ m:i/ fi /
p6eval niecza v24-18-gaf64300: OUTPUT«False␤»
..rakudo 935c90: OUTPUT«#<failed match>␤»
17:09 hoelzro is now known as hoelzro|away
GlitchMr- rn: say 'fi' ~~ m:i/ fi / 17:09
p6eval niecza v24-18-gaf64300: OUTPUT«False␤»
..rakudo 935c90: OUTPUT«#<failed match>␤»
GlitchMr- eval: use utf8; 'fi' ~~ m/fi/i ? 'true' : 'false'
rn: say uc 'fi' 17:10
p6eval rakudo 935c90: OUTPUT«FI␤»
..niecza v24-18-gaf64300: OUTPUT«fi␤»
GlitchMr- niecza bug?
flussence hard to tell... perl5 agrees with rakudo, but vim agrees with niecza :) 17:12
GlitchMr- Unicode standards 17:14
flussence
.oO( the great thing about them is there's so much reading material! )
17:15 domidumont joined, FROGGS left 17:29 Gruber is now known as Grrrr
jnthn nom & 17:31
17:31 domidumont left 17:36 grondilu left 17:37 grondilu joined, isBEKaml left
[Coke] anyone know who "sue spence" is? 17:38
17:40 jerome left 17:41 Vlavv_ joined 17:44 SamuraiJack left, rindolf joined
rindolf Hi all. 17:44
TimToady: hi, here? 17:45
masak ho, rindolf. 17:46
[Coke]: looks like a CPAN author (SUE) with two modules. 17:47
[Coke]: first I thought it was a corny pun (something with "suspence")
er, "suspense". 17:48
rindolf SUE?
Sue is short for Susan.
Or an alternative word for litigate.
[Coke] rindolf: yes, but neither of those are really helpful. :) 17:49
rindolf [Coke]: ah.
[Coke] Just wondering if she's lurking in here or perhaps she's linked-in-ing everyone with a pause account.
diakopter oh, I got that too 17:50
rindolf [Coke]: ah, oh.
[Coke]: if she's indeed a she. ;-)
masak [Coke]: hm, I'm on PAUSE but I don't have any CPAN modules. didn't get a LinkedIn invitation from any Sue. 17:51
17:53 cognominal left
BinGOs I doubt that Sue is aware that linkedIn is doing that 17:54
geekosaur linkedin like to rifle your address book and invite everyone, yeh 17:55
cosimo [Coke]: she's a London.pm member IIRC
nwc10 She has a daughter. And I think I've seen her husband
s/seen/met/
I've certainly seen pictures
so I think the evidence is that she is a she :-)
18:01 cognominal joined
masak BinGOs, geekosaur: which is why you should never, as a general principle, allow a third-party service to log into your email account. 18:03
geekosaur yep 18:04
unforutnately many third party services go to some effort to trick unsuspecting users into allowing it
rindolf geekosaur: yes. :-( 18:05
geekosaur and/or hide the opt-out 18:06
(and then there's the really evil ones; anyone remember spock.com?)
18:07 cognominal left 18:08 dakkar left 18:09 cognominal joined 18:18 xinming left, kst` is now known as kst
moritz www.perlmonks.org/?node_id=1017212 # Code golf with a readable and short-ish Perl 6 solution 18:19
18:19 Chillance joined 18:20 xinming joined
TimToady masak: yes, GS's definitions are very like how we define our contexts by what we're promising we don't care about 18:21
he and I have similar ideas on the way forward with parallelism, though obviously he expresses it much better than I do 18:22
18:23 cognominal left
TimToady kind of a shame they gave up on Fortress... 18:23
rindolf TimToady: meow! 18:27
18:27 xinming left
TimToady rindolf: meow meow, meow... 18:28
rindolf TimToady: so nice you have to meow thrice!
TimToady: what's up? 18:29
18:29 xinming joined
TimToady I dunno, but whatever it is is stuck in the IO monad... 18:30
colomon moritz++ 18:32
masak TimToady: programming seems to map well to a constructivist subset of mathematics, but not always so well to parts involving proofs or infinities. to me, the challenge of what Steele is talking about is to find nice models/isomorphisms that are pleasant to program with. 18:41
TimToady my challenge is a step beyond that, to find models that *other* people find pleasant to program in :) 18:42
masak moritz++
TimToady in my experience, other people do not always take pleasure in the same things I do...
masak moritz: I love how we folded the Schwartzian transform into the language, so that it really isn't a trick at all :) 18:43
TimToady yes, moritz++, though I was trying to figure out what the +* prefix operator does...
masak TimToady: heh.
numify?
oh, you read it as '+*', I see :P
colomon numify whatever! 18:44
TimToady if I were writing it in production, I'd probably do +(*.split...)
colomon agrees with TimToady
masak meh. just learn to read Perl 6 :P
colomon I actually read it as (+*).split... then realized that didn't make sense
TimToady there's a real weight problem between the methodcall postfix precedence level and the looser symbolic prefix level 18:45
I keep wanting special parens that don't require a matching paren 18:46
could even replace 'do' with the left version of that 18:47
moritz or maybe even *.split(':')[2].Int 18:48
TimToady or that
18:49 arlinius left
masak moritz: do you ever get chewed out for posting Perl 6 solutions to people's problems on PerlMonks? 18:49
TimToady hope so 18:50
'cuz then it means we're to the "Then they fight you" stage
PerlJam TimToady: but I want to be at the "then you win" stage! :) 18:51
TimToady we're still in the "ignore you" stage for most of the rest of the world
masak the problem with the Ghandi model is that projects that ultimately fail also often go through "ignore" and "fight" stages... 18:52
er, Gandhi
TimToady PerlJam: the only thing that will get us there is cussed stubbornness
masak *
masak .oO( don't let the bastards Gandhi you down )
moritz masak: rarely. Sometimes people silently upvote it, sometimes they ask how a particular feature works 18:53
PerlJam whenever I give a Perl 6 solution to some Perl 5 problem on #perl (granted, I haven't done that in a while), I get questions about the code or Perl 6 or whatever, but no one has been particularly upset about it 18:54
18:55 SunilJoshi1 left
TimToady in addition to being stuborn, I'm very good at tuning out most of the noise, including the entire maelstrom around forking Perl 5 18:55
*stubborn
masak I may have said it already, but my two impressions from talking about Perl 6 at FOSDEM (to mostly Perl 5 people) were similar: (a) people *like* Perl 6, overall, and (b) I had partly forgotten what an improvement it is, and the crowd's reaction reminded me. 18:56
rindolf TimToady: can I PM you for a sec? 18:57
masak both of these surprised me a little. guess using Perl 6 for all these years have gotten me used to how nice it is :)
PerlJam masak: if only we had an implementation that hit the magic sweet spot of being featureful enough and fast enough ;-)
rindolf TimToady: I mean private msg.
masak PerlJam: featureful, fast, threads, CPAN.
TimToady darn, was hoping to be a prime minister
rindolf: nobody else asks first :) 18:58
rindolf TimToady: I think you should run for .us government.
TimToady: OK.
TimToady: well, it's common courtesy.
PerlJam masak: why does everyone want threads?
rindolf Nobody gets threads! Larry gets threads.
masak PerlJam: (a) because we promised. (b) because "the free lunch is over" and "welcome to the jungle". 18:59
PerlJam I think "threads" are the catchall for "doing multiple things simultaneously" even if/when we have ways to do that already.
I'm fairly sure many people say "threads" but are really thinking about async IO 19:00
(for instancE)
masak PerlJam: yes, what I really mean is solid support for concurrent and parallel programming.
but events and async sort of gets pulled into that model. 19:01
by the way, if anyone likes such topics, check out the Rx framework and "LINQ to events". real cool stuff. 19:04
19:13 fhelmberger left 19:22 cognominal joined 19:23 arnsholt joined, colomon left
arnsholt 'lo \o 19:24
19:25 viewonly left, Liz joined, Liz is now known as Guest14460, benabik joined
arnsholt phenny: tell jnthn I think I give up this bootstrapping thing. Somehow, once I get NQP updated to the new stuff, I break Rakudo: "Method 'get_lex_type' not found for invocant of class 'Perl6LexPad'" something about "Cannot unbox argument to '$name' as a native str" 19:27
phenny arnsholt: I'll pass that on when jnthn is around.
19:33 geekosaur left 19:34 geekosaur joined 19:40 arlinius joined
masak looks at p6cc2012's t1 19:49
tadzik jnthn: warning: apparently both of my patches to nqp-jvm are Rong :( 19:53
I'll fix them soon
masak tadzik: what happened to them why what why 19:57
tadzik masak: they have the 'start' attribute, which I forgot to respect 19:58
it's almost always 0, except when it's not, e.g. you shift() from the array
masak ah.
tadzik so you need specially crafted tests to catch that :) 20:02
masak mmm, tests. 20:04
arnsholt tadzik: What do you mean, tests don't automatically reveal every defect simply by virtue of existing? 20:06
I'm shocked, I tell you, shocked =)
masak remember the lesson of the TDD Sudoku incident. 20:07
arnsholt The TDD sudoku incident?
masak the TDD Sudoku incident!
arnsholt Is this like the Perl 6 noodle incident? =)
masak finds link
ravimohan.blogspot.se/2007/04/learn...lvers.html 20:08
the takeaway from that post and subsequent discussion -- for me, anyway -- is that TDD is fine as a methodology, but nothing beats knowing what the heck you're doing. knowing APIs, algorithms, data structures.
tadzik arnsholt: I'm offended
20:09 SmokeMachine left
arnsholt Indeed. If you're not actually sure what you're making, TDD is only so useful 20:09
20:10 colomon joined
arnsholt Which is why there are no tests yet for the project I started today. Still noodling around and prodding the problem space to see what happens 20:10
20:10 bruges joined 20:12 bruges_ left
arnsholt Is there a Nordic Perl Workshop scheduled for 2013, a propos nothing? 20:13
masak it's on its way, it seems.
Copenhagen! \o/ 20:14
moritz has fond memory of eating Japenese food and hacking Perl 6 in Copenhagen
20:15 MikeFair_ left, MikeFair__ joined
masak moritz: just before the Japanese food, you and I were talking about Eiffel. 20:15
swarley mmmm Eiffel
masak (I have an episodic memory. when I remember places, soundbites pop up with them.) 20:16
moritz masak: we were? I don't remember the particular details, but I talk about that language occasionally :-)
arnsholt has good memories of Copenhagen as well
masak moritz: "variants", right? non-negative magnitudes that have to decrease with each loop iteration, proving that the loop terminates. 20:17
TimToady: oh!
TimToady: that's an *excellent* example of "comfortably mapping to a constructivist part of math".
moritz masak: correct. Integers even.
masak yes, 'course.
moritz and I remember discussing macros at breakfast, when we both alternated between "oh, looks like closures" and "htf is anybody going to implement that?" 20:18
20:20 rindolf left
masak moritz: we were groping after all the problems I've now identified and solved. 20:21
moritz: I distinctly remembered there was something that *bothered* us about the closure-like properties. 20:22
like "wait, doesn't it all work out?" -- "hm, oh wait, no..." -- "now I don't even see a problem anymore..."
20:23 Guest14460 left 20:26 benabik left 20:31 benabik joined 20:32 [particle]1 is now known as [particle], Liz_ joined 20:33 Liz_ is now known as lizmat
timotimo masak: you did a talk at fosdem, right? will there be a recording? 20:35
20:35 domidumont joined
lizmat I've made the recording. Not sure if it is good enough, or complete. 20:36
timotimo fosdem is big, isn't it? why are there no proper recordings of all talks? 20:37
lizmat In any case, it will need to be downgraded to something that is easily downloadable
masak I think my prepared talk got recorded, but the battery was out by the second, impromptu one.
lizmat! \o/
lizmat yes, only the first one got recorded
masak lizmat: thanks again for an awesome weekend. :)
timotimo proper as in: taking the audio directly from the speaker's microphones
lizmat masak: you're welcome, it was fun! 20:38
20:38 FROGGS joined
masak lizmat: I'm safely back home. a bit tired, but happy I went. 20:38
lizmat: now the only problem is that I will want to do FOSDEM again ;)
tadzik I'm jealous
lizmat hehe… it is addictive, I know
I just checked: I got the first 20 minutes, which is almost the whole presentation 20:39
it is in HD and it is out of focus :-(
masak :/
tadzik slides! 20:40
lizmat but I think good enough to put out in the world
masak tadzik: coming right up.
tadzik \o/
North, you mean
lizmat but not today.. we're at the Amsterdam.pm meeting right now… 20:42
FROGGS lizmat: and after that you all join booking.com? 20:43
masak tadzik: :P
tadzik: masak.org/carl/fosdem-2013-flying-car/talk.pdf
lizmat FROGGS: been there, done that
masak *lol*
FROGGS I've read yesterday they are hunting for 25 devs again
ahh
;o)
masak today's laugh. :)
tadzik :D
yeah, Warsaw.pm got the message too
I wonder if that means they wish to sponsor PLPW 20:44
FROGGS I guess they would
I'd love to work for them, but I dont wanna move :/
masak not even... to Sweden? :P :P 20:46
(guess who's also hunting for devs) 20:47
lizmat FROGGS: FWIW, if you like working in a fast growing organization in the center of Amsterdam, Booking.com is the place to be
20:48 slavik1 joined
lizmat but don't expect too much time writing tests (at least not in most of the areas of Booking.com) 20:48
you should realize that almost all coding at Booking.com is aimed at getting more reservations. 20:49
masak ...which makes sense, since that's what they do ;)
FROGGS masak++ # the cards example is very good
lizmat if errors in the code cause more reservations (without causing more cancellations), then the code will stay, even if it was in error :)
masak pmichaud++, then :)
20:49 domidumont left
FROGGS lizmat: I can live with that, currently I have to care what tests I write and which not... 20:50
there is nobody who would care
masak: scotland is the only place I'd move to 20:51
.... except maybe risa
lizmat masak: Wendy and I slept most of yesterday, after having brought back the van before 8am :-) 20:52
geekosaur could see moving to sweden, aside from little issues like being able to afford it. and being rather more sysadmin than dev
colomon would definitely consider moving to Newfoundland....
arnsholt geekosaur: The main challenge there is getting the job in Scandinavia. The pay scales with the living expenses =) 20:53
(Also, greetings fellow XMonader =)
timotimo i liked the slides already
FROGGS spaces for free \o/
geekosaur there's thre challenge of *getting* there...
20:55 bluescreen10 left
FROGGS the slides are very good, it covers it well 20:55
masak \o/
people were more positive about the live demo, though. 20:56
timotimo what did you demo?
masak I sat down and started implementing MineSweeper.
TDD style.
timotimo did you demo the enhanced error messages i recently made? :P
tadzik cool
timotimo oh, that's neat
masak timotimo: oh!
timotimo: I *totally* should've done that, and pretended I had made a typo :P 20:57
photo: twitter.com/habanerd/status/297753325011628033
timotimo there's really no need, though ;)
i think i'll try to do moreinput today
lizmat fwiw, Wendy uploaded some time lapse movies from FOSDEM to Youtube 21:04
www.youtube.com/watch?v=5AOUpfAwmAA
skids masak: why not wait until you do make a typo, and pretend you didn't :-) 21:07
cognominal lizmat: with some the usual [french] suspects at the left of the first frame (Maddingue, dolmen?, elbeho)
lizmat indeed…. :-)
21:13 benabik left
tadzik bah. I'm sure my deletepos is buggy, but I can't reproduce a bug :/ 21:15
arnsholt I hate those 21:16
masak a... heisenbug?
tadzik not really
it makes me think I don't understand the problem
masak, my dear bug wizard..
TimToady nr: sub r2cf(Rat $x is copy) { gather $x [R/]= 1 while ($x -= take $x.floor) > 0 }; say r2cf(1.4142136) 21:17
p6eval rakudo 935c90: OUTPUT«===SORRY!===␤Preceding context expects a term, but found infix = instead␤at /tmp/WXbDH1h_R_:1␤------> b r2cf(Rat $x is copy) { gather $x [R/]=⏏ 1 while ($x -= take $x.floor) > 0 }; sa␤»
..niecza v24-18-gaf64300: OUTPUT«1 2 2 2 2 2 2 2 2 2 6 1 2 4 1 1 2␤»
TimToady dunno if you have that one yet
21:17 benabik joined
tadzik masak: if you could look at github.com/tadzik/nqp-jvm-prep/blo...e.java#L37 21:17
masak don't think so.
FROGGS TimToady: \o/
masak submits TimToady's rakudobug
tadzik I think it's wrong 'cos it doesn't respect this.start 21:18
FROGGS TimToady: do you have time to look at my pull request?
tadzik so in my opinion, a following should trigger a bug:
masak tadzik: sorry, a bit too distracted right now.
tadzik oh, sure
masak tadzik: if you could produce a golfed failing test... :)
tadzik but that's the problem! :)
masak yes, I know.
no excuses. try it. 21:19
TimToady FROGGS: I'll try to get to it
masak if the bug escapes your grasp, it simply means that your net is too sparse.
FROGGS thanks
:o)
tadzik masak: that's the whole point. I can't write a failing test :P
raiph__ "Longest token match shouldn't make any difference on the speed of parsing" 21:20
true? partly? false?
masak tadzik: then what makes you think it's a bug?
raiph__: compared to ordinary Recursive Descent? I think LTM performs better. 21:21
arnsholt A big piece of code that fails, I guess
tadzik masak: instinct and pencil+paper simulations
and it makes me think I'm stupid :)
masak tadzik: reduce, reduce, reduce.
tadzik: inside every big interesting problem is a small interesting problem, fighting to get out. 21:22
tadzik I got it reduced to 3 calls, still works
masak r: my $x; $x [R/]= 1
p6eval rakudo 935c90: OUTPUT«===SORRY!===␤Preceding context expects a term, but found infix = instead␤at /tmp/95XYnmRMtC:1␤------> my $x; $x [R/]=⏏ 1␤»
FROGGS n: my $x; say $x [R/]= 1 21:24
p6eval niecza v24-18-gaf64300: OUTPUT«Use of uninitialized value in numeric context␤ at /home/p6eval/niecza/lib/CORE.setting line 1287 (warn @ 5) ␤ at /home/p6eval/niecza/lib/CORE.setting line 294 (Any.Numeric @ 8) ␤ at <unknown> line 0 (ExitRunloop @ 0) ␤ at /home/p6eval/niecza/lib/CORE.s…
FROGGS n: my $x = 0; say $x [R/]= 1
p6eval niecza v24-18-gaf64300: OUTPUT«Inf␤»
FROGGS n: my $x = 1; say $x [R/]= 1
p6eval niecza v24-18-gaf64300: OUTPUT«1␤»
FROGGS ahh
masak n: my $x = 1; $x [R/]= 2, 3, 4; say $x
p6eval niecza v24-18-gaf64300: OUTPUT«2␤»
masak n: my $x = 1; $x [R/]= (2, 3, 4); say $x 21:25
p6eval niecza v24-18-gaf64300: OUTPUT«3␤»
raiph__ masak: the longer comment (by someone else) was "NFA precomputation is constructing an lr-0 or lr-n automaton and using lookahead to eliminate states. Once you have the rule, you can order your backtracking search across the states. For packrat, it goes in left-to-right, for perl 6 rules, it goes by the length. The speed is relatively unchanged by order." 21:26
TimToady
.oO("but what's 3 orders of magnitude among friends")
21:28
masak raiph__: ok, then it seems like it's comparing packrat (which I don't know) against LTM. 21:29
s/LTM/Perl 6 LTM/
raiph__ masak: my intuition was that for many grammars/inputs LTM declarative prefixes make a good pragmatic match and *would* be significantly faster 21:30
21:30 lizmat left 21:31 kaare_ left
masak raiph__: faster than *what*? 21:31
you can't avoid scanning the source string once.
TimToady well, P6 uses LTM to drive a recursive descent engine, so it really depends on how well we drive :)
masak I mean, with Boyer-Moore, you can sometimes do good guesses and beat O(n), but... 21:32
TimToady currently we do end up matching everything twice
masak Recursive Descent is not well-known for being fast, IIUC.
TimToady in the absence of captures or other side effects, we could optimize away some of the duplicate matching
sorear masak: The unique morphism from a general set S to a singleton set {x} is... a constant function! 21:33
TimToady masak: that's mostly the fault of precedence hierarchies, which we sidestep
and secondarily the fault of making bad probes, which LTM bypasses
masak sorear: oh urgh. that was too easy :P 21:35
TimToady what you'd really like to do is cache activation records relative to the beginning of the token, then magically do a goto the middle of a matcher that is several levels down, where it will eventually be with the cursor at the end of the token 21:36
masak sorear: does that mean that "doubleton sets" {x, y} are also terminal sets? I'm confuzzled again. 21:37
TimToady but I don't think anyone has invented future continuations quite yet
masak s/terminal sets/terminal objects/
sorear masak: No, because there are two inequivalent functions from {x} to {x,y}
masak: The number of functions from S to T is #T ** #S. It is 1 if #S == 0 or #T == 1 21:38
masak gotcha.
nice.
diakopter TimToady: can you explain that more?
TimToady when you match LTM, the returned "fate" determines the next one or several recursive calls and their associated decisions, until the RD parser catches up to the position that the LTM got to 21:39
diakopter that's conceivably doable 21:40
TimToady it would be nice to have a way to cache those activation records, and any associated new Cursors (they'd have to encode relative positions somehow), such that it looks after taking the "continuation" like you did all the code without doing it
well, sure, I just conceived it, but that's not quite doing it :P 21:41
diakopter I would maintain a stack of descent commands while NFAing 21:42
TimToady I suppose one approach would be to emulate recursive descent with your own stack, making sure that the "continuation" was self contained, then remembering it
depending on what you mean by "commands", that's what STD did with its "fates" 21:43
but that didn't prevent actually having to do the calls afterward
diakopter which alternation to take
TimToady that bit is a solved problem
STD already did it
(not sure if the current version still does though) 21:44
21:45 arlinius left
TimToady I'm talking about doing something a bit more stackless, that you could look at the set of pads and Cursors that would be created by a particular LTM, and somehow bundling that up to a reusable thing you just poke somewhere and you're magically already several levels deep in call, and at the correct cursor position to begin the non-declarative bits of the pattern 21:46
(I'm not suggesting anyone try this soonish, it's just an idea for an eventual optimization) 21:47
Cursors currently hold an absolute position, so could not be reused that way without relocation logic
21:48 benabik left
diakopter which alternation to take, also how many times each quant succeeded 21:49
TimToady and the parser currently relies rather too heavily on dynamic variables, which would also have to be accounted for somehow
masak TimToady: with enough effort, anything can be CPS-transformed into a state machine. then you can do the trick you mention.
I'd certainly like to try it at some point.
raiph__ TimToady: thanks 21:51
TimToady we're using recursive descent not because it's fast, but because mere mortals can understand it a little more easily; that doesn't preclude cheating^Woptimization, as long as we don't get caught 21:52
[Coke] aloha, seen bacek? 21:53
masak ENOALOHA
[Coke] masak: irclog.perlgeek.de/search.pl?channe...mp;q=aloha 21:54
dalek d: 3725e26 | (Tobias Leich)++ | STD.pm6:
move $( ~ ) into variable token

This way contextualizers in code, quotes _and_ regexes behave the same.
d: da06458 | (Tobias Leich)++ | CORE.setting:
Merge branch 'master' of git://github.com/perl6/std
d: 7551b8f | larry++ | STD.pm6:
Merge pull request #4 from FROGGS/master

move $( ~ ) into variable token
[Coke] at a guess, we might have lost any data it had accumulated.
FROGGS yay 21:55
TimToady FROGGS++
raiph__ FROGGS++
FROGGS thanks :o) 21:56
[Coke] who maintains dalek on feather? can we run aloha next to dalek?
TimToady FROGGS++ # for persistence
raiph__ TimToady++ # for persistence (25 years and counting)
TimToady
.oO("He was fishing with the persistence that many mistake for patience." --Field and Stream)
21:57
22:00 benabik joined
TimToady I remember reading that when I was a teenager. 22:00
masak TimToady: Leslie Hawthorn's FOSDEM talk about community leaders made me ask myself whether you've ever had a burnout relating to the Perl venture. 22:04
raiph__ TimToady: what a striking quote
22:06 skids left 22:10 PacoAir left 22:11 am0c left 22:14 donaldh joined
TimToady masak: as long as each burnout is matched by a subsequent burnin, nobody can tell the difference between that and bipolar disorder :) 22:15
22:17 Juerd left, Juerd joined, spider-mario left
masak I guess. :) 22:19
TimToady: was there ever a point when you went, "hm, this Perl thing could turn out to be quite popular. maybe even dozens of users"? :) 22:20
TimToady I never didn't think that. 22:22
I'd already released several popular things. 22:23
so Perl was born popular :)
masak hehe.
22:26 cognominal__ joined 22:28 cognominal left
swarley I wish I better understood how virtual machines work, I always day dream about having the know how to plan it out. I made my own tiny little vm once, but it was just like ObjC's retain/release, didn't really do much 22:30
masak swarley: follow your dreams. learn by building stuff. 22:32
geekosaur they execute code, they provide some way t evoke system services from the vmm (either via emulated hardware or special instructions)
swarley well that I understand 22:34
geekosaur and there are different varieties of virtual machine --- they can emulate hardware like vmware/parallels/virtualbox, or provide their own custom environment like the JVM/CLR/most Smalltalk VMs, or be something like LLVM which is sort of the latter but whose bytecode can be further "compiled" into optimized (if suitably annotated) native code
swarley But there is much more theory to it than that, that i don't understand
dalek p: 09bd1bc | (Tobias Leich)++ | src/QRegex/P6Regex/ (2 files):
removed metachar:sym<$( )>

Which was my first approach to support contextualizers. Since this is not the way STD does it, and since it doesnt work right, it gets reverted.
22:36
p: 1fb778f | (Tobias Leich)++ | src/HLL/Grammar.pm:
move <sigil> and <twigil>

  ... to HLL::Grammar since we are using it from NQP::Grammar
and Perl6::Grammar.
swarley the main issue i have is thinking of how to abstract types, like the idea of class inheritance is very blurry for me when i start thinking as to how it would be when everything is compiled
p: 2c13753 | (Tobias Leich)++ | src/NQP/ (2 files):
move $( ~ ) into variable token

This way contextualizers in code, quote and regexes do all the same, and we can get rid of circumfix:sym<sigil>.
kudo/nom: d77b765 | (Tobias Leich)++ | / (3 files):
move $( ~ ) into variable token

Contextualizers do work and litvar.t is parseable now.
22:37
kudo/nom: 0dda4c8 | (Tobias Leich)++ | tools/build/NQP_REVISION:
bump NQP revision
swarley And prehaps more sophisticated garbage collection techniques 22:38
22:39 cognominal__ left
benabik GC is "exciting" to program, since errors express themselves as creeping memory corruption instead of big errors. 22:39
22:40 cognominal__ joined
swarley I really wish I had a better idea of how to implement a language like nqp. It's quite fascinating. I stopped development on the nqp-yarv because i benchmarked a large code sample and it's terribly inefficient.. I'd love to try it in llvm, but I really know next to nothing about llvm 22:42
benabik NQP on LLVM would be interesting, but also painful. LLVM provides _no_ language support, so you have to build everything from scratch. 22:43
Things like GC, objects, IO, etc.
swarley ah
Well, I don't imagine it would be too terrible 22:44
benabik It is a *low-level* virtual machine, after all. :-D
swarley I think the hardest part would just be learning llvm
I was trying to decide on a parser generator. I'm not sure if I want to go with flex/bison or ANTLR3
PerlJam swarley: Perl 6 ;) 22:45
swarley I want it output in C/C++ :p
I looked at lemon, and I thought it was neat, until I saw how terribly inconvenient it was 22:46
PerlJam Using Perl 6 does not preclude outputting C
:-)
swarley Oh, I suppose you're right..
tadzik swarley: did you consider JVM?
swarley We already have nqp-jvm, I believe jnthn is working on it 22:47
hm.. I wonder how I would output C++ with perl6 22:48
tadzik yeah
it's pretty nice, if you ask me :) nqp-jvm
22:48 shinobicl left
tadzik and performance is promising so far, even surpassing Perl 5 22:48
swarley I guess I would create nodes and just have them dump to text?
benabik swarley: You can skip the nodes if you don't intend to manipulate them. Just have action methods that print code. 22:49
swarley I'm not sure really. I need to learn more about llvm 22:50
I have __no__ idea how it does classes
benabik It doesn't.
swarley yeah, i know
I mean how it fakes them
Or how _you_ would fake them 22:51
Well, NQP isn't supposed to have dynamically generated methods is it?
benabik Any way you want. :-D Learning LLVM is not so different from learning assembly.
swarley You say that like it's not a bad thing :p
22:52 shinobicl joined
benabik I'm a big fan of learning how computers actually do their thing. High-level languages are great, but if you don't know how it's put together you can create horrible code. 22:52
swarley Yeah, I like assembly, but it's not a walk in the park to learn 22:53
timotimo first attempt at "moreinput" handling in rakudo is compiling now :)
i've got pretty much no idea how to properly test this short of running a perl6 interpreter and communicating with it, or writing a different frontend or something
dalek ast: cdf2b0a | (Tobias Leich)++ | S05-metasyntax/litvar.t:
first tests for contextualizer $( ), cleanup
22:54
benabik To some extent, LLVM IR is assembly-lite. It handles things like register allocation, calling conventions, etc.
timotimo it seems like i broke it 22:56
swarley Oh alright.. I see how you fake classes in llvm
benabik s/fake/implement/ 22:57
swarley I prefer fake
Because it's not a class
It's a struct
geekosaur how do you fake classes in x86 assembly? much the same answer for llvm...
swarley And then you just name the functions with a namespace
geekosaur "class" is kinda at a diferent level of abstraction
whicg gets back to what I was saying about the different kinds of VMs 22:58
timotimo i kind of dislike that rakudo signalises "wrong grammar" not by an error but by not terminating when trying to build the seting :( 22:59
23:05 FROGGS left 23:09 colomon left
timotimo oh, *now* it compiles 23:11
23:11 cognominal__ left 23:12 cognominal joined, pmurias joined
swarley It would be neat to use the erlang vm as well. But I'm sure that, that is more hellish than llvm 23:12
pmurias swarley: re terribly inefficient, yarv itself or the code nqp-yarv generated? 23:13
swarley the way that you have to load the yarv sequence
23:13 benabik left
swarley it turns into a massive ruby data structure 23:13
There is no way to just use the yarv vm independently as of yet 23:14
pmurias and creating the data structure is slow? or converting it to yarv bytecode? 23:15
swarley It's just that once your program gets anywhere past a few tens of lines, you have a thousand element array
so, trying to run NQP would end up with a massive array sitting in memory 23:16
pmurias shouldn't the number of opcodes for a line be relatively small? 23:17
like 10x
23:19 donaldh left
swarley well, each opcode is wrapped in an array 23:19
and each arg, if it's any sort of complex type
is wrapped in an array 23:20
I'll continue the project if they expose an API for compiling it to actual bytecode that doesn't require it to be in a ruby data structure
jnthn phenny: tell me stuff
phenny Hey, I'm not as stupid as Monty you know!
jnthn: 19:26Z <arnsholt> tell jnthn I think I give up this bootstrapping thing. Somehow, once I get NQP updated to the new stuff, I break Rakudo: "Method 'get_lex_type' not found for invocant of class 'Perl6LexPad'" something about "Cannot unbox argument to '$name' as a native str" 23:21
23:21 cognominal left
jnthn phenny: tell arnsholt I'll look at it once I'm home tomorrow, or maybe on Thursday when I don't have to care about anything other than Perl 6 stuff :0 23:21
phenny jnthn: I'll pass that on when arnsholt is around.
timotimo this moreinput stuff doesn't quite seem to work yet >_<
23:22 cognominal joined
swarley i dislike that the parsing method that llvm recommends is just creating your own 23:22
i can't imagine doing that for anything of scale 23:23
pmurias you mean just creating your own parser?
swarley: which ruby version do I need for RubyVM::InstructionSequence​.load(iseq_structure) to work? 23:24
timotimo not being able to debug the grammar rakudo uses to parse your code makes this a bit harder than i'd like :( 23:25
jnthn swarley: The ONLY way that is sane to parse Perl 6 (NQP included) is to write the grammar in perl 6. 23:26
timotimo (which is still better than how to parse perl5) 23:27
jnthn Which menas you take an existing Perl 6 of NQP parser and write a backend.
timotimo Error while compiling, type X::::::::C::o::m::p::::::::N::Y::I feature: multi-dimensional indexes - lol wut?
diakopter lol 23:28
23:28 cognominal left
masak something went wrong in that error message... :) 23:29
timotimo can't hack on the grammar without weeeiird things happening
huf still not as good as Error: Success (0) 23:30
timotimo yeah, but at least that one's understood pretty well
23:30 cognominal joined
pmurias jnthn: what features of NQP make it diffcult to parse? 23:31
timotimo did moreinput work in STD at all, ever? 23:32
swarley pmurias, 2.0
23:32 skids joined
pmurias jnthn: it has a inmutable grammar, so any old tool (yacc, handcoded recursive descent) should be sane 23:32
23:32 stopbit left
timotimo it seems like a good idea to put an alteration into <ws> to match end-of-string and then grab more text, but it doesn't seem like it gets hit at all?! 23:32
swarley jnthn, why is it insane to try something else? 23:33
pmurias swarley: because the grammar in Perl6 is extendable
jnthn OK, fine, do what you like. I don't care, I'll do it the way I've spent the last however meany yars figuring out. 23:34
swarley i was just wondering
jnthn Because it all hangs of protoregexes and they hang off LTM.
pmurias jnthn: that was aimed at me? 23:35
jnthn Doing a Perl 6 parser depends on being able to mix in to the grammar. The roles you mix in then in turn affect LTM.
masak 'night, #perl6
diakopter o/
jnthn pmurias: Not aimed at anyone, just general frustration at trying to do stuff in ways I know won't lead to something viable to build a Perl 6 implementation on... 23:36
anyways, sleep &
timotimo night masak!
night jnthn :)
pmurias jnthn: night 23:37
swarley so wait.. The language can change itself at compile time?
timotimo sure, it's called Slangs
jnthn swarley: Yes, and Perl 6 does every time you declare a custom operator.
timotimo also, every time you add an operator it happens
and macros can have "is parsed /regex/"
swarley alright then.. 23:38
that seems like it would make lexing terrible
pmurias jnthn: re frustration, we should have an perl6-implementation-faq "why don't we use llvm?" ;)
timotimo so, in a perl6 grammar, $ should match "end of string", right? and $( .meth ) should call .meth and try to parse the return value?
diakopter what's this thing you call lexing
jnthn That's why Perl 6 grammars generate the lexer rather than making he user do it ;) 23:39
pmurias: Yes, probably :)
swarley well then
pmurias jnthn: elf had a grammar written in ruby (handcompiled from STD)
swarley this sounds like i'm.. in for not having a fun time!
pmurias jnthn: it was definitely insane 23:40
jnthn Porting NQP is *hard*. But if it's ported and self-hosts then there's a good chance of running on Raudo.
timotimo or should that really be { $¢.moreinput }
like in STD? because that didn't seem to work in rakudos grammar at all :(
diakopter jnthn: it's not hard; I ported 8 rakudos before breakfast
timotimo jnthn: did you mean "running Rakudo"?
jnthn timotimo: yes, sorry
EVERYTIRED :) 23:41
diakopter every tire what?
timotimo man who runs in front of car gets tired, man who runs behind car gets exhausted
it's as easy as that
jnthn timotimo: *lol*
skids :D 23:42
pmurias jnthn: go to sleep, you can always backlog later ;)
timotimo unfortunately you can't throw in remarks and comments into the backlog
jnthn pmurias: Yes, I took your JavaScript effort much more enthusiasticly since I saw the bounded serialization stuff getting ported. A good port of that and 6model and the grammar engine = we can really get Rakudo on JavaScript :)
skids
.oO(MST6P?)
23:43
timotimo github.com/perl6/std/blob/master/STD.pm6#L626 - would this even work in rakudo? i'm not even sure any more if it could, or why. 23:45
23:45 thundergnat joined
jnthn timotimo: Well, that's like { $/.CURSOR.moreinput } 23:46
timotimo: The hard part is writing moreinput
timotimo: Take a look at ParseCommon or something in src/nqp/Cursor.nqp
timotimo it seemed like i would just have to return a string with more text, that's obviously wrong? 23:47
the point is, moreinput isn't even being called when i write incomplete things
jnthn timotimo: No, you need to diddle the orig and target in parsecommon :)
m
oops
timotimo diddle, eh?
jnthn timotimo: A few months ago we didn't even have the parse common thing, so this woulda been practically impossible to implement :)
timotimo heh. all right 23:48
jnthn I changed it partly for doing highwater stuff, but also for moreinput and for textual macros ;-)
timotimo oh, textual macros, eh?
jnthn Anyway, you can now change the target string the grammar is parsing.
timotimo src/QRegex/Cursor, this one? 23:49
jnthn aye
timotimo i don't see a parsecommon in there :( 23:50
maybe ParseShared?
jnthn That's 'cus it's called ParseShared :)
It's $!orig and $!target in there that need to change when there's more input.
timotimo right. would i then restart the parse from the beginning, though? 23:51
lue wonders what moreinput is 23:52
timotimo lue: when you type something like sub blubb() { and hit newline, in "good" repls, you're asked to enter another line 23:53
thundergnat jnthn: Is there any way to manually refresh the method cache for augmented types?
timotimo rakudo will currently just say "there's stuff missing!" and you'd have to retype everything into one line
lue ah, OK
timotimo i see i bit off more than i can chew ... again 23:54
jnthn thundergnat: It's the method cache of its subtypes that is the problem. 23:55
thundergnat Yeah
jnthn thundergnat: SubType.^publish_method_cache() # should do it
thundergnat That has to be done for each subtype I want to see the method? 23:56
jnthn thundergnat: Yeah. I need to fix it to actually do sub kinda publish/subscribe. Problem: anonymous subtypes (like mixins) need it to be a weak ref...
Which is...fun ;)
thundergnat Heh... I could imagine... 23:57
jnthn It's on my todo list. But my todo list is like...well. :) 23:58
timotimo i suppose i'll try to do i another time
moritz jnthn: I tried to make variables in sink context warn, but the problem is that we introspect the LHS QAST tree for stuff like binding and assignment
thundergnat jnthn: Yeah... I could imagine that too. Thanks. 23:59
moritz and also it immensely increased the size of the QAST tree when I wrapped each variable in a QAST::Want
jnthn moritz: Yeah, but maybe the optimizer can track it.
moritz jnthn: so my next idea: maybe we could set up a callback in QAST::Compiler that is called for each QAST node in void context that's not a QAST::Want