»ö« 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.
[Coke] found a few files with a 100+ tests where pugs errored out after the first 5, so that was a win. ;) 00:00
00:02 ascrazy left 00:03 Guest67167 joined 00:05 fsergot joined 00:10 Guest67167 left
[Coke] b: (20298*.25)-4632 00:18
p6eval b 1b7dd1: ( no output )
[Coke] b: say (20298*.25)-4632
p6eval b 1b7dd1: OUTPUT«442.5␤»
colomon [Coke]++ 00:30
00:34 ribayr joined
colomon So, we have (basically) three ways of shelling out? 00:37
"qx" -- takes a command line, returns stdout. (maybe stderr too?)
00:38 packetknife left
colomon shell: takes a command line, returns Proc::Status 00:38
run: takes command and list of arguments, returns Proc::Status
sorear colomon: stdout only 00:41
there is shell and p5 precedent for sending stderr directly to the terminal
colomon works for me... 00:42
sorear but yes, I agree with your assessment of the ways
00:42 plobsing left, geekosaur left
colomon what's frustrating is it seems like this is a total mismatch with the available C# library methods. or maybe I'm missing all the good ones 00:43
sorear are you still looking at SDP?
colomon yes 00:44
sorear it's a total mismatch with the winapi too
fits pretty well with posix though - execl, system, popen
00:45 ribayr left 00:46 ribayr joined, packetknife joined 00:47 geekosaur joined
colomon does Mono.Posix have execl? 00:47
sorear yes, but not fork, which makes it a lot less useful
ah, you're speechless too. 00:48
colomon actually, just trying to find documention
you mean you have to end your current process to use it? 00:49
sorear yes
well, re-use, not end so much
colomon okay, so that's not helpful
00:54 am0c joined
colomon does mono have popen? I'm not seeing it in google searches.... 00:54
sorear I didn't find it.
colomon so it does seem like some unholy combination of GLib.Process.SpawnSync and SDP? 00:57
oooo, wait, SpawnCommandLineSync
!
that sounds promising for "qx"
01:00 tokuhirom left 01:07 bitpart joined 01:08 bitpart left 01:13 scott_ joined, scott_ is now known as Guest25148
colomon niecza> qx/ls/ 01:17
Bag.pl
FETCH_URL 01:18
Fathers_Jig.mp3
(etc)
01:21 plobsing joined 01:52 sisar joined
dalek ecza: 50e27f4 | (Solomon Foster)++ | lib/ (2 files):
Rough implementation of rungather (ie qx and qqx).
02:05
02:10 am0c left
sorear colomon!! 02:15
I mean colomon++
o/ sisar
02:15 sisar left
colomon sorear: still need to get the SDP versions written and working 02:18
sorear colomon: is this even possible with SDP? 02:19
colomon System.Diagnostics.Process.StandardOutput ... so I think so 02:20
dalek ast: 6cdc350 | coke++ | / (16 files):
pugs fudges
02:23
gs.hs: b88c3a7 | coke++ | t/spectest.data:
run fudged tests
ecza: ac5e469 | sorear++ | tools/extheapshot.c:
[extheapshot] Start adding new-style printers
02:26
02:26 bonsaikitten left, bonsaikitten joined 02:39 birdwindupbird joined 02:43 woosley joined 02:45 thou joined 02:56 NamelessTee left
dalek ecza: a93b4b8 | sorear++ | lib/Cursor.cs:
Lexer need not retain the LAD trees
03:03
colomon oooo, just got a basic SDP version of qx/ / working 03:13
03:21 orafu left 03:25 orafu joined 03:33 odoacre joined, birdwindupbird left 03:35 birdwindupbird joined
colomon sorear: how do you find the length of a string in C#? 03:37
sorear .Length
colomon sorear++ 03:38
ah, it's a property, not a method 03:39
sorear niecza: printf "%5d%5d", 2,3 03:41
p6eval niecza v14-90-ga93b4b8: OUTPUT«Unhandled exception: index out of range␤ at /home/p6eval/niecza/lib/CORE.setting line 0 (sprintf @ 1) ␤ at /home/p6eval/niecza/lib/CORE.setting line 1237 (printf @ 3) ␤ at /tmp/hBFSke07v7 line 1 (mainline @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting …
sorear niecza: printf '%5d%5d', 2,3 03:42
p6eval niecza v14-90-ga93b4b8: OUTPUT«Unhandled exception: index out of range␤ at /home/p6eval/niecza/lib/CORE.setting line 0 (sprintf @ 1) ␤ at /home/p6eval/niecza/lib/CORE.setting line 1237 (printf @ 3) ␤ at /tmp/ipqHxmh1qf line 1 (mainline @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting …
sorear niecza: say 25.fmt('%5d')
p6eval niecza v14-90-ga93b4b8: OUTPUT« 25␤»
03:48 am0c joined 03:53 birdwindupbird left
dalek ecza: de628e4 | sorear++ | tools/extheapshot.c:
[extheapshot] Improve time handling for higher frequencies
03:56
ecza: 7376b10 | sorear++ | src/NieczaFrontendSTD.pm6:
Add an option to display stats on @*MEMOS usage
sorear niecza: say Any.keys 03:58
p6eval niecza v14-90-ga93b4b8: OUTPUT«0␤»
04:00 wolfman2000 joined 04:01 lestrrat left 04:02 lestrrat joined
dalek ecza: e8df2d9 | (Solomon Foster)++ | lib/Builtins.cs:
Add System.Diagnostics.Process-based implementation of command_qx as a backup in case the GLib.Process.SpawnCommandLineSync cannot be found.
04:06
colomon sorear: If you get chance to look that one over, please do. Once we've had time to pound on that a bit, I'll clone it for run and shell, too. 04:07
dalek ast: c158aed | (Solomon Foster)++ | S02-literals/quoting.t:
Unfudge qx tests.
04:08
sorear observation: niecza's parser will benefit a lot from improved collection types 04:18
04:37 sftp left 04:38 sftp joined, packetknife left 04:51 mucker joined 05:05 unobe left 05:25 birdwindupbird joined 05:29 kaleem joined 05:34 worr joined 05:45 razor42 left 05:55 birdwind1pbird joined 06:01 lestrrat left 06:02 skids left, lestrrat joined 06:11 s1n joined 06:20 mishin joined 06:28 bbkr left 06:37 birdwind1pbird left 06:43 wtw joined 06:45 takesako left, fsergot left 06:46 takesako joined 07:22 mj41 joined 07:24 agentzh joined
TimToady Here's a funny new RC entry: rosettacode.org/wiki/Amb#Perl_6 07:44
it only works in niecza because I've used 'next' in a custom operator to skip X cross entries, and niecza obviously uses a loop that responds to 'next'
sorear I think it's a bug also 07:46
@a Xlf @b Xlf @c should call lf on 3 args at a time
because Xlf should have list assoc
(that could be worked around with a sprinkling of dos, of corse) 07:47
TimToady well, X with a binary op should still work
sorear worse, I think that might only be working because of mostly-eager-ness 07:48
07:49 proller_ joined 07:50 proller_ left
doy wow, the perl5 one there is kind of hilarious 07:50
07:52 proller_ joined
TimToady if we force it to consider 4 args at a time, then we lose the benefit of nexting out of an earlier loop and not even constructing much of the search tree 07:53
so nexting out of binary ops seems like a feature to me
sorear I think this may be the first I've seen anyone use perl5's glob builtin. 07:56
08:01 proller_ left
Tene sorear: I used it yesterday. 08:04
08:04 proller joined
sorear ... 08:05
I just realized niecza is sending undef warnings to STDOUT. 08:06
s/realized/noticed/
08:07 Tedd1 joined 08:11 proller left 08:13 proller joined 08:16 havenn joined 08:18 Jerkwad left
dalek ecza: ed8f7dc | sorear++ | src/ (2 files):
Try to remove a retention path via OUTER::CALLER pointers of parametric role methods
08:19
ecza: e9fbe21 | sorear++ | src/NieczaFrontendSTD.pm6:
Fix spurious reporting of "0" for character positions with no memos at all
ecza: 4c7a3f0 | sorear++ | lib/Cursor.cs:
Remove more unneeded words from NFA.Node and NFA.Edge
08:23 proller left
masak morning, #perl6 08:27
sorear o/ masak 08:31
false alarm on the warnings thing. 08:32
masak: release tocalandarday! 08:33
masak release today? yay! 08:36
08:39 slavik2 left
jnthn morning' 08:40
oops, useless use of abbreviation marker
08:42 grondilu joined
masak morning', jnthn' 08:44
grondilu I wrote sha256 in perl6: s0.barwen.ch/~grondilu/Crypto.pm6 I works, but it's terribly slow: more than 5 minutes to compute a single hash! I think it might be a nice benchmark to test code optimisation and so on. 08:45
jnthn Indeed, thanks. Will give it a run through the profiler. 08:52
(though not during the day...at $dayjob)
grondilu glad you like it. 08:53
sorear I think I'm going to call a break to the niecza memory optimizations now 08:54
The biggest immediate win looks like it will come from storing the line number and whitespace info in compact arrays
which means it looks like S09 is a highish priority for me now 08:55
sorear -> sleep
08:55 grondilu left
masak S09! \o/ 08:58
though S09 is so much more than compact arrays... :) 08:59
it's shaped arrays and hashes, for example.
or arrays with hash indexing. 09:00
nom: say (2**32).^name 09:02
p6eval nom c295b5: OUTPUT«Int␤»
sorear masak: I can do compact arrays and tell everyone "I did as much on S09 as I had time for"
masak :)
'night, sorear. dream of doing the -Ofun parts of S09.
enlightening discussion about time-based releases: blogs.perl.org/users/educated_foo/2...lease.html 09:06
doy "enlightening" 09:08
masak well, what was enlightening to me was the p5p mail and the blog comments. 09:09
doy well, sure
masak not so much the post itself, which is just critique without arguments.
it reminds me of the fact that Perl 5 now has well-established time-based releases, and it seems to be working very well for them. 09:11
bonsaikitten so does KDE
masak there are critics, but it's all a bit of a "past the hump" thing at this point.
bonsaikitten I don't see how one date is more special than the other, and there's too many x.1 releases happening either way
silly users do things you never expect and find new errors
doy well, at this point, it's still pretty easy to say "seriously, just *look* at 5.10" 09:12
(:
(i do think it's a good thing though)
masak it's not about one date being more special than the other. 09:15
it's about getting fixes and improvements into the hands of users in a timely manner.
09:15 havenn left
masak time-based releases are an *insane* idea -- until you understand the basics of CI. 09:16
doy yeah, it's always pretty amazing to me when i see what the perl 5 core's massive testing infrastructure is capable of 09:18
09:18 worr left 09:21 fsergot joined
fsergot Hi #perl6 o/ 09:22
09:29 fsergot left, fsergot joined
masak fsergot! \o/ 09:31
fsergot masak: how are You? 09:32
jnthn o/ fsergot 09:33
09:35 explorer__ joined
masak fsergot: I'm in a good mood. how about You? 09:35
fsergot jnthn: how are You? :-) 09:37
09:37 jferrero left 09:38 woosley left
fsergot I'n at the school. :-( 09:39
masak glad to hear that.
fsergot Why glad? :-) 09:41
masak it's hard to explain. you may not appreciate school right now, but I'm happy that's where you are. 09:42
rather than, say, unemployed or in a motorcycle gang. 09:43
school is a relatively good place to be.
09:45 Guest17202 is now known as Trashlord, Trashlord left, Trashlord joined
jnthn fsergot: I'm fine...doing on-site $dayjob today 09:46
Only two and a half weeks until vacation \o/
moritz ... and only one week until GPW!
masak \o/ 09:47
moritz which reminds me, I have a talk to prepare
jnthn Yay, German beer! \o/
masak yay
moritz and the greeting talk and the goodbye talk and so on
it seems I didn't say "no" fast enough when the organizers were looking for a fool to do it 09:48
jnthn "Ein sehr gut Bierplatz ist hier!"
09:48 kaleem left 09:49 kaleem joined
jnthn Critical opening talk info ;) 09:49
moritz well, it's really more like "on Monday night, we're going out together. Tuesday night is social event (free food)"
jnthn oooh! :D 09:50
09:53 daxim joined
masak say that, and you'll get applause and cheers. 09:54
in fact, go for minimal things like that. you'll be remembered forever. 09:55
"he turned up, said exactly what was needed, and then he faded back into the masses."
moritz I do plan to be brief. People don't attend the workshop to hear me greeting them in length. 09:56
masak the people are geeks. they can find out more details online if they need to :P
jnthn ...provided the workshop has wifi. :) 09:59
moritz it has. In standard crap quality, I fear :/ 10:00
cognominal jnthn, what's the diff between nqp et nqpq? why rakudo is using nqp? 10:01
jnthn nqpq is the work to bootstrap NQP using QRegex
moritz and iirc the nqpq executable uses QRegex for regexes by default 10:02
jnthn yes
well, really nqpq does just that in master
masak .oO( it has a Q in it, so it must be the future )
jnthn It's only in qbootstrap where the real work to bootstrap on it is going on.
But, bs has higher priority at the moment 10:03
cognominal jnthhn: I have a lot of problems with regexen recently. I gather you will go back to them after bs. 10:04
jnthn Well, many of them likely stem from missing mark_commit stuff.
cognominal I will C<gather> after you had a C<take> at it :) 10:05
fsergot masak: You are probably right. :-) 10:09
About school. :-)
10:15 xinming left
masak fsergot: well, to a first approximation, at least. of course, if it sucks, be aware that there are ways of making it a better experience. 10:15
moritz and you can IRC at school. I never could do that :-) 10:16
10:16 bbkr joined
tadzik hello #perl6 10:16
10:18 xinming joined, Guest25148 left
fsergot This is the first time I IRC at school. :-) 10:19
tadzik :) Phones these days :P
masak they're not really phones any more. they're handheld computers with a built-in cell-network radio. 10:20
tadzik true
masak that's what made me start to like them :)
they're an "everything device". phone being one function which is subsumed into the rest. 10:21
they're like Emacs.
tadzik maybe I should buy this handheld computer for meself. People hate my phone these days, for they hear they own voice when talking to me
I thought it's all handled in the baseband, which means there's something seriously wrong with my phone
masak from things I've been told about phone tech, there's some amazing engineering going on there. turns out voice compression needs to allocate most of its space to handle sibilants. 10:23
arnsholt I usually refer to my phone as a supercomputer that fits in my pocket 10:24
masak it's certainly a viewport to a supercomputer cluster.
arnsholt There's that as well. But for me it's mostly the fact that there's a ridiculous amount of processing power in a modern clever phone 10:25
From time to time, I try to remind myself that I'm actually living in the future =D
jnthn didn't think he'd be that bothered about having a smartphone until he actually got one 10:26
arnsholt Yeah, it's pretty nice 10:27
jnthn Though actually phoning people is pretty far down the list of things I use it for :)
arnsholt Indeed =D
jnthn Finding out how late the train is, reading email and doing video skype probably top my usage list. :) 10:28
jnthn expected video skype to make his data transfer hit the sky, but the compression actually seems pretty impressive...it's not made so much of a dent 10:29
masak I'm still disappointed at the selection of programming IDEs *on* the Android. 10:31
tadzik I'm wondering whether there's a vi variant, but for fingers, not for keyboards, if you know what I mean 10:33
moritz model editing with fingers?
10:33 NamelessTee joined 10:34 lestrrat left
tadzik aye 10:34
masak sounds a bit like chording to me.
en.wikipedia.org/wiki/Chording_keyboard
arnsholt tadzik: I've done some minor editing with an ssh client and vim via my phone =) 10:35
10:35 lestrrat joined
masak me too. 10:35
tadzik masak: like an accordion!
masak oh wow, an accordion smartphone. 10:36
"Hold on, I'll just call Greg." -- *expands bellows with a majestic sound*
10:37 thou left
tadzik heh, funny. When I saw you saying "chording", I thought of guitar chords. On the computer keyboard I'm probably mostly using piano chords, and phone seems more appropriate for guitar chords 10:37
szabgab hi 10:42
10:42 xinming left
szabgab who is running rdstar ? 10:42
I'd like to put a name to it but I only see Rakudo Death Star on rdstar.wordpress.com/
moritz that's lue 10:43
szabgab thanks, is there a longer name I could add to the Perl Weekly ? 10:44
masak Life, The Universe, and Everything? :)
szabgab oh that lue :)
masak he seems to be one of our pseudonym peeps.
I know his real name, but he seems to want to go by "lue" or "rnddim". 10:45
szabgab ok, so I stick to the title RDS
masak www.cs.washington.edu/education/cou...index.html # looks interesting. 11:00
too bad that in the first PDF, they put Perl squarely in the "interpreters" slot, and spell it "PERL" at that. :/
could still be a good course, though.
tadzik looks interesting, indeed 11:05
the Compilation Techniques on my Uni I'll start in October
moritz a few random observations: 11:07
* printers suck 11:08
* all this talking about theory makes me think that maybe I should learn a bit theory on compilers too
* printers still suck.
tadzik random thought: lazy evaluation is a way to trick a mind reader illusionist. He says "pick a number between 1 and 10", and you don't. You wait with picking it until he wants to do something with it 11:09
it should do the trick 11:10
(the trick, you see? Ha ha!)
moritz lazy is, in some sense, like hubris 11:13
it's like saying "I *know* how I could generate these value. Why bother?"
11:14 mishin left
masak moritz: printing things is so twentieth century anyway. 11:16
get the PDFs as an audiobook! :)
tadzik: lazy evaluation is just corecursion. in ordinary recursion, you have routines calling routines to generate more data. in corecursion, you have data calling data to generate more routines. ;) 11:17
moritz oh, the post men will love me for sending the recipient address as an audiobook :-)
dalek kudo/nom: 409db17 | moritz++ | t/spectest.data:
run mkdir_rmdir.t
11:24
tadzik moritz: oh, it's always like this with learning :) 11:27
dalek ast: 75f1166 | moritz++ | S16-filehandles/mkdir_rmdir.t:
fudge S16-filehandles/mkdir_rmdir.t for rakudo
11:29
11:30 pernatiy left, xinming joined 11:36 sisar joined 11:55 birdwind1pbird joined
sisar hi ! 12:02
12:03 mucker left
masak sisar! \o/ 12:06
sisar masak : did you get a chance to look at irclog.perlgeek.de/perl6/2012-02-26#i_5209998 and the following conversation ? 12:07
s/following/subsequent
masak yes, I saw it.
Perl 6 historically was forgiving with numification of not-number-strings. 12:08
but it has become stricter in the past few years.
perl6: say +'foo'
p6eval niecza v14-96-g4c7a3f0: OUTPUT«Unhandled exception: Cannot parse number: foo␤ at /home/p6eval/niecza/lib/CORE.setting line 1362 (die @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3401 (ANON @ 10) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3403 (NumSyntax.str2num @ 4) ␤ at …
..pugs b927740, rakudo 409db1: OUTPUT«0␤»
masak I believe Niecza is more correct than Rakudo/Pugs here.
sisar (as i mentioned there) the specs are not clear on this 12:09
tadzik +1
sisar revisiting my problem, "if $x = <someAlphabet>, and i want to increase $x by 2, i.e. 'a' goes to 'c' , how would i do that ?" 12:12
.succ is not good enough
masak .succ.succ
(duh) :)
sisar masak: how about from 'a' to 's'
masak sub increase-by-n($orig, $n) { my $result = $orig; $result .= succ for ^$n; $result } 12:13
sisar (suppose i want to go from 'a' to 'e') how about 'a'.succ(4) 12:14
masak arrgh, no. 12:15
don't laden the .succ interface with complexity for everyone just to satisfy a use case you like.
fsergot nim: say 1.succ.
masak fsergot: it's "nom" and no period at the end
fsergot nom: say 1.succ 12:16
p6eval nom 409db1: OUTPUT«2␤»
sisar masak: submitting a rakudobug? 12:18
fsergot masak: because of small touch keyboard :-)
masak sisar: sorry, for what? 12:19
12:19 birdwind1pbird left
sisar masak: +'foo' gives 0 12:20
or maybe you meant Niecza is more correct but rakudo is still correct (?)
masak ah. 12:21
I think there's already a rakudobug in there for that.
sisar niecza: say +'two'; #just for fun ;-) 12:22
p6eval niecza v14-96-g4c7a3f0: OUTPUT«Unhandled exception: Cannot parse number: two␤ at /home/p6eval/niecza/lib/CORE.setting line 1362 (die @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3401 (ANON @ 10) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3403 (NumSyntax.str2num @ 4) ␤ at …
sisar hehe
masak niecza: say +'rebmun esrap tonnaC' 12:24
p6eval niecza v14-96-g4c7a3f0: OUTPUT«Unhandled exception: Cannot parse number: rebmun esrap tonnaC␤ at /home/p6eval/niecza/lib/CORE.setting line 1362 (die @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3401 (ANON @ 10) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3403 (NumSyntax.str…
masak guess I should've had a colon at the start, too.
sisar :) 12:25
sisar think if +'two' -> 2 is actually implemented in perl6, that would be a helluva dwim 12:27
lumi___ +'the number I'm thinking of' -> 7
sisar of course i can make a module for tha()
*that
moritz well, if we did, then people would want other languages to DWIM too
and a generic mechanism for plugging in other numification schemes 12:28
sisar yeah, but that would be awesome !
not to mention a pain for compiler writers
moritz and a mechanism for context-dependent numifications
sisar but who cares about compiler writers these days ;-) 12:29
moritz
sisar moritz: +1 #context...
sisar too 12:30
moritz use numification :base<day> :offset<yesterday>; say +'tomorrow' # 2
dammit, I should have saved that for Date.new('2012-03-31').succ 12:31
masak nom: sub increase-by-n($orig, $n) { my $result = $orig; $result .= succ for ^$n; $result }; say increase-by-n("a", 18) 12:32
p6eval nom 409db1: OUTPUT«s␤»
masak nom: sub increase-by-n($orig, $n) { my $result = $orig; $result .= succ for ^$n; $result }; say "a".&increase-by-n(18) 12:33
p6eval nom 409db1: OUTPUT«s␤»
sisar masak: i'll modify that sub to accept 's' rather than 18 12:34
masak moritz: every sufficiently advanced April 1st joke is indistinguishable from a real Perl 6 feature.
sisar mosak: because, i know what letter i want finally, rather than how much increment i want
moritz nom: sub increase-by-n($orig, $n) { ($orig, *.succ ... *)[$n] }; say increase-by-n('a', 18)
p6eval nom 409db1: OUTPUT«s␤»
masak nice. 12:35
nom: sub increase-by-n($orig, $n) { ($orig ... *)[$n] }; say increase-by-n('a', 18)
p6eval nom 409db1: OUTPUT«Decrement out of range␤ in method <anon> at src/gen/CORE.setting:7569␤ in <anon> at src/gen/Metamodel.pm:2213␤ in find_method_fallback at src/gen/Metamodel.pm:2211␤ in find_method at src/gen/Metamodel.pm:819␤ in block <anon> at src/gen/CORE.setting:9385␤ in bloc…
sisar tmtowtdi++
masak decrement!?
12:36 jaldhar left
masak nom: .say for (1 ... 100)[^10] 12:36
p6eval nom 409db1: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤»
masak nom: .say for (1 ... *)[^10]
p6eval nom 409db1: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤»
masak nom: .say for ("a" ... *)[^10]
p6eval nom 409db1: OUTPUT«Decrement out of range␤ in method <anon> at src/gen/CORE.setting:7569␤ in <anon> at src/gen/Metamodel.pm:2213␤ in find_method_fallback at src/gen/Metamodel.pm:2211␤ in find_method at src/gen/Metamodel.pm:819␤ in block <anon> at src/gen/CORE.setting:9385␤ in bloc…
masak I call bug.
moritz calls masak
12:37 pernatiy joined
masak submits rakudobug 12:37
colomon who you gonna call? masakbot!
12:38 mcartmell left
masak :P 12:39
12:39 mikec joined
masak scansion doesn't really work, but still. 12:39
12:41 snearch joined
jnthn +'foo' giving 0 in Rakudo doesn't deserve a bug report because the spec doesn't say it's wrong, afaik. 12:44
Let's get the spec clarified before claiming Rakudo is wrong. :)
masak agreed. 12:45
jnthn There's plenty of (Perl 5) precedent for it being 0. 12:46
Exception feels a bit wrong...it maybe is a fail()
s/wro/stro/
moritz jnthn: it's the "Decrement out of range" that's a bug
jnthn moritz: I agree that's a bug.
moritz: I was looking back at the +'foo' discussion. 12:47
masak I checked, and didn't find an existing RT ticket for +'foo' being 0 rather than error. I won't submit one either. 12:48
moritz it only makes sense to fail() in that case once our Failure handling has become much better 12:53
jnthn Yeah. 12:54
Once I'm done with bs stuff I need to go back and look at the TimToady++ failure changes proposal again
moritz well, proper failure handling also needs sink
12:58 havenn joined
masak decommutes 13:00
13:01 tokuhirom joined
jnthn Decommuting? at 2pm?! 13:01
sjn jnthn: welcome to scandinavia :)
daxim is that an euphemism now for getting out of bed? 13:15
moritz no. 13:16
sisar where are modules installed by panda installed ? 13:20
moritz ~/.perl6/lib/ 13:21
sisar thanks :)
13:24 havenn left 13:29 kaleem_ joined 13:32 mtk joined, kaleem left 13:44 retupmoca left, am0c left 13:56 sergot joined 13:58 retupmoca joined 14:00 fsergot left 14:01 slavik1 joined 14:04 snearch left 14:05 am0c joined 14:15 am0c left 14:17 sergot left 14:18 fsergot joined 14:19 noam_ left, noam_ joined 14:25 kaleem_ left 14:30 skids joined 14:31 xinming left 14:32 xinming joined
jnthn Productive day. So far I've deleted 400,000 lines of code. 14:38
moritz wow 14:39
jnthn I don't think my "lines committed" count at this place will ever be positive again. :)
moritz did the source tree contain several hundred slightly different versions of the same tree?
jnthn No
Just a huge amount of code generated by an ORM. 14:40
14:40 PacoAir joined
colomon \o/ 14:40
my wife says you should get a double positive count for deleting lines, as long as the code still works. ;) 14:41
jnthn :) 14:42
colomon is trying to figure out if he is looking at dead code which can be deleted for his $work, too
jnthn also discovered git show --stat today also :) 14:47
s:1st/also//
colomon what's that do? 14:49
moritz and that's non-trival to discover, because it's not explicitly in the man page
colomon: gives a summary of added/deleted lines
jnthn colomon: Shows a diffstat for the commit
colomon ah 14:50
interesting
moritz ah, 'man git-show' says "This manual page describes only the most frequently used options." 14:51
and... what about the others? Should I read the source code? 14:52
14:55 agentzh left
[Coke] perhaps info? 15:01
daxim ahahahaha
moritz all the manpages say that one should use 'info' for more documentationi, and then the info page is exactly the same as the man page, but shown in a weirder pager 15:03
15:04 eiro joined
eiro hello all 15:04
moritz eiro/
eiro someone can tell me how to write "it's unreadable!" in swedish ?
(also the spelling can be fun) 15:05
moritz phenny: en se "it's unreadable"?
phenny moritz: "it's unreadable" (en to se, translate.google.com)
moritz erm
Det är oläslig # says the web interface 15:06
jnthn looks feasible.
moritz and that sounds reasonable to me
jnthn läs is certainly "to read"
moritz (in German "unleserlich" is "unreadable", and it seems to follow the same pattern as "oläslig") 15:07
eiro i don't trust translate.google.com when i don't know the langage at all 15:08
ok then: i have the first slide of my perl introduction
moritz aye; helps to know 2.5 other germanic languages :-)
ok, really more like 2.1 :-) 15:09
15:09 kmwallio joined
eiro :) which are ? 15:09
moritz German, English, Norwegian (Bokmal) 15:10
in descending order of fluency
jnthn does English and a little Swedish :)
eiro jnthn, also czec for ya ? 15:11
arnsholt eiro/moritz: From a Norwegian perspective, the Swedish looks good as well
fsergot nom: .say for 1, 5 ... 100; 15:12
p6eval nom 409db1: OUTPUT«(timeout)»
arnsholt It's the same in Norwegian , modulo spelling
fsergot nom: .say for 0, 5 ... 100;
p6eval nom 409db1: OUTPUT«0␤5␤10␤15␤20␤25␤30␤35␤40␤45␤50␤55␤60␤65␤70␤75␤80␤85␤90␤95␤100␤»
jnthn eiro: I speak some Slovak, which is close to Czech.
fsergot How to do the same loop but with 99 as the upper limit?
15:13 havenn joined
cognominal eiro: \o/ 15:13
eiro cognominal, \o/
fsergot nom: .say for 0, 5 ... 99; # doesn't work
eiro oh ... so what about the perl6 classroom at jp12 ?
p6eval nom 409db1: OUTPUT«(timeout)»
jnthn fsergot: It won't work because you never hit 99
eiro masak, any news ?
cognominal très Gaullien comme salut :)
jnthn fsergot: It has to match exactly.
moritz jnthn: but it's a bug that 'for' is eager-ish if it can't detect the infinity of the list 15:14
jnthn True.
Dunno who is to blame for that one.
arnsholt cognominal: ECHANNEL? =)
jnthn MapIter or GatherIter or something in series...
*sequences
moritz not sequences
fsergot jnthn: is there any way to do what I want (short :P )
? :)
moritz iirc it's not limited to them 15:15
fsergot: what is that you want to do?
jnthn nom: .say for 0, 5 ... * < 99 # maybe
p6eval nom 409db1: OUTPUT«0␤»
moritz nom: .say for 0, 5 ... * >= 99
p6eval nom 409db1: OUTPUT«0␤5␤10␤15␤20␤25␤30␤35␤40␤45␤50␤55␤60␤65␤70␤75␤80␤85␤90␤95␤100␤»
jnthn er, yes, that way :)
nom: .say for 0, 5 ...^ * >= 99 15:16
moritz a successfull smartmatch terminates the sequence
p6eval nom 409db1: OUTPUT«0␤5␤10␤15␤20␤25␤30␤35␤40␤45␤50␤55␤60␤65␤70␤75␤80␤85␤90␤95␤»
fsergot I want to read every fifth element of a 100 element array.
15:16 noam_ left
fsergot Great! thanks moritz++ 15:16
jnthn++
moritz nom: say ('a' .. 'z')[0, 5 ... *] 15:17
p6eval nom 409db1: OUTPUT«Method 'gimme' not found for invocant of class 'Range'␤ in method postcircumfix:<[ ]> at src/gen/CORE.setting:1159␤ in block <anon> at /tmp/1vA_PP1V8t:1␤␤»
colomon nom: my @array = 'a'..'z' xx 5; say @array[0, 5 ... * >= 99]
moritz nom: say ('a' .. 'z').list[0, 5 ... *]
p6eval nom 409db1: OUTPUT«a f k p u z Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any()␤»
nom 409db1: OUTPUT«a f k p u z␤»
moritz nom: say ('a' .. 'z').list[0, 5 ... *] 15:18
15:18 havenn left
p6eval nom 409db1: OUTPUT«a f k p u z␤» 15:18
colomon nom: my @array = 'a'..'z' xx 5; say @array.list[0, 5 ... * >= 99]
p6eval nom 409db1: OUTPUT«a f k p u z Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any()␤»
jnthn colomon: That may be precedence
moritz it seems it doesn't flatten?
ah
colomon nom: my @array = ('a'..'z' xx 5).list; say @array[0, 5 ... * >= 99]
p6eval nom 409db1: OUTPUT«===SORRY!===␤Confused␤at /tmp/kVl0GpNtqW:1␤» 15:19
jnthn nom: my @array = ('a'..'z') xx 5; say @array.list[0, 5 ... * >= 99]
p6eval nom 409db1: OUTPUT«a f k p u z e j o t y d i n s x c h m r w␤»
colomon jnthn++
moritz agrees completely with afkpuzejotydinsxchmrw :-)
sisar badly wants multi-dimensional arrays to be implemented 15:21
colomon really could use one more vowel, I reckon
15:21 jferrero joined
moritz sisar: you're not the only one :-) 15:22
sisar moritz: sigh !
jnthn wonders if his next grant should be "do S09 stuff" :)
colomon sisar: you can always start implementing.... ;)
sisar jnthn++ #just for wondering !
15:22 noam joined 15:23 explorer__ left
colomon only wanted to write libraries in Perl 6, but somehow got dragged by #perl6 into implementing the compilers.... 15:24
15:24 noam left
sisar colomon: yeah, but i'm sure you guys would have finished implementing it twice before i complete implementing it :p 15:24
colomon *helping implementing
15:24 noam joined
moritz sisar: the point is not to complete it yourself, but help us doing it :-) 15:24
and even small bits help
colomon: well, part of the compiler (the setting) does feel like writing libraries 15:25
and it is, in fact
that's how I got lured too
15:25 havenn joined
colomon sisar: I'm pretty sure every single thing I've done on niecza, sorear++ could have done just as well, probably better. But that doesn't mean I'm not usefully helping him out by doing what I can do and freeing him up to work on the trickier stuff. 15:25
moritz: true enough, most of what I've done probably qualifies as writing core libraries. :) 15:26
sisar moritz: what are you working on currently & how can i help? #give my 2 cents
moritz sisar: one thing I'm working on in Rakudo is to convert error messages from pure strings to objects that contain more information 15:27
nom: Date.new('2012-02-31')
p6eval nom 409db1: OUTPUT«day of 2012/2 out of range. Is: 31, should be in 1..29␤ in method check-value at src/gen/CORE.setting:8719␤ in method check-date at src/gen/CORE.setting:8729␤ in method new at src/gen/CORE.setting:9035␤ in method new at src/gen/CORE.setting:9041␤ in method new at…
15:27 tokuhirom left, preflex_ joined
moritz that's just the string, but under the hood... 15:27
sisar oh! that is 'typed exceptions' (?)
moritz nom: try Date.new('2012-02-31'); say $!.perl
p6eval nom 409db1: OUTPUT«X::OutOfRange.new(what => "day of 2012/2", got => 31, range => 1..29)␤»
moritz sisar: correct
sisar: and it's not too hard to do. You just search for places where the compiler or the setting throws an error (search for 'die' or 'panic') 15:28
and then come up with a name for that error
and write a class for it in src/core/Exceptions.pm
15:29 preflex left
moritz and change the throwing location to use the class 15:29
write a test in t/spec/S32-exceptions/misc.t
15:29 preflex_ is now known as preflex
sisar .oO( i said 2 cents, not 2 dollars !! ) 15:29
moritz that's more like 0.5 dollars :-)
sisar: that's how a typical patch looks like: github.com/rakudo/rakudo/commit/9d...8481ce8cd6 15:30
[Coke] 4 bits.
moritz sisar: not too complicated, is it?
sisar okay, really basic question, are exceptions just errors with more info? 15:31
moritz github.com/rakudo/rakudo/commit/86...f8623377ac that one is a bit more complex (it passes additional information to the error object), but still manageable
in this case yes 15:32
15:32 kaare__ joined
moritz well, not even much more information than before, but easier to access 15:32
nom: try Date.new('2012-02-31'); say $!.range
p6eval nom 409db1: OUTPUT«1..29␤»
moritz I didn't need to parse the error message
and I can catch just this kind of exception if I want, because it's identified by a type 15:33
these two pieces are the whole point, really
15:33 xinming left
sisar hmm, looks interesting 15:34
moritz sisar: want to walk through such a change? 15:35
15:35 xinming joined
sisar yes-ish :p 15:36
moritz ok
let's start by finding a place to change
on my shell, I type
$ ack -w die src/core/ 15:37
lots of hits
one for example is
src/core/Routine.pm
89: die("Invalid wrap handle passed to routine")
so, let's open src/core/Routine.pm
the code that throws the error is: 15:38
method unwrap($handle) {
$handle.can('restore') && $handle.restore() ||
die("Invalid wrap handle passed to routine")
}
so, routines can be wrapped and then unwrapped. The error is thrown if you try to unwrap something that wasn't wrapped, or is totally unrelated
sisar wait, let me open it too
moritz waits
sisar ok, loacated the code 15:39
continue 15:40
moritz alright
so, we need a name for that error
by convention, all error type names start with X::
then the error is related to routines, and occurs during unwrapping. So let's call it X::Routine::Unwrap 15:41
so, in another terminal, we open src/core/Exceptions.pm, and create that class 15:42
the general structure is
my class X::Routine::Unwrap is Exception { method message() { "error message here" } } 15:43
sisar: with me so far? 15:44
sisar yes
15:44 Psyche^ joined
moritz ok, so we save Exceptions.pm 15:44
sisar what does 'is Exception' do ?
moritz it makes the new class inherit from the class Exception
which gives it facilities such as a .backtrace method
so, back to Routine.pm 15:45
we just replace die("some message here") by die(X::Routine::Unwrap.new())
we're nearly done now 15:46
sisar what is the .new() for ?
moritz well, we want to throw an object of class X::Routine::Unwrap and not just the type object 15:47
because our object carries state, like the backtrace
so we need to create a new object, and throw that
("throw that" means "pass it to die()")
sisar ok
moritz so, there's a tiny problem left 15:48
Routine.pm is compiled before Exceptions.pm
15:48 Patterner left, Psyche^ is now known as Patterner
moritz so if tried to compile rakudo now, it'd compain that it doesn't know about X::Routine::Unwrap 15:48
to fix that, we put a so-called "stub" at the very start of Routine.pm
it's a promise that we'll declare that class later
it goes like this: 15:49
my class X::Routine::Unwrap { ... } # literal ... here
sisar oh the yada-yada-yada operator !
[Coke] (all error type names start with X) - I'm used to X not being a core thing, but a user-extension. (http, smtp)
15:49 skipper joined
moritz sisar: right 15:50
so, let's safe Routine.pm
15:50 havenn left
moritz and type 'make' 15:50
and wait for a while
in the mean time, we can think about writing a test
first let's try to trigger the error here
nom: sub f() { }; f.unwrap
p6eval nom 409db1: OUTPUT«Method 'unwrap' not found for invocant of class 'Nil'␤ in block <anon> at /tmp/BXxkCpbZSS:1␤␤»
moritz wow, that was wrong
I tried to call .unwrap on the return value of sub f 15:51
nom: sub f() { }; &f.unwrap
p6eval nom 409db1: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤ in method unwrap at src/gen/CORE.setting:1567␤ in block <anon> at /tmp/PzK37ydhe4:1␤␤»
moritz right, method unwrap wants a wrap handler
so, let's give it something that's not a wrap handler
nom: sub f() { }; &f.unwra("foo")
p6eval nom 409db1: OUTPUT«Method 'unwra' not found for invocant of class 'Sub'␤ in block <anon> at /tmp/QHWFU0z1OA:1␤␤»
moritz nom: sub f() { }; &f.unwrap("foo")
p6eval nom 409db1: OUTPUT«Invalid wrap handle passed to routine␤ in method unwrap at src/gen/CORE.setting:1569␤ in block <anon> at /tmp/5RNnAQBlty:1␤␤»
sisar bingo ! 15:52
moritz aye
so, we know how to trigger the error 15:53
let's go to t/spec/S32-exceptions/misc.t
to the very end of the file
and the test goes like this:
colomon moritz++ # very cool to watch this in the background as I hack up my $work source
moritz throws_like 'string that causes the error', X::Error::Type;
so
throws_like 'sub f() { }; &f.unwrap("foo")', X::Routine::Unwrap 15:54
15:54 thou joined
moritz add semicolon at the end of the line 15:54
sisar wait, i dont' have a spec library in my 't' directory
(i have rakudo cloned) 15:55
moritz sisar: type make spectest_checkout in a shell in your rakudo dir
sisar: that gets the t/spec/ dir from github
sisar: you have to do that only the first time 15:56
sisar it is clonig as we speak :)
continue...
moritz well, we're mostly done 15:57
add the test I typed above
safe the file
wait for rakudo to compile
and then when rakudo has compiled, type make t/spec/S32-exceptions/misc.t
and if the test passes, you know it worked 15:58
(I had to restart my rakudo compilation because of a stupid typo, so it might take a bit longer here)
sisar will take still longer for me, i'm on a very slow machine 15:59
moritz finished compiling here \o/ 16:01
and... test passes
sisar what does the test mean: just check if the exception was thrown or not?
moritz it does two thinks 16:02
first it checks that the code actually died
and then it checks the type of that exception
the test output here is
ok 194 - 'sub f() { }; &f.unwrap("foo")' died
ok 195 - right exception type (X::Routine::Unwrap)
sisar moritz: sorry !! 16:03
damn! i got to go :(( will be back as soon as possible
moritz sisar: I'll also decommute
sisar: don't hurry, let it compile in the background :-)
sisar afk
16:04 thou left, bacek left
moritz also afk 16:05
jnthn decommutes 16:20
16:22 att joined 16:24 bothra joined, bothra left 16:27 lue left
colomon is getting that warm fuzzy feeling you get when your rewrite is shorter... 16:31
16:31 blynch joined 16:34 daxim left, Jerkwad joined 16:38 mucker joined 16:40 lue joined 16:44 pernatiy_ joined
TimToady masak: that's an interesting solution to quasi lifting; treat all functions as potential macros 16:45
16:45 blynch left, pernatiy left
TimToady I'm not sure it helps much with lifting our multi-ops though 16:46
16:47 Trashlord left
TimToady is referring to irclog.perlgeek.de/perl6/2012-02-26#i_5211665 16:48
16:48 blynch joined
TimToady in general, multi-macros don't seem like they'd work too well if they have to reify a switch statement at every call point 16:51
16:51 skipper left
TimToady lifts in multis seem more like they just need to delay lookup of the lifted names till when the caller is known 16:51
16:52 Trashlord joined 16:54 wtw left, kaare__ is now known as kaare_ 16:56 havenn joined 16:57 thou joined
jnthn home 16:57
16:58 wolfman2000 left 17:01 am0c joined
TimToady perl6: say "True" if 'a' === any <a b c> 17:01
p6eval pugs b927740, rakudo 409db1, niecza v14-96-g4c7a3f0: OUTPUT«True␤»
TimToady perl6: say "True" if 'a' eqv any <a b c>
p6eval rakudo 409db1, niecza v14-96-g4c7a3f0: ( no output )
..pugs b927740: OUTPUT«True␤»
TimToady pugs++ 17:02
rakudobug, nieczabug
colomon TimToady: this is what I was messing around with the other day. Are you saying eqv should take Any arguments? 17:03
TimToady that is exactly what I'm saying
as with ===, there needs to be a more primitive eqv underneath that doesn't autothread
but users will expect eqv to autothread 17:04
colomon then we've got incorrect spectests....
in eqv.t
TimToady is not surprised; I keep having to argue this point :)
either way we work it is a FAQ, but I think way will be less F than the other 17:05
*this way
colomon reckon I can fix the spectests and niecza. :)
17:06 lateau__ joined
lateau__ can I ask somthing about nqp here? 17:07
jnthn Sure 17:08
TimToady certainly, though I'm not the expert on that
lateau__ thank you
is this allowed in nqp? %hash = ( 'k' => 'v'); on perl6 17:09
17:09 kaare_ left, kaare_ joined
jnthn No 17:09
lateau__ oops
jnthn For one, no assignment.
Only binding 17:10
17:10 birdwindupbird left, pernatiy_ left
lateau__ so, I should do it like : my %hash; %hash<key> := 'value'; 17:10
[Coke] nqp: my %hash; %hash<key> := 'value'; 17:11
p6eval nqp: ( no output )
[Coke] nqp: my %hash; %hash<key> := 'value'; say %hash<key>
p6eval nqp: OUTPUT«get_pmc_keyed() not implemented in class 'Sub'␤current instr.: '_block1000' pc 73 ((file unknown):56) (/tmp/nzzHmIeG4A:1)␤»
jnthn nqp: my %h := hash(a => 1, b => 2); say(%h<a>)
p6eval nqp: OUTPUT«1␤»
jnthn nqp: my %h := hash(a => 1, b => 2); say(%h<b>)
p6eval nqp: OUTPUT«2␤»
jnthn Like that. 17:12
17:12 NamelessTee left
lateau__ jnthn: I got "Could not find sub hash" 17:13
17:13 pyrimidine left
lateau__ jnthn: hmm... I'm using parrot-nqp. is this different from nqp? 17:14
jnthn lateau__: Yes.
lateau__ jnthn: oops.
jnthn The one in the nqp repo github.com/perl6/nqp is latest 17:15
And is the one we're using with Rakudo.
17:16 plobsing left 17:17 havenn left, ggoebel left 17:18 plobsing joined
lateau__ jnthn: I'm actually working with parrot-nqp and referencing that repo(around HLL). I was confusing why parrot-nqp did not works like nqp sometimes. parrot-nqp != nqp... thank you ;) 17:18
TimToady colomon: btw, eqv autothreading is specced at S03:1303, if you want an argument from the scriptures :) 17:20
colomon TimToady: I'm okay with getting the answer from on high. ;) 17:21
TimToady won't make you take off your shoes :) 17:22
and I'd better not pursue that metaphor much further lest I be eaten of worms :) 17:23
colomon is already shoeless
well, barefoot, anyway 17:24
17:27 ggoebel joined 17:28 noam left
TimToady oh, got to the backlog where sorear++ already point out eqv(Any,Any) 17:29
well, I call Volleyball Principle
(better too many going for the ball than too few)
sorear good * #perl6
TimToady good morning 17:30
jnthn o/ sorear 17:31
fsergot \o 17:33
colomon \o
17:36 kaare__ joined
fsergot open 'file', :w allows us to write to file, right? 17:36
17:36 kaare_ left
colomon yes 17:36
17:37 aindilis left
fsergot But is this file "saved" only when we close a filehandle? 17:37
moritz back
yes, that's a limitation in current rakudo 17:38
and parrot, for that matter
colomon and niecza, too
fsergot :(
Is it hard to change?
colomon would have done it years ago if it was easy 17:40
sorear is it bad of me to be thinking "if you don't close filehandles, you deserve whatever you get"?
fsergot colomon: right, sorry for stupid question. :)
colomon fsergot: it drives me crazy too. I'm too use to C++'s RAII taking care of that sort of thing. 17:41
TimToady well, p5 will close them for you if you don't get around tuit
17:43 NamelessTee joined, noam joined
sorear do we want to guarantee that p6 calls all DESTROY submethods on clean exit? 17:43
TimToady btw (still backlogging) I think IO.lines should close the file
sorear: I would like that very much 17:44
it is especially necessary for embedded stuff
you don't want apache leaking filehandles, for instance 17:45
or memory, for that matter 17:46
colomon or water
TimToady well, depends on what kind of apache 17:47
sorear fuel?
dalek kudo/nom: d696855 | moritz++ | src/core/ (2 files):
Routine.unwrap now throws a typed exception
17:49
ast: 52f6db6 | moritz++ | S32-exceptions/misc.t:
test for X::Routine::Unwrap
17:50
moritz phenny: tell sisar I've turned our session into two commits, github.com/rakudo/rakudo/commit/d696855f41 and github.com/perl6/roast/commit/52f6db64fc
phenny moritz: I'll pass that on when sisar is around.
dalek kudo/nom: 38fc6fc | moritz++ | src/core/Exceptions.pm:
awesomize error message a bit
17:53
ecza: acd7da0 | (Solomon Foster)++ | lib/CORE.setting:
infix:<eqv> is supposed to take Any, Any.
17:56
17:57 havenn joined
dalek ast: ca66c90 | (Solomon Foster)++ | S03-operators/eqv.t:
Instead of testing Mu eqv Mu and Mu !eqv Any, test that infix:<eqv> autothreads. (New test fudged for Rakudo.)
17:58
TimToady maybe primitive === and eqv should be called \=== and \eqv or some such 17:59
colomon new test shamelessly stolen from TimToady++, btw. ;) 18:00
TimToady unless someone can think of better names 18:02
sorear how about cmp?
slavik1 and <=> ? 18:03
TimToady what is the numeric value of a junction?
but certainly a prefix of '\' for "primitive" could be somewhat productive, if we want it 18:04
but like + and ~, not like metaoperators 18:05
unless \ is some kind of higher-order funciton that lies to Any,Any candidates about their arguments' types 18:07
sorear TimToady: [\===] 18:09
TimToady there is that
could be spelled [[\===]] at need 18:11
I doubt people are going to be reducing on the primitive ops all that often, and if they're good enough to know there are primitive ops, they'll know how to wrap ops in extra [] 18:12
18:12 sisar left
TimToady perl6: say [[+]] 1,2,3 18:12
p6eval rakudo 38fc6f, niecza v14-97-gacd7da0: OUTPUT«6␤» 18:13
..pugs b927740: OUTPUT«*** ␤ Unexpected "1"␤ expecting operator, ":" or ","␤ at /tmp/sHsTNFScxd line 1, column 11␤»
TimToady perl6: sub infix:<\\===> ($a, $b) { $a === $b }; say [[\===]] 42, 42 18:16
p6eval rakudo 38fc6f: OUTPUT«===SORRY!===␤Confused␤at /tmp/s0Yegi4aZ8:1␤»
..pugs b927740: OUTPUT«*** ␤ Unexpected "42"␤ expecting operator, ":" or ","␤ at /tmp/nXmCpfD3kr line 1, column 56␤»
..niecza v14-97-gacd7da0: OUTPUT«True␤»
TimToady niecza++
18:16 mj41 left
TimToady perl6: sub infix:<\\+> ($a, $b) { $a + $b }; say [[\+]] 1,2,3 18:18
p6eval niecza v14-97-gacd7da0: OUTPUT«6␤»
..rakudo 38fc6f: OUTPUT«===SORRY!===␤Confused␤at /tmp/fwDDTiteXp:1␤»
..pugs b927740: OUTPUT«*** ␤ Unexpected "1"␤ expecting operator, ":" or ","␤ at /tmp/NdCa5Kxci6 line 1, column 50␤»
TimToady so that can work as an escape hatch
TimToady loves the 'op eq [op]' rule 18:19
18:20 Trashlord left
dalek ecs: 46e7100 | larry++ | S03-operators.pod:
conject \=== and \eqv
18:22
18:36 MayDaniel joined 18:41 am0c left 18:45 Chillance joined 18:48 Trashlord joined
TimToady phenny: tell grondilu if you remove the unnecessary 'where' constraints, your sha256 runs 20 times faster 18:49
phenny TimToady: I'll pass that on when grondilu is around.
TimToady phenny: tell grondilu if you really want them, change them to 'where ^33' and it still runs 15 times faster 18:51
phenny TimToady: I'll pass that on when grondilu is around.
jnthn How were they written originally?
jnthn tries to find the link in the backlog...
TimToady where { $b == any(^33) }
18:51 birdwindupbird joined
masak hello-from-a-train, #perl6. 18:52
colomon \o
18:52 lateau__ left
TimToady hello-to-a-train 18:52
18:53 Trashlord left
[Coke] ponders again a perl6 intro talk for yapc::na. 18:53
jnthn o/ masak
Which tells me junctions are a pig...
TimToady especially in hot code :) 18:54
masak followup to awesome Bret Victor video: www.chris-granger.com/2012/02/26/co...-creation/
jnthn Tssk. Looks like somehow the marshalling of the binary blob of serialization data is getting screwed up in some cases :(
colomon TimToady, jnthn: surely it's not a surprise that 0 <= $b < 33 is faster than any($b == 0, $b == 1, $b == 2, ...)?
TimToady well, it's not a surprise to me, which is why I glared at the code the moment I saw it 18:55
[Coke] masak: agh! I haven't even watched the victor video yet! 18:56
TimToady is too connected to his creation to watch random videos...
masak [Coke]: suit yourself ;) 18:57
jnthn Blech, and IMCC parses strings with escape codes REALLY slowly...
masak jnthn: I read that as "marshmallowing the binary blob" :P
jnthn masak: :P 18:58
TimToady I read it as: Serializer! Serialize thyself!
jnthn Screw it. Let's base-64 encode...
Actually, I think I'll eat first. :)
19:00 MayDaniel left
moritz jnthn: can't you use freeze and thaw on strings? 19:00
masak jnthn: you didn't catch the pronoun mis-agreement in "Det är oläslig"... 19:01
moritz: the reson you couldn't translate to "se" is that the two-letter language code is "sv". you were thinking of the country code. 19:02
moritz masak: oh right
jnthn moritz: The serializer produces a binary blob. We emit a .pir file which *then* becomes a .pbc. It's the step through .pir that is currently seeming problematic :/
moritz jnthn: complain in #parrot :-) 19:03
TimToady interestingly, niecza without the junctional constraints only runs the code a couple percent faster
jnthn TimToady: Rakudo's auto-threader is *slow*. Mostly because it's a "make stuff work" implementation rather than a "make stuff fast" one. 19:04
TimToady so yes, something is pigging out on those where constraints in rakudo
it's also possible something in mono is inlining all those shifts and rotoates 19:05
*tates even
19:05 proller_ joined 19:08 pyrimidine joined 19:10 twirp joined
masak reading things like scalamacros.org/usecases/advanced-d...ages.html, I get the feeling Perl 6 macros will be digging into the guts of AST hierarchies, transforming them wildly, possibly using dedicated libraries. 19:14
TimToady: re your suggestion to make all subs potential macros -- that reminds me of the recent-ish discussion to simply make macros subs with AST parameters. 19:15
19:15 noam_ joined, cogno joined
TimToady
.oO(Any sufficiently advanced macro is indistinguishable from a compiler.)
19:16
tadzik 'evening 19:18
19:18 noam left
masak well, yes. subroutines give you new ways to produce values at runtime. macros give you new ways to produce compiled code at compile time. 19:20
grr. train fast, connection slouuuugh. 19:21
colomon is making one of those "tiny" changes for $work which blossoms out into dozens of tricky decisions....
masak tadzik! \o/
tadzik: sometimes I get the urge to turn your nick into a diminutive when greeting you... but it already is a diminutive! :) 19:22
tadzik: is there a word for that feeling in Polish "the wish to diminutize a name beyond the possible range"? :) 19:23
tadzik diminutize? 19:25
hmm, yes, it's diminutived already
oh, there are techniques to diminutize a word beyond sanity 19:26
masak how are we going to express affection towards you when it's the default? :)
colomon t.z.!
tadzik :) See, it's a hack
masak "oh, tadeczik!" :D 19:27
tadzik well, there are some names which my parents use against me which used to make me roar...
masak with laughter? or with rage? :)
tadzik my age decided :P 19:28
masak heh. 19:29
tadzik I used to go bananas upon hearing "tadzinek"
masak aww
tadzik SAY CUTE! SAY CUTE AND I'LL CUTE YOURSELF!
:P
19:30 mj41 joined
masak shields himself with a teddy bear 19:30
19:30 MayDaniel joined 19:31 cogno left
TimToady you can always go multilingual: tadziklet, tadzikito, tadzikchan 19:31
masak neat. 19:32
tadzik teddy bear, very funny 19:33
masak thought you might catch that one :)
tadzik ;)
[Coke] always reads tadzik as tzatziki 19:36
tadzik heh, it made me wonder how would people say to me on NLPW, my first Perl event. To my suprise, they kept on twisting their tongues on "tadzik", and it sounded quite correct :) 19:37
[Coke] # 02/27/2012 - niecza++ ; pugs (23.8%); rakudo (99.03%) 19:38
"niecza", 20302, 8, 751, 1539, 22600, 23752
"pugs" , 4832, 6, 2024, 404, 7265, 23561
"rakudo", 20106, 80, 605, 1856, 22647, 23762
19:41 noam_ left 19:42 noam_ joined
[Coke] b: say 20302*.25-4832 19:42
p6eval b 1b7dd1: OUTPUT«243.5␤»
19:44 NamelessTee left
masak [Coke]: it's a joy to see the Pugs percentage creep upwards. I hope to have some time slot to look at hacking Haskell later in the week. 19:44
dalek kudo/nom: 3ca6e5f | moritz++ | src/core/ (2 files):
typed exception from default constructor when called with positional arguments
[Coke] masak: slow but steady. having someone hacking on actual haskell will help immensely, I wager. 19:45
dalek ast: 44d0aa3 | moritz++ | S32-exceptions/misc.t:
test X::Constructor::Positional
19:46 noam__ joined
[Coke] (and having a runnable test suite will help them/you, is my hope) 19:46
19:47 cogno joined
masak indeed. 19:47
[Coke] pugs: Date.new("something").say
p6eval pugs b927740: OUTPUT«*** No such subroutine: "&Date"␤ at /tmp/dpEw4uR5ts line 1, column 1 - line 2, column 1␤»
19:49 noam_ left 19:55 cogno left
TimToady niecza: Date.new("something").say 20:00
p6eval niecza v14-97-gacd7da0: OUTPUT«===SORRY!===␤␤Undeclared name:␤ 'Date' used at line 1␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1344 (die @ 3) ␤ at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 33) ␤ at /home/p…
moritz nobody has stolen Temporal.pm yet? 20:01
colomon nope
TimToady I could actually use the Date module right now in niecza for $job, but it depends heavily on overloading builtin multis
which niecza doesn't support yet
colomon :( 20:02
20:03 lichtkind joined 20:04 noam_ joined
lichtkind is <prior> also a predefiend subrule? 20:04
20:06 bacek joined
TimToady grep is your friend here 20:06
20:07 noam__ left
masak two hits in S05. 20:15
TimToady only one if you put the angles 20:16
masak nod.
20:16 alester joined 20:17 icwiener joined 20:19 birdwindupbird left 20:21 birdwindupbird joined
lichtkind i get just one hit and it was not in the list but looks like one 20:21
thatswhy i asking because i cant get definite info from s05 20:22
20:23 havenn left 20:24 havenn joined, mucker left 20:26 havenn left, NamelessTee joined, havenn joined
TimToady what is this "the list" of which you speak? 20:27
lichtkind feather.perl6.nl/syn/S05.html#Prede...d_Subrules 20:29
20:30 blynch left
moritz nom: say 'abc' ~~ /../; say 'foobarabracadabra' ~~ /<prior> \w ** 5/ 20:32
p6eval nom 3ca6e5: OUTPUT«=> <ab>␤␤=> <abracad>␤ prior => <ab>␤␤»
jnthn nom: say 'part' ~~ /a../; say 'quart' ~~ /<prior>/ 20:36
p6eval nom 3ca6e5: OUTPUT«=> <art>␤␤=> <art>␤ prior => <art>␤␤»
20:37 mucker joined, mucker left
moritz jnthn++ # prior => <art> 20:38
[Coke] wonders why pugs passes six tests about wrap when it doesn't implement Sub's .wrap 20:39
20:42 Chillance left, Chillance joined 20:43 mucker joined
masak [Coke]: that's how awesome Pugs is. 20:47
20:47 mucker left 20:48 birdwindupbird left, mucker joined
dalek ecs: 12a2ea6 | larry++ | S05-regex.pod:
make clear that "the list" is not exhaustive

  lichtkind++
20:51
moritz oh right, it doesn't come with :exhaustive :-)
20:59 twirp left, snearch joined 21:03 Trashlord joined 21:04 hundskatt joined 21:07 kaare__ left, kaare_ joined 21:14 proller_ left
dalek p/bs: b5e5fd1 | jnthn++ | / (3 files):
Add a public domain base64 encode/decode implementation.
21:22
p/bs: 5025478 | jnthn++ | src/ (2 files):
Base64 encode the serialized data; for one, we avoid a weird corruption issue with binary:'...' strings (so CORE.setting deserialization now completes), but also it's parsed by IMCC much faster than the binary string with a load of escapes.
jnthn So...with that mess fixed, I've got the problem I expected to have at this point :) 21:23
masak jnthn++ 21:26
[Coke] jnthn: what's that? 21:28
jnthn The augment + bs fun. :) 21:30
Basically, the setting augments the types in BOOTSTRAP, but the changes get lost.
dalek p/bs: f626c29 | jnthn++ | src/6model/serialization. (2 files):
Don't leak.
21:35
kudo/bs: 50cfbcf | jnthn++ | src/binder/s (2 files):
Bump to latest 6model headers.
masak "Don't leak", the latest romantic pop hit by robots, for robots.
21:35 havenn left 21:39 icwiener left
jnthn :P 21:40
21:41 dukeleto left, dukeleto joined, dukeleto left 21:42 dukeleto joined, dukeleto left, dukeleto joined, dukeleto left 21:43 dukeleto joined, dukeleto left, dukeleto joined, dukeleto left
masak nom: augment class Str { method postcircumfix:<[ ]>($i) { self.substr($i, 1) } }; say "OH HAI"[4] 21:43
p6eval nom 3ca6e5: OUTPUT«===SORRY!===␤augment not allowed without 'use MONKEY_TYPING'␤at /tmp/vzQXStVHBn:1␤» 21:44
masak nom: use MONKEY_TYPING; augment class Str { method postcircumfix:<[ ]>($i) { self.substr($i, 1) } }; say "OH HAI"[4]
p6eval nom 3ca6e5: OUTPUT«A␤»
masak \o/
jnthn ew :P
21:44 dukeleto joined, dukeleto left
masak that's the cultural stigma talking :) 21:44
it may be frowned upon, but it's possible...
and easy.
21:44 dukeleto joined, dukeleto left
masak granted, the .[] should be a bit smarter, and accept lists. 21:45
jnthn If you implement at_pos instead, it will :P
21:45 dukeleto joined, dukeleto left
masak nom: use MONKEY_TYPING; augment class Str { method at_pos($i) { self.substr($i, 1) } }; say "OH HAI"[4] 21:45
p6eval nom 3ca6e5: OUTPUT«A␤»
21:45 dukeleto joined
masak nom: use MONKEY_TYPING; augment class Str { method at_pos($i) { self.substr($i, 1) } }; say "OH HAI"[1..4] 21:45
p6eval nom 3ca6e5: OUTPUT«H H A␤» 21:46
21:46 dukeleto left
masak niiice. 21:46
nom: use MONKEY_TYPING; augment class Str { method at_pos($i) { self.substr($i, 1) } }; say "OH HAI"[1..4].perl
p6eval nom 3ca6e5: OUTPUT«("H", " ", "H", "A")␤»
21:46 dukeleto joined, dukeleto left
masak ...but that's maybe a case where lvalue substr being syntactical-only would feel inadequate. 21:46
21:47 dukeleto joined, dukeleto left, dukeleto joined
dalek kudo/bs: 82818b3 | jnthn++ | src/Perl6/World.pm:
Toss dead line of code.
21:47
21:47 dukeleto left 21:48 dukeleto joined, dukeleto left, dukeleto joined, dukeleto left 21:49 dukeleto joined, dukeleto left, dukeleto joined, dukeleto left 21:50 dukeleto joined, dukeleto left
masak dukeleto is the noisiest bot on the channel right now. 21:50
21:50 dukeleto joined, dukeleto left 21:51 dukeleto joined, dukeleto left, dukeleto joined, dukeleto left 21:52 dukeleto joined, dukeleto left
jnthn Aye 21:52
Guess one of us could find our op bit and quieten it :)
21:52 dukeleto joined 21:53 dukeleto left, dukeleto joined, dukeleto left, ChanServ sets mode: +o masak 21:54 dukeleto joined, dukeleto left, kmwallio left, dukeleto joined, dukeleto left 21:55 dukeleto joined, masak sets mode: +b dukeleto!leto@turkeyberry.sgn.cornell.edu, dukeleto left
jnthn masak++ 21:55
21:55 dukeleto joined, dukeleto left
jnthn oh, dang. :) 21:55
21:55 ChanServ sets mode: -o masak
masak oh noes :/ 21:55
21:56 ChanServ sets mode: +o masak, dukeleto joined
masak clearly I need to work on this. 21:56
21:56 dukeleto left, dukeleto joined, dukeleto left 21:57 dukeleto joined, dukeleto left, dukeleto joined, dukeleto left 21:58 dukeleto joined, dukeleto was kicked by masak (dukeleto)), dukeleto joined, dukeleto left 22:00 MayDaniel left
Trashlord obviously 22:00
and we're all sure you'll do a great job
22:00 masak sets mode: +b *!leto@turkeyberry.sgn.cornell.edu, ChanServ sets mode: +o jnthn, dukelet0 joined, ChanServ sets mode: -o masak
masak oh wtf 22:01
22:01 dukelet0 is now known as dukeleto, jnthn sets mode: +b *!*@turkeyberry.sgn.cornell.edu
masak op #perl6 masak 22:01
22:01 jnthn sets mode: -o jnthn
masak er 22:01
jnthn: now there are three bans registered for dukeleto. 22:02
22:03 ChanServ sets mode: +o jnthn
Trashlord heh 22:03
masak if they're a scarce resource, probably the first two should be clean'd up.
22:03 jnthn sets mode: -b dukeleto!leto@turkeyberry.sgn.cornell.edu
masak honestly, I thought the second one would keep things like dukelet0 away. 22:03
Trashlord I think the first ban didn't work because it's *!leto, not *!~leto
masak oh!
22:03 jnthn sets mode: -b *!leto@turkeyberry.sgn.cornell.edu
masak Trashlord++ 22:03
22:03 jnthn sets mode: -o jnthn
Trashlord er, the second one I mean, yes 22:03
masak anyway, the leto bot is gone for now. 22:04
it can re-apply for membership in an orderly fashion, if it wants :)
jnthn has all tomorrow for Perl 6 o/ 22:05
Wonder if I can get Rakudo passing most of them spectests again with the bs. :)
masak sounds like a challenge :) 22:06
[Coke] jnthn++
jnthn Muchly depends how well the design I sketched out for handling the augment stuff falls into place.
oh, guess I should do the * release tomorrow also 22:07
22:10 skids left, dukeleto left
masak \o/ 22:11
[Coke] wonders if he should mention anything about the new perl6 say spec on the conversation about the p5p say thread. 22:13
s/he/we/
masak how does it apply to p5? 22:15
perl6: print <a b c d>
p6eval pugs b927740, rakudo 3ca6e5, niecza v14-97-gacd7da0: OUTPUT«abcd»
masak perl6: say <a b c d>
p6eval rakudo 3ca6e5, niecza v14-97-gacd7da0: OUTPUT«a b c d␤»
..pugs b927740: OUTPUT«abcd␤»
masak I mean, Perl 5 doesn't even have a &gist routine, nor any plans to get one. 22:16
22:16 att left
[Coke] So won't they be surprised. 22:19
masak good point.
go for it.
worst case, it's of no import to them. 22:20
best case, they can use that knowledge for something.
22:33 Araq joined
masak Araq: greetings. 22:34
Araq hi masak
masak welcome to our humble adobe :) 22:35
Araq there's 194 people in here and yet I'm greeted. nice :-)
22:35 kaare_ left
masak Araq: we're mostly on a first-name basis here... :) 22:36
big village.
Araq so what's the status of perl6? 22:37
masak alive and kicking, and stronger than ever! :) 22:38
nom: say "Perl 6 greets you too, Araq :)"
p6eval nom 3ca6e5: OUTPUT«Perl 6 greets you too, Araq :)␤»
Araq spec and implementation finished? 22:39
masak nom: .say for 1, 2, 4 ... 256
p6eval nom 3ca6e5: OUTPUT«1␤2␤4␤8␤16␤32␤64␤128␤256␤»
masak Araq: spec still being twiddled, but large parts of it are very stable.
Araq nom: .say 2, 4 ...
p6eval nom 3ca6e5: OUTPUT«===SORRY!===␤Confused␤at /tmp/Bzepz_HdM_:1␤»
masak no need for the dot in '.say' there. 22:40
or do '.say for'
jnthn nom: .say 2, 4 ... *
p6eval nom 3ca6e5: OUTPUT«===SORRY!===␤Confused␤at /tmp/lBuIkboitj:1␤»
jnthn gah
masak also, you need a '*' at the end if you want to go forever.
jnthn nom: .say for 2, 4 ... *
masak or an 'Inf'
jnthn though that's kinda infinite... :)
p6eval nom 3ca6e5: OUTPUT«(timeout)2␤4␤6␤8␤10␤12␤14␤16␤18␤20␤22␤24␤26␤28␤30␤32␤34␤36␤38␤40␤42␤44␤46␤48␤50␤52␤54␤56␤58␤60␤62␤64␤66␤68␤70␤72␤74␤76␤78␤80␤82␤84␤86␤88␤90␤92␤94␤96␤98␤100␤102␤104␤106␤108␤110␤112␤114␤116␤118␤120␤122␤124␤126␤128␤130␤132␤134␤136␤138␤140␤142␤144␤146␤148␤150␤15
masak hah, you got the arithmetic sequence :)
that will never get all the way to infinity :P
Araq how does that work? it's ambigous 22:41
benabik Two numbers are assumed to be an arithmetic sequence, I think
colomon benabik has right
benabik Three get examined for arithmetic or geometric.
masak Araq: it tries to fit things into an arithmetic sequence, otherwise a geometric one.
if both of those fail, it fails.
benabik nom: .say for 2, -3, 55 ... * 22:42
p6eval nom 3ca6e5: OUTPUT«2␤-3␤55␤Failure.new(exception => X::AdHoc.new(payload => "unable to deduce sequence"))␤»
colomon nom: .say for 1, 2, 5 ... * > 100
p6eval nom 3ca6e5: OUTPUT«1␤2␤5␤Failure.new(exception => X::AdHoc.new(payload => "unable to deduce sequence"))␤»
masak nom: .say for (2, -4, 8 ... *)[^20]
p6eval nom 3ca6e5: OUTPUT«2␤-4␤8␤-16␤32␤-64␤128␤-256␤512␤-1024␤2048␤-4096␤8192␤-16384␤32768␤-65536␤131072␤-262144␤524288␤-1048576␤»
masak \o/
Araq it could pretend there's underlying polynomial and extrapolate it
masak haha
Araq: you're not the first one to suggest it :) 22:43
we're crazy, but not that crazy.
Araq how does multiple dispatch work in perl6?
is it type or value based?
benabik yes 22:44
jnthn Type based first, then value-based for tie-breaking.
Araq are there disambiguation rules? or do trigger ambiguities an exception=
?
jnthn If it's ambiguous you'll get an exception. 22:45
I mean, there are rules.
benabik nom: multi f(int $) { say "int" }; multi f(0) { say 0 }; multi f($) { say "anything"}; f("foo"); f(0); f(1); f(0.5)
p6eval nom 3ca6e5: OUTPUT«anything␤int␤int␤anything␤»
masak nom: multi foo($x) { say "amb" }; multi foo($x) { say "iguous" }; foo(42)
p6eval nom 3ca6e5: OUTPUT«Ambiguous dispatch to multi 'foo'. Ambiguous candidates had signatures:␤:(Any $x)␤:(Any $x)␤␤ in block <anon> at /tmp/bKE2are5WV:1␤␤»
jnthn But we don't try and disambiguate everything. 22:46
benabik jnthn: Why didn't I get the 0 case? ^^ Int v int?
jnthn benabik: Correct.
TimToady constraints are evaluated in order
jnthn benabik: Native types always match narrower.
At the type level, not at the constraint level.
benabik nom: multi f(Int $) { say "Int" }; multi f(0) { say 0 }; f(0); f(1)
p6eval nom 3ca6e5: OUTPUT«0␤Int␤»
jnthn It may well have even resolved that one at compile time.
masak Araq: it tries to figure out which candidates are more specific than others. if it tried everything and there are still > 1 candidate left, that's ambiguous.
benabik Odd that int is "narrower" than 0. *shrug* 22:47
TimToady or if theres a circularity or contradiction in the types
jnthn benabik: Yeah, maybe we should inference it as int instead of Int.
Or...hmm, that has issues too :)
masak TimToady: yes, but that's covered by the "> 1 candidate left" case.
Araq what's perl 6's take on concurrency? 22:48
jnthn There are ways to get circularities without constraints.
But probably not with the default type system.
masak Araq: Perl 6 is all for it.
Araq: details pending, because no-one has picked up the torch for that one yet, really. 22:49
TimToady mostly we try to express any inherent parallelism syntactically, and then let the computer figure out how
masak not since the Pugs days, anyway.
TimToady but various forms of concurrency are expressed naturally: hyperoperators, ffeeds
masak form feeds are concurrent? :P
this explains a lot of my printer trouble lately. 22:50
TimToady even lazy lists can be done concurrently
benabik jnthn: Is there a way to differentiate between Int and int literals?
masak 'night, #perl6 22:51
TimToady we try to keep our literals as allomorphic as possible
jnthn benabik: No, they...what TimToady said
I suspect we have some details on that allomorphy to work out yet, though.
Well, I have, even if TimToady++ has it all worked out. :)
TimToady er...maybe subconsciously... :) 22:52
fsergot good night #perl6 o/ 22:54
jnthn 'night, fsergot 22:55
colomon \o
Araq which implementation is the most advanced? rakudo? 22:57
TimToady they all have their strong points and weak points 22:58
Araq like? 22:59
TimToady see perl6.org/compilers/features
and niecza is on average considerably faster than rakudo at this point
rakudo is stronger on its MOP, niecza is stronger in its parser (in the feature sense) 23:00
they both pass about the same number of spec tests at this point 23:01
Araq rakudo is based on parrot, right?
TimToady yes 23:02
at the moment
but is designed to be retargetable someday
niecza is on mono/.NET
Araq are there any language features that are *not* in perl6? :-) 23:03
TimToady sure
indentation for syntax; optional semicolons :)
we don't do currying in the strict sense, though partial application is fine 23:04
where currying strictly means all functions are really of one argument as they are in Haskell
(many people misuse "currying" to mean partial application) 23:05
there are many, many stupid features that we haven't borrowed from other languages too
like multi-pass parsing 23:06
Araq really?
how should syntax macros work otherwise?
TimToady hygienically
you can do multi-pass parsing if you force it, there's always text macros and eval and such 23:07
23:07 mj41 left
TimToady but that falls under the category of knowing you're programming in two different languages at the same time 23:08
intentional generic code is okay, but generally we want to know exactly which language the parser is in at any moment
so we don't borrow two-pass solutions like P5's source filters 23:09
which are not very composable
a good site for comparing programming langauges is rosettacode.org; Perl 6 usually comes off looking pretty good there 23:11
Araq: what languages are you familiar with already? 23:12
Araq I hope pretty much all of them :-)
TimToady ooh, a dilettante/1 23:13
*!
in that case, you should definitely see rosettacode.org 23:14
Araq thanks you made my day :D
TimToady unless, of course, that's what brought you here in the first place...
Araq strictly speaking if you allow for user defined operator precedence, you have to do multi pass parsing already 23:16
ok, not if you keep a symbol table for parsing 23:17
TimToady well, basically, that's why we enforce one-pass parsing, so that you can know whether you're in the language with the new operator or not 23:18
in the extreme view, every declaration of a new name changes the language a bit 23:19
jnthn Time for some sleep &
TimToady o/
Araq so if I introduce a new operator like ??! and give it precedence 23:21
and then use it after definition
TimToady it will automatically be parsed correctly by the operator precedence parser
the P6 parser is a layer cake of top-down and bottom-up 23:22
Araq so you keep a symbol table for parsing?
so that you can look up ??!'s definition?
and precedence
TimToady we keep an entire new grammar and lexer if you do something like a new operator
derived from the old one
grammars are just classes with funny methods that look like regexes 23:23
Araq alright, how does the parser know when to invoke which grammar?
23:23 kmwallio joined
Araq oh I see. There is a notion of a "current" grammar I suppose 23:23
TimToady the parser passes aroudn Cursor objects that reflect the current grammar and state of the parse
and with lazy lists of cursors, you get backtracking for free 23:24
well, for "free" :)
Araq hm
TimToady backtracking is merely throwing away this cursor and continuing with the next one on the lazy list 23:25
colomon niecza: sub infix:<??!>($a, $b) is equiv<*> { $a * $b * 2 }; say 1 + 3 ??! 5
p6eval niecza v14-97-gacd7da0: OUTPUT«31␤»
colomon niecza: sub infix:<??!>($a, $b) is equiv<+> { $a * $b * 2 }; say 1 + 3 ??! 5
p6eval niecza v14-97-gacd7da0: OUTPUT«40␤»
Araq I don't get it. Why a lazy list and no stack?
TimToady you can't unpop a stack without continuations 23:26
if you want to backtrack into a subrule, you need a way to do that
colomon: that equiv<> syntax looks weird to me
oh, I guess it's still just a pair in disguise 23:27
Araq what's an 'unpop' operation? a 'push'?
TimToady only if you can manage to push back whatever was popped off and thrown away! 23:28
colomon TimToady: just copying the syntax I found in a quick grep of the niecza source. :)
TimToady colomon: sorry, just woke from nap and am still groggy
colomon niecza: sub infix:<??!>($a, $b) is equiv(&infix:<+>) { $a * $b * 2 }; say 1 + 3 ??! 5
p6eval niecza v14-97-gacd7da0: OUTPUT«===SORRY!===␤␤Bogus term at /tmp/9RAbq7nbU6 line 1:␤------> iv(&infix:<+>) { $a * $b * 2 }; say 1 + ⏏3 ??! 5␤␤Parse failed␤␤»
TimToady Araq: note that the precedence levels are all relative, and you can insert an infinite number of new precedence levels
colomon TimToady: no worries 23:29
Araq so you don't pop a grammar at the end of the module that introduced it 23:30
TimToady well, the top-level precedence levels are absolute, but the user never worries about those
Araq so because you never pop, it's a list and no stack
TimToady if you throw away the last lazy element that references the grammar, sure 23:31
and leaving a block does that sort of thing
Araq I still don't get the 'lazy' part so I'm ignoring that for now
so ... hm 23:32
TimToady low level, it means you can match / x*? y / as few times as possible without actually finding all the x's first
high-level, it means you can deal with infinite lists 23:33
Araq any pseudo-code for how the parser works?
TimToady perl6: say (0, 1, *+* ... *)[100]
p6eval rakudo 3ca6e5, niecza v14-97-gacd7da0: OUTPUT«354224848179261915075␤»
..pugs b927740: OUTPUT«*** ␤ Unexpected "["␤ at /tmp/Er2wHKHDes line 1, column 22␤»
TimToady 100th fibonacci
why pseudocode? the real code is in Perl 6... 23:34
or do you mean the cursor stuff? 23:35
Araq link?
and well I mean the cursor stuff and the parser
I guess; not sure since I don't understand yet how it works 23:36
TimToady do you have any of these installed yet?
Araq is there any classical lexer/parser distinction at all?
TimToady yes and now
*no
you write the parser, and the lexer is automatically derived from it for you
you have some control over that in how you write the parser 23:37
you can tell it where to stop attempting longest token matching, for instance
Araq I suppose the grammars are neither LL(k) nor LR(k) nor LAIR or whatever 23:38
is it based on PEGs?
TimToady yes, PEGs is probably the closest concept 23:39
Araq do you allow for left recursion?
TimToady outside of that, LL is pretty close, but we don't generally have to worry about left recursion because the bottom up EXPR rule tends to get invoked somewhere in the middle layer 23:40
23:40 whiteknight joined
Araq how can the EXPR rule be bottom up? 23:40
TimToady you can write a left recursion, and it won't blow up the LTM (longest token matcher), but you better have something in place to decide how to get out of the recursion
it's an operator precedence parser 23:41
Araq so EXPR does not use the same matching algorithms?
TimToady at least in the standard language it is; one could substitute something stronger, but generally only at the risk of befuddling the users
Araq is EXPR hardcoded then? 23:42
TimToady EXPR calls back down into the top-down rules to find terms and infixes
it's just a method, as are all the rules in the grammar
23:42 snearch left
Araq I see 23:43
TimToady github.com/perl6/std/blob/master/STD.pm6 is the standard parser that everyone is aiming towards
niecza follows it more closely than rakudo at this point
just search down for 'method EXPR' if you want to see the opp 23:44
Araq thanks, found it 23:45
TimToady it's not a trivial parser, insofar as it handles strange forms of associativity
Araq how is parsing speed with this approach? 23:46
TimToady you'll want to consult the precedence table in S03
not blazing fast yet, but gives much better error messages than your typical LALR
there's still plenty of room for optimization, I think 23:47
but we're concentrating on correctness first
23:48 skids joined 23:51 kmwallio left
Araq what's the obsession with <> styled brackets? :-) 23:51
<.sorry: "..." >
TimToady well, that's the extension syntax for assertions in P6 regexes
that particular syntax is just a method call 23:52
if you're familiar with Perl 5 regexes; Perl 6 regexes are a radical rethink
S05 describes the differences
you'll also see <foo> used a lot as literal hash subscripts because the standard parser is written on top of a Perl 5 engine, so objects tend to be hashes 23:53
those will change to .foo accessors as we move more to an opaque object model 23:54
(and is one of those optimizations I mentioned) 23:55
23:56 am0c joined
sorear good * #perl6 23:58
TimToady sorear: Araq++ here seems to be a kindred spirit; he's asking all sorts of interesting questions :)
er, ey is :) 23:59