Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-06-01

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:04 snarkyboojum joined #perl6
00:18 icwiener joined #perl6
00:37 bacek joined #perl6
00:50 seb_ joined #perl6
01:19 c9s joined #perl6
01:33 agentzh joined #perl6
01:38 seb_ left #perl6
02:03 pugs_svn r26978 | ron++ | added test for call to multimeth with wrong number of args RT #66006
02:21 alanhaggai joined #perl6
02:27 ruoso joined #perl6
02:28 ruoso Hello!
02:30 dextius joined #perl6
02:30 skids So anyone want to talk about macros, now that lichtkind has left?  :-)
02:31 Tene what about macros?
02:31 skids Nothin.  Joke.
02:31 dextius I "use macro" in Perl5, very useful, for avoiding function call overhead :-)
02:32 dextius I have made a small update to a Rakudo test, what is the process for getting this reviewed / checked in?
02:33 skids Is it rakudo-specific, or good for all Perl6?
02:33 dextius it's a spec test in the pugs suite..
02:33 dextius S03-operators/autoincrement.t
02:34 skids Ah, well, either get someone to give you a commit bit if you expect to contribute often, or try to hook up with morris or masak who may put it in for you
02:35 skids since they do tests often.
02:35 Tene dextius: /msg me an email address and preferred username, and I'll give you a commit bit for pugs
02:35 dextius Tene: What is the review process for changes?
02:36 skids "ask forgiveness not permission" I think, for pugs.
02:37 dextius I'll be careful then.
02:37 Tene that's right
02:37 skids Though if you are unsure, it can be good to get someone's attention here or on p6l for comments first.
02:40 * dextius is excited.. have wanted to contribute to this since the Parrot O'Reilly books came out!
02:44 FurnaceBoy_ joined #perl6
02:51 skids dextius: fwiw, pmichaud was working on postfix:<++> and prefix:<++> today
02:51 skids Don't think his changes are in yet though, unless I missed dalek.
02:53 dextius I'll keep clear for at least a week and update both parrot and rakudo before I do anything :-)
02:53 dextius g'night!
02:57 pasteling "ruoso" at 189.97.61.71 pasted "odd behavior by rakudo" (62 lines, 2K) at http://sial.org/pbot/36941
02:57 ruoso the paste above has a code that presents some odd behavior in rakudo...
02:58 ruoso it initializes an array with some values, but it gets reset to zero for some reason
03:00 ruoso when executing, note the output from lines 33 vs 35
03:04 meppuru joined #perl6
03:14 veritos joined #perl6
03:18 synth joined #perl6
03:19 kate21de joined #perl6
03:19 skids ruoso: not that it has anything to do with the problem, but shouldn't it be for 0..^$.width?
03:27 justatheory joined #perl6
03:35 skids Ah... i think... [] xx foo = foo copies of the same exact anonymous array.
03:35 skids each @new[$x] bound to the same array.
03:38 alester joined #perl6
03:39 crugix joined #perl6
03:40 skids ruoso: try     for 0..^$.width { @new.push([]) }; instead of  [] xx $.width
03:58 crugix left #perl6
04:02 pmichaud correct --   [] xx $n  results in a list with $n elements, all referring to the same array.
04:20 synth joined #perl6
04:22 sri_kraih joined #perl6
04:33 ruoso pmichaud, but is that expected or is it a bug?
04:33 pmichaud as far as I know, it's expected
04:34 pmichaud it's the same as
04:34 pmichaud my $a = [];   ($a, $a, $a)
04:34 ruoso ok...
04:34 pmichaud or, more precisely:
04:35 pmichaud my $a = [];    $a xx $n
04:35 ruoso rakudo takes 23s to compute 4 iterations of a 15x15 grid
04:35 pmichaud well, what we learned yesterday is that postfix:<++> and ranges (which use postfix:<++>) are really slow.
04:36 pmichaud I've been working on speeding them up today, but I keep running into roadblocks
04:36 pasteling "ruoso" at 189.97.61.71 pasted "working conway's game of life in rakudo" (57 lines, 1.7K) at http://sial.org/pbot/36942
04:38 ruoso the code could be prettier... but cascading maps and greps don't quite work
04:40 Lectus joined #perl6
04:46 flexibeast joined #perl6
04:47 ruoso while implementing game-of-life, I realized how cool "for ^$width X ^$height -> $x, $y { ... }" is
04:47 pmichaud why does the pastbot code show 0..^$.width, ooc?
04:47 pmichaud why not just ^$.width ?
04:48 ruoso because I only reduced that in the last minute
04:48 ruoso ;)
04:48 pmichaud ahhhhh
04:48 pmichaud it's still a range (and still slow in current rakudo)
04:51 pasteling "ruoso" at 189.97.61.71 pasted "simplified working conway's game of life in rakudo" (51 lines, 1.6K) at http://sial.org/pbot/36943
04:54 ruoso pmichaud, do you see any other way of making that code even simpler?
04:55 pmichaud nothing major
04:55 pmichaud but I'm still heads-down in the postfix:<++> stuff at the moment, so not looking too closely
04:55 ruoso ok...
04:55 pmichaud last line could be:   say .perl for $g.list
04:56 pmichaud or   say .perl for @($g)
05:04 [particle]1 joined #perl6
05:05 jwest- joined #perl6
05:12 synth joined #perl6
05:12 alester joined #perl6
05:12 kate21de joined #perl6
05:12 ruoso joined #perl6
05:12 Eevee joined #perl6
05:12 mikehh joined #perl6
05:12 elmex joined #perl6
05:12 broquaint joined #perl6
05:12 hcchien joined #perl6
05:12 ascent_ joined #perl6
05:13 flexibeast joined #perl6
05:23 justatheory joined #perl6
05:27 JDlugosz Helllo anyone
05:35 eMaX joined #perl6
05:39 finanalyst1 joined #perl6
05:41 Tene JDlugosz: Hi!
05:41 finanalyst1 joined #perl6
05:52 justatheory joined #perl6
06:02 RogerRabbit joined #perl6
06:30 synth joined #perl6
06:34 synth joined #perl6
06:36 xinming_ joined #perl6
06:40 synth joined #perl6
06:47 synth joined #perl6
06:54 eMaX joined #perl6
06:55 viklund joined #perl6
06:58 dakkar joined #perl6
06:59 mickej joined #perl6
07:01 zamolxes joined #perl6
07:18 unitxt left #perl6
07:23 DemoFreak joined #perl6
07:24 viklund joined #perl6
07:30 zamolxes_ joined #perl6
07:30 Matt-W Morning
07:31 xinming joined #perl6
07:38 mberends morning Matt-W
07:39 eiro joined #perl6
07:40 eiro joined #perl6
07:42 eiro joined #perl6
07:44 ejs joined #perl6
07:54 ejs joined #perl6
07:56 iblechbot joined #perl6
08:02 zamolxes joined #perl6
08:15 mikehh_ joined #perl6
08:18 agentzh joined #perl6
08:34 ZuLuuuuuu joined #perl6
08:39 barney joined #perl6
08:48 DanielC joined #perl6
08:49 tulcod joined #perl6
08:49 mberends DanielC: hi!
08:49 DanielC moin
08:49 DanielC hi mberends
08:52 DanielC mberends: perl6-examples/misc/Fletcher.pl  <-- Unicode friendly implementation of Fletcher-16, and a small script to make the file names we were talking about yesterday.
08:52 mberends I hope not to burst your bubble, but after your nice Fletcher algorithm work I began to doubt whether any kind of hashing at all is appropriate to the problem being addresses, namely telling apart the conflicting file names originating from a very small number of authors/authorities
08:52 mberends *addressed
08:52 DanielC ok
08:53 DanielC It was just an idea. What's the problem with hashing?
08:53 mberends particularly since hashing alone is by definition not a complete solution
08:53 DanielC I have an issue with that statement.
08:54 DanielC Any reasonable hash should be a complete solution.
08:54 DanielC Use Fletcher-32 and the chances of collision are really remote.
08:55 mberends collisions will happen. there is such a thing as a "Perfect Hash", but it is based on constructing a custom hashing function for a finite set of possible strings.
08:55 DanielC 32-bit hash => 64k authors with the same module name and the same version before you can expect a collision.
08:56 DanielC 160-bit hash (e.g. sha1) => 1e14 authors with the same module name and the same version before you can expect a collision
08:57 mberends the whole hashing approach looks like overengineering for the small variety of :auth values that will be required.
08:57 DanielC 512-bit hash (e.g. whirlpool) => 1e77 authors with the same module name and the same version before a collision.
08:57 DanielC It's just a matter of choosing a hash length that is appropriate.
08:58 DanielC There are 6e9 people on earth. A 64-bit hash would allow almost everyone on earth to be an author of the same module with the same version.
08:59 mberends adding more bits is so... brute force :(
09:00 masak joined #perl6
09:00 mberends I have to go afk for a few hours, but I'd like to ask if you can think of non-hashing alternative, because I think I can.
09:00 DanielC I think 64 bits is far more than we need. I'm just making a point here, that the hash length can be selected to make the chance of collision small enough.
09:00 masak ni hao, #perl6 adventurers.
09:00 DanielC I think that a hashing alternative is very elegant. I think a 32-bit hash would be an excellent choice.
09:01 DanielC mberends: On a different topic: Can you tell me if a single module can have more than one file?
09:01 DanielC masak: hi!
09:01 * masak waves happily
09:01 DanielC mberends: A non-hashing alternative is to urlencode all the fields instead of hashing them.
09:02 mberends sorry, I have to go, but am very interested in continuing this discussion later.
09:02 DanielC sure
09:02 mberends afk &
09:03 mikehh_ joined #perl6
09:03 DanielC Maybe masak can tell me if a module is always one file or if it can contain several files :-)
09:03 masak DanielC: been thinking a bit more about your dir structure auth/Foo::Bar/ver.
09:03 DanielC yeah, that's what mberends was just talking about, forget about the dir structure :-)
09:03 masak oh, ok.
09:04 masak I see I need to backlog. :)
09:04 DanielC Yesterday we were talking about putting all the files in one single directory and naming them with:  Foo::Bar-auth:4ca03-ver:1.2.0
09:04 masak DanielC: of course a module can consist of several files. that's what 'augment' gives us.
09:04 DanielC thanks
09:04 masak DanielC: that sounds sane.
09:05 DanielC The naming scheme is automatically extensible (more metadata)
09:05 DanielC masak: Take a look at perl6-examples/misc/Fletcher.pl
09:05 * masak does so
09:07 masak DanielC: nice. real code is always pleasant to look at.
09:07 masak DanielC++
09:07 DanielC :-)
09:07 jferrero joined #perl6
09:08 masak DanielC: one small nit: must we have a dir called 'misc'? :)
09:08 masak everything in this world is misc.
09:08 masak it's like calling it 'stuff' or 'data'...
09:08 DanielC I didn't know what to call it...
09:08 DanielC yeah
09:08 masak DanielC: perhaps because it contains two very different things.
09:08 DanielC I'm happy to put Fletcher.pl elsewhere, but where?
09:09 masak DanielC: we might move out the bf thing into some other directory, and call this one 'modules' or something.
09:09 DanielC We can put bf in a directory called 'acme'.
09:10 masak that works.
09:11 masak 'acme' has CPAN connotations.
09:11 DanielC I still need a name for the module holding Fletcher.pl  I can't think of anything...
09:11 DanielC he he... s/module/dir/
09:12 masak DanielC: I'd go with 'modules' or 'module-management'.
09:12 DanielC ok
09:12 DanielC ah, I see why you said 'modules'
09:12 DanielC I was thinking "but Fletcher.pl is not a module..."
09:13 masak :)
09:13 DanielC I'll pick module-management for now.
09:14 masak nod.
09:14 DanielC updated
09:15 viklund masak: I'm adding errorchecking for the run commands in proto, should it say "buildt" even if there is no Makefile?
09:15 masak viklund: yes.
09:17 masak viklund: the idea behind that is that there might not be a build system, and then building is trivially a no-op.
09:17 viklund yes, I thought so too
09:17 mikehh__ joined #perl6
09:19 DanielC masak: If a module can have many files then  Foo::Bar-auth:4ca03-ver:1.2.0  would have to be a directory, not a file. Right?
09:19 masak viklund: and I think we should also accept both forms of build systems currently out there, the Makefile.PL one and the Configure.p6 one.
09:19 * viklund runs the test './proto install all'
09:20 masak DanielC: yes, I think it needs to be that anyway. even CPAN does it like that.
09:20 viklund yes, I'm not changing anything about that, just adding error handling
09:20 DanielC masak: ok
09:20 viklund previously it said built even if the configure failed
09:20 masak viklund: yes. :(
09:20 viklund very user unfriendly
09:21 masak viklund: thank you for giving that part of proto some love.
09:21 viklund it has bitten me too many times ;)
09:21 masak "inspiring people by writing a crappy prototype" :P
09:22 viklund oh, the bleeding branch of proto defaults to bleeding rakudo now, that needs to be remembered when merging over to the master branch
09:22 masak well, as long as we merge soon after the next release, that should be ok...
09:22 masak because then release and bleeding will not have diverged too much yet.
09:24 viklund the master branch will fail eventually if it's not changed to default to release, but the release version needs to be changed anyways so some editing needs to be done anyways
09:24 viklund *sigh*
09:27 masak viklund: not sure I see what you perceive to be the problem...
09:28 viklund well, there won't be a problem as long as the master branch defaults to release
09:30 masak it does.
09:31 viklund yes, and when bleeding is merged to master, it will default to bleeding, so that needs to be changed
09:31 viklund it's not a problem, just something that we need to remember
09:31 viklund or else it will be a problem
09:32 masak viklund: when you say 'default to bleeding', are you talking about what proto pulls down when installing Rakudo?
09:33 viklund masak: yes, the generated configuration file defaults to bleeding.
09:33 masak viklund: ok. then I see.
09:34 masak viklund: why does it default to bleeding in the branch? because it's tedious to change the proto.config file?
09:36 viklund yep, but I also thinks it matches the expectations, if you run the bleeding branch of proto you excpect to get bleeding rakudo as well
09:36 viklund s/exc/ex/
09:36 masak fair enough.
09:37 masak there's an interesting dissonance in there somewhere between the need to have a sane default for the branch and the wish to do clean merges back to master.
09:37 masak I wonder if that phenomenon has a name...
09:38 Matt-W masak: 'Reality'
09:39 masak Matt-W: :P
09:39 Matt-W we were just talking about a similar problem at work
09:39 Matt-W one of the lead techs is shying away from making an incompatible change because he doesn't want to tell people they need to migrate their database
09:39 Matt-W even though it's a really easy migration
09:40 DanielC Matt-W: Rule 1 of tech support: users are idiots.
09:41 viklund how would I write to reduce on zip? [Z] [[<a b>],  [1, 2]], doesn't work for example...
09:41 Matt-W DanielC: that's why I'm a developer :)
09:42 DanielC :-)
09:42 viklund and I can't find reductive cross mentioned in S03...
09:48 masak rakudo: my @a = <a b>, (1, 2); .perl.say given [Z] @a
09:48 p6eval rakudo 0b9c9a: OUTPUT«Statement not terminated properly at line 2, near "@a"␤in Main (src/gen_setting.pm:0)␤»
09:48 masak rakudobug, p'haps?
09:48 Matt-W possible
09:48 Matt-W I'd expect that [Z] makes sense to have
09:49 Matt-W So I'd expect it to work
09:49 viklund whatabout [X]? That's not even mentioned...
09:50 Matt-W what about [infix:<foo>]
09:50 viklund ;)
09:50 Matt-W surely it should work with anything :)
09:51 masak std: my @a; [Z] @a
09:51 p6eval std 26978: OUTPUT«ok 00:02 38m␤»
09:51 masak if it's good enough for STD...
09:51 Matt-W std:my @a; [X] @a
09:51 Matt-W std: my @a; [X] @a
09:51 p6eval std 26978: OUTPUT«ok 00:02 38m␤»
09:51 Matt-W then it's good enough for me!
09:51 viklund std: my @a; [X~] @a
09:51 p6eval std 26978: OUTPUT«ok 00:02 38m␤»
09:52 viklund ahh
09:52 Matt-W std: sub infix:<foo>($a, $b) { }; my @a; [foo] @a;
09:52 p6eval std 26978: OUTPUT«ok 00:03 41m␤»
09:52 Matt-W yay!
09:54 masak foo++
09:58 viklund git-cherry-pick++
10:01 donaldh joined #perl6
10:09 Matt-W foo does make a nice change from x, y and z
10:11 clintongormley joined #perl6
10:12 ruoso left #perl6
10:13 agentzh joined #perl6
11:00 Chillance joined #perl6
11:06 DanielC In Perl 6, is it possible (for example) to define a Matrix type, and then overload infix:<+> so it can do the right thing when you give it two matrices?
11:07 masak DanielC: sure.
11:07 DanielC cool
11:07 masak DanielC: just type the arguments to that infix:<+> sub to be matrices.
11:08 DanielC I was wondering about Perl 6's ability to grow in the future...
11:08 DanielC How do you define a type?
11:09 masak DanielC: many ways. see S12.
11:09 DanielC thanks
11:09 masak most common is perhaps defining a class, but it all depends.
11:09 DanielC Well, the main thing I wanted to know is that it is possible.
11:10 DanielC Point being, the language is not stuck in time but can grow in unexpected ways.
11:10 DanielC Yesterday I saw a video of a Google talk by Larry.
11:11 DanielC I learned that the Perl 6 core is actually tiny (Larry said non-existent) and all of the operators are defined using the language itself.
11:11 DanielC e.g. postfix:<++>
11:11 DanielC So I extrapolated from that, that the language should be very maleable then.
11:20 donaldh joined #perl6
11:33 beggars joined #perl6
11:46 mib_1i2pid joined #perl6
11:48 meppl joined #perl6
11:56 Muixirt joined #perl6
11:56 Matt-W @tell DanielC Yes, Perl 6 is very mallable. Ultimately we'll be writing macros and mucking about with the grammar to our hearts' content.
11:56 lambdabot Consider it noted.
11:56 jnthn o/
11:57 masak jnthn: ahoj!
11:58 jnthn masak: ahoj :-)
11:59 Matt-W hi jnthn
11:59 Matt-W hi masak
11:59 masak hi Matt-W.
11:59 pmichaud Good morning, #perl6
11:59 masak morning, pm.
12:00 * jnthn has a pile of not-perl6 stuff to do for the next hour or two
12:00 jnthn Then it's dispatcher debugging time.
12:01 pmichaud it's likely to take me an hour or two to recover from yesterday
12:01 Matt-W pmichaud: what did you do yesterday?
12:01 jnthn postfix:<++> was quite an ordeal?
12:02 pmichaud jnthn: *is* still an ordeal
12:02 jnthn pmichaud: oh, ouch.
12:02 pmichaud yeah.
12:02 pmichaud I'm discovering lots of little issues
12:03 pmichaud (nopasting)
12:04 pmichaud http://gist.github.com/121365  # part 1
12:04 pmichaud http://gist.github.com/121366 # part 2
12:06 * Matt-W blinks
12:06 Matt-W oh my
12:06 pmichaud I've got more.  :0|
12:06 pmichaud but gotta finish getting kids to school
12:07 Matt-W although I'm sure I've seen something similar with that being the faster way to get classes
12:07 jnthn pmichaud: Looks like PMCProxy all over again.
12:07 jnthn as in, multiple creation of...
12:07 jnthn At first guess.
12:09 Matt-W It still seems very odd that something that takes more lines of PIR to do is so much faster
12:09 perlmongo joined #perl6
12:09 Matt-W Is it something to do with it being in a loop and making needless temporaries?
12:10 ruoso joined #perl6
12:11 pmichaud jnthn: yes, I'm thinking it's PMCProxy again.
12:11 pmichaud We have to switch all of our isa's to use the faster form anyway, but I was shocked to discover such a speed difference
12:11 ruoso Hello!
12:12 * ruoso with no time to backlog
12:12 Matt-W It really is a very surprising thing
12:12 pmichaud in postfix:<++> I ended up needing a call to '!DEREF', and simply calling !DEREF produced a 3x slowdown
12:12 pmichaud (because !DEREF  does    isa $P0, ['ObjectRef']
12:13 Matt-W is this also something to do with the faster form tells Parrot where to look, so it doesn't have to go hunting as much for the class?
12:14 pmichaud I guess.
12:14 jnthn pmichaud: Yeah, in the dispatcher changes !DEREF is dead.
12:14 jnthn pmichaud: Well, I didn't kill it yet.
12:14 jnthn pmichaud: But there's a dynop to replace it.
12:14 pmichaud ah
12:14 pmichaud I was thinking about a dynop
12:14 pmichaud works for me
12:14 jnthn Yeah. The performance hit was horrid without it.
12:15 pmichaud well, changing !DEREF to just use the get_namespace form instead of   isa $P0, ['ObjectRef']  produced a huge speedup
12:15 jnthn Oh, I lost a bit on dispatcher performance too so we no longer quite beat sub dispatch speed. I had to stick the check in for Whatever and create the closure.
12:16 jnthn I'll work out a way to avoid that cost on every dispatch though.
12:16 jnthn Somehow.
12:19 pmichaud well, checking for Whatever can be fast
12:19 pmichaud it's fast if you already have the Whatever class stashed away somewhere that doesn't require a lookup
12:20 jnthn We still shouldn't pay the cost on every dispatch.
12:20 pmichaud anyway, to describe a bit more of the saga
12:20 jnthn I have a whole bunch of stashing-away-style optimizations to do on the dispatcher though.
12:20 pmichaud turns out that changing postfix:<++> broke enums
12:21 jnthn ooh.
12:21 pmichaud took me about 2 hours to track down why
12:21 jnthn Did you by any chance get an infinite recursion issue?
12:21 pmichaud it's because it started returning parrot Integer PMCs instead of rakudo Int objects
12:21 pmichaud so that broke infix:does
12:21 pmichaud I have that fixed now
12:21 jnthn infix:does should be able to handle that. :-S
12:22 pmichaud well, it doesn't.  Or, it does now.  :-)
12:22 pmichaud but it's orse
12:22 pmichaud *worse
12:22 pmichaud along the way I said "okay, let's try hll_map"
12:22 pmichaud and ran into...
12:23 pmichaud http://gist.github.com/121374  # part 1
12:24 pmichaud http://gist.github.com/121376 # part 2
12:24 pmichaud creating our Int, Num, Str is five times slower than creating parrot Integer, Float, String
12:25 pmichaud afk, taking kids to school
12:25 Matt-W oh dear
12:26 jnthn Well, it does create 3 times as many PMCs. :-|
12:26 Matt-W yes but then it should only be three times slower :)
12:27 Matt-W (yes I know that makes no sense at all)
12:27 jnthn Matt-W: The overhead really comes because it's now not just a PMC, but a high-level Object.
12:27 ZuLuuuuuu joined #perl6
12:27 Matt-W I wasn't aware of a difference
12:28 Matt-W I should find some time to learn more about Parrot
12:29 Matt-W and do some Form.pm again
12:29 Matt-W I got into a bit of a rut of not doing anything, due to the next big thing being handling numbers
12:30 Matt-W which just looks hideously difficult
12:40 pmichaud back
12:47 pugs_svn r26979 | pmichaud++ | [t/spec]:  Fudge autoincrement.t -- test may be incorrect
12:49 pmichaud jnthn: when you have some time for a few discussion items, let me know
12:49 pmichaud (no rush -- I have plenty else to do also)
12:51 jnthn pmichaud: OK, give me 30mins-1 hour.
13:04 pmurias joined #perl6
13:04 pmurias ruoso: hi
13:04 ruoso hi pmurias
13:05 pmurias if $!attr gets translated into self.instance_storage{$?PACKAGE~'attribute'} how will we handle role Foo {method bar {$!foo}}
13:06 jnthn Badly. ;)
13:06 ruoso pmurias, by doing a hack when composing the role
13:06 ruoso by injecting a new value for $?PACKAGE in the lexical tree of the method composed in the class
13:07 jnthn Alternatively, go of $?CLASS, which is generic.
13:08 jnthn *off
13:08 pmichaud http://gist.github.com/121388   # Huh?!?!?!
13:08 ruoso pmurias, jnthn, I guess $?CLASS should work as well... and makes more sense to be overriden
13:08 ruoso I mean... it already needs to be overriden
13:10 jnthn pmichaud: Hm? I'm guessing Str is :vtable('get_string')'d.
13:10 pmichaud jnthn: .... but it's not
13:10 pmichaud :vtable('get_string') is Str
13:11 pmichaud but more to the point, afaik there's no vtable:('get_string') or Str for Range
13:11 pmichaud which is really the source of my "Huh?"
13:11 jnthn There's no generic one in Object that calls .Str?
13:11 pmichaud yes, there's a generic vtable in Object that calls .Str
13:11 pmichaud but Range doesn't define .Str
13:11 jnthn Oh.
13:11 pmurias ruoso: and how does 'is rw' recognize immutable values so that they get wrapped?
13:11 jnthn So which one's it inheriting? :-S
13:12 ruoso pmurias, "is rw" is something that applies to the accessor method
13:13 ruoso pmurias, we will be able to handle it when we handle "is rw" routines
13:14 pmurias i meant is rw in signatures
13:14 pmurias all routines are is rw now
13:16 hanekomu joined #perl6
13:17 cmarcelo joined #perl6
13:19 jnthn pmichaud: OK, free now.
13:19 ruoso pmurias, all routines are "is ref" right now... but we still need a spec clarification on how to fix that
13:22 pmichaud jnthn: I'm thinking seriously about making the switch so that containers have a "rw" property and everything else is assumed readonly.
13:23 ruoso pmichaud, I'm not sure if what you're saying is related with me and pmurias' conversation... but storing that in the container doesn't really solve the problem
13:23 pmichaud ruoso: it's not related.
13:23 ruoso ah... ok
13:24 pmichaud ruoso: it's a slightly different conversation that I've been having with jnthn++ off-and-on
13:24 skids joined #perl6
13:24 masak pmurias: seen Jonathan Leto's email about GSoC updates?
13:24 ruoso but anyway... it would be nice to have a solution to the "enforcing ro in captures" thing...
13:25 jnthn pmichaud: That could be a win.
13:25 barney joined #perl6
13:25 jnthn pmichaud: I'm hoping an optimizer will be able to optimize away a lot of checks though.
13:26 pmichaud jnthn: the reason I was avoiding it previously was to avoid creating a bunch of properties on aggregates.... but we're going to end up with those anyway
13:26 pmichaud and I still hope we can get all of the elements of an aggregate to share a common prophash
13:26 jnthn Well, plus we can share them for the mostpart IIRC.
13:26 pmichaud right.
13:26 jnthn *nod*
13:26 pmichaud would that switch likely interfere with your dispatch work?
13:26 pmichaud I'm thinking I'll want to wait until after that's done.
13:27 pmichaud and, do you see any immediate negatives?
13:27 jnthn It's unlikely to. I actually jsut locally comitted what I had so far and pulled latest trunk and no conflicts to resolve by hand.
13:28 pmichaud okay.  I may look into that soonish.
13:28 pmichaud Another question:  enum MyEnum <a b c d>
13:28 jnthn We still need to check things are rw in a lot of places though...
13:28 jnthn (Increment being one of them.)
13:28 pmichaud I'll come back to my second question
13:29 jnthn But again, optimizer I hope will inline it.
13:29 pmichaud checking for rw isn't hard
13:29 pmichaud really we just do it in assign
13:29 jnthn Yes, true.
13:29 pmichaud even increment is implemented in terms of assign
13:29 DanielC joined #perl6
13:29 jnthn By assign you mena infix:=?
13:29 pmichaud yes.
13:29 jnthn ok
13:29 jnthn Then yes.
13:29 DanielC Sigh... I just had to spend an hour or two rescuing my local system... Thank God for backups.
13:29 lambdabot DanielC: You have 1 new message. '/msg lambdabot @messages' to read it.
13:30 DanielC @messages
13:30 lambdabot Matt-W said 1h 34m ago: Yes, Perl 6 is very mallable. Ultimately we'll be writing macros and mucking about with the grammar to our hearts' content.
13:30 mizioumt joined #perl6
13:30 pmichaud basically, anywhere that we have to type check a value to a container ends up going through infix:=
13:30 pmichaud and rw is just part of that.
13:30 pmichaud anyway, back to my second q
13:30 pmichaud enum MyEnum <a b c d>
13:31 pmichaud each of "a", "b", "c", "d' currently end up with "does Abstraction".   Is that important?
13:31 pmichaud I mean, are they really abstractions?
13:31 pmichaud (same go for Bool::True and Bool::False at the moment)
13:31 jnthn They need to be parsed as type names.
13:32 pmichaud ah.
13:32 pmichaud Actually, STD has changed that
13:32 jnthn The alternative is a special case.
13:32 jnthn Oh?
13:32 pmichaud they need to be parsed as *names*, but not necessarily types
13:32 jnthn Names, type names...
13:32 pmichaud STD.pm now has   ".is_name"  instead of ".is_type"
13:32 jnthn :-/
13:32 pmichaud where a "name" can be something more than a type, or something that "does Abstraction"
13:32 jnthn OK, we probably need to catch up with that distinction at some point.
13:32 pmichaud I might be close to that point.
13:33 jnthn OK.
13:33 jnthn It's probably not going to be so painful.
13:33 pmichaud So, is the only reason that enum/True/False have "does Abstraction" is to get .is_type to work?
13:33 jnthn Yes.
13:33 pmichaud okay.
13:33 pmichaud I wasn't sure if there was something more there.
13:33 pmichaud Good that there's not.  Yes, it shouldn't be too painful a fix.
13:33 jnthn Above, you wrote enum, I think you meant enum values?
13:34 jnthn The name of an enum itself probably wants to stay a type name.
13:34 pmichaud correct, enum values
13:34 jnthn OK.
13:34 pmichaud I agree that the enum name itself remains Abstraction
13:34 jnthn OK, good.
13:35 pmichaud okay, if enum values don't need Abstraction (nor True nor False), then that makes it easier to get   True/False/pi/e/Inf/Nan/etc to act like constants
13:35 jnthn Feel free to go ahead and do the changes you need on that.
13:35 pmichaud I will.
13:35 jnthn Don't see it impacting me.
13:35 pmichaud I just needed to make sure there wasn't something I was missing :-)
13:36 jnthn If there is, I don't see it. :-)
13:36 pmichaud okay, I think that's all I have at the moment for questions.
13:36 * jnthn holds some vain hope that the exit segfaults will have vanished with the upgrade to a later Parrot revision.
13:37 FurnaceBoy joined #perl6
13:37 pmichaud no such luck from what I've seen thus far
13:37 jnthn pmichaud: Are you seeing exit segfaults too then?
13:37 pmichaud oh, Range.Str does exist, but it's in setting
13:37 pmichaud okay, I see the problem now.
13:37 pmichaud yay.
13:37 pmichaud easy fix.
13:37 pmichaud (segfaults)  -- yes, I consistently get an exit segfault in slice.t or something like that
13:38 pmichaud t/spec/S09-subscript_slice/slice.rakudo      0    11    27    0  ??
13:38 jnthn OK, I've been seeing several more after my refactor.
13:38 pmichaud that's the only one, although a few others popped up yesterday while I was mucking about with hll_map
13:38 ZuLuuuuuu left #perl6
13:39 pmurias S28 mentions $?CLASS type as a Class, which is not a valid type right?
13:40 pmichaud pmurias: correct.
13:40 jnthn pmichaud: I'm thinking it probably is the proto-object.
13:40 ruoso pmurias, yeah... there's no "meta-type"
13:41 jnthn Last I remember, TimToady was speculating Class might mean "a metaclass"
13:41 ruoso wasn't that ClassHOW?
13:41 jnthn Which makes sense in the context of traits.
13:42 jnthn ruoso: No, something that means "any meta-class"
13:42 jnthn Not just ClassHOW, but WhateverHOW :-)
13:42 ruoso hmm... seems a fragile definition...
13:43 jnthn So long as we have a mechanism of knowing, "was this declared as a knowhow" it can probably fly.
13:43 jnthn pmichaud: Wow, make spectest feels faster these days...
13:43 pmichaud jnthn: it should be faster
13:44 pmichaud last weekend spectest was taking 45 minutes on my benchmarking machine
13:44 pmichaud as of yesterday noonish, I had it down to 25 minutes
13:44 jnthn Wow.
13:44 jnthn I don't have ICU, and still it feels faster...
13:44 pmichaud oh, yes.
13:44 pmichaud the change I made to speed up parsing doesn't require ICU
13:44 jnthn Oh, cool.
13:44 jnthn :-)
13:45 pmichaud bacek++ fixed TT #24 -- the one about the hash keys not comparing correctly
13:45 pmichaud that meant I could go straight to iso-8859-1 instead of ucs2
13:45 jnthn Oh nice.
13:45 jnthn Hey, does that mean we can parse unicode hypers now?
13:45 pmichaud so now parsing is slow only for files that contain unicode beyond the first 256 codepoints
13:46 pmichaud oh, we're already parsing unicode hypers
13:46 jnthn ah, ok
13:46 pmichaud I fixed that about a week or so ago, I think
13:46 ruoso jnthn, but remember that not only knowhows can be used as HOW...
13:46 jnthn OK, nice.
13:46 jnthn ruoso: Huh?
13:46 pmichaud rakudo:   say «hello, jnthn»;
13:46 p6eval rakudo 0b9c9a: OUTPUT«hello,jnthn␤»
13:46 ruoso jnthn, the HOW is just an object like any other...
13:47 ruoso jnthn, knowhow is simply a pure prototype object...
13:47 pmichaud jnthn: you changed BUILD recently, yes?
13:47 jnthn Can you translate pure prototype from smop terminology?
13:47 ruoso jnthn, it's an object that has its storage and its meta definitions all stored in itself
13:47 jnthn pmichaud: yes.
13:48 pmichaud jnthn: hmmm.  In Range objects,  $!from and $!to are now being held as ObjectRef->Int  instead of just Int
13:48 ruoso jnthn, so it doesn't depend on external objects to dispatch its methods
13:48 jnthn pmichaud: Should be Perl6Scalar->Int
13:48 jnthn pmichaud: It's because they're constructed like normal objects now.
13:48 pmichaud should just be Int
13:48 pmichaud a normal container would be just Int
13:49 pmichaud rakudo:  my $a = 3;  say $a.PARROT;
13:49 p6eval rakudo 0b9c9a: OUTPUT«Int␤»
13:49 jnthn OK, then I only migrated what was already wrong in the existing BUILD.
13:49 pmichaud hmmm.
13:49 jnthn I essentially moved it over to CREATE.
13:49 pmichaud do you remember the approximate date of the change?
13:49 jnthn ruoso: Heh, sounds like what Parrot's default Object/Class is.
13:49 pmichaud I'd like to compare then to now.
13:50 jnthn pmichaud: I did it shortly before starting the dispatch refactor IIRC.
13:50 pmichaud so, after the stockholm release?
13:50 jnthn Yes
13:50 pmichaud okay, I'll just try the release copy
13:50 jnthn Think so.
13:50 pmichaud thanks.
13:50 ruoso jnthn, the idea of a knowhow is precisely to allow you to use a low-level implementation... and its use is mostly related to bootstrapping...
13:50 jnthn pmichaud: oh
13:51 jnthn pmichaud: Friday 19th May or Monday 25th May according to my log.
13:51 pmichaud jnthn: thanks.
13:51 * DanielC wonders if mberends is around now.
13:51 jnthn pmichaud: So it may have been just before the release.
13:52 pmichaud release was 18th, iirc
13:52 jnthn Oh, OK
13:52 pmichaud (yes, time flies.)
13:52 jnthn Yes, you're right.
13:52 jnthn ruoso: OK, the point is that you probably need to be able to write a trait that applies to class-ish things.
13:53 ruoso jnthn, but what are "class-ish" things?
13:53 jnthn And it'd be nice to be able to do that without having to implement them per HOW.
13:53 jnthn ruoso: Probably, things declared with a package declarator.
13:53 jnthn But maybe that's too weak a definition.
13:54 ruoso so a mixed-in anon class doesn't match...
13:54 jnthn I meant semantically more than syntactically.
13:54 ruoso thing is, I thought the concept of "type object" was enough
13:55 jnthn Me too, but TimToady seemed to have the impresstion that the thingy passed to the trait was the metaclass rather than the type object.
13:56 jnthn Which is fine but then needs an answer do, "what do we write to capture that notion in the trait's signature".
13:56 jnthn ruoso: At the moment I think TimToady++ is having a re-think/review/re-design etc on traits though.
13:56 jnthn So fro now I'm just waiting to see what comes out of that.
13:57 ruoso yeah... as every corner of the spec the implementations didn't fully implement ;)
13:57 ruoso I think it comes with the territory
13:57 ruoso as we implement, we find the inconsistencies...
13:57 ruoso ;)
13:57 jnthn pmichaud: Oh hey! The exit segfaults have mostly gone away...
13:57 jnthn (With an upgrade ot the current build/PARROT_REVISION)
13:58 jnthn ruoso: Yes, indeed. :-)
13:59 pochi joined #perl6
13:59 nnunley joined #perl6
14:06 pmichaud Pretty soon we'll all just be handwaving like TimToady++  :-)
14:06 Matt-W it's a new dance craze
14:06 * DanielC just figured out that TimToady's nick is based on TIMTOWTDI
14:06 jnthn Heh. Well I hand-waved my way through implementing enums in Rakudo.
14:07 Matt-W and now look what's happened
14:07 Matt-W People are USING THEM
14:07 jnthn Yeah, but anyone who attempts to ask me to explain how I implemetned it just gets told to read the source. I can't remember, nor do I want to. :-)
14:08 jnthn Which is unfortunate given the two failing tests I now have are...enum related.
14:08 Matt-W That, I think, is a clear indication that the implementation could've been done better :)
14:08 jnthn :-|
14:08 jnthn Matt-W: Heh, it was already done better than the last one.
14:08 Matt-W I remember
14:08 jnthn Matt-W: The main issue is that the spec seems to want enums to be lots of things all at once.
14:09 jnthn And is rather weak on how to hold those together coherently.
14:09 Matt-W hmm
14:09 Matt-W irritating
14:09 pmichaud yes, I looked at the enums code yesterday and thought... "Huh?"
14:09 Matt-W they're rather more than just aliases for integers
14:09 Matt-W they're members of a new type
14:09 Matt-W and... other things too
14:09 jnthn pmichaud: Go read the spec and you'll probably think "Huh wtf" :-)
14:09 pmichaud jnthn: well, yes, I knew that part also.
14:10 rjh are they comparable to java "enums"
14:10 pmichaud they do tend to want to be magical dwim thingies
14:10 rjh which is little more than syntactic sugar around subclasses
14:10 Matt-W no I think they're quite different to java ones
14:10 jnthn rjh: No, it's possible for an implementor to understand the Java ones. ;-)
14:10 Matt-W I'm not quite sure what needs to be magical and dwimmy about enums
14:10 pmichaud lol
14:10 Matt-W I should look at the spec
14:12 pmichaud Matt-W: given    enum Day <Sun Mon Tue Wed Thu Fri Sat>
14:12 pmichaud we should get
14:12 rjh turning integers back into enum objects is evil
14:13 pmichaud my day $d = 3;   say $d.name;   # "Wed"
14:13 pmichaud er, Day
14:13 rjh my $x = 0 but Yes;
14:13 rjh :S
14:13 jnthn pmichaud: No, that one is Wed I think
14:13 mj41 joined #perl6
14:13 jnthn :-)
14:13 Matt-W pmichaud: hmm
14:13 hanekomu_ joined #perl6
14:14 pmichaud now, the question becomes -- how does that 3 turn into a Day-type thingy?
14:14 jnthn pmichaud: That's one of the bits, I didn't yet figure out...
14:14 Matt-W Well if it was C++, I'd say that Day gets a constructor which takes an int
14:14 Matt-W can we do things like that?
14:14 Matt-W would that even work?
14:14 jnthn pmichaud: It may be along the lines of a type-check-that-actually-coerces kinda thing.
14:14 pmichaud Matt-W: except that "Day" isn't a constructor here
14:14 pmichaud it's a type constraint
14:14 pmichaud and... what jnthn++ just said
14:15 jnthn Because of course you can write those. ;-)
14:15 Matt-W I suppose you ahve to be able to intrude into the 'is 3 a Day' check and say 'yes, yes it is, it's this one'
14:15 pmichaud type names on variables aren't coercers -- they're constraints
14:15 jnthn See subset AutoIncrement ;-)
14:15 pmichaud (they can be coercers, but they aren't by default)
14:15 jnthn Making them coercers is evil.
14:15 Matt-W yes
14:15 jnthn But do-able.
14:15 pmichaud my Str $x = 3;   # type mismatch, not a coercion
14:15 Matt-W and I'm happy with that
14:16 Matt-W I'm just used to having implicit constructors running in those circumstances
14:16 pmichaud right
14:16 pmichaud but anyway, that means that Day  has to act like a subset type
14:16 jnthn Anyway, this is just one of the areas where enums feel insanely dwimmy to me.
14:16 Matt-W in a way... I'm not sure why we want to be able to do that
14:16 pmichaud my Day $x = 18;   # probably a constraint violation
14:17 jnthn Yeah, expect os.
14:17 jnthn *so
14:18 pmichaud but in addition to acting like a subset, it also acts like a role
14:18 pmichaud because we can do:
14:18 pmichaud my $x = 'hello' but Tue;
14:18 pmichaud which means that $x.Day  and $x.Tue become valid
14:18 jnthn OH NO DON'T MAKE ME RELIVE THE HORROR
14:18 jnthn ;-)
14:19 Matt-W umm
14:19 Matt-W do we?
14:19 Matt-W why?
14:19 jnthn pmichaud: They're done mostly as roles.
14:19 pmichaud jnthn: right
14:19 rjh Matt-W: http://rakudo.org/2008/07/enu​ms-and-the-but-operator.html
14:19 pmichaud jnthn: I'm just saying it's a role that also has to act like a subset type that also has to act like ....
14:19 jnthn pmichaud: Yes, I know, which is why it was horrible to try and implement.
14:19 pmichaud agreed.
14:20 jnthn pmichaud: At the end of the day, ACCEPTS is what really decides how something type checks.
14:20 jnthn So we've got a hook there.
14:20 jnthn ish.
14:20 pmichaud which is what answers Matt-W's statement....
14:20 pmichaud 14:10 <Matt-W> I'm not quite sure what needs to be magical and dwimmy about enums
14:20 pmichaud :-)
14:21 pmichaud anyway, I'm afk for a bit
14:21 Matt-W okay so that's nice and crazy
14:22 Matt-W I'm not sure why you'd want to use enums like that, but I'm sure somebody has thought of a very clever example
14:22 jnthn rakudo: role Foo { }; say Foo
14:22 p6eval rakudo 0b9c9a: OUTPUT«Foo()␤»
14:22 sri_kraih joined #perl6
14:23 rjh does this still work
14:23 rjh rakudo: enum Maybe <No Yes>; my $x = 0 but Yes; say $x.Maybe;
14:23 p6eval rakudo 0b9c9a: OUTPUT«1␤»
14:23 jnthn rjh: Apparently, yes. :-)
14:23 rjh rakudo: enum Maybe <No Yes>; my $x = 0 but Yes; say $x.Yes;
14:24 p6eval rakudo 0b9c9a: OUTPUT«1␤»
14:24 rjh i am confused here
14:24 rjh it's 0-valued, but has the enum type of an index of 1
14:24 jnthn How so?
14:24 jnthn I don't follow
14:25 rjh i seem to have that problem a lot :)
14:25 jnthn .Maybe is returning the current value.
14:25 jnthn .Yes and .No return true/false dpending on the current value.
14:25 jnthn (that is, only value of .Maybe )
14:26 jnthn so it's a bit like method Yes { self.Maybe === Yes } or something
14:26 Matt-W the enum-related value stuff is completely different
14:26 Matt-W to the 0
14:26 rjh okay, but when you do my Maybe $m = 0;
14:26 rjh it'll set it to No?
14:26 Matt-W you just get a 0 with some extra methods
14:26 Matt-W rjh: yes
14:27 rjh that seems inconsistent to me
14:27 jnthn Matt-W: correct
14:28 Matt-W it's not
14:28 Matt-W in the second case, you make a new object which is a Maybe, initialised with a value of 0 (or somehow told that it should have the value of the entry in the enum corresponding with 0)
14:28 Matt-W in the first case, you start with an Int object and add the Maybe stuff to it
14:29 rjh ok
14:29 Matt-W rather like you could add the function of a bottle of milk to your salt shaker using some duct tape
14:29 rjh perhaps the better word is 'usability nightmare'
14:29 rjh but that comes with the territory with perl 6
14:29 rjh so if you were to do "return 0 but Maybe"
14:29 rjh would it set the enum type the same way as "my Maybe $m = 0"
14:30 jnthn It's the same difference between having a varible typed as a role vs mixing in the role.
14:30 jnthn rjh: The difference there is that you're mixing in.
14:30 Matt-W "0 but Maybe" is an Int with a Maybe mixed in
14:30 rjh right
14:30 DanielC joined #perl6
14:30 rjh I can see there is a difference
14:30 jnthn You're saying "I take the integer 0 and add another attribute storing the current enum value"
14:32 DanielC @seen mberends
14:32 lambdabot mberends is in #perl6. I last heard mberends speak 5h 30m 23s ago.
14:33 rjh Can you think of a situation where you'd want to do "0 but Maybe" and not have it get changed to Yes or No...?
14:33 rjh I suppose the 'but' operation has to be general
14:35 jnthn Yeah, it is a general role mix-in mechanism.
14:36 * Matt-W decides that saying 0 but Hash is probably rarely a good idea due to a lack of implementations
14:36 rjh lol
14:37 jnthn some(!$tobaco but Hash)
14:37 rjh so just for fun, how would I do "return 0 but Maybe" and expect to get No out the other end
14:37 jnthn *smoke
14:37 DanielC masak: You made a new branch of Rakudo, right? (to work on the modules thing). Is it published somewhere?
14:37 jnthn rjh: say $ret_val.Maybe.name
14:37 jnthn IIRC
14:38 masak DanielC: http://github.com/rakudo/ra​kudo/tree/ver-auth-modules
14:38 rjh well .Maybe is good enough
14:38 DanielC *click*
14:38 masak DanielC: I've only branched so far, not made any cool commits or anything.
14:38 DanielC masak: Ok.
14:39 DanielC masak: What part of the source code will you be working on? I'm not familiar with the Rakudo source tree.
14:39 rjh rakudo: enum F<A B C>; say 0.F;
14:39 p6eval rakudo 0b9c9a: OUTPUT«Method 'F' not found for invocant of class 'Int'␤»
14:39 masak DanielC: src/parser/ contains the grammar and actions of the compiler.
14:40 masak DanielC: the first step would probably be to make the use_statement action recognize versions and/or auths.
14:40 rjh rakudo: enum F<A B C>; say (0 but Maybe).Maybe.name;
14:40 p6eval rakudo 0b9c9a: OUTPUT«Null PMC access in isa()␤in Main (/tmp/3aLSHuEuG8:2)␤»
14:40 rjh yay
14:40 DanielC masak: ok
14:40 masak rjh: care to submit a rakudobug?
14:40 rjh rakudo: enum Maybe<A B C>; say (0 but Maybe).Maybe.name;
14:40 p6eval rakudo 0b9c9a: OUTPUT«Method 'name' not found for invocant of class 'Undef'␤»
14:40 ejs1 joined #perl6
14:41 rjh rakudo: enum Maybe<A B C>; say (0 but Maybe).Maybe.WHAT;
14:41 p6eval rakudo 0b9c9a: OUTPUT«Failure()␤»
14:41 pmichaud masak: where "recognize" means...?
14:41 pmichaud masak:  parse?
14:41 masak no, it already parses them fine.
14:41 masak it means "take some action based on"
14:41 pmichaud oh, I can add a few more details.  Currently there's a function called 'use'
14:41 pmichaud so the next step would be to make sure that the vers/auth/other colonpair items are passed to that function
14:42 masak ah. I see.
14:42 pmichaud (there won't always be a function called 'use', but that's what we have atm)
14:42 eMaX joined #perl6
14:42 masak thanks for the pointer. I'll investigate that.
14:42 pmichaud more directly, it might be nice to have a way of grabbing the colonpair items out of a <longname> parse subtree
14:43 masak aye.
14:43 pmichaud could be an action method, although I don't know if we want to invoke that method on every longname (as the majority of them don't need colonpairs)
14:43 pmichaud maybe an action method only if colonpairs are parsed.
14:45 masak why not just put that logic in the use_statement action?
14:45 rjh rakudo: say (0 but F);
14:45 p6eval rakudo 0b9c9a: OUTPUT«Null PMC access in isa()␤in Main (/tmp/Pt4uZk2g0i:2)␤»
14:45 rjh rakudo: 0 but F;
14:45 p6eval rakudo 0b9c9a: OUTPUT«Null PMC access in isa()␤in Main (/tmp/reA32i3Q4j:2)␤»
14:47 rjh masak: done, let me know if it sucks
14:48 DanielC pmichaud: You are the author of PmWiki?
14:48 pmichaud DanielC: Yes.
14:48 DanielC cool
14:48 DanielC I didn't know that.
14:49 masak rjh: looks fine.
14:49 masak rjh++
14:50 rjh rakudo: enum Maybe <A>; say (0 but Maybe).WHAT
14:50 p6eval rakudo 0b9c9a: OUTPUT«Int()␤»
14:51 rjh rakudo: enum Maybe <A>; say (0 but Maybe).Maybe
14:51 p6eval rakudo 0b9c9a: OUTPUT«␤»
14:51 rjh rakudo: enum Maybe <A>; say (0 but Maybe).Maybe.WHAT
14:51 p6eval rakudo 0b9c9a: OUTPUT«Failure()␤»
14:51 rjh rakudo: enum Maybe <A>; say (0 but Maybe).A
14:51 p6eval rakudo 0b9c9a: OUTPUT«0␤»
14:52 rjh rakudo: enum Maybe <A>; say (0 but A).A
14:52 p6eval rakudo 0b9c9a: OUTPUT«1␤»
14:57 Matt-W I'd have expected that second one to be 0
14:57 pmichaud what's the question being asked here?
14:58 kidd joined #perl6
14:58 rjh I'm trying to come to terms with the behaviour of enums when mixed in as roles
14:58 pmichaud keep in mind that (I think)    0 but Maybe  is not the same as Maybe(0)
14:59 rjh rakudo: say Maybe(0).WHAT
14:59 p6eval rakudo 0b9c9a: OUTPUT«Could not find non-existent sub Maybe␤»
14:59 rjh oops
14:59 pmichaud (we don't support that form yet, sorry)
14:59 rjh ah
14:59 rjh initially i assumed that was the point of "0 but Maybe", but a constructor-style method would make a lot more sense there
15:00 pmichaud "0 but Maybe" would mean   0 with the Maybe enum role mixed in.
15:00 rjh yeah
15:00 pmichaud But the Maybe enum role has its own attribute with the Maybe value.  It doesn't use the 0.
15:00 pmichaud rakudo:  enum Maybe <A B>;   say (3 but B) * 2;
15:00 p6eval rakudo 0b9c9a: OUTPUT«6␤»
15:01 pmichaud the 3 is still a Int 3
15:01 pmichaud rakudo:  enum Maybe <A B>;   say (3 but B).B
15:01 p6eval rakudo 0b9c9a: OUTPUT«1␤»
15:01 pmichaud but it has a Maybe value of 1 (B)
15:01 pmichaud rakudo:  enum Maybe <A B>;   say (3 but B).Maybe
15:01 p6eval rakudo 0b9c9a: OUTPUT«1␤»
15:01 rjh got it
15:01 rjh thanks
15:02 rjh but crucially, when you do my Maybe $m = 0;
15:02 rjh you are assigning to the Maybe value, because that's it's actual type
15:03 rjh *its
15:03 pmichaud I'm not sure about that (reading spec)
15:05 pmurias joined #perl6
15:05 flexibeast joined #perl6
15:05 c9s joined #perl6
15:05 andreasg_ joined #perl6
15:05 Jedai joined #perl6
15:06 pmichaud the spec doesn't explicitly say that    my Maybe $m = 0    would result in the 0 being coerced
15:07 kidd joined #perl6
15:08 pmichaud although one could reasonably infer that from
15:08 pmichaud my day $d = 3;
15:08 pmichaud which is talking about native types
15:09 [particle]1 joined #perl6
15:09 pmichaud so I'm guessing that's probably the case.
15:09 pmichaud and enum type constraints are really coercers (that also check that whatever they're coercing is compatible with the enum)
15:10 pmichaud i.e., through their ACCEPTS method
15:11 DanielC rakudo: "next cmd=a" ~~ m/ \s* next \s+ cmd \s* '=' \s* <alpha>/
15:11 p6eval rakudo 0b9c9a:  ( no output )
15:14 DanielC S05 says that m/ <.ws> next <.ws> cmd <.ws> '=' <.ws> <condition>/ is equivalent to m/ \s* next \s+ cmd \s* '=' \s* <condition>/
15:15 pmichaud Yes, it should be.
15:15 DanielC Why is it that some times <.ws> means \s* and other times it means \s+  ?
15:15 pmichaud it means \s+ when we require that we're not in the middle of a word
15:15 pmichaud for example
15:15 pmichaud next <.ws> cmd /   will match   "next cmd"  but not "nextcmd"
15:16 pmichaud while
15:16 jnthn rakudo: enum Color <white gray black>; say Color.pick(2)
15:16 p6eval rakudo 0b9c9a: OUTPUT«12␤»
15:16 jnthn rakudo: enum Color <white gray black>; say Color.pick(2)>>.name
15:16 p6eval rakudo 0b9c9a: OUTPUT«blackgray␤»
15:16 pmichaud / next <ws> '=' /    will match either  "next="  or "next ="
15:16 pmichaud more precisely
15:16 DanielC interesting
15:17 pmichaud / next <ws> . $ /   will match   "next="  or "next    ="  and "next b"   but not  "nextb"
15:17 DanielC What does the '.' (dot) do in <.ws> ?
15:18 pmichaud in the case of matching against "next=", the <.ws> acts like a \s*;  in the case of matching against "nextc", the <.ws> won't match because it wants a space between any pair of word characters
15:18 pmichaud (and so it acts like a \s+)
15:18 pmichaud <ws>  means "capture", <.ws>  means "don't capture"
15:18 DanielC I see.
15:19 DanielC So in / next <ws> '=' / if there is a match the $0 variable will contain the spaces?
15:19 pmichaud no, it would be in $<ws>
15:19 pmichaud named subrules capture to the hash interface
15:19 DanielC ok, so it's a different capture from (  )
15:19 pmichaud yes.
15:19 pmichaud ( )   capture to $0, $1, $2, etc.
15:20 pmichaud <foo>  captures to $<foo>
15:20 DanielC ah, I didn't know that.
15:20 pmichaud (which is the same as  $/<foo>, which is the same as $/{'foo'}
15:20 donaldh joined #perl6
15:20 DanielC But what if you have / <foo> bar <foo> / ?
15:20 pmichaud then $<foo> is an array of matches
15:20 DanielC ok
15:20 pmichaud same for quantified parens
15:21 DanielC thanks
15:21 pmichaud / (bar)+ /    #   $0 will be an array
15:21 DanielC that's new...
15:21 DanielC (I think)
15:21 DanielC It's a good idea.
15:22 DanielC With your example, can I do '$size = scalar $0' to find how many times the word 'bar' appears in the text?
15:22 pmichaud '$size = +$0'
15:22 DanielC ok
15:23 pmichaud we don't have a 'scalar' keyword anymore
15:23 DanielC ok
15:23 DanielC Thanks.
15:24 nihiliad joined #perl6
15:24 pmichaud can also do    $size = $0.elems
15:24 pmichaud to be slightly more explicit
15:24 DanielC Can you do 0..$^0 too?
15:24 pmichaud yes, although that might give you one more than what you want
15:25 pmichaud rakudo:  my $a = [<a b c>];   say 0..$a;  # just curious
15:25 p6eval rakudo 0b9c9a: OUTPUT«0123␤»
15:25 pmichaud okay, good.
15:25 pmichaud normally would do
15:25 DanielC rakudo:  my $a = [<a b c>];   say 0..$^a;
15:25 p6eval rakudo 0b9c9a: OUTPUT«0123␤»
15:25 pmichaud rakudo:  my $a = [<a b c>];   say 0..^$a;  # just curious
15:26 p6eval rakudo 0b9c9a: OUTPUT«012␤»
15:26 pmichaud rakudo:  my $a = [<a b c>];   say ^$a;    # or even
15:26 p6eval rakudo 0b9c9a: OUTPUT«012␤»
15:26 DanielC ah, that's the one.
15:26 DanielC So @^arr means the same as +@arr but ^@arr means (+@arr - 1) ?
15:27 pmichaud no, I misread earlier
15:27 pmichaud @^arr would be a positional param, and what you wrote earlier woulnd't work
15:27 lambdabot Maybe you meant: arr yarr
15:27 pmichaud 0..^@arr   means    0..(+@arr - 1)
15:27 pmichaud it actually parses as   0 ..^ (+@arr)
15:28 pmichaud which means from 0 up to (but not including) the number of elements in @arr
15:28 DanielC rakudo:  my $a = [<a b c>];   say $^a;
15:28 p6eval rakudo 0b9c9a: OUTPUT«a b c␤»
15:28 pmichaud $^a is a parameter shortcut
15:28 pmichaud i.e., it's a placeholder param
15:28 pmichaud (man, I can't type straight this morning, or get my terms correct.)
15:29 DanielC rakudo:  my $a = [<a b c>];   say $a; say $^a
15:29 p6eval rakudo 0b9c9a: OUTPUT«a b c␤a b c␤»
15:29 pmichaud in this case rakudo is treating  $^a as the same as $a.  It should probably complain about a redeclared $a
15:29 pmichaud you probably recognize $^a better from:     sort:  { $^a cmp $^b }
15:29 DanielC ah, yes... $^a is what you use in a sub.
15:29 masak DanielC: also, those [] are redundant.
15:29 DanielC Yes, I recognize it now.
15:30 pmichaud the [] aren't redundant.
15:30 pmichaud (they used to be, but are no longer)
15:30 masak oh.
15:30 masak rakudo: my $a = [<a b c>]; say $a.perl; $a = <a b c>; say $a.perl
15:30 p6eval rakudo 0b9c9a: OUTPUT«["a", "b", "c"]␤["a", "b", "c"]␤»
15:30 pmichaud (rakudo still implements the "used to be" semantic, though
15:30 masak aye.
15:31 masak how will it be when it's no longer how it used to be (which it still is)?
15:31 pmichaud DanielC: anyway,   ^(value)   is the same as    0 ..^ (value)
15:31 pmichaud so ^3  is the same as 0 ..^ 3  which gives the elements 0, 1, and 2
15:32 DanielC rakudo: say ^3
15:32 p6eval rakudo 0b9c9a: OUTPUT«012␤»
15:32 DanielC interesting
15:32 pmichaud ^@arr  is the same as 0 ..^ @arr  which gives the elements 0, 1, 2, ... , @arr-1
15:32 DanielC Is $a = <a b c> supposed to give an error now?
15:32 rjh rakudo: my Undef $u; [$x.WHAT, $x.HOW, $x]>>.say
15:32 p6eval rakudo 0b9c9a: OUTPUT«Malformed declaration at line 2, near "Undef $u; "␤in Main (src/gen_setting.pm:0)␤»
15:32 rjh rakudo: my Any $u; [$x.WHAT, $x.HOW, $x]>>.say
15:33 p6eval rakudo 0b9c9a: OUTPUT«Symbol '$x' not predeclared in <anonymous> (/tmp/62DbxdhcOt:2)␤in Main (src/gen_setting.pm:3166)␤»
15:33 rjh i'm an idiot
15:33 rjh rakudo: my $x; [$x.WHAT, $x.HOW, $x]>>.say
15:33 p6eval rakudo 0b9c9a: OUTPUT«Failure()␤Could not find non-existent sub die␤»
15:33 pmichaud DanielC: $a = <a b c>;    isn't an error, but it won't end up being an Array
15:33 DanielC ok
15:33 masak pmichaud: what's that "Could not find non-existent sub die" error there?
15:33 pmichaud masak: I have no clue.  PerlJam said he was seeing those also.
15:34 masak I've seen it before too.
15:34 pmichaud oh!
15:34 masak rakudo: my $x; $x.HOW
15:34 p6eval rakudo 0b9c9a:  ( no output )
15:34 jnthn masak: Gone in dispatch refactor I expect.
15:34 pmichaud I'm guessing that the P6object stuff is still looking for  "die"(...)
15:34 masak ah.
15:34 pmichaud which disappeared when we switched HLLs
15:34 jnthn Right.
15:34 masak :)
15:34 * masak submits rakudobug
15:34 rjh aren't Failure() objects going out of vogue
15:34 jnthn masak: It's already fixed locally...
15:35 masak jnthn: then you get to close one more! :)
15:35 pmichaud rjh: yes -- we still need to turn Failure into a role
15:35 jnthn Yeah I just lvoe the administrative overhead!
15:35 jnthn :-P
15:35 rjh anyways I was attempting to do Ruby's .methods
15:35 pmichaud masak++ is just trying to pad his bug resume
15:35 rjh i found it!
15:35 rjh ;)
15:35 masak I don't know if I should laugh or go on strike. :P
15:35 DanielC The ^ is surprisingly logical: ^foo == 0..^foo == 0..(foo - 1). That works whether foo is 3, $val or @arr... because (@arr - 1) is in scalar context.
15:36 pmichaud DanielC: correct.
15:36 pmichaud In general, it's the "up to" operator :-)
15:36 DanielC ok
15:36 masak jnthn: if you dislike the administrative overhead, stop creating so many new bugs. :P
15:36 rjh rakudo: say $x.methods
15:36 pmichaud s/bugs/features/
15:36 p6eval rakudo 0b9c9a: OUTPUT«Symbol '$x' not predeclared in <anonymous> (/tmp/q8licMqPP4:2)␤in Main (src/gen_setting.pm:3166)␤»
15:36 rjh rakudo: my $x; say $x.methods
15:36 p6eval rakudo 0b9c9a: OUTPUT«Method 'methods' not found for invocant of class 'Failure'␤»
15:37 jnthn rjh: it's meta
15:37 pmichaud rakudo:  my $x;  say $x.^methods
15:37 p6eval rakudo 0b9c9a: OUTPUT«ACCEPTSdefinedhandledpe​rl!exception!throw_unhandled␤»
15:37 DanielC rakudo: say (^ 3).perl
15:37 p6eval rakudo 0b9c9a: OUTPUT«0..^3␤»
15:37 rjh rakudo: my $x; $x.methods>>.say
15:37 p6eval rakudo 0b9c9a: OUTPUT«Method 'methods' not found for invocant of class 'Failure'␤»
15:37 DanielC rakudo: say (^3).perl
15:37 p6eval rakudo 0b9c9a: OUTPUT«0..^3␤»
15:37 rjh rakudo: my $x; $x.^methods>>.say
15:37 p6eval rakudo 0b9c9a: OUTPUT«ACCEPTS␤defined␤handled␤pe​rl␤!exception␤!throw_unhandled␤␤»
15:37 rjh thanks
15:38 pmichaud omg.... looks like postfix:<++> might actually be pretty close to almost being finished for real this time
15:38 rjh rakudo: Any.methods>>.say
15:38 p6eval rakudo 0b9c9a: OUTPUT«Could not find non-existent sub die␤»
15:38 rjh i notice .^methods doesn't include itself? how do I get a list of meta methods?
15:38 pmichaud rakudo:  Any.HOW.methods>>.say
15:38 p6eval rakudo 0b9c9a: OUTPUT«too few arguments passed (1) - 2 params expected␤in Main (src/gen_setting.pm:3166)␤»
15:39 pmichaud rakudo:  Any.HOW.methods(Any.HOW)>>.say
15:39 p6eval rakudo 0b9c9a: OUTPUT«does␤parents␤methods␤dispatch␤WHAT␤is​a␤can␤add_parent␤add_parent␤add_method␤add_m​ethod␤add_attribute␤add_role␤compose_role␤re​gister␤new_class␤get_proto␤get_parrotclass␤»
15:39 rjh neat
15:39 jnthn Any.HOW.^methods>>.say
15:39 jnthn rakudo: Any.HOW.^methods>>.say
15:40 p6eval rakudo 0b9c9a: OUTPUT«Method '!.^' not found for invocant of class 'P6metaclass'␤»
15:40 jnthn wtf
15:40 jnthn oh
15:40 pmichaud metaobjects don't have .^methods
15:40 rjh why not? ;)
15:40 jnthn Hmm?
15:40 pmichaud (they probably could, if Any.HOW.HOW == Any.HOW)
15:40 pugs_svn r26980 | pmurias++ | [re-smop] attributes should have a unique private_name (TBD)
15:40 pugs_svn r26980 | pmurias++ | instead of playing games with $?PACKAGE
15:40 pmichaud Any.^methods   is the same as   Any.HOW.methods
15:40 pugs_svn r26981 | pmurias++ | [re-smop]
15:40 pugs_svn r26981 | pmurias++ | added &PRIMITIVE::storage_name
15:40 pugs_svn r26981 | pmurias++ | started work on $!
15:40 pugs_svn r26981 | pmurias++ | sketched out in sig.t how Signature  might be implemented
15:41 pmichaud or, in general
15:41 masak pmichaud: ping
15:41 pmichaud $x.^methods  is the same as ($x.HOW).methods
15:41 pmichaud masak: pong
15:41 masak pmichaud: oops, tab completion fail. :/
15:41 masak pmurias: ping
15:41 pmurias ruoso: could you look at re-mildew/sig.t
15:41 pmurias masak: pong
15:41 masak pmurias: did you see Leto's mail from earlier today?
15:41 masak pmurias: he mentioned you.
15:42 pmurias masak: haven't seen it... where was it sent to?
15:43 * pmichaud gazes hopefully at his spectest run, noticing no failures yet.
15:43 masak pmurias: tpf-gsoc
15:43 masak don't know if it's public, but here: http://groups.google.com/group/tpf-gsoc​/browse_thread/thread/a5cd1f6e0767e2f1
15:44 * jnthn gazes at his hopefully now being down to just one test file that has a fail he needs to fix before comitting the dispatch branch
15:44 rjh jnthn: looking forward to it :)
15:44 jnthn Good news: 1 failing test file. Bad news: it fails by segfaulting.
15:45 pmichaud afk for a bit
15:45 REPLeffect joined #perl6
15:45 pmurias masak: i don't think it's public
15:46 masak no, me neither.
15:46 pmurias masak: was the mail something worrying?
15:46 masak pmurias: he simply wondered why he hadn't heard from some GSoC students. and he listed you as one of them.
15:47 masak that seemed strange to me, since you are here a lot.
15:47 masak pmurias: but you should perhaps consider joining that list.
15:47 masak since it seems that at least Leto is trying to reach you through it. :)
15:49 payload joined #perl6
15:51 jnthn oooh...I see potential for accidental collection of referenced stuff...
16:05 icwiener joined #perl6
16:07 Chillance joined #perl6
16:08 jnthn ...unfortunately, fixing that didn't fix the problem. :-(
16:09 abra joined #perl6
16:12 TimToady DanielC: actually, int $a/$b will not do long term, so I recommend writing int($a/$b)
16:12 TimToady the problem is that int is a type name, and so can't also parse like a prefix operator
16:12 dalek rakudo: b9bfabc | pmichaud++ | src/ (8 files):
16:12 dalek rakudo: Fix postfix:<++> to be faster in general, and faster still for Ints.
16:12 dalek rakudo: auto-incrementing 20,000 Ints previously took 13.36s, it now takes 2.76s.
16:12 dalek rakudo: In order to get this to work, we also:
16:12 dalek rakudo: * Fixed ++/-- to auto-promote to Num/BigInt as needed
16:12 dalek rakudo: * Changed !DEREF to check isa using a class object instead of a Key
16:12 dalek rakudo: * Refactored all of the autoincrement/decrement operators
16:12 dalek rakudo: * Fixed infix:<does> to now work on Integer/Float/String PMCs
16:12 dalek rakudo: * Cleaned up .succ and .pred in Bool
16:12 dalek rakudo: * Rewrote the .succ and .pred rules for Str in PIR (was C),
16:12 dalek rakudo:   made it extensible to unicode ranges, and removed no-longer-the-right-place
16:12 dalek rakudo:   increment/decrement vtable in Perl6Str
16:12 dalek rakudo: * Removed the not-quite-working Range.clone method -- we can inherit
16:12 dalek rakudo:   from Object anyway.
16:12 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/b​9bfabc46dfd27f3b9fdf10547556c871d00a9bc
16:12 DanielC TimToady: ok
16:12 masak pmichaud++
16:13 PacoLinux joined #perl6
16:13 TimToady and .split('') is better writting .comb now
16:13 jnthn rakudo: enum day <Sun Mon Tue Wed Thu Fri Sat>; say day.perl;
16:13 TimToady since it defaults to combing single chars
16:13 p6eval rakudo 0b9c9a: OUTPUT«␤»
16:13 DanielC rakudo: say ("hello".comb).perl
16:13 p6eval rakudo 0b9c9a: OUTPUT«["h", "e", "l", "l", "o"]␤»
16:14 DanielC TimToady: thanks
16:14 masak rakudo: 'hello world!'.words.say
16:14 p6eval rakudo 0b9c9a: OUTPUT«helloworld!␤»
16:14 masak rakudo: 'hello world!'.words.perl.say
16:14 p6eval rakudo 0b9c9a: OUTPUT«["hello", "world!"]␤»
16:14 masak words++
16:15 TimToady rakudo: '/etc/passwd'.lines.say
16:15 p6eval rakudo 0b9c9a: OUTPUT«Method 'lines' not found for invocant of class 'Str'␤»
16:15 TimToady rakudo: '/etc/passwd'.slurp.say
16:15 p6eval rakudo 0b9c9a: OUTPUT«Method 'slurp' not found for invocant of class 'Str'␤»
16:15 jhorwitz joined #perl6
16:15 jnthn rakudo: slurp('/etc/passwd').say
16:15 p6eval rakudo 0b9c9a:
16:15 p6eval ..OUTPUT«root:x:0:0:root:/root:/bin/bash␤daemon:x​:1:1:daemon:/usr/sbin:/bin/sh␤bin:x:2:2:bin:/bin:​/bin/sh␤sys:x:3:3:sys:/dev:/bin/sh␤sync:x:4:65534​:sync:/bin:/bin/sync␤games:x:5:60:games:/usr/game​s:/bin/sh␤man:x:6:12:man:/var/cache/man:/bin/sh␤l​p:x:7:7:lp:/var/spool/lpd:/bin/sh␤mail:x:8:8:m…
16:15 masak o_O
16:16 TimToady rakudo: lines('/etc/passwd').say
16:16 jnthn oh noes safe mode is has a fail
16:16 p6eval rakudo 0b9c9a:
16:16 p6eval ..OUTPUT«root:x:0:0:root:/root:/bin/bashdaemon:x:​1:1:daemon:/usr/sbin:/bin/shbin:x:2:2:bin:/bin:/b​in/shsys:x:3:3:sys:/dev:/bin/shsync:x:4:65534:syn​c:/bin:/bin/syncgames:x:5:60:games:/usr/games:/bi​n/shman:x:6:12:man:/var/cache/man:/bin/shlp:x:7:7​:lp:/var/spool/lpd:/bin/shmail:x:8:8:mail:/var…
16:16 pmichaud changing the namespace symbol entries won't elimnate the methods :-)
16:16 masak oh noes!
16:17 jnthn hehe
16:17 jnthn Phew...got my segfault down from a 70 test script to a 1 liner.
16:17 pmichaud I've always hated the term "safe mode" in the PHP world, though.
16:18 pmichaud It's misnamed.
16:18 jnthn Because PHP is never safe? ;-)
16:18 pmichaud It's really "crippled mode".  In most environments, "safe mode" doesn't actually make things significantly safer.
16:18 jnthn Well, so far Rakudo's one seems to fir the name perfectly.
16:18 pmichaud kinda like barricading the door while leaving the windows open.
16:18 jnthn ;-)
16:19 * masak goes swimming
16:19 ruoso pmichaud, re Any.HOW.HOW... nothing stops Any.HOW.HOW to be different from Any.HOW... it's just another object...
16:20 pmichaud Worse, working around PHP's "safe mode" often means that we have to do things that actually make the overall system less safe.
16:20 pmichaud ruoso: I know -- that was kinda what I was saying (albeit not clearly)
16:20 pmichaud that Any.HOW.HOW wasn't necessarily Any.HOW
16:20 ruoso ah... ok...
16:21 ruoso so metaobjects do have .^methods
16:21 pmichaud and thus Any.HOW.^methods would be the same as   Any.HOW.HOW.methods    (I think)
16:21 ruoso Any.^methods is Any.HOW.methods(Any)
16:21 pmichaud right.
16:21 ruoso Any.HOW.^methods is Any.HOW.HOW.methods(Any.HOW)
16:21 pmichaud yes, we agree.
16:21 ruoso cool
16:21 jnthn Me too. :-)
16:22 jnthn The problem now is just the way .^ is implemented.
16:22 pmichaud ??
16:22 pmurias ruoso: have you seen re-mildew/sig.t
16:22 pmichaud why is that currently a problem?
16:22 * ruoso updating in this second
16:22 jnthn pmichaud: As a method !.^ on Object.
16:22 ruoso jnthn, .^ is syntax
16:22 pmichaud oh.
16:22 jnthn ruoso: yeah, I know
16:23 pmichaud that part
16:23 ruoso the compiler itself can implement .^foo to be expanded as .HOW.foo($invocant)
16:23 jnthn pmichaud: Yeah, I've avoid that anti-pattern elsewhere. :-)
16:23 jnthn ruoso: It could. Doesn't have to be done that way.
16:23 jnthn ruoso: But it may be what I end up fixing it to do.
16:24 TimToady at some point we've got to stop defining non-primitives :)
16:24 ruoso true... but notice the signature from Foo.^methods and Foo.HOW.methods differ
16:24 jnthn ruoso: Yeah, that mangling is why it was easier to do it the way it currently is.
16:26 iblechbot joined #perl6
16:27 ruoso pmurias, wow... that looks nice
16:30 pmurias bjj&
16:32 TimToady ruoso: if you want new [] each time, instead of [] xx $n, use [] for ^$n
16:32 TimToady though I don't think rakudo implements list comprehensions yet
16:33 ruoso TimToady, yeah... pmichaud told me that already... I submitted my final version to the list
16:33 TimToady k, still backlogging :)
16:33 TimToady and I always figure it's better to be told too many times than too few :)
16:34 ruoso heh... indeed..
16:35 mizioumt joined #perl6
16:37 ruoso pmurias++ # mildew has "map" now
16:37 ruoso mildew: say "evalbot up?"
16:37 p6eval mildew: OUTPUT«Bareword found where operator expected at perl6-snapshot/STD.pm line 4, near "$LANG is"␤  (Missing operator before is?)␤Bareword found where operator expected at perl6-snapshot/STD.pm line 5, near "$PKGDECL is"␤   (Missing operator before is?)␤Bareword found where operator expected
16:37 p6eval ..at…
16:37 Zooix joined #perl6
16:37 ruoso nah
16:37 Psyche^ joined #perl6
16:38 Zooix Hi all ! I would like to try Perl 6 but I don't know where to start ! Can you give me some links (in French if you can, if not in english) to start on good basis with Perl 6 please
16:39 DanielC Zooix: Do you have a Perl 6 compiler installed?
16:39 sbp Zooix: try in the sense of "install", or in the sense of "learn the language"?
16:39 Zooix sbp, both
16:39 Zooix DanielC, no
16:39 DanielC Zooix: http://rakudo.org/how-to-get-rakudo
16:40 Zooix I've just Parrot
16:40 Zooix just*
16:40 DanielC Zooix: All Perl 6 compilers today are incomplete, but Rakudo is complete enough to make a lot of real programs.
16:40 sbp Zooix: to install, I did this:
16:40 sbp $ git clone git://github.com/rakudo/rakudo.git
16:40 sbp $ cd rakudo
16:40 sbp $ perl Configure.pl --gen-parrot
16:41 sbp Zooix: if you already have parrot and want to use it, you'd have to use another process
16:41 Zooix sbp, ok, thanks
16:41 sbp (as --gen-parrot means to get parrot for you)
16:41 DanielC sbp: It's easier if Zooix just uses the standard method.
16:41 sbp rakudo is a (well, the) leading perl6 implementation; there are others
16:41 Zooix I'll notice it cause I'm on WIndows now but I'll installa GNU/Linux distrib tonight
16:41 Zooix surely Zenwalk :D
16:42 Zooix thank you two ! Bye ^^
16:48 rjh does parrot/rakudo have localisation for built-in error messages?
16:49 jnthn rjh: Not yet, but I remember someone starting some work on that for Parrot.
16:49 rjh jnthn: cool, i don't think many other languages do it
16:50 pmichaud http://use.perl.org/comments​.pl?sid=43083&amp;cid=68891
16:52 rjh does it still use 1.4 gigs of ram
16:54 pmichaud I don't know.  Doubtful.
16:54 pmichaud I suspect many of those gigs were due to extra PMCProxys or something.
16:54 pmichaud what's an easy way to measure?
16:54 ejs joined #perl6
16:54 rjh ps?
16:56 pmichaud looks like 83 megabytes on my box, unless I'm reading it incorrectly.
16:56 rjh yikes
16:57 rjh 1.4gbs seems like an error on his part, or something incredibly strange
16:57 pmichaud no, he did 10x the number of iterations that I did
16:58 ejs0 joined #perl6
17:03 jnthn pmichaud: So, segfault avoided.
17:03 pmichaud \o/
17:03 jnthn pmichaud: And a previously todo'd spectest fixed in the process.
17:04 pmichaud \o/ x 2
17:04 jnthn I'm running make spectest now. But that test was my final failure that I could see was related to my dispatcher changes.
17:04 jnthn Which means I can probably push them.
17:04 pmichaud good.  did you merge in my changes yet?
17:04 jnthn No, that might have been wise before my spectest run actually...
17:04 * jnthn cancels and does so.
17:05 pmichaud yes, I think so.
17:05 jnthn Did you bump parrot revision again?
17:05 pmichaud no.
17:05 pmichaud not for that.
17:05 pmichaud currently 39288
17:05 pmichaud (or later...)
17:07 M_o_C joined #perl6
17:08 jnthn Whoa...that makes a difference in tools/benchmark.pl :-)
17:08 jnthn ('cus the ranges are faster)
17:09 pmichaud I'm about to make another change to improve ranges even more
17:09 nihiliad joined #perl6
17:10 jnthn OK, spectesting with mine and yours. :-)
17:10 * jnthn crosses fingers
17:10 pmichaud merged cleanly?  that's a good sign.
17:10 jnthn pmichaud: Yes.
17:18 nihiliad1 joined #perl6
17:30 nihiliad joined #perl6
17:33 kane__ joined #perl6
17:38 jnthn \o/
17:40 mizioumt1 joined #perl6
17:40 [particle] joined #perl6
17:41 dalek rakudo: 711bd6d | jnthn++ |  (14 files):
17:41 dalek rakudo: Large refactor of method dispatch, providing deferal, eliminating some levels of indirection in method dispatch and improving performance. Also starts a refactor of roles since various past tricks will no longer fly and we should fiddle less with Parrot's Role PMC, though much remains to be cleared up there so roles are a little messy for now.
17:41 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/7​11bd6d629533672e68bcefa4a72b79213cff7d1
17:41 dalek rakudo: ff312ab | jnthn++ | :
17:41 dalek rakudo: Merge branch 'master' of git@github.com:rakudo/rakudo
17:41 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/f​f312abb7feb6950c1d894f0fbb1da503d288eee
17:41 dalek rakudo: 03e90ad | jnthn++ | src/ (4 files):
17:41 dalek rakudo: Track down a couple of issues relating to enums and role punning, which were causing test fails, plus track down a bug with .perl on roles.
17:41 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/0​3e90ad93a181716e5a3c4f7bddb05d1d7b1ba7c
17:41 dalek rakudo: 2044332 | jnthn++ | :
17:41 dalek rakudo: Merge branch 'master' of git@github.com:rakudo/rakudo
17:41 zippete joined #perl6
17:41 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/2​044332a2a66db5087982645027ec5cf9ece1454
17:43 pmichaud I should review jnthn++'s changes, but I'm afraid of what I might see.... :-P
17:43 jnthn pmichaud: 1500+ line diff. ;-)
17:43 jnthn pmichaud: Role punning is The Mess now. I've got some re-org to do.
17:43 pmichaud AIIIIGH, MY IIIZ IS BURNIN!
17:43 jnthn hehe
17:44 jnthn P6Invocation and P6opqaue are where the interesting bits are.
17:44 pmichaud IZ READIN YR CODE THRU MY FINGERZ
17:44 pmichaud no major changes to P6object, other than what's already in Parrot?
17:45 jnthn Nope.
17:45 pmichaud Cool.
17:45 jnthn Apart from
17:45 jnthn One less method that we poke into it.
17:45 jnthn Also
17:45 jnthn We subclass Parrot's Roke PMC
17:45 pmichaud less filling --> tastes great
17:45 pmichaud the second version of that PMC is likely B-Roke  :-)
17:45 jnthn I need to rename/move Role.pir out of src/parrot/ into src/classes/ now or something.
17:46 pmichaud anything that runs in the Parrot HLL namespace should stay in src/parrot
17:46 jnthn *Role :-P
17:46 pmichaud anything else should go out
17:46 jnthn Yes, the point is that it doesn't now. :-)
17:46 jnthn So we're fudging methods into one less Parrot thingy.
17:47 jnthn One thing that is awkward is "what to pun and what not to"
17:47 jnthn Example: we can't pun .ACCEPTS because if we do we break type checking.
17:48 pmichaud ummm, Role.pir is still in the Parrot HLL namespace?
17:48 jnthn We got away with this before because we only punned things sent through !dispatch_method so we could sneakily call whatever we wanted without it getting punned by not going through that.
17:48 jnthn It is?
17:48 jnthn Oh
17:48 jnthn It's adding methods to a PMC still. :-|
17:48 jnthn And all PMCs live in the Parrot namespace. :-/
17:48 jnthn OK, it has to stay there then.
17:49 jnthn It should be adding to the P6role rather than the Role ns now though.
17:49 pmichaud Correct
17:49 pmichaud okay, I feel better now.
17:49 jnthn OK, good.
17:51 pmichaud maybe change Role.pir to P6Role.pir, though.
17:51 pmichaud so it's not confused with the other Role.pir that is in the perl6 hll
17:51 jnthn Yes
17:52 jnthn I've got some do-less-class-checks-by-name things to do yet which should win some extra performance.
17:53 jnthn Plus other ideas to try.
17:53 jnthn So this is as much a start as a finish. :-)
17:53 payload i want to use a git-svn repo of parrot with rakudo... I currently hack the --gen-parrot to use git-svn and a custom directory... though it takes time, cause i am rel new to perl :)
17:54 pmichaud I'm looking at parrot's  isa_pmc right now to see why it's so slow.
17:54 pmichaud I'm wondering if we'll want a root_isa opcode to go along with root_new
17:55 pmichaud actually, a dynop might be even better.
17:55 pmichaud we could make a table of fast isa checks.
17:55 jnthn aye
17:55 jnthn isa_pmc should be just poitner arith, surely?
17:56 pmichaud HAHAHAHAHAHAHAHAHAHAHAHAHAHA
17:56 pmichaud tell me another good one :-)
17:56 pmichaud here:
17:56 jnthn for each parent { if it == the_thing_we_look_for { return 1 } }
17:57 pmichaud pmc_name = VTABLE_get_string(interp, lookup);
17:57 pmichaud return parrot_hash_exists(INTERP, isa_hash, (void *)pmc_name);
17:57 jnthn !!
17:57 jnthn That sounds a little more expensive...
17:57 pmichaud sure, since we create a gc-able string on each lookup.
17:58 pmichaud oh, it gets better.
17:58 jnthn ouch
17:58 pmichaud that's default.pmc:897
17:58 jnthn why isn't it just copy on write... :-S
17:58 pmichaud for Object PMCs, which first does the call I just gave
17:59 pmichaud we then proceed to ask the Class PMC for it to check
17:59 pmichaud it then does
17:59 pmichaud classobj = Parrot_oo_get_class(interp, lookup);
18:00 pmichaud (which is probably where our extra PMCProxys come from)
18:00 pmichaud and then
18:00 pmichaud we do the get_string trick all over again
18:00 pmichaud and then
18:00 pmichaud we recursively call isa_pmc for any parent classes
18:01 pmichaud which does that call to Parrot_oo_get_class and get_string trick again for each parent class (and their parents)
18:01 pmichaud there is one short-circuit on pointer arithmetic if we happen to hit the match directly
18:02 pmichaud but otherwise we're comparing strings
18:02 pmichaud doesn't the mro already have *all* of the parents in it?
18:02 pmichaud (including their ancestors?)
18:03 pmichaud i.e., we don't need the recursive call?
18:04 jnthn all_parents should contain...all parents.
18:04 jnthn Even if they are from different class universes
18:04 pmichaud right
18:04 renormalist joined #perl6
18:04 jnthn It should have at some point asked for them.
18:04 pmichaud so we're taking an O(n) operation and turning it into O(n^2)
18:04 jnthn Right.
18:04 jnthn With a bit factor to boot.
18:04 pmichaud with string lookups all the way
18:05 jnthn I had assumed that isa called isa_pmc...
18:05 pmichaud so when you get to something that is deeply nested
18:05 pmichaud this *is* isa_pmc
18:05 jnthn No, I mean
18:05 pmichaud this *is* VTABLE_isa_pmc
18:05 jnthn VTABLE)isa (string) would have been implemented by a lookup + then VTABLE_isa_pmc
18:05 pmichaud even that doesn't help.
18:06 pmichaud $I0 = isa $P0, ['Integer']
18:06 jnthn Sure, not if isa_pmc is doing that crazy stuff!
18:06 pmichaud callsa   isa_i_p
18:06 renormalist joined #perl6
18:06 pmichaud (actually isa_i_pc)
18:06 pmichaud the problem is actually *in* VTABLE_isa_pmc
18:07 pmichaud so, if we have an object of type Perl6Array
18:07 pmichaud and we're doing an isa check on it
18:07 pmichaud we end up doing
18:08 pmichaud O( (Perl6Array, List, Any, Perl6Object, P6object, Object, ResizablePMCArray, FixedPMCArray)  ** 2)
18:08 jnthn Yes, I follow, I'm just not being too clear.
18:08 pmichaud and if we happen to have a Perl6Scalar referencing the Perl6Array, we add that to the list above as well.
18:08 * jnthn wonders what happens if we rip the crap out and just iterate a list of pointers
18:08 pmichaud I might do that.
18:09 pmichaud But this is what I've been really complaining about when saying we do class membership checks with strings
18:09 pmichaud it's deep in Parrot
18:09 pmichaud (all the way down to VTABLE_isa_pmc, as you can see)
18:09 jnthn We're dynamic so we need to be able to somewhat _but_ when we already have something resolved from a name we should be able to use it directly.
18:09 jnthn Not turn things we can do fast back into named checks.
18:10 pmichaud exactly
18:10 pmichaud even if it's not pointer arithmetic -- every unique type gets a type id, yes?
18:10 jnthn Also, the fact that we can ever get multiple PMCProxy instances disturbs me (I had never intended that to be a possible occurence).
18:10 jnthn Yes but the point is it *should* be doable by a pointer comp.
18:11 pmichaud sure, but the type id would "solve/workaround" the issue of when we end up with multiple PMCProxys, for now.
18:11 jnthn The PMC representing a class (be it a PMCProxy for a Class) should be canonical.
18:11 * jnthn wonders why we aren't attaching the PMCProxy to a slot in the VTABLE rather than screwing around with namespace storage.
18:11 pmichaud well, namespaces still need to be able to map to their class.
18:12 pmichaud even for non-PMCProxy items
18:12 jnthn Sure we can _cache_ it in the namespace too.
18:12 jnthn But at least hanging it there might help keep it canonical.
18:12 pmichaud anyway, I'll probably work on this a bit later
18:12 jnthn *nod*
18:12 jnthn It'd be worth it. Fast isa checks would help us plenty.
18:13 jnthn does-a too.
18:13 pmichaud Not only in Rakudo.
18:13 pmichaud PGE does a lot of isa checks.
18:13 pmichaud And I don't know what Parrot's MMD dispatch uses -- if it uses VTABLE_isa
18:13 jnthn erm, does.
18:13 jnthn It calls ACCEPTS
18:13 jnthn And does whatever that dos.
18:13 jnthn *does
18:13 pmichaud no, not Rakudo's MMD
18:13 pmichaud *Parrot's* MMD
18:13 jnthn Oh, Parrots.
18:13 jnthn Who knows. :-)
18:13 pmichaud right
18:13 jnthn It doesn't even have a cache. ;-)
18:13 jnthn (For MultiSub)
18:13 pmichaud but if it's using _isa, then it would be also adding GC pressure
18:14 pmichaud like, a tone
18:14 pmichaud *ton
18:14 jnthn right
18:15 jnthn Speeding that up would get PAST::Compiler faster I guess?
18:15 jnthn 'cus that uses Parrot's MMD.
18:15 pmichaud yes
18:15 pmichaud and PGE, too.
18:15 pmichaud and P6object
18:15 jnthn :-)
18:16 jnthn Speed. We needs it.
18:16 pmichaud Lunch.  I needs it also.
18:16 pmichaud I'm waiting to see how our spectest runs goes.
18:16 jnthn Ah, with my changes in? OK, here's hoping. :-)
18:17 pmichaud yes.
18:17 pmichaud as of May 21, "make spectest" was requiring 51 minutes on my laptop.
18:17 pmichaud as of yesterday, it was down to 25 mins.
18:17 pmichaud with your dispacher improvements and the changes to postfix:<++>, it's now....
18:17 pmichaud still running.  :-P
18:19 pmichaud I'm guessing there's about another 10 mins to go on my box
18:19 pmichaud oh, is assign.t much faster on your system now?
18:20 jnthn Didn't watch the spectests running too closely...can try it
18:20 pmichaud yeah, just try the one test
18:21 jnthn Still takes a while to get started but I think not as long as it sued to.
18:21 jnthn I didn't have a timing though...
18:22 pmichaud I went from 2:30 to :30
18:23 jnthn oh, it was far closer to the second of those
18:23 jnthn OK, dinner time...
18:25 cotto does per6 specify a standard deviation function?
18:26 TimToady not currently
18:26 TimToady would be pretty trivial to write one
18:27 pmichaud $mean = ([+] @array) / @array;
18:27 pmichaud $std = sqrt( ([+]  (( @array >>->> $mean ) >>**>> 2 ) )
18:27 pmichaud or something like that.
18:29 pmichaud spectest now  23m22.  I has 2 failz.
18:29 pmichaud lunchtime.
18:29 cotto Thanks.
18:30 cotto It'll be fun getting used to thinking in terms of meta and hyper ops.
18:31 cotto except when I have to go back to php
18:32 literal spack: multimethod
18:32 literal how does this work again...
18:35 TimToady spack: multiple dispatch
18:37 nihiliad joined #perl6
18:37 amoc joined #perl6
18:38 [particle]1 buubot: spack multimethod
18:38 buubot [particle]1: S09-data.pod:1
18:57 pmurias joined #perl6
18:58 pmurias ruoso: mildew's map is doesn't return an array yet
18:58 pmurias i just use it as a for
18:58 ruoso pmurias, ah... ok
18:58 TimToady is it lazy?
18:58 TimToady :)
19:06 pmurias ruoso: do you need any Cish things in smop to write a lazy map?
19:06 ruoso TimToady, speaking about lazyness... did you happen to see my post in perl6-l about threading and events?
19:07 ruoso pmurias, we need a proper definition on how lazy things need to behave
19:07 ruoso the post I'm talking about starts to address it
19:08 TimToady ruoso: when?  if it was last week, I probably read it during my 6-day headache, and promptly forgot it
19:08 ruoso right... the subject is "RFC: Implicit threading and Implicit event-loop (Was: Re: Continuations)"
19:13 perlmongo left #perl6
19:18 ruoso TimToady, after some time, I realized every lazy list should be seen as a "continuation" of its own registered in the interpreter, so the main event-loop will raise them as their "buffer" is ready...
19:18 ruoso actually... every lazy object, not just list
19:19 zamolxes joined #perl6
19:20 TimToady yes, this seems logical; one can view every gather as establishing an internal thread that know its "standard takeout"
19:20 donaldh joined #perl6
19:22 ruoso TimToady, if you consider gather/take as the basis for all lazynes
19:22 ruoso I tend to see it as just one of the syntaxes
19:22 ruoso I mean... every map, grep, for, assignment of lazy lists etc
19:23 ruoso should register themselves as "internal threads"
19:23 TimToady sure, you can view it like that too
19:23 TimToady needs to be very lightweight on context switching
19:25 ruoso TimToady, the easy part is that it being event-based, it only switch context when something happens
19:25 ruoso so idle threads cause no cost
19:26 ruoso I also mean that I wouldn't implement a preemptive scheduler, but rather have a "worker thread" pool
19:27 ruoso which eventually spawn new worker threads on a given condition (i.e. a "continuation" waiting for more than X miliseconds)
19:31 sjohnson i think "say()" being backported to perl 5.10.0 is an urban legend
19:31 TimToady it's only enabled if you ask for it
19:31 sjohnson never have i ever got it to work on that version of perl, despite everyone and their dog raving about how it's backported
19:31 sjohnson *sad face*
19:31 sjohnson waaah!
19:31 TimToady tried "use feature 'say'"?
19:31 sjohnson *sob*
19:31 payload \o/ my gen parrot uses git svn
19:32 TimToady or use 5.010;
19:32 sjohnson no, i suppose i shuold do that
19:32 sjohnson TimToady: will try it out
19:32 Tene :( rakudo's 'use' updates broke foreign HLL loading.
19:32 TimToady considering Cursor.pmc is using it in 5.10
19:32 Tene Fixing...
19:34 ruoso TimToady, but you think the ControlExceptionWouldBlock, Observable, Observer thingies are ok?
19:36 TimToady have to go back and reread now that I'm sane, or less insane
19:36 TimToady can't right now, timesharing $job
19:39 ruoso ok
19:42 sjohnson TimToady: have you ever met / heard of a man named Dr. Alan Paeth?
19:44 * jnthn back from dinner
19:45 TimToady can't say that I have, but every time I learn a Japanese verb I forget a name
19:45 TimToady and then I'll forget the verb without remembering the name...
19:46 unitxt joined #perl6
19:47 sjohnson he wrote the Paeth rotation algorithm that's used in things like adobe photoshop.  , he was a teacher for me for computer studies.  he programs in perl too, old school unix fellow.  he has met bill gates and i was hoping you too :)
19:48 TimToady if anyone says they've met me, they're probably correct, regardless of what I say. :)
19:49 sjohnson maybe he was one of your toadies :)
19:55 sjohnson is it true that people have emailed you / tracked you down so that they could have a hand with their Perl homework?
19:56 Scorp1us joined #perl6
19:56 masak joined #perl6
19:56 masak jnthn: ping
19:56 kane_ joined #perl6
19:59 jnthn mmaska: pong
19:59 jnthn erm
19:59 jnthn masak
19:59 masak almost. :)
20:00 masak your latest commit, in src/classes/List.pir on line 218.
20:00 masak just curious if it should be something other than "# XXX this is due to can giving dubious answers due to auto-thread/pun/closure creation"
20:01 jnthn No, it's a todo.
20:01 jnthn Just one I didn't yet decided who is going to be todone. :-)
20:01 jnthn erm, how
20:01 masak jnthn: what I mean is, the comment is a bit... unclear.
20:02 masak please try and read it yourself, and you'll see.
20:02 pmichaud you want proper grammar in our code?!?
20:02 masak :P
20:02 jnthn You are parsing can as a noun (name of an opcode) rather than as a transative verb?
20:02 jnthn If not, that's why it might sound bad. ;-)
20:02 masak ooh.
20:02 pmichaud maybe C<can>  instead of just "can"
20:03 jnthn Yes. :-)
20:03 masak I C<can> fix that.
20:03 jnthn I'm hoping that comment doesn't live too long anyways.
20:03 pmichaud ....and people wonder why we think sigils are important :-)
20:03 masak hehe
20:04 pmichaud it's pretty easy to tell that $can is a lot different from can  :-)
20:06 dalek rakudo: a0d09b3 | masak++ | src/classes/List.pir:
20:06 dalek rakudo: [src/classes/List.pir] C<> clarification
20:06 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/a​0d09b31e74155abd0066a9f4a25d608221f4595
20:07 jnthn When can can actually tells us if we can the comment can go away.
20:13 * masak doesn't manage to parse that after two readings
20:13 pmurias masak: why can't everyone view tpf-gsoc archive?
20:14 masak pmurias: perhaps the discussions there are deemed private to gsoc participants in some way. I'm not sure.
20:14 masak pmurias: but you're doing a tpf-gsoc, so you definitely belong.
20:19 masak }ï{ -- nice.
20:22 [particle]1 joined #perl6
20:22 DanielC hi all
20:23 mberends DanielC: hi again
20:23 DanielC hey!
20:23 DanielC mberends: I've been thinking about the hash thing. Do you have a minute?
20:23 mberends yes, quite a few ;)
20:24 DanielC We can add a counter to the file name: Foo::Bar-auth:92de-ver:1.2.0--0
20:24 * masak reviews viklund++'s proto changes
20:24 DanielC The counter doesn't mean anything, it's just a counter.
20:24 masak apparently, viklund has the pumpkin right now. :)
20:24 mberends :)
20:24 DanielC mberends: If Rakudo gets another module with the same name, just save it with --1 and so on.
20:25 DanielC s/same name/same name, version and auth hash/
20:25 mberends a counter is no problem, in fact that was approximately what I was planning to discuss as a substitute for an :auth hash :)
20:25 DanielC So this can deal with arbitrarily many collisions.
20:25 mberends quite
20:26 DanielC Yeah, with a counter the :auth hash is no longer needed. That said, I wonder if it's still useful to identify different modules that come from the same author.
20:26 mberends no, not within Rakudo, only in library management utilities
20:27 DanielC If we keep the author hash, it is easy to get a list of all modules from the same author. I have no idea if that is useful for anything.
20:28 mberends not within Rakudo, only outside in other tools
20:28 mberends it's more beneficial to keep Rakudo streamlined
20:29 eMaX joined #perl6
20:29 DanielC Yeah, but if the directory name doesn't include the auth: hash the other tools can't benefit (they'd have to actually read each module's metadata).
20:29 DanielC On the other hand, it probably makes sense to skip the hash until there is a proven need.
20:29 DanielC s/need/benefit/
20:29 mberends yes
20:30 DanielC So we start with Foo::Bar-ver:1.2.0--0  then?
20:30 DanielC (or something similar)
20:30 mberends yes, (something similar)
20:31 mberends the exact format can still be ironed out, other principles come first
20:31 DanielC such as?
20:31 mberends a single directory scales very badly on many file systems
20:31 DanielC hm
20:32 DanielC Foo/Bar-ver:1.2.0--0
20:32 mberends directory Foo, filename Bar* etc
20:32 DanielC yeah
20:32 DanielC that's what I meant by Foo/Bar-ver:1.2.0--0
20:33 mberends the Perl 5/Java etc idea is too good to throw away
20:33 DanielC If you want to go crazy, you could even do Foo/Bar/1.2.0--0
20:34 mberends maybe, but it's not too crowded in the Foo directory most of the time
20:34 DanielC Yeah.
20:35 DanielC As a guideline, how many files/directories can Foo contain before it is a problem?
20:36 masak DanielC: as a guideline, Perl 5 has a directory structure that has worked very well over the years.
20:36 mberends it varies per file system, my intuition says a few hundred/thousand is a tipping point
20:36 masak DanielC: so if you don't do more directories than that, you'll be fine. :)
20:36 DanielC masak: ok
20:36 mberends the implementors of the squid cache had a good look at this issue, but maybe only on Unix
20:36 DanielC masak: But we might have to, if we are going to store multiple versions of the same module.
20:37 masak DanielC: the number of versions will not be very large, I think.
20:38 mberends when you configure squid, you set the directory tree width and depth
20:38 masak I don't see it exceeding three versions very often, and definitely not ten except in pathological cases.
20:38 DanielC Btw, in Perl 6 applications will have to use the same package manager as the cpan modules. Otherwise, how does the package manager know whether it's ok to delete Foo/Bar-v1.2.0--0 when you install Foo::Bar-v2.1.1 ?
20:39 pmichaud seems to me they ought to be the same manager
20:39 mberends the format chosen will apply to Rakudo, proto and all relevant utilities
20:39 pmichaud or at least build from the same codebase
20:40 masak is there a type of block that only runs after a loop has completed by falling out the bottom of its last iteration?
20:40 DanielC pmichaud: Not just the same code base, but also the same database. The package manager needs to know that there is something installed that depends on Foo::Bar-v1.2.0 so it doesn't remove it.
20:40 pmichaud DanielC: that's far more complex than I was envisioning.
20:41 pmichaud I'd be surprised if the package manager tries to keep track of every Perl script on the system.
20:41 DanielC pmichaud: Yes. It's more complex than what I had in mind too.
20:41 pmichaud I'd say that would be a site policy.
20:41 DanielC But how else do you deal with dependencies?
20:41 pmichaud by failing when a dependency isn't met
20:41 pmichaud or by having the package manager mark a module as "don't delete this"
20:42 pmichaud or by having a site policy that says "never delete"
20:42 pmichaud or ....
20:42 DanielC pmichaud: Imagine your software breaking every time you upgrade Foo::Bar...
20:42 DanielC "never delete" seems a bit like a sledgehammer approach.
20:42 pmichaud DanielC: in the most common case, your software probably doesn't want to request a specific version of Foo::Bar
20:42 pmichaud usualy it will want to require a minimum version
20:43 pmichaud if you have software that depends on a specific version of Foo::Bar, then you probably need somewhat more advanced package management than the default policy
20:43 DanielC pmichaud: But Perl 6 allows a software to request a specific version of Foo::Bar, therefore it will happen from time to time.
20:43 pmichaud agreed, which is why I think it becomes a policy issue
20:44 mberends pmichaud: where else should we study implementation of 'use' in addition to src/parser/actions.pm:385-443 (use_statement) ?
20:45 pmichaud mberends:   src/builtins/eval
20:45 pmichaud mberends:   src/builtins/eval.pir  -- sub 'use'
20:46 pmichaud but that function will change quite a bit
20:46 pmichaud you'll also want to look at 'require', which is what 'use' uses in order to load a module
20:46 mberends pmichaud: thanks :)
20:46 masak if we don't know the encoding of a string, can we really do ord() on it?
20:47 pmichaud yes.
20:47 pmichaud each string knows its own encoding
20:47 masak aha. the only thing that's wrong is to assume that it's utf-8, or any other specific encoding. right?
20:48 pmichaud in Parrot, "ord" is not simply "give me the first byte".  It's really "give me the first codepoint"
20:48 masak that's neat.
20:49 tulcod left #perl6
20:49 masak mberends: if you have a bit of time, you could help me figure out what's wrong with my Druid web app. I tried to make it show SVG like your web server does, but it wouldn't comply.
20:49 DanielC pmichaud: We can delegate package management to a higher-level tool. We can offer a simple, dumb program that simply installs and uninstalls packages. Someone else is free to make a wrapper around that which uses a database to track dependencies.
20:49 szabgab joined #perl6
20:50 pmichaud DanielC: sounds good.
20:52 mberends masak: I read that. I never managed to inline SVG, although the spec describes a way. It may be a browser thing, to have to link to an SVG file rather like referencing a JPG.
20:53 masak mberends: I just pushed to druid at github. please try to run bin/web-druid and see if you too get the HTML page repeated inside the <object> inclusion.
20:53 masak mberends: there should be an SVG canvas there, but I'm doing something wrong. probably just a path somewhere. :/
20:53 * mberends begins trying
20:53 masak when I surf directly to the path, it shows SVG.
20:54 masak I'm writing up Weeb 8 of Web. it would be nice if we got SVG to work before I post. :P
20:54 mberends Weeb is a nice unit of time ;)
20:54 masak it is. :)
20:55 masak it complements the concept of Tuits quite nicely.
20:57 FurnaceBoy is it like a Pomodoro?
20:58 masak FurnaceBoy: is a Pomodoro round as well?
20:58 FurnaceBoy arguably. http://www.google.com/search?client=opera​&amp;rls=en&amp;q=pomodoro+technique&amp;​sourceid=opera&amp;ie=utf-8&amp;oe=utf-8
20:59 masak oh, I see it is.
20:59 FurnaceBoy :)
20:59 FurnaceBoy round as a tomato
20:59 FurnaceBoy i need tuits
20:59 FurnaceBoy desperately
21:00 masak they're in short supply.
21:00 justatheory_ joined #perl6
21:00 masak but new ones are being minted as we speak.
21:01 FurnaceBoy cool.
21:01 FurnaceBoy i'd pre-order... if I had time
21:01 masak FurnaceBoy: I'd recommend the book "Momo", but chances are you've already read it...
21:02 FurnaceBoy no I haven't.
21:02 FurnaceBoy sounds like something Bruce Mau did?
21:02 masak Michael Ende, actually.
21:02 FurnaceBoy ah. completely off track :)
21:02 masak of "Neverending Story" fame.
21:02 FurnaceBoy i'll check it out. how did it help you?
21:03 masak it's a very #perl6 kind of book, I'd say.
21:03 masak FurnaceBoy: it gives a wonderful perspective on time and the values in life.
21:03 masak oh, and it's basically childrens fiction, just like Neverending Story.
21:03 masak but still very enjoyable.
21:03 FurnaceBoy ok neat I have located it. http://www.abebooks.com/servlet/SearchResults?an=​ende&amp;n=200000038&amp;tn=momo&amp;x=0&amp;y=0
21:04 masak that's the one.
21:06 mberends masak: the /board.svg itself is an empty 400x400 rectangle, both called directly or embedded in the home page. First signs are that the containers are all working but the contents are missing.
21:07 masak mberends: yes, it should be an empty 400x400 rectangle. but that's not what I see embedded. is that what you see embedded?
21:09 mberends the Epiphany browser (Debian) shows the 400x400 rectangle embedded
21:09 masak oki. Safari doesn't.
21:09 masak I'll try it in Firefox as well, hold on.
21:10 mberends Iceweasel (aka Firefox) ok here too.
21:10 jnthn Iceweasel? lol
21:11 masak huh. works in Safari now, too.
21:11 masak mberends: thank you! your extra eyeballs made the bug so shallow it disappeared. :)
21:11 FurnaceBoy :)
21:11 mberends always willing to help in this way :)
21:12 * FurnaceBoy invites mberends to come over with his powerful tuits
21:12 masak it's more of a combination of tuits and weebs, I think...
21:13 mberends these tuits are so round, they keep falling off the table
21:13 FurnaceBoy hm. need to introduce deliberate imperfections
21:13 * masak supresses a 'your mom' joke
21:13 FurnaceBoy fractal tuits?
21:13 FurnaceBoy lol
21:13 jnthn masak: I supress a lot of those...
21:13 kane_ joined #perl6
21:14 * jnthn gets out his shaver and heads for some post-dispatch-refactor yaks.
21:14 pmichaud jnthn: okay, I improved the speed of 'isa' a fair bit, but also figured out why the default walks mro recursively
21:14 pmichaud is there a way to look at class immediate parents, instead of all parents?
21:14 jnthn pmichaud: Do I want to know why? :-)
21:14 DanielC mberends: Ok, we picked a naming scheme. What's the next step? :-)
21:14 jnthn pmichaud: Yes, that's what ->parents is.
21:14 pmichaud jnthn: individual classes can override VTABLE_isa
21:15 jnthn pmichaud: Ah.
21:15 pmichaud so we have to go through their check
21:15 jnthn ouch.
21:16 mberends masak: web-druid is going to be brilliant!
21:16 pmichaud but that might also mean that we should only walk parents instead of mro
21:16 DanielC rakudo: package Foo;
21:16 p6eval rakudo a0d09b: OUTPUT«Unable to parse package definition at line 2, near ";"␤in Main (src/gen_setting.pm:1435)␤»
21:16 pmichaud (instead of all_parents)
21:16 DanielC I guess packages are not implemented yet.
21:16 masak mberends: glad you are into the concept. :)
21:16 jnthn pmichaud: Would an override saying "no" mean we stop looking?
21:16 jnthn Or should it?
21:16 masak mberends: still much left to do, but give me 8 uninterrupted hours of coding...
21:16 pmichaud it probably ought to mean we stop looking for that parent
21:16 jnthn Aww.
21:17 DanielC masak: What is web-druid again?
21:17 pmichaud if a parent is changing its notion of 'isa', should we be bypassing it?
21:17 om454545445 joined #perl6
21:17 mberends masak: you can take a Weeb if you want
21:17 masak DanielC: ok, so Druid is a board game, with a bit of 3D in it.
21:17 DanielC ah, now I remember.
21:17 jnthn Could we use a flag on the class PMC to mean "no isa overrides"?
21:17 om454545445 left #perl6
21:17 masak DanielC: Web.pm is a web framework-toolkit-thingie.
21:17 masak DanielC: web-druid is Druid running on Web.pm.
21:17 DanielC I like web framework toolkit thingies.
21:18 jnthn pmichaud: That is, we work it out once that there isn't, and the rest of the times we just walk the mro...
21:18 masak jnthn: that sounds a bit like lolspeak.
21:18 jnthn I HAZ A OPTIMIZASHUN
21:18 pmichaud jnthn: why would it be bad to just ask the parents ?
21:18 masak DanielC: this web framework toolkit thingies looks a lot at other web framework toolkit thingies out there, and steals the best parts from them.
21:18 pmichaud (ooc)
21:18 pmichaud instead of all_parents ?
21:19 mberends DanielC: next just a Simple Matter Of Programming, around the file references pmichaud++ mentioned earlier ;)
21:19 jnthn pmichaud: Because then rather than walking through an array we gotta then go recurse and so on.
21:19 DanielC masak: That's how the best tools are made. Perl is great precisely because it's willing to copy a good idea from someone else.
21:19 jnthn And check for overrides.
21:19 pmichaud I don't think the recursion is so bad.
21:19 jnthn Which I expect has a cost that for _most_ classes does not exist?
21:20 pmichaud well, we currently have the worst of both worlds, in that we're recursively checking every class' "all_parents"
21:20 * ruoso decommute &
21:20 masak DanielC: so far we're copying Rack and Hpricot (from Ruby), Genshi (from Python), and Jifty/Catalyst (from Perl 5). and I probably forgot a few.
21:20 DanielC mberends: I think I missed the file references thing. I guess that you mean that someone has to teach Rakudo to look for a module in a certain location. Is that what masak is doing?
21:20 jnthn pmichaud: Ah, no wonder it sucks!
21:20 masak DanielC: yes, that's what I plan to do in the branch.
21:21 DanielC masak: I'll be very interested in your work.
21:21 masak DanielC: help welcome.
21:21 DanielC masak: I'm not a brilliant programmer. I'm not sure how much help I can be.
21:21 pmichaud note that "look for module in a certain location" really means "select a module from a set matching x, y, and z characteristics"
21:22 DanielC masak: The grammar stuff looks like Greek to me.
21:22 masak DanielC: as far as I can tell, you're quickly building up knowledge about the territory of this problem. keep doing that, and help me design the thing to work in Rakudo. that's all. :)
21:23 DanielC masak: I did find the use_statement method in actions.pm, but it was a bit over my head.
21:23 masak DanielC: actually, I might take some weebs to explain it to you. that might help me too.
21:23 DanielC masak: :-)  I'll try.
21:23 DanielC sure
21:23 masak just going to finish this blog post. give me... 10 minutes.
21:23 DanielC ok
21:23 pugs_svn r26982 | pmurias++ | [re-smop] Signature is now part of CORE
21:23 pmichaud how many Weebs is 10 minutes?  ;-)
21:24 pugs_svn r26983 | pmurias++ | [re-smop] added a test for assigning to an readonly variable
21:24 pugs_svn r26983 | pmurias++ | HashBvalue.STORE propagates exceptions correctly
21:24 masak pmichaud: depends on the length of those weebs, duh. :)
21:24 pmichaud looks like 10 minutes ~=~  1 milliWeeb
21:24 jnthn length? I thought they were round?
21:24 masak no, that's tuits.
21:25 pmichaud there is no length in Perl 6.
21:25 masak *lol*
21:25 mberends Perl 6 has great depth
21:25 mberends tuits have circumference
21:25 jnthn .oO( there's no length...that's why we don't know how long it will take )
21:26 pmichaud lol!
21:26 * pmichaud has another quote to add.
21:26 REPLeffect joined #perl6
21:26 masak "- How far to Christmas? - Don't know, Larry removed .length"
21:26 mib_75bhow86 joined #perl6
21:27 mib_75bhow86 hello
21:27 masak mib_75bhow86: hey there. welcome.
21:27 mib_75bhow86 thanks
21:28 masak mib_75bhow86: since you're from mibbit, please start by proving that you're not a bot and that your intentions are friendly. :P
21:28 mib_75bhow86 ya sure thing
21:28 * jnthn hopes git just did the Right Thing with his rename...
21:29 masak git is a he?
21:29 * FurnaceBoy fights bzr :(
21:29 jnthn masak: The rename was mine. ;-)
21:29 mib_75bhow86 do any of you have MKW?
21:29 jnthn masak: git is probably female, because I can't understand it at all...
21:29 FurnaceBoy lulz
21:29 * masak groans
21:30 mberends mib_75bhow86: is that a disease, or Mark Williams Company?
21:30 masak mib_75bhow86: "MKW" == "Milky Way"? it's right outside your window!
21:30 mib_75bhow86 :)hello
21:30 FurnaceBoy Masak Keeps Watch
21:30 masak he does indeed.
21:30 FurnaceBoy mib_75bhow86, hello. why not change your nick to something more personal?
21:31 mib_75bhow86 no that a video game MKW=mario kart wii
21:31 FurnaceBoy Mild Kleptomania Warning
21:31 FurnaceBoy mib_75bhow86, you're in the wrong channel.
21:31 masak mib_75bhow86: you're not doing very well on the Turing test so far, I'm afraid. why don't you tell me a bit about Shakespeare poems?
21:31 mberends and don't nobody say W-H-O-Z
21:31 mib_75bhow86 k bye then
21:32 masak mberends: wut wrong wit whoz?
21:32 mberends /kick ma<tab>
21:32 dalek rakudo: 6ed6997 | jnthn++ |  (3 files):
21:32 dalek rakudo: Rename Role.pir to P6role.pir now it's adding methods to Rakudo's subclass of Parrot's Role PMC.
21:32 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/6​ed69978207cf37e50c3ad99ea626a58cff22127
21:32 masak Matt-W: watch out!
21:32 jnthn mberends: Using /kick and tab completion considered dangerous.
21:33 mberends jnthn: in the wrong hands
21:33 mberends the enter key's the problem
21:34 masak :)
21:34 masak mberends: "it's not the fall that's the problem, it's the sudden stop at the end"
21:35 snarkyboojum joined #perl6
21:35 mberends yup. Mario Kart is quite nice on the DS, don't you think?
21:36 Muixirt what is wrong with that line:
21:36 Muixirt parrot/parrot -O2 perl6.pbc ~/test/ackermann/ackermann.p6.pl
21:36 Whiteknight joined #perl6
21:36 mberends masak: I've forked yarn to mutilate it beyond recognition
21:36 Muixirt i get following error message:
21:36 masak mberends: sounds excellent. looking forward to your blogging.
21:37 Muixirt too few arguments passed (0) - 1 params expected
21:37 masak Muixirt: and the script is... where?
21:37 Muixirt in Main (src/gen_setting.pm:0)
21:37 jnthn Muixirt: Sounds like -O2 makes the program get the wrong answer quickly.
21:37 Muixirt masak, the coomans was invoked inside the rakudo dir
21:38 masak Muixirt: I see.
21:38 masak Muixirt: well, I don't have a test/ in my rakudo dir.
21:39 Muixirt masak, oh the p6 script lies somewhere in my home dir
21:39 masak Muixirt: it's hard to help you further, then. :)
21:40 Muixirt this works: parrot/parrot -R cgoto perl6.pbc ~/test/ackermann/ackermann.p6.pl
21:40 masak strange.
21:40 mberends Muixirt: please paste your ackermann.p6.pl file on http://sial.org/pbot/perl6
21:41 lichtkind joined #perl6
21:41 lichtkind masak: viklund still seems quit?
21:42 pasteling "muixirt" at 91.47.109.66 pasted "little perl6 test script" (30 lines, 607B) at http://sial.org/pbot/36963
21:42 masak lichtkind: I met him on Friday, when we went to the hackathon. I didn't have the precense of mind to remind him about the account, unfortunately... :/ I'll send him another nudge now.
21:42 masak lichtkind: out of curiosity, what is it that you plan to do on the wiki?
21:44 lichtkind masak: im not quit shure but i maybe make a wiki with small texts and lot of pointers for people who are interestet and come from outside
21:44 lichtkind masak: for everything else we have already our internal perl 6 wikis for devs and perl heads
21:45 masak aye.
21:45 masak there sure could be some more information about November itself on the site.
21:46 lichtkind of course
21:46 lichtkind masak: fortunately i finished my p6tutorial yesterday so i have more mind resources now
21:46 masak sounds good.
21:46 mberends Muixirt: are you implementing http://en.wikipedia.org/wiki/Ackermann_Function ?
21:47 jnthn pmichaud: By the end of your enhancements, do you expect isa_pmc to be faster than isa (with the string)?
21:47 Muixirt mberends, yes
21:47 masak ok, I'll post this blog post, mail-nudge viklund, and then show DanielC around the use_statement action.
21:47 pmichaud jnthn: I think the string is still faster than the pmc.
21:47 DanielC \o/
21:47 lichtkind masak: is lexikon a english term?
21:47 DanielC lexicon
21:47 pmichaud isa_pmc is faster *if* you happen to pass it the class object directly
21:47 lichtkind thanks :)
21:47 masak lichtkind: what DanielC said.
21:47 pmichaud if you send it a string, that's next fastest
21:48 jnthn pmichaud: OK, I can send it a class PMC.
21:48 pmichaud the pain is constantly looking up the class PMC
21:48 lichtkind masak: yeah but dont forget my effort to make a perl 6 lexicon are consume much more time that the 8 part tut i just wrote
21:48 pmichaud if doing it from a dynop, not so painful.  A bit painful from PIR.
21:48 jnthn OK, but if I have a situation where I can cache it...
21:48 pmichaud yes, caching it helps.
21:48 lichtkind cheers jnthn
21:49 masak lichtkind: I'm very well aware of that. I've been compiling a TODO for u4x over the past few months.
21:49 pmichaud anyway, I'm about to improve isa dramatically for us
21:49 jnthn lichtkind: hi :-)
21:49 jnthn pmichaud: Great. :-)
21:49 pmichaud I'll give an amount shortly.
21:50 lichtkind masak: whats that?
21:50 masak lichtkind: http://use.perl.org/~masak/journal/38279
21:52 pasteling "muixirt" at 91.47.109.66 pasted "some error messages" (8 lines, 366B) at http://sial.org/pbot/36964
21:52 mberends Muixirt: it works with -O1 and fails as you reported with -O2, making it likely to be a Parrot bug. It may be already known, but I think you would have to ask at #parrot on irc.perl.org. The code is fine otherwise, although there are nitpickers here who might want to rewrite it a little/lot.
21:53 jnthn Agree, almost certainly Parrot bug.
21:53 Muixirt ok
21:54 Muixirt mberends, if you can come up with a better one :-)
21:55 * masak comes swinging in on a rope
21:55 masak I sense some nitpicking to be done here!
21:55 mberends Muixirt: no, not me, I make nits for my esteemed colleagues to pick ;)
21:56 masak Muixirt: ($n>0) and ($m==0) don't need parens.
21:57 mberends Muixirt: see?
21:57 Muixirt as a challenge, the perl5 version is *much* faster
21:57 masak whoa! cool trick with the recursion depth!
21:57 masak Muixirt++
21:58 masak Muixirt: oh, and if you ask me, 'loop($n=0;$n<4;$n+=1) {' is better written 'for 0..4 -> $n {'
21:58 masak ah, sorry, 'for 0..3 -> $n {'
21:58 masak ...of course.
21:58 mberends took the words out of my ... nevermind
21:59 masak Muixirt: that way, you need predeclare only %test, because $n and $m are declared with the loop blocks themselves.
22:02 mberends rakudo: for ^4 X ^10 -> $n,$m { "$m,$n ".print }
22:02 p6eval rakudo a0d09b: OUTPUT«sh: ./perl6: No such file or directory␤»
22:03 masak mberends: even nicer!
22:04 mberends ruoso++'s idea
22:04 masak DanielC: you still there?
22:04 DanielC yup
22:05 masak ok, let's spend a weeb or two on actions.pm, shall we?
22:05 jnthn pmichaud: Elimited !DEREF. Little but wrothwhile performance win, especially for deleting code. ;-)
22:05 * mberends sits up for the lesson
22:05 DanielC sure
22:05 jnthn (Using the dynop instead.)
22:06 masak so, we're at line 386 in actions.pm.
22:06 DanielC yup
22:06 pmichaud I'm getting a build failure.
22:06 DanielC my $name := ~$<name>;
22:07 masak yes.
22:07 DanielC I have a question already, what is ~$
22:07 jnthn pmichaud: Oh?
22:07 masak DanielC: the prefix:<~> makes a string out of a value.
22:07 jnthn pmichaud: From isa changes?
22:07 jnthn Or something else?
22:07 masak DanielC: it might help to refer to line 346 of grammar.pg also.
22:07 jnthn Remember to re-configure, I renamed a file.
22:08 masak DanielC: that rule calls the corresponding sub in actions.pm.
22:08 DanielC rule use_statement {
22:08 DanielC $<sym>=[use] <name><colonpair>*
22:08 DanielC <EXPR>?
22:08 DanielC {*}
22:08 DanielC }
22:08 Muixirt masak, thanks for the suggestions ... but it doesn't run faster :-)
22:08 masak DanielC: aye. and we might want to keep excessive pasting down on the channel. :)
22:08 DanielC I don't know Perl 6 well enough to understand this.
22:09 DanielC ok
22:09 masak Muixirt: I never promised that...
22:09 Muixirt ok
22:09 masak DanielC: hang in there.
22:09 pmichaud jnthn: from P6role.pir
22:09 jnthn pmichaud: oh wtf
22:09 masak DanielC: what you see in grammar.pg is a rule. it parses use statements.
22:10 jnthn pmichaud: Do you have the file?
22:10 jnthn Or is it missing?
22:10 pmichaud missing.
22:10 jnthn shit
22:10 jnthn moment
22:10 pmichaud (there's also tons of stuff happening around the house here, so I'm a bit distracted in case you hadn't noticed the delays on my responses :-)
22:11 masak DanielC: the rule says '$<sym>=[use]', which means "first, we expect the literal string 'use', which we'll store in $<sym>".
22:11 pmichaud yeah, it doesn't appear in the repo.
22:11 DanielC ok
22:11 jnthn pmichaud: pushed
22:12 pmichaud jnthn: got it
22:12 pmichaud now building
22:12 masak DanielC: that <name> is the module, something like "Foo::Bar", and <colonpair>* is what we're interested in taking care of, :ver<> and :auth<> and such.
22:13 dalek rakudo: f43c644 | jnthn++ | src/parrot/P6role.pir:
22:13 dalek rakudo: Sometimes, git doesn't do what you want. Add p6role.pir, which it lost in the rename but didn't show as not under version control when I did git status. How awesome.
22:13 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/f​43c644bee5741a135243bd8834d45a082570962
22:13 masak DanielC: since this is in essence a very rich regex, the asterisk means "zero or more"
22:13 pmichaud masak/DanielC:  also, note that rakudo's grammar should probably be updated a little bit to match recent changes in STD.pm
22:13 DanielC masak: So there is already a <name> rule defined somewhere that takes are of Foo::Bar, yes?
22:13 masak pmichaud: noted. I haven't been following those recent changes.
22:14 masak DanielC: indeed.
22:14 pmichaud masak: neither have we, obviously.
22:14 masak DanielC: line 858.
22:14 masak pmichaud: :)
22:14 pmichaud Usually when implementing a new feature or fixing something I first check the specs and STD.pm for guidance
22:14 pmichaud so that we don't get too out-of-sync
22:15 masak sounds sound.
22:15 pmichaud jnthn: perl6multisub compile fail
22:15 pmichaud let me see if it's rakudo or parrot that is the problem.
22:16 masak DanielC: the <EXPR>? part, I don't know what that might be used for, but I guess we'll find out when we peruse actions.pm again.
22:16 masak DanielC: any questions so far?
22:16 pmichaud masak:  it's because use statements take arguments
22:16 pmichaud for example
22:16 DanielC masak: Not yet.
22:16 pmichaud use Math :trig
22:16 pmichaud the ":trig" is an argument
22:16 pmichaud note that this is different from
22:16 masak pmichaud: but isn't that also a colonpair?
22:16 pmichaud use Math:ver<1.2.1>  :trig
22:16 masak ok.
22:16 pmichaud the colonpair is abutted with the module name
22:17 masak I see.
22:17 DanielC masak: The {*} means that the can be 0 or more use statements, yes?
22:17 pmichaud the arguments are separated by a space
22:17 masak DanielC: no, it means 'action here'.
22:17 mberends it's odd that use_statement calls <name> and no_statement calls <module_name>
22:17 DanielC ok
22:17 masak DanielC: note that there are {*} on every rule and token in grammar.pg.
22:17 pmichaud mberends: in STD.pm, 'use' calls <module_name>
22:17 mberends ok
22:18 masak DanielC: ok, so let's go back to actions.pm now.
22:18 DanielC masak: Yes, I see... every rule has a {*}...
22:18 masak DanielC: aye, it simply means "here's where we call the corresponding action sub".
22:18 DanielC ok
22:18 masak DanielC: now, in actions.pm, the $<name> var that you found before...
22:19 pmichaud jnthn: looks like my build fail may be due to recent parrot -- investigating further
22:19 DanielC masak: Ok, so {*} in a rule means "run the method with the same name as this rule".
22:19 masak DanielC: exactly.
22:19 DanielC k
22:19 masak DanielC: $<name> simply contains the parse tree for the <name> rule that we called in the use_statement rule.
22:19 masak DanielC: but we're only interested in the name itself, not the parse tree, so we stringify with ~.
22:20 DanielC ok
22:20 masak then, two lines down, we check that $name isn't 'v6' or 'lib'.
22:20 masak those two seem to be no-ops here.
22:21 masak ah, line 392 is the call to the 'use' sub that pmichaud talked about earlier.
22:21 DanielC At this point $name could be something like "warnings" or "strict"...
22:21 masak aye.
22:21 masak (except we don't have those two in Perl 6.)
22:21 masak but you got the idea.
22:22 DanielC Ok.
22:22 masak and the thing below '## Handle tags.' takes care of things like :trig, as pmichaud showed just now.
22:22 masak note that $<EXPR> is referred to here, so it all makes sense.
22:23 masak oh, look! we have '##  Handle versioning' too!
22:23 DanielC use Foo::Bar:ver<1.2.3> :foo  --> "foo" is an <EXPR> yes?
22:23 pmichaud the ":foo" is the expression
22:23 pmichaud it's a pair
22:23 masak DanielC: yup.
22:23 DanielC ok
22:24 DanielC Do I need to know what @?BLOCK is? I don't know "@?"
22:24 payload joined #perl6
22:24 pmichaud DanielC: you might be able to figure it out though :-)
22:24 pmichaud You know what @ is
22:24 masak pmichaud: the 'Handle versioning' part of the code, is it used for anything? can one see the effects of typing in a version in a use statement?
22:25 pmichaud masak: it's currently set up as being a named parameter to 'use'
22:25 masak pmichaud: ok, I'll defer my question to after having read the 'use' sub.
22:25 pmichaud I'm not sure it should be that way ultimately, but that's how it's set up at the moment.
22:25 pmichaud I think the 'use' sub ignores it.
22:25 pmichaud i.e., doesn't use it.
22:25 masak oki.
22:25 DanielC pmichaud: I know that @ means array... I guess that "@?" could mean "maybe this is an array" but that sounds really weird.
22:26 pmichaud DanielC: the ? twigil generally means "compiler variable"
22:26 DanielC ah!
22:26 masak anyway, if we want to add :auth, it should be fairly straightforward, if we already have :ver as an example.
22:26 pmichaud for example $?LINE  means "what source line am I on?"
22:26 mberends it would also handle :auth or :anything as it stands
22:26 mberends the name is not checked
22:26 masak mberends: oh! you're right.
22:26 pmichaud 'ver' is misnamed, currently
22:26 pmichaud it should not be called 'ver'
22:26 masak :)
22:27 pmichaud it should be called whatever we call the string-of-colonpairs-that-follow-a-longname
22:27 * pmichaud checks S11
22:27 mberends masak: TODO
22:27 masak aye.
22:28 DanielC What is PAST::Op ?
22:29 pmichaud probably should be called "adverbs"
22:29 pmichaud they're called adverbs in S11
22:29 masak DanielC: it's a part of a PAST tree, what the actions.pm program generates from the parsing.
22:29 pmichaud jnthn: something in latest parrot causes perl6multisub to fail.  Bisecting.
22:29 masak DanielC: the PAST::Op is one of seven(?) types of PAST node in that tree.
22:30 masak DanielC: anyway, this whole use_statement sub amounts to calling the 'use' sub in the right way, yes?
22:30 DanielC AFAICT yes
22:31 masak DanielC: now, if you turn to src/builtins/eval.pir and line 141... you'll find that very sub.
22:31 DanielC There are bits I don't understand. Most notably, the PAST thing.
22:31 masak DanielC: the PAST tree is an intermediate representation, waiting to be turned into Parrot opcodes.
22:31 DanielC Wait... I need to catch up. Where in actions.pm does it call a sub? I see .ast, and .name
22:32 jnthn pmichaud: Fail to compile?
22:32 masak hm, let me check.
22:32 pmichaud jnthn: yes, fail to compile.
22:32 jnthn Ouch.
22:32 jnthn Parrot fail...
22:32 jnthn I'm actually just in Perl6MultiSub doing some bits...
22:32 mberends DanielC: actions.pm:436,438
22:32 * DanielC finds line 141 of eval.pr
22:33 DanielC mberends: thanks, I see the use() call
22:33 masak mberends: oh! I had missed that part myself. :)
22:34 masak so... there are actually _two_ kinds of 'use' call here...
22:34 masak one stored in the PAST::Op node, and one made directly.
22:34 masak that kinda makes sense.
22:34 DanielC ok
22:34 pmichaud eventually they'll likely be the same, when we get BEGIN semantics built-in
22:34 pmichaud (which I've already figured out how to do, just need to implement)
22:34 masak that also makes sense.
22:35 masak DanielC: ok, so now we're in PIR land.
22:35 pmichaud i.e., we'll be able to say   BEGIN($past)   and it will automatically compile+invoke the $past at compile time, and we still emite the $past in the compiled output (so it'll run at 'load' time)
22:35 masak pmichaud++
22:35 DanielC masak: Abandon Hope, All Who Enter Here...
22:36 masak DanielC: I never said it'd be easy :)
22:36 fuad joined #perl6
22:36 DanielC :-)
22:36 pmichaud if it was easy, we'd be done already :-)
22:36 dalek rakudo: def4e6d | jnthn++ | src/ (7 files):
22:36 dalek rakudo: Do a little optimization to the deref_objectref dynop, and then eliminate the !DEREF PIR sub in favor of it. Wins a modest but worthwhile performance improvement.
22:36 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/d​ef4e6dd8ccba2ab25d0fe312806405873b2272e
22:36 [particle]1 not me, i'd just code slower.
22:36 masak DanielC: actually, I see the 'ver' thing being referred to here, quite early in the PIR code.
22:36 masak line 151.
22:36 fuad hello
22:36 pmichaud we use 'ver'?
22:36 DanielC .local pmc ver, compiler_obj
22:37 DanielC ah, yes     ver = options['ver']
22:37 masak pmichaud: we use it to get :lang, it seems.
22:37 pmichaud yes.
22:37 pmichaud that feels... wrongish also.
22:37 masak fuad: oh hai!
22:37 masak pmichaud: aye :)
22:37 fuad is someone knows sql here?:)
22:38 * mberends steps forward
22:38 masak fuad: people might, but remember that this is #perl6, not #mysql.
22:38 fuad yes i know
22:38 fuad i just asked
22:38 masak good.
22:38 fuad coz no one there knows
22:38 chromatic joined #perl6
22:38 mberends fuad: that's not even funny
22:38 pmichaud hola chromatic!
22:39 chromatic jnthn, you're missing semicolons at the end of SETATTR/GETATTR in P6 multi sub PMC.
22:39 masak mberends: actually, I thought it was a bit funny. :)
22:39 mberends (swedish humor)??
22:39 DanielC fuad: Go to #postgres, I'm sure someone knows SQL there...
22:39 masak mberends: might be.
22:40 jnthn chromatic: It just started needing 'em?
22:40 jnthn chromatic: heh, can add.
22:40 pmichaud chromatic/jnthn:  yeah, that's kinda weird.  The file compiles okay in r39298 :-)
22:40 chromatic NotFound changed the macro a few commits ago.
22:40 fuad mberends:sorry(
22:40 pmichaud ahhhhhhh
22:41 jnthn Any particular reason?
22:41 chromatic I think it's the right choice myself; the code reads better with the semicolons.
22:41 masak DanielC: I think I need to sleep now.
22:41 jnthn chromatic: Did it work with semis before?
22:41 masak DanielC: it was fun spelunking with you!
22:41 chromatic It didn't prohibit them; the macro expanded to do { ... } ;;
22:41 DanielC masak: ok, thanks for showing me around the code.
22:41 masak my pleasure.
22:41 jnthn chromatic: OK. I'm doing a bunch of edits to that file at the moment anyway...
22:42 chromatic Double semis aren't a problem.
22:42 chromatic No semis are.
22:42 * masak sleeps
22:42 mberends DanielC: from here on, we have to stop reading and start writing ;)
22:42 DanielC :-)
22:43 pmichaud jnthn: how long til you commit?  I'm eager to see how my oo.c improves things, and I'm blocked at the moment.
22:43 DanielC mberends: Honestly, I think that writing a compiler is probably outside my abilities. I never learned about compilers or grammars, my degree is in math.
22:44 mberends degrees are not that relevant.
22:44 DanielC mberends: But I can tell you a lot about cryptography though :-D
22:44 chromatic I can nopaste a patch for you, pmichaud.
22:44 pmichaud c - that would help.  I'm sure I could do it as well.
22:44 pmichaud but a patch is easier.
22:45 charsbar joined #perl6
22:45 DanielC mberends: I know, but I've never done anything remotely similar to this before.
22:45 chromatic Having already patched it myself....
22:45 chromatic It ended up in #parrot.
22:45 mberends DanielC: the beauty of this little community is that we shall learn to do it within only a few Weebs.
22:46 DanielC mberends: What is weeb anyways? I saw masak say that before.
22:46 mberends DanielC: it was a typo for week, being thrashed to death. See backlog.
22:47 DanielC ok
22:48 pmichaud chromatic: got it, thanks.
22:49 jnthn pmichaud: Not sure, it's a fairly big but in theory not too dangerous change.
22:49 mberends DanielC: we're all learning, and the knowledge available in #perl6 is fantastic
22:49 jnthn pmichaud: Feel free to apply.
22:49 jnthn pmichaud: If git complains I'll just do mf (mine full) to resolve.
22:49 DanielC mberends: :-)
22:50 pmichaud I'll apply if I get past "make test"
22:50 chromatic It pushed me past make test anyway.
22:50 * mberends senses bedtime in .nl and waves to #perl6
22:50 pmichaud looks good to me so far.
22:51 fuad left #perl6
22:52 pmichaud anyway, what I discovered is that   Parrot_oo_get_class would nearly always create a new PMCProxy on each call (which would happen from isa $P0, ['Something'] )
22:52 Muixirt chromatic, parrots command line parsing might need some love, or the documentation thereof, and parrot -h seems outdated
22:53 chromatic I'm sure it is.  What was most confusing for you there?
22:53 dalek rakudo: 9421bca | pmichaud++ | src/pmc/perl6multisub.pmc:
22:53 dalek rakudo: Add semicolons after GETATTR/SETATTR (chromatic++).
22:53 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/9​421bcaf77f411c472762cd123722d8fa8618d86
22:55 Muixirt chromatic, things like --CGP-core (see Ticket 639)
22:55 [particle]2 joined #perl6
22:55 Muixirt chromatic, you might have a look at http://sial.org/pbot/36964
22:56 skids joined #perl6
22:56 chromatic I can look at #639 tomorrow.  Do you know if there's a ticket for your nopaste?
22:57 Muixirt there is no ticket
23:01 lichtkind chromatic: cheers :)
23:02 ssm joined #perl6
23:03 pmichaud jnthn: I get a unicode-related fail now from the dispatch changes
23:03 jnthn pmichaud: Oh?
23:03 pmichaud (I'm fine with regressing, as it's a bit ugly)
23:04 jnthn Ah, I have a build without ICU, so...
23:04 pmichaud the line
23:04 pmichaud A.new().äöü()
23:04 pmichaud ends up producing PIR like
23:04 jnthn But I can't think of much I'd have done to explode it...
23:04 pmichaud $P59 = $P58.unicode:"\x{e4}\x{f6}\x{fc}"()
23:04 jnthn Oh
23:04 pmichaud and IMCC can't handle that unicode:"..." there.
23:04 jnthn That sounds like a code-gen issue.
23:04 jnthn Or an IMCC issue.
23:05 jnthn All I'm doing is producing a PAST::Op node with pasttype callmethod.
23:05 pmichaud please please please don't make it a code gen issue.  That will be.... ugly/complex
23:05 jnthn OK, I can be an IMCC issue.
23:05 pmichaud I guess we can work around it in PCT if need be, but Parrot really ought to be able to handle unicode string method names :-P
23:05 jnthn The only reason we didn't see it before is because we weren't using Parrot's dispatch syntax to actually dispatch.
23:05 pmichaud right.
23:05 jnthn Yes, agree. Parrot issue.
23:05 pmichaud The error message we get is
23:05 pmichaud error:imcc:syntax error, unexpected USTRINGC ('unicode:"\x{e4}\x{f6}\x{fc}"')
23:05 jnthn bwah
23:06 jnthn Yeah, missed it because I don't run the ICU tests.
23:06 pmichaud right.
23:06 pmichaud as I said, I don't mind regressing for now -- it's only two tests.
23:06 jnthn But a little surprised that Parrot complains.
23:06 pmichaud I'm not
23:06 jnthn OK, sure. One of us should file Parrot bug.
23:06 pmichaud I'll file ticket
23:06 jnthn Thanks
23:06 jnthn I'm tracking down a segfault in my MMD caching refactor.
23:07 pmichaud it seems like for every string constant that exists in IMCC we end up having to do this STRINGC -> USTRINGC conversion :-|
23:07 jnthn (Trying to both decrease our startup time *and* get multi-method dispatch speedy as multi-sub dispatch.)
23:07 pmichaud lexicals.  sub names.  subid names.  method names.  named parameters.  and now method calls :-P
23:08 pmichaud fortunately I've filed enough of these tickets that I actually have a template for it :-P
23:08 jnthn lol!
23:10 lichtkind jnthn: what do you think about the idea do put a bit of life into november wiki and make a newbee friendly overview with lot of pointers
23:11 lichtkind jnthn: because perl 6 wiki is not newbee friendly
23:11 chromatic I'll take a look at that IMCC problem tomorrow.  I know how to fix them.
23:11 pmichaud lichtkind: maybe the github wiki instead?    wiki.github.com/perl6/misc/
23:11 pmichaud lichtkind: I can even create a repo for it if we want.
23:12 pmichaud We could also create a githubpages repo to hold docs or other information
23:12 lichtkind pmichaud: tha main idea is to give november a purpose
23:12 pmichaud ah
23:12 pmichaud that's fine with me also, if it can handle the load :-)
23:12 lichtkind pmichaud: what you mean by that?
23:13 ruoso joined #perl6
23:13 lichtkind its like the waterfall chart, real usage improve november which improves rakudo which improves parrot
23:13 lichtkind which also improves perl 6 :)
23:15 lichtkind pmichaud: ah now i understand yes november is slow
23:15 lichtkind dont worry there will be shot texts :)
23:15 lichtkind if can handle the workload :)
23:16 pmichaud chromatic: TT #730, when you get around to it.  Thanks as always for shepherding these and saving me from OH MY GOD ITZ SO PAINFUL!
23:21 donaldh joined #perl6
23:21 chromatic Don't say I never do everything for you!
23:21 chromatic I should be able to fix these tomorrow.  I need to finish an edit and rush out of here soon.
23:22 chromatic I may also get a grant proposal to you tomorrow afternoon.
23:23 jnthn \o/
23:23 pmichaud \o/
23:23 jnthn chromatic++
23:23 pmichaud as you may have detected, we're rapidly in desperate need of that work.  I'll push it along quickly.
23:23 pmichaud preliminary new spectest timing after isa fixes and other additions from jnthn++:   21m51
23:24 pmichaud as of yesterday we were over 25m
23:24 jnthn OK, the 10,000 multi-method dispatch benchmark now runs in 60% of the time it used to.
23:25 jnthn 02 - 10,000 sub dispatches: 3.546252
23:25 jnthn 03 - 10,000 multi dispatches: 3.280236
23:25 jnthn 04 - 10,000 method dispatches: 3.749337
23:25 jnthn 05 - 10,000 multi-method dispatches: 3.671236
23:25 jnthn That gets the common cases of dispatch on a fairly level playing field now.
23:26 jnthn (Before: 05 - 10,000 multi-method dispatches: 5.968184)
23:26 pmichaud oh, I should bump PARROT_REVISION
23:27 * skids stops his make :-)
23:27 * jnthn spectets hopefully
23:28 jnthn I'm tired, if I don't get a clean pass I'll debug tomorrow.
23:34 dalek rakudo: b91e089 | pmichaud++ | build/PARROT_REVISION:
23:34 dalek rakudo: Bump PARROT_REVISION to get latest isa fixes and other stuff.
23:34 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/b​91e089021cd808fa2a098ccd43b1588322616d1
23:38 andreasg_ joined #perl6
23:38 literal_ joined #perl6
23:38 avar joined #perl6
23:39 jferrero joined #perl6
23:43 jnthn Oh noes...I haz one fail. :-(
23:45 frew|work joined #perl6
23:46 jnthn lol I fixez it
23:47 Tene yay
23:49 jnthn spectesting again just to be safe.

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

Perl 6 | Reference Documentation | Rakudo