»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by masak on 12 May 2015.
00:06 spider-mario left 00:11 koo6 joined 00:20 hobbs left 00:27 hoelzro left 00:31 Peter_R left 00:33 aborazmeh joined, aborazmeh left, aborazmeh joined 00:51 hobbs joined 00:54 dayangkun joined 01:00 adu left 01:05 yqt left 01:18 aindilis` joined 01:20 dayangkun_ joined 01:22 kurahaupo joined, dayangkun left, DarthGandalf left, aindilis left, ShimmerFairy left 01:23 ShimmerFairy joined, DarthGandalf joined 01:33 adu joined 01:41 aborazmeh left 01:53 Sqirrel left 01:59 llfourn joined 02:04 llfourn left 02:14 llfourn joined 02:24 AlexDaniel left 02:27 davido_ left 02:28 davido_ joined 02:35 rmgk is now known as Guest9057, rmgk_ joined, Guest9057 left, rmgk_ is now known as rmgk, adu left 02:37 noganex joined 02:40 noganex_ left 02:43 ShimmerFairy left 02:48 hoelzro joined 02:49 SevenWolf left, SevenWolf joined 02:50 SevenWolf left 02:55 ShimmerFairy joined 03:05 sjn_phone left, sjn_phone joined
zostay m: my @h = Pair.new('a', 1); 03:07
camelia rakudo-moar c2a57e: OUTPUT«Too many positionals passed; expected 1 argument but got 3␤ in block <unit> at /tmp/mEMguar280:1␤␤»
zostay m: my @h = Pair.new(:key<a>, :value(1)); 03:08
camelia ( no output )
tadzik I wouldn't mind Pair.new to have a positional variant, frankly 03:09
03:11 [Sno] left
zostay m: enum Test <Zero One Two>; my @h = Zero => 0, One => 1, Two => 2; @h.perl.say; 03:11
camelia rakudo-moar c2a57e: OUTPUT«[:Zero(0), :One(1), :Two(2)]<>␤»
zostay m: enum Test <Zero One Two>; my @h = ::(Zero) => 0, ::(One) => 1, ::(Two) => 2; @h.perl.say; 03:12
camelia rakudo-moar c2a57e: OUTPUT«[Test::Zero => 0, Test::One => 1, Test::Two => 2]<>␤»
03:13 bin_005 joined 03:20 Sqirrel joined 03:21 cschwenz joined
atweiden m: enum Test <Zero One Two>; grammar T1 { token TOP { Zero } }; class TA { method TOP($/) { make ::(EVAL $/.Str); } }; my Str $content = "Zero"; my $actions = TA.new; if my $parsed = T1.parse($content, :$actions) { say $parsed.made.perl }; 03:25
camelia rakudo-moar c2a57e: OUTPUT«Test::Zero␤»
atweiden won't be needing this method i see: github.com/atweiden/nightscape/blo...pes.pm#L35 03:27
m: enum Test <Zero One Two>; grammar T1 { token TOP { Zero } }; class TA { method TOP($/) { make ::($/.Str); } }; my Str $content = "Zero"; my $actions = TA.new; if my $parsed = T1.parse($content, :$actions) { say $parsed.made.perl }; 03:28
camelia rakudo-moar c2a57e: OUTPUT«Test::Zero␤»
03:32 SevenWolf joined 03:33 koo6 left 03:48 bin_005 left 03:51 SevenWolf left 03:53 diegok left 03:56 diegok joined 04:01 diegok left 04:02 diegok joined, flussence left, flussence joined 04:07 davido_ left 04:18 kaare_ joined 04:33 lmc_1136 joined 04:34 lmc_1136 left 04:40 cschwenz left 04:41 amurf left 04:54 amurf joined 04:58 amurf left
masak morning, #perl6 05:10
05:13 meis joined, skids left
masak m: say sign(NaN) 05:18
camelia rakudo-moar c2a57e: OUTPUT«1␤»
masak ok, old Rakudo.
lizmat: I don't think the fix in d5d93adcc30 goes to the root of the problem.
the above would be NaN on a new Rakudo, but... 05:19
m: say NaN.sign
camelia rakudo-moar c2a57e: OUTPUT«1␤»
masak still a problem.
I think the fix should be applied in src/core/Real.pm, the method that sign() delegates to
also, 05:20
multi method sign(Real:U:) { Mu }
I don't see why this has a claim to being Mu. Int sounds more reasonable to me. (the type object for the type being returned) 05:21
or possibly Num, since NaN is also in the codomain.
moritz or maybe Real 05:34
which can be either Int or Num
masak aye.
Mu is problematic -- can't store it in a lexical, for example. 05:35
m: say (my $x).WHAT
camelia rakudo-moar c2a57e: OUTPUT«(Any)␤»
moritz m: my $x = Mu 05:36
camelia ( no output )
moritz it's passing to a function that's problematic
m: sub f($x) { }; f Real.sign
camelia rakudo-moar c2a57e: OUTPUT«Type check failed in binding $x; expected 'Any' but got 'Mu'␤ in sub f at /tmp/WZoCkleQYr:1␤ in block <unit> at /tmp/WZoCkleQYr:1␤␤»
masak oh, ok. 05:39
m: my Any $x = Mu 05:40
camelia rakudo-moar c2a57e: OUTPUT«Type check failed in assignment to '$x'; expected 'Any' but got 'Mu'␤ in block <unit> at /tmp/IWBnJ0JjXN:1␤␤»
masak oh, so Any isn't the implicit type constraint of a declared lexical, it's just the default value. got it.
05:41 jack_rabbit joined
moritz m: my $a = 0; my $b is default(++$a); say $b; $b = Nil; say $b 05:52
camelia rakudo-moar c2a57e: OUTPUT«1␤1␤»
05:52 diana_olhovik_ joined
dalek c: eca2f2d | moritz++ | lib/Language/variables.pod:
variables: Document "is default" trait
05:55
05:56 _mg_ joined 05:57 [Sno] joined, _mg_ left
masak m: my ($a, $b, $c) is default(42); say $b 05:58
camelia rakudo-moar c2a57e: OUTPUT«(Any)␤»
masak this feels like it's a rakudobug for either of two reasons.
(a) the default didn't apply, but it should 05:59
(b) you're not allowed to do that, but there's no error message
I kinda prefer (a), because it feels like it could be a useful thing to do sometimes -- to initialize several variables with the same default
but I confess to not knowing how tricky it'd be implementation-wise
one could argue that any trait in a declaration like that should just automatically distribute to all the declared variables 06:00
as if they'd been declared individually with `is default(42)`
06:03 jack_rabbit left 06:04 Akagi201 joined 06:13 RabidGravy joined, domidumont joined 06:17 oetiker left 06:18 domidumont left, oetiker joined
moritz +1 06:18
06:18 domidumont joined
El_Che w 06:19
masak submits rakudobug 06:20
06:20 FROGGS joined
masak m: my $b is default(42); say $b 06:21
camelia rakudo-moar c2a57e: OUTPUT«42␤»
FROGGS good morning 06:23
masak morning, FROGGS
06:40 atweiden left
moritz quick DB design straw poll: do you prefer natural keys or surrogate keys as primary key? 06:41
06:43 amurf joined
masak surrogate keys. 06:54
06:54 zakharyas joined
masak (because data changes, so the only thing that stays the same in all possible situations is something made-up.) 06:55
("but masak, things like countries or datetimes are stable enough to be used as natural keys!" -- "Czechoslovakia. leap seconds. all instances of adopting or getting rid of DST, ever." -- "oh.") 06:57
moritz: see also c2.com/cgi/wiki?AutoKeysVersusDomainKeys for lots of back-and-forth about this. 06:58
06:59 oetiker left
masak moritz: blog.plover.com/IT/GUID.html also supports my case. 07:00
07:00 oetiker joined 07:07 Ven joined 07:09 rba_ left 07:16 Ven_ joined, Ven left
Ven_ \o, #perl6 07:17
masak o/ 07:20
moritz masak: takk 07:24
masak: I also use surrogate keys 07:25
masak: one argument I don't see very often that referencing a table with a composite, natural key leads to a lot of data duplication 07:26
*is that
and makes the referencing tables brittle when the business rules for the referenced tables change 07:27
07:28 [Sno] left
moritz ah, the c2 page does mention it further down the page 07:29
07:31 [Sno] joined 07:33 amurf left
masak right. a surrogate key is comparable to an impartial "handle" with which you can refer to a particular table row. 07:33
moritz not to mention tooling support (I'm looking at you, Django) 07:34
masak Django automatically gives everything an id, no_ 07:40
?
07:41 espadrine left
dalek kudo/nom: 0a30724 | lizmat++ | src/core/ (2 files):
Fix sign NaN at the root, masak++
07:45
masak lizmat++
lizmat $ 6 'say NaN.sign; say sign NaN'
NaN
masak yay
lizmat .tell [Tux] $=finish now works 07:50
yoleaux lizmat: I'll pass your message to [Tux].
[Tux] lizmat++
yoleaux 07:50Z <lizmat> [Tux]: $=finish now works
lizmat m: my ($a, $b, $c) is argh(42) # masak, agree we need some kind of error here, right ? 07:52
camelia ( no output )
07:53 jaffa4 joined
jaffa4 hi all 07:53
I am testing the speed of n body implemented in perl 6 07:54
It is very slow. Could someone look at the code if there is a mistake in it?
07:54 domidumont left
masak jaffa4: sure thing! maybe provide it as a gist or something? 07:57
07:58 domidumont joined
jaffa4 gist? 07:58
masak lizmat: "need some kind of error" because there's no `argh` trait?
jaffa4: gist.github.com/
lizmat yes
masak lizmat: agreed.
m: my $a is argh(42) 07:59
camelia rakudo-moar c2a57e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/fPt9WzHilk␤Can't use unknown trait 'is argh' in a variable declaration.␤at /tmp/fPt9WzHilk:1␤------> 3my $a is argh(42)7⏏5<EOL>␤ expecting any of:␤ TypeObject␤ default␤ …»
masak lizmat: like that, basic'ly.
lizmat yup
but apparently it's a parsing issue, as the it never winds up in a trait mod, not if in an Any:D trait mod
masak in general, I'd expect `my ($a, $b, $c) is x($y);` to work exactly like `my $a is x($y); my $b is x($y); my $c is x($y);` -- no matter what x and $y are. 08:00
lizmat yeah... but like I said, looks like a parsing / action issue atm
jaffa4 gist.github.com/jaffa4/27bc61e573f086feafed
FROGGS lizmat: action issue
lizmat FROGGS o/ 08:01
jaffa4 perl6-m.bat nbodies.p6 50000000
lizmat FROGGS: any idea where ?
FROGGS lizmat: I'm looking for the right spot currently
masak jaffa4: you have data duplication between $NBODIES and @bodies. that's not a reason for your slowdown, but it's kinda weird in Perl 6. 08:02
jaffa4: maybe because you converted from an ancient language, like FORTRAN or C?
(where one needs to pass on the length of an array along with the array)
FROGGS lizmat: are you sad if I attempt a fix? 08:03
lizmat no, please do :-)
jaffa4 masak: yes, no reason
masak did you mean "no good reason"? :P
lizmat I'm just trying to do small things until I have a few days of consecutive quality time
jaffa4 no reson for slowdown
yes, it is translation from c 08:04
masak well, you can simplify that bit if you want.
the rest looks fairly straightforward. no big mistakes that might be the cause of the slowdown.
jaffa4 it is very slow
dalek Heuristic branch merge: pushed 20 commits to rakudo/newio by lizmat 08:05
jaffa4 that is the state of Moar jit then
masak could be that this is the kind of thing that's amenable to vector calculation, or parallel calculations...
FROGGS $ perl6-m -e 'my ($a, $b, $c) is argh(42)'
===SORRY!=== Error while compiling -e
Can't use unknown trait 'is argh' in a variable declaration.
$ perl6-m -e 'my ($a, $b, $c) is default(42); say "$a $b $c"'
42 42 42
masak \o/ 08:06
FROGGS masak: wait for the fix :D
dalek Heuristic branch merge: pushed 31 commits to roast/newio by lizmat 08:07
08:07 Ven_ left
dalek kudo/nom: 45068ba | FROGGS++ | src/Perl6/Actions.nqp:
handly traits when declaring vars in a list
08:07
lizmat wow!
FROGGS++
masak FROGGS++ 08:08
FROGGS I love single line patches :o)
lizmat although not a single line patch, I loved the low number of patches needed to get $=finish to work 08:09
FROGGS aye 08:10
that proves a good design IMO
lizmat yup
FROGGS and that is one thing that makes hacking on perl6 fun
lizmat agree 08:11
FROGGS and I am very proud that I was able to apply an almost equally good design to an application at work
I would not have been able to do that without what I have learned here 08:12
moritz same here
FROGGS I mean, I never studied CS or anything else...
08:13 darutoko joined 08:19 rba_ joined 08:23 _mg_ joined
dalek kudo/nom: ad21e90 | lizmat++ | src/Perl6/World.nqp:
Stub "use internals" for internal helper subs
08:27
lizmat afk for a few hours& 08:29
08:31 domidumont left, domidumont joined, espadrine joined
DrForr ===SORRY!=== 08:35
Could not find ANTLR4::Actions::Perl6 in any of: file#lib:../json/lib
Doesn't seem that PERL6LIB allows setting multiple paths? 08:36
08:36 llfourn left 08:37 bin_005 joined
FROGGS DrForr: what delimiter do you use? 08:38
m: say $*DISTRO.cur-sep 08:39
camelia rakudo-moar c2a57e: OUTPUT«,␤»
08:40 _mg_ left 08:42 Ulti left
DrForr Well, I was using the (reasonably traditional) ':'. 08:42
08:42 Ulti joined 08:45 jaffa4 left
DrForr PERL6LIB=lib:../json/lib bin/antlr2perl6 foo.g4 # Here's the CLI. 08:46
I can invoke it as perl6 -Ilib -I../json/lib bin/antlr2perl6 # of course, but it'd be nice to be able to just run the app. 08:48
08:52 andreoss joined
RabidGravy m: IO::Socket::INET.new(host => "127.0.0.1:80") 08:55
camelia rakudo-moar c2a57e: OUTPUT«IO::Socket::INET is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting:1␤ in method new at src/RESTRICTED.setting:32␤ in block <unit> at /tmp/50mde9ZMy8:1␤␤»
RabidGravy boo
08:55 larion joined
RabidGravy anyway, just going to send a PR to fix "Type check failed in assignment to '$!port'; expected 'Int' but got 'Str' 08:56
in block <unit> at -e:1" when you do that
FROGGS RabidGravy++
08:57 cschwenz joined, cschwenz left 09:00 chenryn joined 09:02 telex left
jnthn morning, #perl6 09:03
09:04 telex joined
arnsholt FROGGS: If it's any consolation, good development methodology and architecture is not always a very large part of CS curricula 09:05
Also, it feels to me like they're very much practical skills. It's hard to see the wisdom of some things before you've felt the pain of doing it wrong 09:06
FROGGS arnsholt: yes, and I do not regret getting my hands dirty with about age 16 09:07
I had enough of schools and wanted to do something "sensible" 09:08
but sometimes I lack knowledge, and it feels sometimes hard to learn (or even just understand) concept that were teached in CS classes 09:09
taught*
arnsholt Yeah, it's a hard balance to strike
FROGGS morning jnthn
arnsholt I sometimes have the inverse feeling. I have lots and lots of theory, but it's often hard to see where it's relevant (or how to apply it) 09:10
RabidGravy github.com/rakudo/rakudo/pull/435 if anyone feels that specifying host:port is sufficiently useful to need to work ;-)
dalek kudo/nom: b9ab2c2 | RabidGravy++ | src/core/IO/Socket/INET.pm:
Make port an Int if extracted from host:port in host
kudo/nom: fbd86b4 | FROGGS++ | src/core/IO/Socket/INET.pm:
Merge pull request #435 from jonathanstowe/nom

Make port an Int if extracted from host:port in host
RabidGravy :)
FROGGS jnthn: so you are living in Praha now, right? 09:11
09:11 bin_005 left, bin_005 joined 09:12 gagalicious left
FROGGS jnthn: because it is quite possible that I'll be there around august for a week, with wife and kids 09:13
masak waves... from A TRAIN o
FROGGS masak: *g* 09:14
o/
fffrrroomm aa ttrn 09:15
09:15 sjn_phone left
FROGGS ohh, that wasnt even right I think 09:15
masak FROGGS: I'm in the same boat as you are wrt uni education. I took a lot of bioinformatics, but ended up wishing I could've studied a lot more of the "informatics" part.
jnthn FROGGS: Yes, right. :) 09:16
FROGGS: I'll be around in August when I'm not at YAPC::Asia and Swiss Perl workshop :)
FROGGS jnthn: awesome :o)
09:17 amurf joined
masak oh, and... I have a Perl 6 day today! 09:17
my goal is to blog, but I won't say what about ;)
jnthn Macros!
FROGGS masak: I became an electronics engineer after school (with 16), and quite enjoyed it 09:18
I always wanted to fix things I guess
jnthn: now you spoiled it!
El_Che jnthn: happy marrying etc!
09:20 zeleiadi joined
masak jnthn: nope :) 09:21
(though it's a decent guess)
09:22 amurf left
jnthn El_Che: Thanks :) 09:22
09:22 Ven joined
masak FROGGS: is "with 16" (intead of "at 16") a Germanism? I'm intrigued. 09:22
09:22 larion left
FROGGS masak: ohh, indeed 09:23
masak "mit sechzehn [Jahre]"? 09:26
FROGGS mit sechzehn Jahren
masak ah, yes. 09:27
but still, in German you *are* your age ("ich bin") instead of *having* your age ("ich habe"), right?
FROGGS correct
nwc10 masak: is this train moving in an appropriate direction? 09:28
masak nwc10: well, it is moving away from you... :P 09:34
(north)
masak .oO( "masak, this kind of senseless meanness is not becoming of #perl6!" ) 09:35
nwc10 you're running away from the heat? 09:38
masak I'm going up to my old university town (Uppsala) to be a part of the doctoral defense of a good friend. 09:39
basically, I started at Edument; he stuck around and did a PhD.
09:40 Sqirrel left, domidumont left
nwc10 if anything, it seems to be warmer there: www.bbc.co.uk/weather/2666199 www.bbc.co.uk/weather/2692969 09:40
09:41 domidumont joined 09:47 brrt joined
_itz can anyone recommend a good LISP intro and system for a beginner to play with? 09:47
brrt .tell lizmat that i now know why we haven't implemented isatty yet :-P
yoleaux brrt: I'll pass your message to lizmat.
brrt _itz: why not SICP
has a book, video lectures on the internets 09:48
helped me a lot
masak +1 for SICP
brrt ocw.mit.edu/courses/electrical-engi...-lectures/ <- this taught me a lot
_itz thanks I'll take a look
masak this version is very nicely formatted: sicpebook.wordpress.com/ebook/ 09:49
09:52 mr-foobar left 09:53 larion joined 09:54 jab joined
jab Where can I find the syntax for the enum statement? 09:55
DrForr s/// seems to throw an excption when run on class 'Any' rather than silently do nothing. I assume this is by design? 09:56
jab it is 09:57
masak exception is what I would expect, yes.
jab: described in S12, at least.
S12:Enumerations 09:58
synbot6 Link: design.perl6.org/S12.html#Enumerations
jab thanks
masak dunno if docs.perl6.org has something. if not, it probably should. 09:59
cursory search yields nothing.
09:59 dayangkun_ left
jab Yeah it's hard to find enum info 09:59
masak files issue
09:59 bin_005 left 10:00 bin_005_i joined
_itz rosettacode.org/wiki/Enumerations#Perl_6 10:00
masak github.com/perl6/doc/issues/87 10:01
DrForr While I can guess why that's now disallowed it means 'if $content' needs to be added... 10:02
Ven never read SICP 10:03
I should someday.
10:03 bin_005_i_q joined 10:04 bin_005_i left
jab Is there anything perl6 implementations that use JVM? 10:06
10:08 zeleiadi left
DrForr Yep, it's even mentioned on the rakudo homepage. 10:09
10:09 rindolf joined
brrt the rakudo compiler has a JVM backend 10:10
jab Can you combine perl and java code?
brrt i'm not terribly sure how that works, but i believe there has been some work on java/rakudo interop 10:12
10:13 mr-foobar joined 10:14 llfourn joined 10:24 llfourn_ joined, Akagi201 left 10:26 llfourn left
timotimo o/ 10:26
oh, jaffa4 isn't around any more
lizmat brrt: do tell :-) 10:27
yoleaux 09:47Z <brrt> lizmat: that i now know why we haven't implemented isatty yet :-P
timotimo .tell jaffa4 i found it a bit strange that you were using hashes for the bodies in your nbodies translation 10:28
yoleaux timotimo: I'll pass your message to jaffa4.
brrt long story short: we use libuv. libuv exposes two conflicting notions of the idea 'file stream'. One is the simple synchronous uv_file (always an int, always a file descriptor) and one is the uv_handle (a multiplexed magic wrapper for sockets, pipes, file streams, ttys, etc)
to determine if something is a tty, one uses the standard posix isatty() call on a posix file handle
uv_file behaves in all respects like a posix file handle 10:29
timotimo well, uv has this magical "guess handle type" function
we even use that in one spot to get the right type to build the stdin stream with
brrt uv_handle can resolve, if desired, to a posix file handle (now called a uv_os_fd_t), *if* you are on a unix system
10:30 Ven left
brrt on windows uv_handle resolves to a HANDLE, which is defined as an opaque void pointer, which may - depending on context - actually be an integer or may actually be a pointer, whatever the OS likes best 10:31
lizmat brrt: fwiw, isatty should only return true on the handle that has the default STDOUT / STDERR stream
brrt yes timotimo, and that function accepts an uv_file (i.e. an int)
why?
lizmat in all other cases it should return false
timotimo hm, oh.
lizmat in my "world" :-)
10:31 chenryn left
brrt if i do "/dev/tty1/".IO.open.t that should be 'yes' 10:31
lizmat what you want to know, is whether there is potentially a person that with which you can interact 10:32
timotimo and if i do echo "hello" | perl6 -e ... it should be 'no' for stdin and if i do perl6 -e '...' > foobar, it should be 'no' for stdout
brrt exactly :-)
timotimo in my world that's exactly what "isatty" is for ... also i think you can't use tty-like stuff on such handles
using ansi escapes for colors for example, or placing the cursor "on the screen" 10:33
brrt that restricts isatty to syncfile structures
which, i suppose, is fair enough 10:35
and that means we'll only support getting a file descriptor on syncfiles
which i also suppose is reasonable
timotimo the profiler gets very upset with the nbodies program 10:39
exit, THE_END and <unit> all share 33.33% of the time (18446744073709.51ms each) and everything else has almost 0ms 10:40
brrt lunch &
10:40 brrt left
lizmat timotimo: is the program exiting all the time ? 10:42
lizmat is confused
m: THE_END # :-)
camelia ( no output )
masak hm, we might want to hide that symbol from public use... 10:45
10:45 yqt joined 10:46 dakkar joined, bin_005_i_q left
timotimo lizmat: no, it only exits once, but it spends almost all of its time in that 10:47
lizmat masak: working on that
timotimo: are there many phasers ? 10:48
END phasers I mean
timotimo no
but it ends in "exit(0)"
so maybe that confuses it?
lizmat sub exit($status = 0) 10:49
so, hardly any confusion possible
timotimo no, i mean ... just exiting at all 10:50
10:52 yakudza joined
masak m: sub foo($x = exit) { say $x }; foo "OH HAI"; foo; foo "Elvis has left the building" 10:53
camelia rakudo-moar c2a57e: OUTPUT«OH HAI␤»
timotimo i managed to reduce the number of BOOTCode allocations from 8060610 to 3860605, but at the same time, i got the number of Num allocations up from 7100430 to 6300430
oh, wait
m: say 6300430 / 7100430
camelia rakudo-moar c2a57e: OUTPUT«0.8873308␤»
timotimo that's not more
10:54 jab left
timotimo and the number of GCs from 275 to 217 10:56
m: say "METAOP_ASSIGN takes { 583.85 / 1500000 }ms per call" 10:58
camelia rakudo-moar c2a57e: OUTPUT«METAOP_ASSIGN takes 0.000389233ms per call␤»
10:58 xinming left
dalek kudo/nom: 47f91b0 | lizmat++ | src/core/control.pm:
Use a more elegant once block for the end
10:58
timotimo well, that lets it end up in 4th place
10:59 xinming joined
timotimo oh! 10:59
second place is the anonymous sub that implements METAOP_ASSIGN and that's in second place with 12%
so actually METAOP_ASSIGN ends up taking about 16.5% of the program's time 11:00
FROGGS timotimo: what's the program ooc? 11:02
timotimo i was taking jaffa4's nbody.p6 and turning the hashes into classes
lizmat looking at the METAOP subs, I wonder if it would be worthwhile to factor out the $triangle business in a separate candidate 11:03
timotimo postcircumfix:<{ }> used to be in second place at 10.3% and AT_KEY in 4th place (just above METAOP_ASSIGN) with 7.9%
timotimo has the brilliant idea to use native num instead of Real 11:05
5.37user 0.02system 0:05.40elapsed 99%CPU (0avgtext+0avgdata 77424maxresident)k 11:07
oh!7.80user 0.02system 0:07.83elapsed 99%CPU (0avgtext+0avgdata 96824maxresident)k
(without "oh!")
that's the improvement i got so far
oh holy wow. with the "better" version with native nums, the amount of spesh'd vs jitted frames is *much* worse, and there's a whole lot more allocations and GCs, but it's still faster 11:10
what the ... find_method gets invoked? 11:12
FROGGS hmmm, sounds like you get quite some insights currently :o) 11:13
timotimo well, the not jitting is possibly because of NumAttrRef and related ops, maybe those aren't implemented yet; the jit log will tell me in a second.
BAIL: op <getattrsref_n> 11:15
should be easy enough.
FROGGS that's what I was hoping for :o)
11:17 chenryn joined 11:20 noganex left, adu joined 11:26 Rotwang joined
Rotwang hi 11:26
11:27 noganex joined 11:36 Ven joined 11:41 _mg_ joined
Ven can anyone confirm a bug I'm seeing in the REPL (os x)? 11:45
if I just `$ perl6` then up arrow + enter, it segfaults
lizmat $ perl6 11:46
> ^[[A
===SORRY!=== Error while compiling <unknown file>
Bogus statement
at <unknown file>:1
Ven weird, I recompiled everything an hour ago :|
Ven re-pulls
lizmat fwiw, I don't have readline or linenoise or anything like that installed 11:47
Ven ah, that might be it
seems like I was just missing a panda rebootstrap 11:51
dalek kudo/nom: d4dcca7 | lizmat++ | src/core/metaops.pm:
MMDize METAOP_REDUCE_xxx subs

The short-term win is about 4% in each call without :triangle. The longer term win is that we can now easily add optimized candidates for e.g. [+].
Ven lizmat: :triangle is [\+]? 11:54
lizmat I think so 11:55
Ven which makes me realize there's no syntax for named "matching". what I mean is that this works:
m: multi foo(True){1}; multi foo($){0}; say foo(True);
camelia rakudo-moar c2a57e: OUTPUT«1␤»
Ven but this doesn't:
m: multi foo(:val(True)){1}; multi foo(:val($)){0}; say foo(:val); 11:56
camelia rakudo-moar c2a57e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/YUBqhZKO4e␤Malformed parameter␤at /tmp/YUBqhZKO4e:1␤------> 3multi foo(:val(7⏏5True)){1}; multi foo(:val($)){0}; say fo␤ expecting any of:␤ formal parameter␤»
lizmat Ven: yes, named params are only for breaking ties between candidates 11:57
FROGGS std: multi foo(:val(True)){1}; multi foo(:val($)){0}; say foo(:val);
camelia std 28329a7: OUTPUT«5===SORRY!5===␤Malformed parameter at /tmp/upMZicrion line 1:␤------> 3multi foo(:val(7⏏5True)){1}; multi foo(:val($)){0}; say fo␤ expecting any of:␤ named_param_term␤ new name to be defined␤ parameter␤ routine_def␤ signature␤Parse …»
FROGGS Ven: I like that syntax fwiw
Ven lizmat: I know it is
I'm just making a parallel between named and positional params :)
FROGGS: nice :)
FROGGS Ven: and it fits the concept of what we do with pairs usually 11:58
though one could argue that the value of that pair is not a matcher but the default value
Ven we have a syntax for default values already, though 12:00
grondilu m: say [+] rand xx 3 12:05
camelia rakudo-moar c2a57e: OUTPUT«1.54526622351538␤»
12:05 Ven left
grondilu locally I get a 'can not call infix:<+>' 12:05
grondilu pulls rakudo and recompiles 12:06
lizmat $ 6 'say [+] rand xx 3' 12:07
1.58108774004982
Looks like my MMDing of METAOPs is doing bad things on the JVM :-(
12:10 stanrifkin joined
lizmat dilemma: do I just revert, or do I re-instate the old code for the JVM and the new code for Moar ? 12:14
jnthn: ^^^ opinions ?