Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2011-08-19

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:03 mdrc eventually requireing to jump, only within the current scope
00:07 mdrc also adjacent error code doesn't belong amoungst the nice
00:09 mdrc (no matter what automatic profilers would suggest)
00:17 [Coke] mdrc: http://perlcabal.org/syn/S04.html#The_goto_statement
00:18 mdrc nice
00:20 thou joined #perl6
00:21 arnsholt I suspect there are more idiomatic ways to handle that though
00:22 arnsholt Like a LEAVE phaser in the appropriate place
00:23 mdrc "unthrown exceptions", which should be "unthrown exceptions," which -- though
00:23 mdrc with the comma inside the quotation
00:24 arnsholt Only if you use the wrong quotation style =)
00:24 mdrc no that's proper
00:24 mdrc writing style
00:25 arnsholt That depends, actually. I know the US convention is inside, but outside is common in Europe
00:25 arnsholt (IIRC its often called Oxford comma or something like that)
00:25 mdrc oh really, i didn't read european book lately
00:25 arnsholt "Logical punctuation" is another name
00:26 arnsholt Right, Oxford comma is something else (comma before and, not this one)
00:26 mdrc english / uk has the comma within
00:26 mdrc and american
00:27 arnsholt Right. At any rate, outside is a different convention. Reasonably common as well I think
00:27 mdrc i haven't seen it
00:27 mdrc only in errors
00:28 clkao win 22
00:28 arnsholt http://en.wikipedia.org/wiki/Quotation_mark#Typographical_considerations has a fairly thorough discussion
00:28 arnsholt Essentially, punctuation belongs inside the quotes only when it's actually part of the quotation IMO
00:30 takadonet1 left #perl6
00:30 mdrc im also a bit of a caret or whatever
00:30 arnsholt Caret?
00:30 lue I personally treat quotation marks as actual quoting (e.g. unless someone ended their sentence in a comma, I don't write "Hello world," he said.)
00:30 mdrc you know like to point out the little mistakes
00:31 mdrc you should
00:31 mdrc imo
00:31 mdrc seems nicer like that
00:32 mdrc oh, and ). there
00:34 mdrc i.e. when the parenthesis itself is no full sentence
00:36 lue I'm pretty sure I'm going to annoy my English teacher this coming school year due to my logical (i.e. programmer's) approach to writing...
00:37 mdrc sounds interesting
00:38 thou joined #perl6
00:40 lue At least I don't end my sentences in semicolons (yet). That'd be really annoying :) .
00:41 mdrc sometimes they're the only logical choice
00:41 mdrc for on-going sequence points or whatever
00:55 Sarten-X joined #perl6
01:09 pmichaud loliblogged: http://rakudo.org/2011/08/19/rakudo-2011-08-release-status/
01:12 colomon \o/
01:18 [Coke] pmichaud++
01:19 pmichaud time to head to the airport
01:21 [Coke] PerlJam: there's perl code now, if this helps: https://github.com/coke/famflags
01:23 pmichaud afk from riga
01:25 colomon safe home
01:25 [Coke] get ready for the heat!
01:27 uasi joined #perl6
01:29 orphu joined #perl6
01:30 woosley joined #perl6
01:35 odoacre joined #perl6
01:37 LimitSupremum joined #perl6
02:54 _jaldhar joined #perl6
03:07 jaldhar joined #perl6
03:14 thowe joined #perl6
03:24 Su-Shee_ joined #perl6
03:27 wooden joined #perl6
03:33 jaldhar joined #perl6
03:41 satyavvd joined #perl6
03:42 molaf joined #perl6
03:42 LimitSupremum joined #perl6
03:49 Trashlord joined #perl6
03:51 birdwindupbird joined #perl6
04:10 masak joined #perl6
04:11 masak morning, #perl6
04:11 lue hello masak o/
04:11 sorear Hi masak!
04:16 masak so, who will be the first to write a little-animal-farm AI? :)
04:19 masak here's how you do it: https://gist.github.com/1154298
04:19 masak (now with slightly more details filled in)
04:26 TimToady us --> RIX
04:28 thowe I just read the docs for Acme::Meow
04:29 thowe I don't know how to feel about that
04:36 [Coke] .u check
04:36 phenny U+2713 CHECK MARK (✓)
04:38 masak .u cheque
04:38 phenny masak: Sorry, no results for 'cheque'.
04:41 bbkr joined #perl6
04:43 gabiruh joined #perl6
04:45 lue farm looks like an interesting game. (I have an oh-so-sneaking suspicion it doesn't work on nom)
04:46 bbkr_ joined #perl6
04:48 [particle] joined #perl6
04:57 masak lue: let's find out.
05:02 kaare_ joined #perl6
05:04 daniel-s joined #perl6
05:11 masak wow. saying that it takes forever to compile the setting is an exaggeration, but not a very strong one. :/
05:14 masak it seems to definitely hit the swapping roof here. that's probably why. 2 GB.
05:14 masak well, the compilation only takes 1.3 GB, and the rest is other stuff on the system.
05:15 * [Coke] finally gets around to ordering the chinese books that... moritz++ recommended. (crap, was it masak++ ?)
05:16 * [Coke] asks masak for feedback on https://github.com/coke/famflags/
05:17 * masak looks
05:17 masak setting compilation complete. took 19 minutes.
05:18 masak [Coke]: cool. don't know what more feedback you want. :)
05:19 masak lue: your suspicion is correct.
05:19 masak Method 'rxtype' not found for invocant of class 'PAST;Regex'
05:19 masak are we beginning to recognize this error yet? :)
05:20 * masak golfs it
05:20 [Coke] masak: that's sufficient, I suppose. ;)
05:20 [Coke] danke.
05:20 lue Ah. I was updating nom to make sure and see if it was solved in the latest version.
05:22 masak yeah, no. this is bleeding edge.
05:26 masak ok, removing the first two MAINs (and making the last one 'sub' instead of 'multi', not sure that step was necessary) produced this result: it parsed for a long time, took up almost 1 GB of memory, and then parsefailed with 'maximum recursion depth exceeded'.
05:26 masak no, nom is not ready for prime time yet :/
05:27 masak note: parsefailed. I'm presuming that's what the '===SORRY!===' means.
05:28 aloha joined #perl6
05:38 lue How hard would it be to implement native types in nom? I assume I'd have to do a lot of nqp stuff, but that isn't much of a problem.
05:39 masak lue: it definitely would go beyond nqp stuff.
05:39 moritz some native types are already implemented in nom
05:39 lue .oO(PIR? ... PBC‽)
05:39 moritz C
05:42 lue figures. (not C++? I'll learn either, considering I only have a tiny, _tiny_ amount of knowledge concerning C++)
05:44 masak ok, here's what the error in farm.pl golfs down to:
05:44 masak nom: my regex a { a }; my regex b { <&a> }
05:44 p6eval nom: OUTPUT«===SORRY!===␤Method 'rxtype' not found for invocant of class 'PAST;Regex'␤»
05:44 masak pmichaud: ^
05:45 masak but note that once we fix that, there's still the infinite recursion parsefail to fix, too.
05:48 uasi joined #perl6
05:49 moritz in nom, "===SORRY!===" currently means "compilation error", not necessarily "parse error"
05:50 masak ah; thanks.
06:02 wtw joined #perl6
06:02 cotto joined #perl6
06:10 * lue wonders where those native types are implemented in rakudo...
06:10 moritz which part of them?
06:10 sorear nom supports all the native types
06:11 sorear but it runs on a very feature-poor VM which only supports four types
06:11 moritz sorear: no, just int,str,num
06:11 sorear surely it makes no sense to emulate native types not provided by the underlying platform
06:11 sorear they're *native* types
06:13 moritz sorear: well, I'm pretty sure my processor offers uint32 and uint64, even if parrot does not
06:14 moritz sorear: "native" always implies "native to something", and that something might not need to be parrot
06:16 mberends good * all
06:18 uniejo_in_riga joined #perl6
06:18 mberends these types would be native one turtle down, for example native in C (for Parrot) or C#.
06:19 lue I actually just want uint32 so I can make a clearer (and more right) implementation of the SHA-1 algorithm. So I'm willing to try and implement them myself.
06:19 moritz sorear: if I understand the specs correctly, a Perl 6 compiler has to offer all the specced "native" types, even if emulated
06:21 sorear moritz: is there any way to emulate a native type using Perl 6 code?
06:21 moritz sorear: I don't have the slightest idea
06:21 sorear it would be awesome if it were possible to define, say, 64-bit floating-slash numbers with "native type" semantics.
06:23 mberends sorear: by "floating-slash" do you mean Rat64?
06:24 sorear mberends: no
06:25 sorear a 64-bit floating-slash number might have a 6 bit "numerator size" field N, then N bits of numerator, then 60-N bits of denom
06:26 sorear mberends: using C types for Parrot is two turtles down.  You know Parrot will be moved off C soon, right?
06:27 masak \o/
06:27 lue ...to what? (low-level assembler? Parrot itself?)
06:28 koban joined #perl6
06:29 sorear lue: they're in the process of creating a new low-level language called Mole
06:30 mberends sorear: thanks I see now.  I know Parrot has been planning to move off C, but I did not expect it to happen soon.
06:30 sorear "soon" is relative
06:30 TimToady Maybe they should create a low-level language called Go :P
06:31 * TimToady is at RIX
06:33 sorear ??RIX
06:33 sorear TimToady: nih :p
06:33 lue I don't know why, but implementing a virtual machine on top of a custom low-level language seems to me to be... not quite right. (I'm not sure why I feel this, perhaps it's the fact that there is a whole other level now)
06:34 mberends sorear: 58-N bits of denom, unless we upgrade to 66-bit processors iiuc.
06:35 mberends lue: I share your concerns
06:35 sorear mberends: I specified 64-bits, I just can't subtract
06:35 sorear lue: this is a very good sign
06:43 lue is Mole going to JIT (which IIUC means 'interpreted,  but caches interpreted code for when it's used again'), just like Parrot?
06:44 sorear your last statement contains at least three misunderstandings
06:44 sorear first off, interpreters don't generate code.
06:45 sorear a JIT (Just in time (translator)) is a program which runs code by converting it into another form when needed
06:45 sorear and Parrot does not use a JIT yet
06:46 TimToady (anymore)
06:46 mberends are there Mole docs anywhere? I've  seen only blogs and irclogs.
06:47 sorear mberends: talk to cotto
06:49 HarryS joined #perl6
06:53 lue IMO, creating a brand-new platform to put Parrot on means that 1) There is a problem with Parrot, and 2) the solution seems to be to create *another* virtual platform to put it on.
06:54 mberends aye, and 1) smells like 'poor workmen blaming tools'
06:54 mj41 joined #perl6
06:57 lue Not that I'm going to fight all day about something I honestly don't care too much about. I just think it sounds like a bad direction (whether or not it actually is I do not know)
06:58 cotto joined #perl6
06:59 mberends we care about the resulting reliability and efficiency
07:00 lue Indeed.
07:00 mberends cotto: can you point us to some docs about Mole or Parrot's M0?
07:02 xinming joined #perl6
07:03 cotto mberends, sure.  checkout out docs/pdd/drafts/pdd32-m0.pod in the m0-spec branch.
07:03 mberends cotto: thanks
07:03 cotto mberends, my plan for the next few days is to make it closer to an actual assembly language (especially in terms of # of ops).  I'm not sure how much more the spec will change.
07:04 cotto I don't suspect it'll be too drastic other than an increase in the number of ops and possibly a different view of registers.
07:05 mberends a few ops don't matter much. There should always be room for more anyway.
07:07 cotto mberends, we're trying to keep the number down within reason.  I'd expect something in the range of 100-ish, though it's hard to say atm.
07:07 mberends cotto: that's sensible, JVM is similar
07:09 mberends lue: straight to the M0 spec: https://github.com/parrot/parrot/blob/m0-spec/docs/pdds/draft/pdd32_m0.pod
07:09 * lue reading...
07:12 * mberends reading too
07:13 cotto mberends and lue: very little is set in stone.  Comments are most welcome.
07:14 mberends it seems that the motivation for M0 is Parrot's CPS colliding with C's stack.
07:15 masak cotto! \o/
07:15 masak cotto: it was great to meet you at YAPC::EU. thanks for taking the trouble to cross the pond for meeting up with us European hippies.
07:15 TimToady maybe they should start with Go and turn it into Mo :
07:17 TimToady :) even
07:20 cotto masak, it was pretty awesome.
07:21 cotto I'm glad I finally got to meet you and jnthn.
07:21 mberends lue: as with so many languages (C included), M0 defines bit shifting but not rotating, because the number of bits would need to be specified (back to your uint32 wish).
07:22 LimitSupremum left #perl6
07:22 lue I know. I think my current (extremely messy) SHA-1 implementation would be much better if I could use uint32, :2($a), and possibly Bufs
07:22 rafl joined #perl6
07:23 masak rakudo: role Mood[$name] { method name { $name } }; role Mood[$modifier, Mood $m] { method name { "$modifier $m.name()" } }; say "it was ", Mood["pretty", Mood["awesome"]].new.name
07:23 p6eval rakudo a55346: OUTPUT«it was pretty awesome␤»
07:23 masak \o/
07:23 mberends cotto: in http://parrot.org/dev the 'Git Web Interface' link is misnamed and broken
07:24 lue ooh, square brackets. Does that introduce a different meaning than Mood($name) ?
07:24 masak lue: yes, parens are for signatures. brackets are for role poly.
07:24 masak (well, what's in them is a signature too, but that's just a nice unification)
07:27 cotto mberends, not for long
07:29 mberends cotto: if M0 has special 'print' ops to stdout it seems unfair not to also have 'printerr' ops to stderr.
07:30 satyavvd do we have Vim regex equiant of equiant   of  \%[ ]  to match   A sequence of optionally matched atoms  in perl6 ?
07:31 cotto mberends, Hmmm.  I thought we did.
07:31 wamba joined #perl6
07:32 masak satyavvd: well, there's <*xyz>, but I don't know if that's what you mean.
07:32 satyavvd in vim i can match all of these words  fun func funct functi functio function    with a single regex /\<fu\%[nction]\>
07:35 satyavvd masak : how can i do the same in perl6 ?
07:35 masak yes, then I guessed right.
07:35 masak / <*function> /
07:35 masak or maybe
07:35 Mowah joined #perl6
07:35 moritz rakudo: say 'fun' ~~ / <*function> /
07:35 masak / fun <*ction> /
07:35 satyavvd oh ok that is what i need..
07:35 p6eval rakudo a55346: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'fun' "␤»
07:35 moritz alpha: say 'fun' ~~ / <*function> /
07:35 masak note that it's NYI.
07:35 p6eval alpha : OUTPUT«Confused at line 10, near "> /"␤in Main (file <unknown>, line <unknown>)␤»
07:35 moritz niecza: say 'fun' ~~ / <*function> /
07:35 masak it's a fairly new S05 spec patch.
07:36 p6eval niecza v8-52-g3afe236: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Action method assertion:sym<*> not yet implemented at /tmp/u0V1ughKj2 line 1:â�¤------> [32msay 'fun' ~~ / <*function[33mâ��[31m> /[0mâ�¤â�¤Unhandled exception: Unable to resolve method oplift in class Strâ�¤  at /home/p6eval/niecz…
07:36 moritz masak: and by "fairly new" you mean "just two years old" or so?
07:36 masak do we have a table entry for this functionality? :)
07:36 masak moritz: yes :)
07:37 moritz masak: it's at least from 2008
07:38 moritz masak: 'git blame' shows that it's present in pmichaud++'s "Move synopses to their new home." commit from 2008-11-26
07:38 masak oh!
07:39 masak it... felt newer :)
07:39 tyatpi joined #perl6
07:41 mberends cotto: 'List of ops' alludes to gripe and say, but they are not assigned opcodes. (a spello is 'conerned' 2 paras down)
07:42 masak 'gripe' is cute.
07:45 envi joined #perl6
07:47 donri joined #perl6
07:49 Kivutarrr joined #perl6
07:50 envi joined #perl6
07:51 lue .oO(    if all(@else_fails) { gripe "Oh come on! Why won't you work‽"; }    )
07:53 mux cute indeed
07:54 mberends "Division by zero will make the the M0 interpreter sad."
07:54 lue The gripe command wouldn't do anything user-visible, as its intention is to bug the compiler.
07:55 am0c joined #perl6
07:57 mberends griping would make the the interpreter annoyed with the program
07:57 masak bye for now, #perl6
07:57 mberends o/
07:57 masak see you in Estonia! o/
07:58 mux "Every time you divide by 0, the interpreter kills a virtual kitten."
07:58 mberends lol
07:59 moritz "and marks its death in the EINVALIDOP flag"
07:59 lue .oO(Are mult_i and mult_n supposed to ignore $2 ?)
08:00 lue I almost want to create a language that harnesses the awesome power of dividing by zero, instead of fearing its might and immediately keeping it from doing any harm.
08:01 mberends that would be useful to program the infinite improbability drive
08:03 lue .oO(C/++'s null escape character "\0" is just dividing by zero with funny syntax. Since \0 is null, it's obvious that x/0 == Mu , where x is (in Perl 6) of type Mu.)
08:07 mberends obvious :)
08:12 alim joined #perl6
08:13 lue Well, don't Mu and null both mean nothing? [In P6, Mu also means everything, which proves /0 's awesome powers. QED]
08:14 lue .oO(Perhaps I should write a formal-looking paper the proves this..._
08:21 mberends to solve a problem, reduce it to nothing. then the solution is also nothing. no problem.
08:22 lue I can't help it. I'm writing up a proof based on the logic I have presented here.
08:26 sorear who's going to Estonia?
08:29 am0c joined #perl6
08:40 im2ee joined #perl6
08:52 tadzik good morning #perl6
08:52 moritz good morning tadzik
08:52 moritz tadzik: are you back at $home?
08:54 tadzik moritz: yes
08:54 tadzik more like any(@home), but yes :)
08:54 moritz :-)
08:55 * moritz just realized that "no such file or directory" error messages absolutely should include the current working directory
08:58 mberends :)
09:00 Trashlord joined #perl6
09:00 * tadzik looks at the gsoc roadmap
09:01 tadzik okay, so I either invent some workaround for exposing Pod::Parser or poke the crazy formattingcodes :)
09:04 moritz somehow the former sounds more worthwhile right now
09:06 moritz though other explorations in Podspace would be fine by me too, even if they deviate from the gsoc roadmap
09:06 tadzik ouch, stealing colonpair token from the Perl 6 grammar seems like a crazy idea
09:06 tadzik well, technically this is a spec
09:06 tadzik practically, even the spec doesn't use it
09:08 anbz joined #perl6
09:08 anbz left #perl6
09:10 felher nom: sub sayit($x) { say $x.perl};     sayit( all(1,2,3,4) );    {say $^x.perl}( all(1,2,3,4) );
09:11 p6eval nom: OUTPUT«1␤2␤3␤4␤all(1, 2, 3, 4)␤»
09:11 felher rakudo: sub sayit($x) { say $x.perl};     sayit( all(1,2,3,4) );    {say $^x.perl}( all(1,2,3,4) );
09:11 p6eval rakudo a55346: OUTPUT«1␤2␤3␤4␤all(1, 2, 3, 4)␤»
09:11 felher Should the latter be the same as 'sub sayit...'?
09:11 flussence mornin', *
09:11 tadzik hi flussence
09:11 felher perl6: sub sayit($x) { say $x.perl};     sayit( all(1,2,3,4) );    {say $^x.perl}( all(1,2,3,4) );
09:11 felher o/
09:11 p6eval rakudo a55346: OUTPUT«1␤2␤3␤4␤all(1, 2, 3, 4)␤»
09:11 p6eval ..pugs: OUTPUT«\2␤\3␤\4␤\1␤\1␤\2␤\3␤\4␤»
09:11 p6eval ..niecza v8-52-g3afe236: OUTPUT«1␤2␤3␤4␤1␤2␤3␤4␤»
09:12 flussence tadzik: seen this yet? :) https://github.com/perl6/Pod-To-HTML/commit/0e2cd077
09:12 moritz nom: { $^x }.signature.perl
09:12 p6eval nom:  ( no output )
09:12 moritz nom: say { $^x }.signature.perl
09:12 p6eval nom: OUTPUT«:(Mu $x)␤»
09:12 moritz nom: say (sub f($x) { }).signature.perl
09:13 p6eval nom: OUTPUT«:(Any $x)␤»
09:13 moritz that's the difference
09:13 lue tadzik: you mean using the colonpair rule in the Grammar for Pod? I did that :)
09:13 tadzik flussence: oh, that looks cool
09:13 lue ("rule" being used in its general sense, not its P6 Grammar sense neccessarily)
09:14 tadzik lue: oh, nice
09:14 felher moritz: oh, interesting. Is this intended by spec?
09:14 tadzik but I think I'll stumble on the same problem as ususal, ie "I can't use Perl6::Grammar in Perl 6 code"
09:14 moritz felher: I have no idea
09:14 moritz nom: say Perl6::Grammar
09:14 p6eval nom: OUTPUT«Could not find symbol 'Perl6::&Grammar'␤  in sub die at src/gen/CORE.setting:365␤  in mu <anon> at /tmp/HFl8GYQEcW:1␤  in mu <anon> at /tmp/HFl8GYQEcW:1␤␤»
09:15 lue Won't match the key => 1 kind of stuff, but it works for most of the possibilities.
09:16 moritz because it's not a *colon*pair
09:17 lue of course. I don't think I ever expected it to.
09:19 felher moritz++: K, thnx. :)
09:19 felher Maybe it's because of "Note that placeholder variables syntactically cannot have type constraints."
09:19 uniejo_in_riga joined #perl6
09:27 tadzik nqp: say(":allow<B>   " ~~ /':' \w+ /)
09:27 p6eval nqp: OUTPUT«:allow␤»
09:28 tadzik nqp: say(":allow<B>   " ~~ /':' \w+ [ '<' \w+ '>']?/)
09:28 p6eval nqp: OUTPUT«:allow<B>␤»
09:28 tadzik that's one cheaty colonpair :)
09:30 moritz do you have an <identifier> rule you could use instead?
09:30 moritz :allow-bold<really!>
09:30 koban joined #perl6
09:32 tadzik hmm, I do have, yes
09:32 SHODAN joined #perl6
09:32 tadzik it's stolen already
09:33 tadzik okay, blockers again: protoregexes not yet implemented at line 11, near "token pod_"
09:33 moritz then I'd suggest to stall that task
09:35 tadzik hmm
09:36 moritz the effort to work around that isn't justified, IMHO
09:36 tadzik yes
09:37 moritz especially since it will be reduced in the near future
09:37 tadzik closed then
09:37 * moritz still waits for the big regex thing
09:38 tadzik so the only remaining thing is the Crazy Formattingcodes, if we want to implement that
09:38 moritz is that the blocks-inside-formatting-codes?
09:38 tadzik yes
09:38 moritz -1
09:38 moritz rather make V<C<foo>> DTRT
09:38 tadzik in Pod::To::Text you mean?
09:39 moritz what AST does it produce right now?
09:39 tadzik I don't think it's worth specialcasing in the parser itself
09:39 moritz maybe not in the parser, but in the AST generation
09:39 tadzik FOrmattingcode('V', FormattingCode('C', 'foo'))
09:39 tadzik or something like this
09:39 moritz I'd expect it return Formattingcode('V', 'C<foo>')
09:40 felher Hm, no, according to S02, Any is the default routine parameter type. I can not find anything that states otherwise for placeholders, so i guess that should be changed.
09:40 moritz felher: { $^X } is not a routine, but a block
09:41 tadzik moritz: I'd read through Formatting Codes list once again and look for special cases like this one
09:41 tadzik but now, breakfast
09:41 moritz ok
09:41 felher moritz: i see, thanks again. :)
09:41 moritz guten Appetit tadzik :-)
09:41 tadzik Danke Schon, moritz :)
09:42 tadzik I must improve my schlecht Deutsch until the next YAPC::EU
09:42 * moritz had the rest of a Dutch breakfast loaf today, by courtesy of mberends++
09:43 moritz forgot the exact name
09:43 tadzik Stroppwafel maybe? :)
09:43 moritz no, I know that one :-)
09:43 tadzik booking brought those to yapceu, mmm
09:43 tadzik I'm hungry
09:43 moritz it was like a loaf of bread, but it tasted like almond bisuit
09:44 moritz sweet-ish
09:44 tadzik mmm
09:45 dalek roast: 8ebec7e | moritz++ | S02-names_and_variables/varnames.t:
09:45 dalek roast: fudge varnames.t for rakudo
09:45 dalek roast: review: https://github.com/perl6/roast/commit/8ebec7ecfb
09:47 Mowah joined #perl6
09:47 dalek roast: 309defc | moritz++ | S03-metaops/cross.t:
09:47 dalek roast: remove a bogus test
09:47 dalek roast:
09:47 dalek roast: It assumed that >> and << hyper ops do not recurse into nested data
09:47 dalek roast: structures, which deviates from current thinking
09:47 dalek roast: review: https://github.com/perl6/roast/commit/309defc1a4
09:49 moritz nom: my ($foo, $bar); $bar := $foo;
09:49 p6eval nom: OUTPUT«===SORRY!===␤Cannot use bind operator with this LHS at line 1, near " $foo;"␤»
09:49 moritz uhm, why not?
09:50 moritz nom: my $foo; my $bar; $bar := $foo;
09:50 p6eval nom:  ( no output )
09:50 moritz bug!
09:50 mathw bug!
09:50 moritz mathw!
09:50 mathw hi
09:50 moritz that's from t/spec/S03-operators/identity.t
09:50 moritz tests++
09:51 mathw tests are good
09:51 mathw in my new job I intend to get test-first development in if at all possible
09:52 mathw anybody know any good resources on test-first for GUIs?
09:52 mathw is it even possible?
09:52 * mathw sponges off the wisdom of #perl6 without contributing, again
09:54 moritz mathw: I don't have any experience with GUI testing. My previous thoughts on that matter were to make the GUI code as lean as possible, and try to test the backend as much as possible
09:54 woosley joined #perl6
09:55 moritz ideally, each GUI operation should boil down to just one method call on a backend object
09:55 moritz and you can test that backend object without any GUI
09:55 mathw yes, tests are easier without side effects, and the GUI is a really big side effect
09:56 moritz Perl 5 has Win32::GuiTest, which has a rather good reputation
09:56 moritz not sure about cross-platform or linux GUI testing
09:56 mathw it's Windows, so that might be worth a look
09:56 mathw although we should probably stick to .NET tools if we can since that's our development platform
09:57 mathw not that learning Perl wouldn't be good for my new colleagues...
09:58 * mberends noms Bavarian Blue cheese for lunch, courtesy of moritz++
09:58 Mowah_ joined #perl6
10:00 Alias joined #perl6
10:01 moritz mathw: might be of interest, if a bit dated: http://www.testingfaqs.org/t-gui.html
10:07 mathw hmm it seems that makes our proxy explode.
10:07 * mathw saves it for later
10:14 dual joined #perl6
10:17 bbkr_ what is the replacement of __END__ in p6?
10:18 moritz =END or so?
10:19 dalek roast: ba20490 | moritz++ | S05-capture/match-object.t:
10:19 dalek roast: add test file for checking methods on Match objects
10:19 dalek roast: review: https://github.com/perl6/roast/commit/ba20490eab
10:19 bbkr_ =END works :)
10:19 moritz niecza: say Match ~~ Capture
10:20 p6eval niecza v8-52-g3afe236: OUTPUT«Bool::False␤»
10:20 huf joined #perl6
10:25 tadzik delayed status report sent
10:25 tadzik moritz: ^
10:31 tadzik Note, however that the V<> code only changes the way its contents are parsed, not the way they are rendered. That is, the contents are still wrapped and formatted like plain text, and the effects of any formatting codes surrounding the V<> code are still applied to its contents
10:31 tadzik makes sense
10:31 tadzik definitely parse time then
10:32 dalek rakudo/nom: 82849a2 | moritz++ | / (2 files):
10:32 dalek rakudo/nom: implement Match.{pre,post}match, run three more test files
10:32 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/82849a226a
10:33 lue goodnight all o/
10:35 tadzik lue: o/
10:39 ingy nom: say "hi"
10:39 p6eval nom: OUTPUT«hi␤»
10:47 kaare_ joined #perl6
10:58 colomon joined #perl6
11:02 flussence tadzik: is there (currently) any other way to invoke the pod parser than using a POD block and --doc?
11:03 masak joined #perl6
11:03 flussence o/
11:03 masak lol hi from a bus somewhere in the Baltics!
11:04 mj41 joined #perl6
11:06 pernatiy joined #perl6
11:07 masak sorear: jnthn and I are going to Estonia. also, a bunch of people on the bus that I don't know.
11:07 masak I'm surrounded by Chinese people, but I don't understand a word.
11:07 masak I hope it's because they're speaking Cantonese.
11:24 oyse joined #perl6
11:25 oyse Hi, are there any editors that support Perl 6 syntax highlighting. I have some problems getting it to work in Padre even if I have installed Padre::Plugin::Perl6
11:26 flussence vim does
11:26 * moritz uses vim too
11:26 uniejo__ joined #perl6
11:28 oyse I had hoped I could use something other than vim :) My vim knowledge is not that good. Is it hard to install the vim extension?
11:29 moritz oyse: not at all, the syntax file is even included in the newer vim releases
11:31 oyse mortiz: How recently was it added? I am sitting on a Ubuntu Lucid machine for the moment.
11:31 oyse moritz: with vim 7.2.330
11:31 flussence 7.3
11:32 moritz get it from https://github.com/petdance/vim-perl and run 'make install'
11:33 colomon joined #perl6
11:39 oyse mortiz: what file extension should I use for vim to automatically recognize a file as Perl 6?
11:40 moritz oyse: I use .pl, and add a  # vim: ft=perl6   modeline to the end
11:40 TiMBuS i use gedit with perl highlighting. and put comments on lines where the syntax decides to run away
11:40 * TiMBuS shrug
11:41 moritz nom: multi f() { }; multi f() { } ; say &f.Str
11:41 p6eval nom: OUTPUT«AUTOGEN-PROTO␤»
11:41 colomon joined #perl6
11:45 MayDaniel joined #perl6
12:00 masak joined #perl6
12:01 tadzik flussence: nope
12:05 masak more thoughts on macros: https://gist.github.com/1156662
12:05 im2ee joined #perl6
12:07 moritz nice
12:08 masak it's eerie how events come creeping into everything nowadays ;)
12:08 * moritz discovers a XSS vulnerability in one of Germany's largest web communities
12:08 masak jnthn: "The Web sucks" :)
12:09 nine joined #perl6
12:09 mathw joined #perl6
12:10 dalek rakudo/nom: 305e251 | moritz++ | src/Perl6/Actions.pm:
12:10 dalek rakudo/nom: make auto-generated protos have the same short name as the candidadates
12:10 dalek rakudo/nom:
12:10 dalek rakudo/nom: jnthn, please protest/revert if the old behavior had a good reason
12:10 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/305e251beb
12:11 masak jnthn says it's fine :)
12:11 masak it was just an oversight.
12:13 moritz great, thought so
12:13 moritz that was the failure in S06-multi/syntax.rakudo
12:14 moritz I was about to fudge the test because that single failure annoyed me, but I thought a fix would be preferable :-)
12:15 bbkr joined #perl6
12:16 dalek roast: 8ffd0b1 | moritz++ | S05-capture/match-object.t:
12:16 dalek roast: add more match object tests
12:16 dalek roast: review: https://github.com/perl6/roast/commit/8ffd0b1f8e
12:19 masak I think I will be able to start writing macro spectests during the weekend.
12:20 [Coke] joined #perl6
12:22 masak rakudo: class C { has $.self-reference = self }; given C.new { say $_; say .self-reference }
12:22 p6eval rakudo a55346: OUTPUT«C()<0x4bd5f08>␤C()<0x4bd5f08>␤»
12:22 masak \o/
12:23 masak that one can't be written that nicely in Moose. as far as I know.
12:26 moritz it doesn't have $self available in default closures?
12:31 masak it probably does.
12:31 masak but even with default closures, you're already in The Land of Not As Nicely.
12:31 moritz then you can say   default => sub { shift }, lazy => 1;
12:31 masak my point rests.
12:32 moritz nom: sub a(:$g) { say $g }; sub f { a(:$^g) }; f :g<10>
12:32 p6eval nom: OUTPUT«Not enough positional parameters passed; got 0 but expected 1␤  in sub f at /tmp/Iy_cbUtUld:1␤  in mu <anon> at /tmp/Iy_cbUtUld:1␤  in mu <anon> at /tmp/Iy_cbUtUld:1␤␤»
12:32 masak bug.
12:32 moritz indeed
12:32 moritz tested in named-parameters.t
12:32 arnsholt masak: I'm excited by your discussions of macros
12:32 masak arnsholt: :)
12:32 arnsholt It'll be a cool feature to play with
12:33 masak it will.
12:33 arnsholt I've been hacking in Common Lisp lately, and really come to like its loop() macro
12:33 masak nom: sub foo($x, $y?, $z?) { say ($x, $y, $z).perl }; foo :z, 42
12:33 p6eval nom: OUTPUT«Unexpected named parameter 'z' passed␤  in sub foo at /tmp/wauYcHk69v:1␤  in mu <anon> at /tmp/wauYcHk69v:1␤  in mu <anon> at /tmp/wauYcHk69v:1␤␤»
12:33 arnsholt Would be fun to have something like that in Perl 6 as well
12:35 masak arnsholt: so far the impression I have of the loop macro is that it gives imperativeness to people with imperativeness withdrawal syndrome in the relatively functional Lisp environment.
12:35 masak in fact, a bit like Haskell's monadic DSL.
12:36 tadzik moritz: what do you think about a Book chapter about Pod?
12:36 moritz tadzik: +$high_number
12:36 masak arnsholt: but maybe I'm less than fully informed in that matter.
12:36 arnsholt Yeah, it's definitely a treatment against imperative withdrawal. But it's really a quite concise way of describing loops as well
12:37 masak arnsholt: ok, nice.
12:37 tadzik moritz: I'll start a branch then
12:37 masak tadzik: just put it in master, IMO.
12:37 tadzik masak: ok
12:37 masak the resources for the book are few and far between.
12:37 arnsholt The hyper-spec reference for loop() is essentially just a mass of BNF. There's almost a full chapter solely about loop() =)
12:38 masak having things centralized is more important than not stepping on each others' toes.
12:38 masak arnsholt: that... doesn't sound very appealing.
12:39 arnsholt Hehe, I suppose in a way. Most of it is pretty managable, it can just do many things
12:39 dalek roast: 326dc0c | moritz++ | S06-signature/named-parameters.t:
12:39 dalek roast: fix and fudge named-parameters.t
12:39 dalek roast:
12:39 dalek roast: Some of the tests still assumed that you can fill positionals by name,
12:39 dalek roast: another one did not respect the scoping rules of subs and eval
12:39 dalek roast: review: https://github.com/perl6/roast/commit/326dc0c4ea
12:39 arnsholt Things like whether you want the variables you're iterating over to be set serially or in parallel
12:41 masak that reminds me.
12:41 masak someone should fix the error in the Perl 6 Wikipedia article.
12:41 dalek roast: ad5052d | moritz++ | S06-signature/type-capture.t:
12:41 dalek roast: fudge type-capture.t for nom
12:41 dalek roast: review: https://github.com/perl6/roast/commit/ad5052dc0c
12:42 masak it says something preposterous like "you loop in parallel in Perl 6 by doing 'for all(@a) { ... }'"
12:43 moritz I tried it once, and got scared because there were too many weird things
12:46 masak :/
12:46 dalek rakudo/nom: 7930348 | tadzik++ | / (2 files):
12:46 dalek rakudo/nom: Treat V<> blocks specially
12:46 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/79303481a6
12:46 tadzik might be worth to regenerate S26 now
12:47 JimmyZ joined #perl6
12:47 masak right, here's the place: http://en.wikipedia.org/wiki/Perl_6#Autothreading
12:47 masak it's a shame for something that wrong to sit there in the article.
12:48 * moritz tries to fix it
12:48 oyse What type of information is available through introspection of subroutines? For instance can I annotate a method in some way and retrieve that annotation at runtime? For instance to have an annotation that tells a web framework that the method is expose to GET requests?
12:48 moritz oyse: that would be done with traits
12:48 tadzik oyse: take a look at LolDispatch in Web.pm
12:49 tadzik ohh, it may be fixable in nom
12:49 moritz oyse: something like   method foo($x) is dispatch('/') { body of routine }
12:49 tadzik I also had these ideas for an App::Cmd module
12:49 moritz oyse: where there's a role named 'dispatch' that's mixed into the method
12:50 dalek Heuristic branch merge: pushed 235 commits to rakudo/nom-buf by tadzik
12:50 tadzik oo
12:51 masak 'is dispatched', perhaps.
12:51 oyse So I can make my own traits? Tried to read the S06, but it was not the most accessible.
12:51 oyse I will take a look at LolDispatch
12:51 Holy_Cow joined #perl6
12:52 masak yes, you can make your own traits.
12:53 masak just overload trait_mod:<is>, for example.
12:54 moritz oyse: try src/core/traits.pm in rakudo/nom
12:54 dalek features: 82d1c90 | moritz++ | features.json:
12:54 dalek features: formulate parallelization item a bit more broadly
12:54 dalek features: review: https://github.com/perl6/features/commit/82d1c90513
12:54 Holy_Cow left #perl6
12:54 * moritz prepares his sources for the wikipedia entry :-)
12:55 tadzik multi trait_mod:<is>(Routine:D $sub, $cmd, :$command!) { say 'ok' }; sub foo is command('asd') {}
12:55 tadzik nom: multi trait_mod:<is>(Routine:D $sub, $cmd, :$command!) { say 'ok' }; sub foo is command('asd') {}
12:55 p6eval nom: OUTPUT«===SORRY!===␤No applicable candidates found to dispatch to for 'trait_mod:<is>'. Available candidates are:␤:(Attribute $attr, Any $rw)␤:(Attribute $attr, Any $readonly)␤:(Routine $r, Any $rw)␤:(Parameter $param, Any $readonly)␤:(Parameter $param, Any $rw)␤:(Parameter $param,…
12:55 moritz tadzik: I think you need to define a role first
12:55 tadzik a role?
12:56 moritz probably not
12:56 tadzik ok, that's funny
12:57 tadzik multi trait_mod:<is>(Routine:D $sub, :$command!) { say 'ok' }; sub foo is command {}
12:57 tadzik e
12:57 tadzik nom: multi trait_mod:<is>(Routine:D $sub, :$command!) { say 'ok' }; sub foo is command {}
12:57 p6eval nom: OUTPUT«===SORRY!===␤Lexical '$sub' not found␤»
12:58 masak huh?
13:01 moritz huh.
13:02 moritz ask jnthn :-)
13:02 flussence shouldn't that be "$sub:" ?
13:02 tadzik should it?
13:02 flussence dunno
13:02 moritz flussence: nope
13:03 moritz only methods have an invocant
13:03 masak nom: class A { has $.x; method foo(A $o) { $o!x = 42 } }; my $a = A.new; A.foo($a); say $a.x
13:03 p6eval nom: OUTPUT«Method 'postcircumfix:<( )>' not found for invocant of class 'Mu'␤  in mu <anon> at src/gen/Metamodel.pm:2708␤  in method dispatch:<!> at src/gen/CORE.setting:593␤  in method dispatch:<!> at src/gen/CORE.setting:605␤  in method foo at /tmp/6ew4hN0Rkx:1␤  in mu <anon> at /tmp…
13:03 moritz masak: http://en.wikipedia.org/wiki/Perl_6#Autothreading fixed, sort of
13:03 masak moritz++
13:04 donri joined #perl6
13:04 masak moritz: the links don't come out as source links, though.
13:05 masak they're inlined into the text.
13:05 masak rakudo: Int.new(42)
13:05 p6eval rakudo a55346: OUTPUT«flattened parameters must be a hash or array␤  in main program body at line 22:/tmp/5HkA7lsDE0␤»
13:05 moritz masak: do you see what's wrong in the source?
13:05 * masak looks
13:06 masak ugh. slow connection.
13:07 masak no, can't say I do.
13:11 dalek features: bbb91ac | moritz++ | template.html:
13:11 dalek features: add section anchors
13:11 dalek features: review: https://github.com/perl6/features/commit/bbb91ac083
13:12 masak if I had macros, I could implement DLX more efficiently in Perl 6, without creating classes for the Node objects.
13:12 masak it could all be a pretzel hash. :)
13:13 masak perl6: my %h; %h<foo> := %h; say "alive"
13:13 p6eval pugs, rakudo a55346, niecza v8-52-g3afe236: OUTPUT«alive␤»
13:13 masak \o/
13:17 dalek features: c1604ac | moritz++ | template.html:
13:17 dalek features: the name= anchors did not work, try id= instead
13:17 dalek features: review: https://github.com/perl6/features/commit/c1604ac215
13:18 PacoLinux joined #perl6
13:19 masak heh. I hope Perl 6 becomes mainstream at some point, because I really like debugging Perl 6 code. and I seem to not entirely suck at it, too. :)
13:20 masak correction: I like debugging *my own* Perl 6 code. it might not carry over to other people's code :P
13:20 orafu joined #perl6
13:24 Kivutarrr joined #perl6
13:24 oyse Where can I find the best documentation of traits? I tried to understand LolDispatch.pm, but I don't understand anything that have to do with the trait definition.
13:24 Trashlord joined #perl6
13:25 mux LolDispatch.pm? how cute :)
13:25 masak Tene++
13:28 donri oyse: as i understand it it's an operator overload for 'is'
13:28 tadzik oyse: I don't think they're documented anywhere, and it seems that they're broken right now, at least my attempts to use a custom one have failed. Let's wait for jnthn to appear :)
13:28 tadzik donri: not really
13:28 moritz well, in some sense they are
13:28 moritz but they have different calling conventions than normal operators
13:28 tadzik but I see why you would understand them this way
13:29 tadzik true
13:30 donri the main point being that it's not a behavior of the role itself, but an overload-of-sorts to a multi-dispatching operator with a pattern match for the http-handler role
13:30 masak donri: they're not actual operators because they appear outside of ordinary expressions.
13:30 donri aye but it's similar yea?
13:32 oyse tadzik: will it work on the previous rakudo star release?
13:32 masak donri: well, maybe you could see it as all being one single trait_mod operator...
13:33 masak no, wait. that's not the analogy.
13:33 masak it actually is an operator, it's just not an infix one.
13:36 oyse So what is the significance of 'trait_auxiliary'?
13:37 oyse Does that mean the it is a subroutine trait instead of a parameter trait?
13:39 moritz masak: FWIW it was a missing <ref>...</ref> around the {{cite}} that caused the problem
13:40 donri my guess would be that trait_auxiliary:<is> is the name of that "operator" similar to infix:<+> etc?
13:40 masak moritz: ah!
13:40 masak moritz++
13:40 masak donri: yeah.
13:40 donri but apparently it's not really an infix op
13:40 tadzik oyse: I think it was working, but bugged :P
13:41 oyse donri: ok. That makes sense
13:41 moritz tinita++ in #perlde found out
13:43 abercrombie joined #perl6
13:44 oyse So just to see if I understand the line ' multi trait_auxiliary:<is>(http-handler $trait, $block, $arg)' correctly. It overrides the operator called 'trait_auxilliary:<is>'. This operator always three arguments, the first is the Role that is applied to the subroutine, the second is the block that the traits is applied to and the third is a list of all the arguments supplied to the trait? Is this more or less correct?
13:45 tadzik hmm
13:46 tadzik oyse: look at https://github.com/rakudo/rakudo/blob/nom/src/core/traits.pm#L64
13:46 tadzik that adds a new 'is' trait
13:47 tadzik $docee is the left side of the 'is', and it's Mu:Defined in this case
13:47 tadzik $doc is the argument for this operation
13:47 tadzik and :$docs! is the, hmm keyword of some sort
13:48 tadzik so you use it like: $foo is docs("foo")
13:48 tadzik and $doc becomes "foo" in the sub
13:48 tadzik does that make some sort of sense to you?
13:50 oyse tadzik: sort of :) I just started looking at Perl 6 so there are a lot of concepts that are a bit fuzzy
13:50 masak 3
13:50 tadzik oyse: you just chose the wrong concept :)
13:50 masak :)
13:50 tadzik that one is a bit tricky I suppose
13:51 tadzik oyse: want to write a webapp?
13:52 oyse oyse: Sort of. I just need some place to start to get into Perl 6 and that seemed like a good starting point.
13:52 tadzik do you know Dancer?
13:52 oyse tadzik: I have heard of it and looked briefly at it, but I havent used it
13:52 oyse Are there any plans for porting it to Perl 6?
13:53 tadzik I wrote a sort-of-port for it
13:53 masak there are many plans for porting it.
13:53 masak it's still a bit of a wild west out here, I'm afraid.
13:53 tadzik oyse: see http://ttjjss.wordpress.com/2011/01/10/bailamos/
13:54 oyse Anyone that has a Github repo or similar for a port?
13:55 tadzik I think it's linked in the post
13:55 tadzik or not
13:55 tadzik https://github.com/tadzik/bailador
13:56 oyse tadzik: Thanks. I will take a look at it later.
13:56 oyse I have to go now. Thanks for all the help!
13:57 tadzik oyse: see you soon!
13:57 oyse left #perl6
13:58 tadzik nom: class A { method say(*@a) { say(|@a) } }; A.say("foo", "bar")
13:58 p6eval nom: OUTPUT«foobar␤»
13:58 tadzik nom: class A { multi method say(*@a) { say(|@a) } }; A.say("foo", "bar")
13:58 p6eval nom: OUTPUT«===SORRY!===␤Could not find a proto for multi 'say' in package 'A' (it may exist, but an only is hiding it if so)␤»
13:58 tadzik eek
13:59 renormalist joined #perl6
14:03 ingy ll
14:04 JimmyZ joined #perl6
14:05 tadzik heo
14:05 koban left #perl6
14:08 donri tadzik: hows that match the path info on the whole env hash?
14:08 renormalist joined #perl6
14:09 tadzik donri: sorry, I don't understand the question
14:09 tadzik nom: "foo".split( /\s/ )
14:09 p6eval nom:  ( no output )
14:10 tadzik oh
14:11 tadzik BEGIN { /\s/ }
14:11 tadzik nom: BEGIN { /\s/ }
14:11 p6eval nom: OUTPUT«Use of uninitialized value in string context␤Use of uninitialized value in string context␤===SORRY!===␤error:imcc:syntax error, unexpected DOT ('.')␤       in file '(file unknown)' line 29775789␤␤»
14:11 tadzik yeah, shit
14:13 tadzik nom: role A { $!a }; class B does A { method x { $!a = 5 } };
14:14 p6eval nom: OUTPUT«===SORRY!===␤Attribute $!a not declared in role A at line 1, near " }; class "␤»
14:14 tadzik is that correct?
14:14 tadzik niecza: role A { $!a }; class B does A { method x { $!a = 5 } };
14:14 p6eval niecza v8-52-g3afe236: OUTPUT«[31m===[0mSORRY![31m===[0m��Variable $!a used where no 'self' is available at /tmp/mdspA0gPRS line 1:�------> [32mrole A { [33m�[31m$!a }; class B does A { method x { $!a =[0m��Action method trait_mod:does not yet implemented at /tmp/mdspA0gPRS line…
14:19 mtk joined #perl6
14:20 Trashlord joined #perl6
14:25 donri tadzik: if $env ~~ $r.key hows that match the %ENV<PATH_INFO>?
14:26 mtk joined #perl6
14:26 colomon joined #perl6
14:28 tadzik donri: I see if $env<REQUEST_URI> ~~ $r.key {
14:29 tadzik something must've stripped ~~html_tags for you
14:29 donri nope it's missing in the blog post
14:30 donri i see it on github though yea
14:38 tadzik oh, I see
14:38 tadzik will look into that, thanks
14:39 uniejo_in_riga joined #perl6
14:41 felher What are the cases where nom is slower than master? Because for a little program here, nom takes twice as longs a master. (latest 'nom' branch against latest 'master')
14:41 moritz felher: for one, startup time in nom is much larger
14:41 moritz so any short-running program is slower
14:42 moritz secondly we've discovered a rather large memory leak in nom, until it's fixed all bets are off
14:43 felher moritz: okay, its definitively not startup (18 vs ~~30 seconds). Maybe it's the memory leak. Will try again as soon as thats fixed. ty
14:44 perlhack joined #perl6
14:45 uniejo_in_riga joined #perl6
14:48 eiro joined #perl6
14:48 eiro hello guys
14:53 jedai joined #perl6
14:58 cognominal quel est l'équivalent perl5 de ruby markabby ou coffeescript coffeekup?
14:58 cognominal *markaby
14:58 cognominal franck sait peut-être
14:59 cognominal oops sorry
14:59 cognominal I was seeing eiro and thought I was on #perlfr
15:03 eiro :)
15:07 dual_ joined #perl6
15:08 cognominal context is everything except when you make decisions on insufficient context.
15:19 TSa joined #perl6
15:23 hanekomu joined #perl6
15:23 JimmyZ evening, #perl6
15:29 thou joined #perl6
15:31 abercrombie Hi #perl6, could anyone tell me in which part of SYN I can find the use of "[]" like in "$a = [1, 2, 3];" ?
15:37 bbkr_ abercrombie: you have to be more specific, do you mean declaration, iteration, flattening rules, available methods on Array class?
15:40 abercrombie Actually I just want to know the difference between $a=(1,2,3) and $a=[1,2,3]. I read the perl 5 to 6 articles by moritz and there is a sentence "Finally you should know that both [..] and {...} (occurring directly after a term) are just method calls with a special syntax, not something tied to arrays and hashes"
15:43 tadzik nom: my $a=(1,2,3); say $a.WHAT
15:43 bbkr_ (1,2,3) is Parcel type, while [1,2,3] Array type.
15:43 p6eval nom: OUTPUT«Parcel()␤»
15:43 tadzik nom: my $a=[1,2,3]; say $a.WHAT
15:43 p6eval nom: OUTPUT«Array()␤»
15:43 PerlJam tadzik++ I was just about to do that. :)
15:43 bbkr_ exactly :)
15:44 JimmyZ joined #perl6
15:44 abercrombie So in perl5 $a=[..] is to create an anonymous reference. What's the according syntax for perl6?
15:46 PerlJam abercrombie: same
15:46 PerlJam ish
15:47 tadzik abercrombie: stop thinking of references
15:47 bbkr_ In p6 you rarely need references because sigils are fixed
15:47 bbkr_ and more OO approach works in background
15:48 [particle] joined #perl6
15:48 PerlJam abercrombie: if you remove the word "reference" from your vocabulary, many perl 5 things are "the same" in perl 6.
15:49 abercrombie But I read that "dereferencing forms are now $(...), @(...), %(...)"  so I can't help thinking reference..
15:52 tadzik where do you read that?
15:52 bbkr_ abercrombie: think this way - any sigil is reference now. let me give you an example....
15:52 tadzik it's not about dereferencing, it's about making (...) act as if it's stolen in a scalar container
15:53 bbkr_ rakudo: sub foo ( @a ) { @a.push( 3 ) }; my @x = 1,2; foo( @x ); @x.perl.say
15:53 p6eval rakudo a55346: OUTPUT«[1, 2, 3]␤»
15:54 bbkr_ abercrombie: see? @a works like "old reference"
15:56 abercrombie bbkr_: Yes, I see. So what I need to do is to forget the old "reference" concept?
15:56 abercrombie tadzik: I will find out the article I just read.
15:57 icwiener joined #perl6
15:58 abercrombie tadzik: http://perlcabal.org/syn/S03.html   "Changes to Perl 5 operators"
15:58 PerlJam perhaps we still need better explanations of $(), @(), and %() though.  I coudln't think of or find a spot in the synopses that I could point abercrombie at.
15:59 tadzik oh
16:01 bbkr_ abercrombie: Yes, forget old references. In Perl 6 every $, @, % sigil points to an object, so everything is an reference. Dereferencing @() you mentioned is so rarely needed that I cannot even find any good example for them.
16:04 Su-Shee "it's there in cas of an emergency when the power fails and you have to get candles" ;)
16:04 Su-Shee +e
16:04 bluescreen10 joined #perl6
16:07 abercrombie bbkr_: I will try. Thanks for your and others' explanation.
16:10 saaki joined #perl6
16:10 Trashlord joined #perl6
16:11 bbkr_ abercrombie: you're welcome
16:13 REPLeffect joined #perl6
16:19 Mowah_ joined #perl6
16:20 PacoLinux joined #perl6
16:25 bluescreen10 joined #perl6
16:28 alester joined #perl6
16:35 Bucciarati joined #perl6
16:36 Trashlord joined #perl6
16:49 rdesfo joined #perl6
16:49 rdesfo left #perl6
16:50 MayDaniel joined #perl6
16:57 icwiener joined #perl6
16:59 kboga joined #perl6
17:04 siddy joined #perl6
17:06 Trashlord joined #perl6
17:06 coregateFX joined #perl6
17:10 janosik joined #perl6
17:15 Trashlord joined #perl6
17:16 moritz PerlJam: I think the new and accurate explanation is that list-ish objects and hashes have a .flattens flag
17:16 moritz PerlJam: and $() removes that flag (which is roughly the same as turning it into an scalar holding the data structure)
17:17 moritz @() sets the flag to True, and coerces to List if necessary
17:17 moritz %() also sets .flattens to True, and coerces to Hash if necessary
17:17 moritz or maybe s/Hash/EnumMap/
17:33 dalek rakudo/nom: a058d5f | Coke++ | t/spectest.data:
17:33 dalek rakudo/nom: run 2 more tests!
17:33 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a058d5f181
17:36 moritz [Coke]++
17:36 moritz I fudged those test earlier, but seems I forgot to commit
17:40 zby_home joined #perl6
17:44 [Coke] moritz: heh. didn't mean to step on your toes.
17:44 [Coke] I check that spectest.data is failing as expected every so often, happy to find tests passing.
17:44 [Coke] only 161 more tests to fudge.
17:45 [Coke] ... until we have to start looking at other spectest files.
17:46 moritz [Coke]: you didn't step on my toes
17:47 moritz which is why you got the ++ :-)
17:50 siddy joined #perl6
17:51 uniejo_in_riga joined #perl6
17:51 cotto joined #perl6
17:59 dalek rakudo/nom: ca7e354 | Coke++ | t/spectest.data:
17:59 dalek rakudo/nom: track failure modes
17:59 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/ca7e354d88
18:01 [Coke] the "needs fudging" i've not done yet just because it'd mean skipping passing tests.
18:06 alim joined #perl6
18:06 Chillance joined #perl6
18:21 cotto joined #perl6
18:30 shachaf_ joined #perl6
18:30 d4l3k_ joined #perl6
18:31 george_z0rwell joined #perl6
18:31 [particle]1 joined #perl6
18:32 nsh joined #perl6
18:33 JodaZ_ joined #perl6
18:33 tadzik1 joined #perl6
18:33 orevdiabl joined #perl6
18:34 yath_ joined #perl6
18:34 awwaiid_ joined #perl6
18:34 PacoLinux__ joined #perl6
18:34 donri_ joined #perl6
18:34 pmichaud_ joined #perl6
18:34 llabthgi1 joined #perl6
18:37 tadzik1 Files=454, Tests=14875, 2657 wallclock secs ( 9.03 usr  1.97 sys + 2537.13 cusr 91.61 csys = 2639.74 CPU)
18:37 tadzik1 Result: PASS
18:42 tadzik that's almost 15k :)
18:42 moritz about 1k fudged tests, I think
18:43 Trashlord joined #perl6
18:43 sorear good * #perl6
18:44 moritz good * sorear
18:45 tadzik hello sorear
18:45 mtk joined #perl6
18:46 takesako joined #perl6
18:46 jamessalty joined #perl6
18:46 jferrero joined #perl6
18:46 takadonet joined #perl6
18:59 szr left #perl6
19:00 Trashlord joined #perl6
19:01 birdwindupbird joined #perl6
19:01 mj41 joined #perl6
19:11 rdesfo joined #perl6
19:15 im2ee joined #perl6
19:20 Trashlord joined #perl6
19:27 PerlJam perl6++  (I made a nice one-liner to answer a question about some things that my wife and I were talking about)
19:31 xinming joined #perl6
19:47 mj41 joined #perl6
19:59 [Coke] here's the test summary output for nom:
19:59 [Coke] "total",     13158,     8,   542,  1647, 15355, 36260
19:59 [Coke] "Synopsis", "pass","fail","todo","skip","plan","spec"
20:00 tadzik oh, there are fails?
20:00 [Coke] I cleverly did not save the output.
20:01 tadzik I've had full pass 90 minutes ago
20:02 [Coke] then I would assume it's just me.
20:02 tadzik or uncommited stuff
20:03 [Coke] nope.
20:03 [Coke] (nor unpushed)
20:07 Moukeddar joined #perl6
20:07 Vlavv_ joined #perl6
20:12 wamba joined #perl6
20:13 cotto joined #perl6
20:21 woosley joined #perl6
20:39 xinming joined #perl6
21:09 lue joined #perl6
21:09 lue hello world o/
21:09 tadzik hello lue!
21:14 abercrombie Hi #perl, I got another question. S08 says a Capture will not keep the positional information for the named arguments, for example: foo(1,:a<b>,2)
21:14 tadzik that sounds correct
21:14 abercrombie what does it mean? I can still do sub foo($a){say $a[1]} to get :a<b>
21:15 tadzik that probably means that the order of named arguments is lost, as in hashes
21:16 abercrombie Now  $a[0] is 1, $a[1] is :a<b>; $a[2] is 2. Do you mean this order is not fixed?
21:16 abercrombie So some day I can expect $a[1] is not :a<b> ?
21:16 tadzik nom: sub foo($a){say $a[1]}; foo(5, :a<b>)
21:16 p6eval nom: OUTPUT«Unexpected named parameter 'a' passed␤  in sub foo at /tmp/JZEzH8Lr54:1␤  in mu <anon> at /tmp/JZEzH8Lr54:1␤  in mu <anon> at /tmp/JZEzH8Lr54:1␤␤»
21:17 tadzik I do not follow your examples
21:17 tadzik or I'm just quite sleepy :)
21:20 abercrombie nom: sub foo($a){say $a[1]}; foo((5, :a<b>))
21:20 p6eval nom: OUTPUT«"a" => "b"␤»
21:20 abercrombie So this one is not capture?
21:21 abercrombie It's just parcel?
21:21 sorear correct, that passes a Parcel to foo.
21:21 sorear niecza: sub foo($a) { say $a[1] }; foo(\(5, :a<b>, 6))
21:21 sorear that passes a Capture
21:21 p6eval niecza v8-52-g3afe236: OUTPUT«(timeout)»
21:22 sorear niecza: say 2 + 2
21:22 p6eval niecza v8-52-g3afe236: OUTPUT«4␤»
21:22 sorear niecza: sub foo($a) { say $a[1] }; foo(\(5, :a<b>, 6))
21:22 p6eval niecza v8-52-g3afe236: OUTPUT«Stacktrace:␤␤Segmentation fault␤»
21:22 sorear what.
21:22 benabik mono segfaulted?
21:23 sorear benabik: apparently!
21:23 abercrombie :)  I got it. Thank you guys.
21:23 benabik That's awesome.
21:23 benabik Takes effort.
21:25 abercrombie nom: my @a=1..10000; my @b=1..10000; @a»+«@b
21:25 wolfman2000 joined #perl6
21:25 p6eval nom: OUTPUT«(timeout)»
21:25 abercrombie why does it take so long?
21:25 benabik It's probably being eager where it shouldn't.
21:25 sorear benabik: this wouldn't be the first or second bug I've discovered in mono ... niecza is doing a great service
21:26 sorear niecza: my $a = times[0]; my @a = 1..10000; my @b = 1..10000; @a »+« @b; say times[0] - $a
21:26 p6eval niecza v8-52-g3afe236: OUTPUT«1.596099␤»
21:26 benabik times?
21:26 sorear perldoc -f times
21:26 benabik Hm.  perldoc -f  That's handy.
21:26 abercrombie Does it mean nom currently cannot handle >>+<< very well?
21:27 tadzik nom: my @a = 1, 2; my @b = 3, 4; say @a »+« @b
21:27 p6eval nom: OUTPUT«4 6␤»
21:28 eiro what are | in sub foo (|$x) signatures ?
21:28 benabik nom: my @a = 1..1000; my @b=1..1000; say @a »+« @b
21:28 sorear eiro: gets the raw argument list as a Capture object
21:28 p6eval nom: OUTPUT«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 152 154 156 158 160 162 164 …
21:28 sorear sub foo(|$x) { say $x.perl }; foo(1, 2, foo => 'bar', 3)
21:28 sorear niecza: sub foo(|$x) { say $x.perl }; foo(1, 2, foo => 'bar', 3)
21:29 p6eval niecza v8-52-g3afe236: OUTPUT«\(1, 2, 3, |{"foo" => "bar"})␤»
21:29 abercrombie tadzik: I know it works. I just wonder why for 10000 numbers it will take such a long time
21:29 sorear abercrombie: rakudo is slow
21:29 eiro oohhh
21:29 eiro ok thanks
21:29 eiro is niecza faster ?
21:29 benabik sorear: Is niecza lazy with »«?
21:30 sorear benabik: no
21:30 abercrombie sorear: so is the speed issue due to parrot?
21:31 sorear abercrombie: part of it can be blamed on parrot, but I think it's mostly just an issue of priorities
21:31 benabik abercrombie: Also, rakudo hasn't been much optimized for speed.  They attack some of the worst bits, but the priority is correctness first.
21:31 sorear rakudo has always been pushing the boundaries of the spec, implementing hard things without concern for efficiency
21:32 abercrombie even for nom?
21:32 benabik nom is about getting even more things right.
21:33 abercrombie It's said nom is almost a completely reimplementation of rakudo, and it's much faster than the previous rakudo branch.
21:34 [Coke] faster != fast, of course.
21:37 abercrombie I admit that. Well, I don't know the bottom implementation of the hyper operator. But it indeed a little slow out of my expectation. Pardon me.
21:39 sorear abercrombie: I started my own implementation project because I thought not enough attention was being payed to speed
21:39 benabik nom: my @a = 1..10000; my @b = 1..10000;  for @a, @b -> $a, $b { say $a + $b }
21:40 p6eval nom: OUTPUT«(timeout)3␤7␤11␤15␤19␤23␤27␤31␤35␤39␤43␤47␤51␤55␤59␤63␤67␤71␤75␤79␤83␤87␤91␤95␤99␤103␤107␤111␤115␤119␤123␤127␤131␤135␤139␤143␤147␤151␤155␤159␤163␤167␤171␤175␤179␤183␤187␤191␤195␤199␤203␤207␤211␤215␤219␤223␤227␤231␤235␤239␤243␤247␤251␤255␤259␤263␤267␤271␤275␤279␤283␤287␤2
21:41 sorear abercrombie: if you think rakudo is too slow for you, join me :>.
21:42 abercrombie sorear: I see that niecza also already implemented most features. So what's niecza's disadvantage?
21:43 sorear well, not *all* features
21:43 sorear yesterday masak tried to run LAF on niecza, but niecza doesn't have MAIN or attributive parameters yet
21:44 abercrombie Do those things affect speed a lots?
21:45 Psyche^ joined #perl6
21:46 sorear no
21:48 abercrombie Then I don't much get "implementing hard things without concern for efficiency"
21:49 abercrombie What are those things affect rakudo's speed that niecza doesn't have?
21:50 flussence sorear: can I prod you into adding m:p// and/or &dir? Either of those would get niecza running more of Text-Tabs-Wrap/t/*.t than nom currently does :)
21:51 sorear abercrombie: rakudo people spend 100% of their mental energy making complicated stuff like roles work at all
21:52 abercrombie Yes, that's really a complicated one. I just cannot figure out what will affect the hyper operator. It seems there is a 10x+ speed difference on that one.
21:55 sorear abercrombie: take an inefficient implementation of hyperoperators on an inefficient implementation of lazy lists with inefficient looping and inefficient sub calls, the penalties are multiplicative
21:56 abercrombie that sounds pretty inefficient :)
21:57 sorear flussence: hmm, what's m:p?
21:57 sorear found it
22:00 Trashlord joined #perl6
22:04 drbean joined #perl6
22:05 Chillance joined #perl6
22:11 rdesfo left #perl6
23:14 jaldhar joined #perl6
23:17 whiteknight joined #perl6
23:31 jaldhar joined #perl6
23:36 Moukeddar joined #perl6
23:40 ponbiki joined #perl6
23:49 orphu joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo