»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend! Set by sorear on 25 June 2013. |
|||
00:14
hummeleBop left
00:21
sunnavy joined
00:32
Sqirrel left
00:35
Sqirrel joined
01:02
klapperl_ joined
01:06
klapperl left
01:09
thou joined
01:21
tusooa joined
01:22
tusooa left,
thistusooa joined
01:23
thistusooa left,
thistusooa joined
01:40
takesako_____ left
01:44
FROGGS_ joined
01:46
Su-Shee_ joined,
Sqirrel_ joined
01:47
Sqirrel left
01:48
FROGGS left
|
|||
ren1us | Okay, as part of my continuing struggle to work through the book, such as it is, I now have a question: When it comes to constructing a new instance via self.bless, how would the syntax look for sending in a param with a name which doesn't quite match an attribute? | 01:48 | |
And because that clearly made no sense in words, here's a quick example: new($value) { return self.bless(:$value); } works fine, given a "$value" attribute | |||
01:49
Su-Shee left
|
|||
ren1us | However, let's say you wanted to do something along the lines of: new($val) { return self.bless(value => $val); }. How would the *proper* syntax for that look? | 01:49 | |
I think my big confusion is, exactly what is that : operator actually doing and how is bless trying to match things. | 01:50 | ||
BenGoldberg | As far as I know, :$foo is exactly identical to foo => $foo | 01:51 | |
ren1us | But what if you're trying to do foo => $bar? | 01:52 | |
BenGoldberg | Then write foo => $bar | 01:53 | |
flussence | You can write :foo($bar) if you want, but they're both the same everywhere. | ||
ren1us | That works and actualyl makes a ton of sense. Thanks. | 01:54 | |
01:58
prevost left
02:20
hoverboard joined
02:30
perltricks joined
02:38
perltricks left
03:08
perltricks joined
|
|||
perltricks | anyone know why this capture doesn't work? perl6 -e '"one two" ~~ m:g/(\w+)/; for @() { say } | 03:09 | |
avuserow2 | m: "one two" ~~ m:g/(\w+)/; for @() { .say } | 03:12 | |
camelia | rakudo-moar dca172: OUTPUT«「two」» | ||
avuserow2 | perltricks: ^ | ||
03:12
avuserow2 is now known as avuserow
|
|||
avuserow | is that what you are seeing? | 03:12 | |
m: "one two" ~~ m:g/(\w+)/; @().perl.say | 03:13 | ||
camelia | rakudo-moar dca172: OUTPUT«(Match.new(orig => "one two", from => 4, to => 7, ast => Any, list => ().list, hash => EnumMap.new()),).list» | ||
perltricks | Hi, thanks. I'm getting the last match ... but I want to iterate all matches | 03:14 | |
With global matching I expected 'one' and 'two' as captures | 03:15 | ||
avuserow | you could always use .comb here | 03:20 | |
03:21
thou left
|
|||
avuserow | m: .say for "one two".comb(/\w+/) | 03:21 | |
camelia | rakudo-moar dca172: OUTPUT«onetwo» | ||
perltricks | aha, thanks avuserow let me try that | ||
lue | m: .say for "one two".words # even shorter, if you're specifically looking for /\w+/ | 03:22 | |
camelia | rakudo-moar dca172: OUTPUT«onetwo» | ||
03:24
xragnar_ joined,
xragnar left,
xragnar_ is now known as xragnar
03:25
Sqirrel_ left
|
|||
perltricks | thanks lue, will try that also | 03:26 | |
03:29
thou joined
03:33
Sqirrel joined
03:52
perltricks left
04:00
skids joined
04:22
Sqirrel left
04:24
BenGoldberg left
04:33
thou left,
Sqirrel joined
04:39
Sqirrel left
04:41
Sqirrel joined
04:45
Sqirrel left
04:46
hoverboard left
04:51
Sqirrel joined
05:14
kaare_ joined
05:32
xinming joined
05:34
xinming_ left
05:39
SevenWolf joined
05:56
huf_ is now known as huf
06:05
bjz left,
bjz joined
06:21
bbkr left
06:26
darutoko joined
06:27
darutoko- joined
06:31
darutoko left,
darutoko joined,
darutoko- left
06:32
Sqirrel left
06:52
Sqirrel joined
07:10
[Sno]_ is now known as [Sno]
07:17
kurahaupo joined
|
|||
FROGGS_ | moritz: the LWP::Simple r-m* problems you mentioned make me think that we cannot have a star release *after* the compiler release anymore | 07:36 | |
moritz: I think we should do a star release and compiler release at the same time, so do not have regressions in star that require a point release | |||
07:37
FROGGS_ is now known as FROGGS
|
|||
moritz | lue: iirc .words uses \S+, not \w+ | 07:42 | |
FROGGS | correct | 07:51 | |
m: .say for "ohh, yeah".words | |||
camelia | rakudo-moar dca172: OUTPUT«ohh,yeah» | ||
moritz | FROGGS: I dunno, the failures shoudl have been obvious from the rakudo-star-daily thingy | 07:53 | |
FROGGS | moritz: nothing hangs on my box when I build r-m* | ||
just checked | |||
moritz | FROGGS: maybe adding that to the release guide would help | ||
FROGGS: it hung here on two different machines :( | |||
FROGGS: does r-p* build the modules fine for you? | 07:54 | ||
xfix | perlcabal.org/syn/S03.html#line_1456 - interesting, ANSI C explicitly allows for operator looser in the precedence in middle part. But I guess it's because there is rarely an use for that. | ||
FROGGS | moritz: it did on wednesday, but I'll check in a minute | ||
moritz | (that is, no SORRY in the output) | 07:55 | |
FROGGS | I see that LWP::Simple fails a test though (on r-m) | 07:56 | |
"Internal error: inconsistent bind result" | 07:57 | ||
never seen that before | |||
08:24
bjz left
08:31
spider-mario joined
08:37
denis_boyun_ joined
08:57
denis_boyun___ joined,
denis_boyun_ left
08:58
uniejo joined
08:59
SevenWolf left
09:04
denis_boyun_ joined
09:05
denis_boyun___ left
09:08
SamuraiJack__ joined
09:12
Su-Shee_ is now known as Su-Shee
09:26
Sqirrel left
|
|||
masak | FROGGS++ # a new internal error; well done! | 09:31 | |
FROGGS | meh | ||
:P | |||
moritz | git grep -i inconsistent in rakudo/nqp/parrot/moarvm doesn't yield that error message anywhere | 09:32 | |
any idea where it comes from? | 09:33 | ||
FROGGS | rakudo/src/Perl6/Metamodel/BOOTSTRAP.nqp:2927: nqp::die("Internal error: inconsistent bind result"); | ||
09:43
Sqirrel joined
|
|||
jnthn waves from the mojoconf hackathon | 09:45 | ||
09:45
bowtie left
|
|||
moritz | oh, my local copy of rakudo is "a bit" out of date | 09:45 | |
like, 1225 commits | |||
jnthn | FROGGS: That means that the lowered signature code thought the bind failed, it fell back to the binder proper to generate an error message, and that then thought all was OK, and the internal error is 'cus that should not happen. | 09:46 | |
FROGGS | hmmm | ||
09:47
Psyche^ joined
|
|||
jnthn agrees with moritz that we need to use the star-daily thingy to try and make sure we don't cut releases that bust stuff for Star | 09:49 | ||
On the other hand, given it seems that that only some of us can re-produce the bug... | 09:50 | ||
09:51
Sqirrel left
09:53
Sqirrel joined
09:55
kaare__ joined
09:59
kaare_ left
|
|||
jnthn | FROGGS: Can you get me a condensed test case on the internal bind error? | 10:01 | |
FROGGS | jnthn: gimme a minute | 10:02 | |
jnthn | ok | ||
I'm also looking into the crazy slowness of IO::Path.contents | 10:03 | ||
10:06
sqirrel_ joined
|
|||
jnthn | Uhh...yeah | 10:09 | |
Doing it 100 times hits the binder slow path around 30,000 times. | |||
10:10
dmol joined
|
|||
jnthn | We also hit it 78 times at startup now. | 10:13 | |
Wonder how much that is costing... | |||
vendethiel | that reminds me of String#hashCode which is itself called so much time in Java's library that the JIT optimized it already when your own program starts | ||
jnthn wonders which on earth BUILD method is so costly... | 10:14 | ||
vendethiel | (what tools do you use for bottlenecks ?) | ||
xfix | timotimo++, I just noticed you (yes, I know, late, but I don't follow Perl 6 news lately) continued my old blog I didn't have time to write anymore. Also, it seems you write better posts than I did :-). | 10:16 | |
FROGGS | jnthn: the lwp-simple problem is about this: gist.github.com/FROGGS/9228162347e3b4c03a18 | 10:18 | |
jnthn: when I delete the LWP/Simple.moarvm, I get the gisted bt | 10:19 | ||
and it passes when I disable spesh | |||
10:19
Rotwang joined
|
|||
jnthn | FROGGS: eek, yeah, that obj looks like junk | 10:20 | |
FROGGS | I am not sure I can provide a one-liner though | 10:21 | |
but perhaps.... I create a shorter script that shows the problem | 10:22 | ||
xfix | I barely have time for programming and writing because of school. | ||
(perhaps I should try Perl 6 again, and check how it improved...) | 10:23 | ||
FROGGS | xfix: you should :o) | ||
xfix | It was 6 months, after all. Is MoarVM usable now? | 10:24 | |
(or should I continue using Parrot Perl 6?) | |||
10:27
denis_boyun_ left
|
|||
jnthn | xfix: Many folks are using MoarVM as their Perl 6 backend of choice these days. | 10:27 | |
xfix: Worth it for the speedup. | 10:28 | ||
xfix | So, it's reasonably complete. | ||
jnthn | Well, it passes more spectests than any of the other backends by now. | ||
So at least by that measure... | |||
:) | |||
Has full nativecall support too | |||
xfix | Interestnig. | ||
10:29
anaeem1_ joined
|
|||
xfix | Compared to Perl 5, how fast MoarVM Rakudo Perl is? | 10:32 | |
But considering Parrot's performance six months ago, it's probably comparable or faster. | 10:34 | ||
moritz | xfix: try it and see | 10:35 | |
xfix | :-) | ||
Right now it's compiling. | |||
jnthn | Comparison with Perl 5 varies greatly by benchmark. | ||
xfix | note: expected ‘char (*)(struct DCCallback *, struct DCArgs *, union DCValue *, void *)’ but argument is of type ‘char (*)(struct DCCallback *, struct DCArgs *, union DCValue *, struct MVMNativeCallback *)’ | 10:36 | |
I love overzealous compilers. | |||
jnthn doesn't | |||
The MSVC build of MoarVM is warning free. The clang build on OSX apparently spits out 1000 warnings o.O | |||
xfix | Well, I guess that void * in function is not compatible with struct MVMNativeCallback *, but it will work on most platforms. | 10:37 | |
jnthn | gcc is a few | ||
xfix | Except for Emscripten if I remember correctly. | ||
But considering MoarVM is JIT, I doubt it would work on Emscripten either way. | 10:38 | ||
FROGGS | three warning using gcc | 10:39 | |
warnings* | |||
xfix | I got one while compiling MoarVM. | ||
10:39
anaeem1_ left
|
|||
xfix | gcc 4.8.1, if you ask. | 10:40 | |
FROGGS | I've got also 4.8.1 | ||
jnthn | I htink I have 3 on GCC... | 10:41 | |
I'll fix those is nobody else gets to them first. | |||
The clang 1000 is just crazy though :) | |||
xfix | Why it would report way more than gcc? | 10:42 | |
FROGGS | jnthn: I can't provide a simple case for the lwp-simple issue, the problem vanishes when I rip out random stuff | ||
vendethiel | (is clang bad ?) | ||
I watched some C++ talks and they kept making fun of clang ;o) | |||
jnthn | vendethiel: Not bad, just different defaults, I guess :) | ||
FROGGS | I like clang | ||
xfix | For fish shell, I get two warnings in clang, and one in gcc. | 10:43 | |
vendethiel | the little I used clang, it was just soo good because it was soo fast | ||
xfix | But let's be honest, before fixing them, clang reported way more. | ||
Those two warnings that were left are about unused static functions for which calls are generated using preprocessor. | 10:44 | ||
tadzik | I think clang is awesome | ||
xfix | It is. | ||
It found lots of legit issues in fish shell. | 10:45 | ||
github.com/fish-shell/fish-shell/b...k.cpp#L804 | 10:46 | ||
Now I wonder who added __attribute__((unused)) here, and didn't add it anywhere else. | |||
10:48
denis_boyun_ joined,
thou joined
|
|||
xfix | MoarVM installed, and it seems more responsive than Parrot. Interesting. | 10:49 | |
10:50
prevost joined
|
|||
xfix | Its REPL still loads faster than Node.js's REPL, which is already quite great. | 10:50 | |
tadzik | well, I started writing Steroids and games because Mokudo was faster than Typescript :) | 10:52 | |
xfix | The only issue I see for now is that -e code loads in 0.8 seconds or so. | ||
10:52
thou left
|
|||
xfix | Typescript slower than Rakudo? What? | 10:53 | |
Aren't JavaScript implementations optimized really well? | |||
tadzik | well, startup-time wise | ||
typescript needed like 3 seconds to compile an empty file | |||
vendethiel | xfix: they mean the compiler :-) | ||
tadzik | so I said "screw this, I'll write it in Perl 6" | ||
vendethiel | compile it is long, not running it | ||
tadzik | which is funny, since typescript compiler is written is JS which is supposed to be OMG FAST | 10:54 | |
xfix | 3 seconds is faster than C++ that can easily compile for 2 days :-). | ||
tadzik | but it was super annoying to deal with | ||
moritz | xfix: I don't know any C++ compiler that takes >3s for an empty fie | ||
xfix | Hm, right. | ||
I assumed that 3 seconds for a complete program. | 10:55 | ||
tadzik | well, Rakudo now takes more than 3 seconds to compile the entire steroids too | ||
and it's possible that typescript is still at 3 :) | |||
but the startup time was unbearable so I ditched it | |||
xfix | I remember compiling HHVM. It took so long that I just installed Fedora in VM, and downloaded the .rpm package in meantime. | ||
(yes, it's PHP_) | 10:56 | ||
tadzik | I like Go :) | ||
well, Hiphop is C++, I don't think it uses PHP in itself, does it | |||
xfix | Well, it's VM for PHP. | ||
I like Go, but I cannot get used to the types being on the right side just because. | 10:57 | ||
vendethiel | go is bad :/ | ||
all hail rust ! | |||
xfix | And this array declaration syntax which looks like []int. Like, why? | ||
tadzik | because writing function pointers isn't crazy like in C :) | 10:58 | |
and it all makes sense | |||
xfix | It's not even consistent. func main() should be main func() IMO. | 10:59 | |
tadzik | * | ||
FROGGS | ohh dang, panda's sub local-fetch needs some love... | 11:03 | |
xfix | And there is issue of Unicode support. It claims to be Unicode supporting programming language. It even has fmt.Println("Hello, 世界") on main page. | 11:04 | |
It even has some methods that only make sense in Unicode. But they don't work, strings.EqualFold("ss", "ß") returns false. | |||
What's worse? Not having Unicode support, or claiming to have Unicode support without having it? | 11:05 | ||
moritz | xfix: the world isn't just black and white. Get used to it. | 11:06 | |
xfix: it simply could have Unicode support that's not perfect. | |||
xfix | I guess you are right here, but it still annoys me. | ||
But it's annoying when according to Go, uppercase version of ß is ß. That's basic ISO-8859-1. | 11:11 | ||
Then again, it's not that Rakudo does it better. | 11:12 | ||
rn: say uc "ß" | 11:13 | ||
camelia | rakudo-jvm dca172: OUTPUT«SS» | ||
..rakudo-{parrot,moar} dca172, niecza v24-109-g48a8de3: OUTPUT«ß» | |||
xfix | But I assume it's just a bug in Rakudo. | ||
moritz | r-j does better. | 11:14 | |
xfix | r-j: say uc "ß" | ||
camelia | rakudo-jvm dca172: OUTPUT«SS» | ||
xfix | I already know it was reported - rt.perl.org/Public/Bug/Display.html?id=121377 | 11:15 | |
tadzik | isn't ß defined as case neutral in unicode? | 11:16 | |
xfix | 00DF; 00DF; 0053 0073; 0053 0053; # LATIN SMALL LETTER SHARP S | ||
No, it's not. | |||
tadzik | The Unicode standard defines, that “ß” does not change when mapping to upper, title, or lower case. | ||
xfix | (according to SpecialCasing.txt) | 11:17 | |
tadzik | no source for that above sentence though | ||
just an internet comment that people didn't disagree wiht :) | |||
xfix | According to Unicode, \xDF is \xDF (lowercase), \x53\x73 (titlecase) or \x53\x53 (uppercase). | ||
moritz | tadzik: that comment is wrong; I recently looked it up | 11:18 | |
tadzik | fair enough | ||
xfix | www.unicode.org/Public/UNIDATA/SpecialCasing.txt - this is newest version of Unicode, if you want it. | 11:20 | |
In most cases ß is uppercased to SS. | 11:22 | ||
Apparently ẞ is obligatory for official documentation when wriing geographical names in all-caps (141.74.33.52/stagn/Portals/0/101125_TopR5.pdf), but other than that, SS is being used. | 11:23 | ||
11:27
molaf left
|
|||
FROGGS | xfix: I also had email conversation with german grammar officals, and it is quite possible that ẞ will be the offical ß.uc in a few years | 11:29 | |
which would result in an update to unicode of course | 11:30 | ||
xfix | Well, yes, but currently Unicode doesn't change this change. | ||
FROGGS | "change this change"? | 11:31 | |
xfix | update for this change* | ||
wasn't updated* | |||
FROGGS | the officals will only accept ẞ if it used more widely btw | ||
xfix: unicode can't do that on its own | 11:32 | ||
xfix | That would be an interesting change. | ||
Especially considering that ẞ was added rather recently. Windows Vista doesn't have ẞ character, but I bet that Microsoft would release an update if ẞ would be officially accepted. | 11:33 | ||
(assuming that it will be changed before Vista end of support) | 11:34 | ||
FROGGS | ẞ is there since uniode 5.1 (2008) | 11:37 | |
not that recently | |||
11:38
SamuraiJack__ left
|
|||
tadzik | hmm, I don't suppose there's something like nqp::getattr() that'll traverse the inheritance hierarchy for me? | 11:50 | |
FROGGS | hehe | ||
nice try :o) | 11:51 | ||
tadzik | :> | ||
11:51
anaeem1_ joined
|
|||
tadzik | that nice try would've saved me a 'for { ... try {' :P | 11:51 | |
tadzik is porting MooseX::StrictConstructor | |||
jnthn | .oO( "It looks like you're after a method" ) |
||
11:53
denis_boyun__ joined
11:54
denis_boyun_ left
11:56
sqirrel_ left
|
|||
jnthn | grr | 12:02 | |
So I got :enc(:$encoding) to work out for bind lowering, thus dealing with open, subst, etc. | |||
Then I discovered match :/ | |||
:st(:nd(:rd(:th(:$nth)))) | |||
FROGGS | :/ | 12:03 | |
jnthn just hacks it | 12:04 | ||
timotimo | o/ | 12:05 | |
xfix: thanks for your kind words | |||
12:06
bowtie joined
|
|||
xfix | r: a: goto a; | 12:08 | |
camelia | rakudo-{parrot,jvm,moar} dca172: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfileUndeclared routine: goto used at line 1» | ||
jnthn | It turns out the slow-path binder is less slow than I thought... Eliminating the 30,000 calls to it doesn't really make much difference to the IO::Path.contents slowness | ||
xfix | Any idea why 'a:' causes SIGSEGV in r-m (on my computer)? | 12:09 | |
(but only in REPL) | |||
FROGGS | hmmmm | ||
jnthn | No idea. Doesn't here in REPL for me. | ||
xfix | > a: | ||
fish: Job 1, 'perl6' terminated by signal SIGSEGV (Address boundary error) | |||
Strange. | |||
FROGGS | segfaults for me too :( | ||
12:09
bowtie left
|
|||
jnthn | Odd. No problems here. | 12:10 | |
xfix | Perhaps it's x86_64 specific or something. | ||
12:10
bowtie joined
|
|||
jnthn is on x86_64... | 12:11 | ||
xfix | I have 3.11.10-7 kernel, but it's probably not about that. | ||
Well, 3.11.10-7-desktop (openSUSE). | 12:12 | ||
Let me check gdb... | |||
(after I install it) | |||
FROGGS | xfix++ | 12:14 | |
xfix | "/home/xfix/Code/rakudo/install/bin/perl6": not in executable format: File format not recognized | ||
Hm... | |||
It's a shell script. Ok. | 12:15 | ||
gist.github.com/xfix/7313ed1b82d2047f7faa | 12:18 | ||
huh | |||
FROGGS | xfix: you need a MoarVM --debug=3 build | 12:19 | |
xfix | Hm, ok | ||
FROGGS | you don't need to reinstall nqp/rakudo afterwards btw | 12:20 | |
xfix | So, I guess I have to recompile Moar. | ||
FROGGS | just reconfigure MoarVM, and provide --prefix and --debug=3 | ||
xfix | I installed Rakudo using --gen-moar. | ||
FROGGS | --prefix needs to point to your install directory | ||
xfix | And there is --moar-option | ||
I guess I have to download Moar then. | 12:22 | ||
jnthn now has a Rakudo that doesn't hit the slow-path binder at all at startup | |||
12:22
Sqirrel left
|
|||
jnthn | or match/subst | 12:22 | |
xfix | Heh, fish shell still calls sed on startup. | 12:23 | |
12:25
kaare__ is now known as kaare_
|
|||
FROGGS | jnthn: do you recognize a speed improvement? | 12:25 | |
12:26
spider-mario left
|
|||
jnthn | Not a great one... | 12:26 | |
12:26
pippo joined
|
|||
pippo | o/ #perl6 | 12:26 | |
jnthn | I mean, it knows some off IO::Path.contents | ||
xfix | Hi, pippo. | ||
jnthn | But it appears not to be the main thing that makes it costly | ||
Even though 100 of them did it 30,000 times | 12:27 | ||
pippo | xfix: same problem as yours on my box here. I have a 32bits machine. | ||
xfix: btw also on perl6-j REPL. | |||
xfix | gist.github.com/xfix/8aa1ba6cb3d9f8679654 | 12:28 | |
Is it useful enough? | |||
FROGGS | xfix: yeah | 12:29 | |
it tries to unbox_s a NULL object | |||
xfix | Why it would do that... | 12:30 | |
FROGGS | I dunno | 12:31 | |
but I will find out | |||
xfix | Anyway, I have to go away | ||
FROGGS | thanks for the backtrace :o) | 12:32 | |
12:33
Sqirrel joined
12:36
thou joined
|
|||
dalek | p: b436340 | jonathan++ | / (3 files): Support having a pair of possible parameter names. Just on MoarVM backend for now, but that's the only one that lowers Perl 6 signatures at present. |
12:36 | |
12:38
Sqirrel left
|
|||
dalek | kudo/nom: 10d5c92 | jonathan++ | src/Perl6/Actions.nqp: Lower attributive parameter binds. |
12:38 | |
kudo/nom: 9df1a8c | jonathan++ | / (2 files): Lower :a(:$amaze) in signatures. |
|||
kudo/nom: 33e16f0 | jonathan++ | src/core/Str.pm: Tweak match signature to be lowerable. With this, we never hit the slow-path binder on startup, and avoid it on all the calls to match. |
|||
12:39
Sqirrel joined
12:41
thou left
|
|||
tadzik | "A class's explicit method definition hides any role definition of the same name", says S14. Is there a way to call it anyway? | 12:41 | |
vendethiel | tadzik: .RoleName.method ? .*method ? | ||
tadzik | nah, doesn't work | 12:42 | |
masak | m: role R { method foo { say "R!" } }; class C does R { method foo { say "C!" } }; C.new::R.foo | ||
camelia | rakudo-moar dca172: OUTPUT«===SORRY!===Could not find symbol 'new'» | ||
masak | m: role R { method foo { say "R!" } }; class C does R { method foo { say "C!" } }; C.new()::R.foo | 12:43 | |
camelia | rakudo-moar dca172: OUTPUT«===SORRY!=== Error while compiling /tmp/GVUay61J3vTwo terms in a rowat /tmp/GVUay61J3v:1------> s R { method foo { say "C!" } }; C.new()⏏::R.foo expecting any of: method arguments ar…» | ||
jnthn | ummm... | ||
masak | m: role R { method foo { say "R!" } }; class C does R { method foo { say "C!" } }; C.new().R::foo | ||
camelia | rakudo-moar dca172: OUTPUT«R!» | ||
tadzik | hmm | ||
masak | got the syntax wrong first. but there it is. | ||
tadzik | how about from C.foo? :) | ||
jnthn | in IO::Path.contents | ||
We do | 12:44 | ||
next unless $elem ~~ $test; | |||
And then a few lines later | |||
take $elem.path if $elem ~~ $test; | |||
Meaning we're doing the test twice? | |||
tadzik | m: role Bar { method meth { say "from role" } }; class Foo does Bar { method meth { say "from class"; Bar::meth } }; Foo.meth | ||
camelia | rakudo-moar dca172: OUTPUT«from class===SORRY!===Could not find symbol '&meth'» | ||
jnthn | That won't be helping its speed... | ||
tadzik | masak: that's what I want to do here | ||
jnthn | tadzik: self.Bar::meth | 12:45 | |
tadzik | maybe I get the syntax wrong too | ||
aha! | |||
jnthn++ | |||
masak | yeah, it's still a method call. | ||
I used to not like the syntax, feeling it mixed together roles with module 'our' sub lookup. | |||
tadzik | and I guess I can do that with callwith() too | ||
masak | but nowadays I think it's fairly brilliant. | 12:46 | |
tadzik | or something | ||
jnthn | FROGGS: Do you know if the test in contents is meant to happen on the fully qualified path after we catfile, or on the unqualified one? | ||
FROGGS: Feels wrong to do it on both... | |||
FROGGS | jnthn: what test on contents? | 12:48 | |
jnthn | FROGGS: In IO::Path.contents | 12:49 | |
We try $test twice. | |||
next unless $elem ~~ $test; | |||
$elem := $.SPEC.catfile($!path, $elem) if self ne '.'; | |||
if $elem.substr(0, 2) eq any("./", ".\\") { | |||
$elem := $elem.substr(2); | |||
} | |||
take $elem.path if $elem ~~ $test; | |||
There's so much fail in here... | 12:50 | ||
Just avoe | |||
*above | |||
my Str $elem := nqp::nextfiledir($dirh); | |||
if nqp::isnull_s($elem) || !$elem.chars { | |||
isnull_s is meant to be used on a native str... | |||
FROGGS | hmmm | 12:51 | |
I've seen that we test twice yesterday or so... but we also modify $elem in between | 12:53 | ||
jnthn | yeah but...only on Moar | ||
on JVM we check it once | |||
tadzik | I ported MooseX::StrictConstructor to Perl 6: github.com/tadzik/ClassX-StrictConstructor | 12:55 | |
it was fun :) | |||
I wonder if I should maybe reuse some existing exception class, but X::Attribute::Undeclared only supports one attribute | 12:56 | ||
and I feel it's more helpful to show them all | |||
Juerd | What does .^ do and does anybody know a way to google for punctuation? :) | 12:57 | |
Or another search engine | |||
12:58
Sqirrel left
|
|||
masak | tadzik++ # boa constrictconstructor | 12:58 | |
tadzik | Juerd: calls to MOP | ||
Juerd | Thanks | ||
masak | Juerd: $obj.^meth == $obj.HOW.meth($obj) | ||
tadzik | and no, I don't know how to search for punctuation | 12:59 | |
vendethiel | m: role R { method foo { say "R!" } }; class C does R { method foo { say "C!" } }; C.new().R.foo # what's that ambigous with ? | ||
camelia | rakudo-moar dca172: OUTPUT«No such method 'R' for invocant of type 'C' in block at /tmp/SKp2ZG4DVx:1» | ||
vendethiel | oh, it's left associative ? | ||
dalek | kudo/nom: 2c54ffd | jonathan++ | src/core/IO.pm: Various optimizations to IO::Path.contents. Eliminate duplicate application of $test on MoarVM; probably just an accident in porting. Then do a range of other optimizations. Cuts the time taken to less than half of what it was. |
||
tadzik | hm. I can remove nextsame; from the end of Boa::Constrictor's new(), and tests will still work | ||
vendethiel | m: role R { method foo { say "R!" } }; class C does R { method foo { say "C!" } }; C.new().(R::foo) # what's that ambigous with ? | ||
camelia | rakudo-moar dca172: OUTPUT«===SORRY!===Could not find symbol '&foo'» | ||
Juerd | Not being able to search for punctuation has always been annoying when learning Perl... Maybe I'll create an operator lookup web thingy. | ||
12:59
Sqirrel joined
|
|||
tadzik | I wonder if tests are lacking, or is it indeed unnecessary :) | 12:59 | |
vendethiel | Juerd: "poogle", like hoogle :P | 13:00 | |
Juerd | ? | ||
jnthn | FROGGS: Hopefully the various patches today alleviate your .contents slowness issues a little. | ||
vendethiel | Juerd: haskell.org/hoogle | ||
Juerd | Ah, I was googling for poogle and found nothing relevant :) | ||
This does look like something we could use indeed | 13:01 | ||
13:01
denis_boyun__ left
|
|||
masak | tadzik: well, can you think of a situation where 'nextsame' would make an observational difference? | 13:01 | |
tadzik | masak: I just thought of one | 13:02 | |
FROGGS | jnthn: that'd be nice :o) | ||
tadzik | masak: gist.github.com/tadzik/815aa29efaebd5d15adf | ||
13:02
WAAD4CC joined
|
|||
tadzik | this outputs "new from B\nnew from A" | 13:03 | |
FROGGS | installing v5 using panda takes more than 10m | ||
tadzik | if teh class weren't using the StrictConrnsyarntoa it would never say "new from A" | ||
so the nextsame is rong | |||
masak | aye. | ||
tadzik: minor thing, but I saw github.com/tadzik/ClassX-StrictCon...ctor.pm#L6 and thought "hm, using the private forms in that string means that a subclass cannot polymorphically override typename and extras in that message" | 13:04 | ||
jnthn | FROGGS: Almost all the rest of the time is taken up in evaluating the test... | ||
masak | tadzik: usually, I use the ! forms in command methods and the . forms in query methods, for this reason... YMMV. | 13:05 | |
tadzik | masak: hm, I see | 13:06 | |
but speaking of this nextsame, I found a counter-example | |||
FROGGS | jnthn: looks like I need to profile my use-case and then come up with something sane :o) | ||
tadzik | m: class A { method new { say "new from A" } }; class B is A { }; B.new | ||
camelia | rakudo-moar dca172: OUTPUT«new from A» | ||
FROGGS | my brane is not very capable of doing this right now sadly | ||
tadzik | so adding a StrictConstructor to B should not change anything | ||
so A.new still should get called | |||
so nextsame is necessary after all | 13:07 | ||
jnthn | FROGGS: Well, looks like Junction.ACCEPT being slow is muchly to blame. | 13:08 | |
13:10
sqirrel_ joined
|
|||
FROGGS |