Zoffix m: class Foo { method ACCEPTS ($what) { say "Got `$what`" } }; "foo" ~~ Foo 00:53
camelia rakudo-moar 373634: OUTPUT«Got `foo`␤»
Zoffix m: role Foo { method ACCEPTS ($what) { say "Got `$what`" } }; "foo" ~~ Foo
camelia ( no output )
Zoffix :(
japhb role Foo { method ACCEPTS ($what) { say "Got `$what`" } }; "foo" ~~ Foo.new 00:56
m: role Foo { method ACCEPTS ($what) { say "Got `$what`" } }; "foo" ~~ Foo.new
camelia rakudo-moar 373634: OUTPUT«Got `foo`␤» 00:57
timotimo hey japhb
how are you? :)
japhb m: role Foo { method ACCEPTS ($what) { say "Got `$what`" } }; "foo" ~~ class :: does Foo
camelia rakudo-moar 373634: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Unable to parse class definition␤at <tmp>:1␤------> `$what`" } }; "foo" ~~ class :: does Foo⏏<EOL>␤»
japhb m: role Foo { method ACCEPTS ($what) { say "Got `$what`" } }; "foo" ~~ class :: does Foo {}
camelia rakudo-moar 373634: OUTPUT«Got `foo`␤»
japhb Zoffix: You need to get it into a class, either composing it or punning it
timotimo: Not too bad. You?
timotimo okay-ish 00:58
far from productive these days
but did you notice how rakudo's builtins have become significantly faster? 00:59
japhb Oh, I've been watching lizmat++'s commit stream happily.
timotimo oh yes, very yes 01:00
japhb Need raw speed though, not just builtin speed.
timotimo yes :(
parallelization speed is also still an issue because invoking something hits our shared (i.e. locked) allocator twice. once for lexical environment, once for locals 01:01
and then when a frame returns, we hit the allocator again for freeing one or two of those
japhb :-(
timotimo so sometimes tiny things don't get inlined and just trash performance by keeping that lock occupied all the time 01:02
japhb ugh.
timotimo "oh you want to add these two numbers? ok! that'll be 1/100 msec per call"
"oh yeah and 70% of that is allocating/deallocating" 01:03
japhb :-(
timotimo things do improve, though 01:04
do you have anything like a "macro-benchmark" for raw-speed-y things?
the kind of thing you need to have fast?
jnthn has been running a daily moarvm benchmark as you might know, but we really ought to give a day-by-day comparison; i don't think the data stayed around, though 01:05
so not entirely sure how to make that work :)
japhb Too bad he's not keeping the benchmark data, because perl6-bench can certainly pivot to showing historical change 01:07
I tried to convince people to take their benchmarks and add them to the perl6-bench suite, but ... that has been less than successful, and I don't have the cycles to do it myself. :-( 01:08
Zoffix Failed to create directory '/var/www/tmp/IRC-Client/lib/.precomp' with mode '0o777': Failed to mkdir: 13 01:11
timotimo mhm
oh gosh, 13?!?
that's bad!
Zoffix I really wish we didn't create .precomp dirs all over the place.
Well, in this case, I'm assuming it's cause I don't have /var/www/tmp/..blah blah. It's just part of my `lib` because I do have it on another box. 01:12
And I wish it just ignored it instead of dying...
I'd be creating .precomp in $*TMPDIR 01:16
if it were my personal project. I see no reason of spamming .precomp into any dir we get a chance to get our hands on
timotimo :\
Zoffix Or some dir inside the perl6 install
timotimo i wonder if that'd just work; having a .precomp for everything, and having the hashes not collide when two different repo-chains have something similar 01:18
it might be easy to make that work by providing your own CompUnitRepo
one that only handles precomp saving
Zoffix Nice.
timotimo might 01:19
Zoffix I've been hating .precomp directory since the first day I had to add it to .gitignore and I think the above error just drew the final straw.
Zoffix sets .precomp on fire
ShimmerFairy I'd recommend a special setup like ~/.perl6/.precompdirs/ or something, where there are directories with names depending on the absolute path it belongs to in some fashion 01:20
e.g. ~/.perl6/.precompdirs/home-projects-foobar-lib/ is equivalent to a .precomp in the lib/ directory (though not quite like that, of course) 01:21
Zoffix The one problem I see with storing .precomp in P6 dir instead of $*TMPDIR is it'll gradually fill up and at the end you won't even know which ones you still use and which aren't used 01:22
ShimmerFairy Zoffix: ah, true. I just picked ~/.perl6 since I think of that as the "main directory" for Perl 6's module installation and stuff :) 01:23
also fun fact, we don't get 64 bits of fractional precision on square roots, at least 01:26
timotimo :o
ShimmerFairy m: say ((sqrt(3) * 2**64).floor % 2**64).base(16) # should be 0xBB67AE8584CAA73B, according to SHA-512
camelia rakudo-moar 373634: OUTPUT«BB67AE8584CAA000␤»
timotimo damn 01:27
ShimmerFairy m: say ((sqrt(5) * 2**64).floor % 2**64).base(16) # and this 0x3C6EF372FE94F82B 01:29
camelia rakudo-moar 373634: OUTPUT«3C6EF372FE950000␤»
ShimmerFairy timotimo: it looks to me like there might be a 64-bit limit including the non-fractional part. I just don't know how to calculate the square root of primes without sacrificing bits to the integral part :P 01:30
timotimo i haven't a clue
ShimmerFairy I can't seem to squeeze out a few more digits via something like sqrt(5/256), not sure if I should expect that to work in the first place though. 01:38
Zoffix travis-ci.org/rakudo/rakudo/builds/148589867 01:41
buggable Zoffix, One build failed due to timeout.
Zoffix Neat. eh
ShimmerFairy I wonder if at some point Perl 6 would want multi-precision floating-point numbers, like it currently has bigints. 01:46
timotimo fantastic, Zoffix 01:49
well, yeah, we need a bit of internals rework to make bigger-than-64bit-things work 01:50
but then we can have 96 bit floats
Zoffix I retract my $*TMPDIR .precomp thoughts. It'd be cleaned on every restart and make precomp useless in many instances.
ShimmerFairy timotimo: I'd personally love if we had mpfr in moar or similar (assuming libtommath doesn't already have mp floats waiting to be used). 01:55
...Actually, does the spec ever say if Num is meant to be the floating point version of Int? 01:56
timotimo um, i'm not sure 01:57
ShimmerFairy (it possibly should IMO, since the likes of num can cover limited floating point) 01:58
timotimo that's not what the difference is 01:59
the difference is between having a box that you can add roles to and such, and having just a register or something
ShimmerFairy timotimo: true, but we don't have e.g. Int64 do we? So for the land of integers, that's at least one difference. 02:00
timotimo well, of course, Int is always big
ShimmerFairy My one concern is how an mp float (let's call it FatNum for clarity) can be limited in precision; that is, how do I tell sqrt(FatNum.new(2)) to stop at 128 fractional bits? 02:03
timotimo oh, well, that's difficult :) 02:04
ShimmerFairy maybe FatNum[128] for "128 bits mantissa" or something?
timotimo my laptop seems to have stopped charging from the plugged in AC ... 02:05
this is kind of bad
i'll end up having to get the repair earlier than i thought i would
ShimmerFairy :( 02:06
timotimo but repair will still be free 02:25
and on-site
so that's nice
i'll let my laptop sleep 02:32
Zoffix Wow neat. Dude jumped from a plane without a parachute and landed into a net: www.facebook.com/topic/Heaven-Sent...0391206050 02:44
But the neat part is that that video is 360... You can click-and-drag in it to rotate the view and look around. That's really neat. 02:45
gfldex m: say Q ⸨ oi! ⸩ 02:59
camelia rakudo-moar 373634: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Couldn't find terminator ⸨ (corresponding ⸨ was at line 1)␤at <tmp>:1␤------> say Q ⸨ oi! ⸩⏏<EOL>␤ expecting any of:␤ ⸨␤»
gfldex should that work?
ShimmerFairy m: say "⸨".uniprop 03:00
camelia rakudo-moar 373634: OUTPUT«Ps␤»
ShimmerFairy m: say "⸩".uniprop
camelia rakudo-moar 373634: OUTPUT«Pe␤»
ShimmerFairy m: say Q⸨ oi!⸩ 03:01
camelia rakudo-moar 373634: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Couldn't find terminator ⸨ (corresponding ⸨ was at line 1)␤at <tmp>:1␤------> say Q⸨ oi!⸩⏏<EOL>␤ expecting any of:␤ ⸨␤»
ShimmerFairy gfldex: Seems to me like it should.
timotimo i think we have a big string somewhere that has all openers and their respective closers or something?
geekosaur the problem iirc is that while unicode tells you the start vs. end, it doesn't tell you which go with which
so the list is hardcoded and needs to be managed manually 03:02
timotimo comes goes with snowman
it might be that what i'm thinking of is what powers magical succ, though
gfldex m: say Q ⁅ oi! ⁆ 03:03
camelia rakudo-moar 373634: OUTPUT« oi! ␤»
ShimmerFairy we need to petition Unicode for new properties! .oO(Matching_Close_Bracket and Matching_Open_Bracket?) 03:04
gfldex m: say 2 ⁽²⁺³⁾
camelia rakudo-moar 373634: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> say 2⏏ ⁽²⁺³⁾␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ statement end␤ statement modifier␤ …»
ShimmerFairy I don't think you should quite expect a superscript EXPR from standard P6 :P 03:05
Zoffix Why not? 03:07
m: say 2 *²²⁺³
camelia rakudo-moar 373634: OUTPUT«128␤»
Zoffix :trollface:
m: say 2²⁺³ 03:12
camelia rakudo-moar 373634: OUTPUT«64␤»
Zoffix m: say 2²⁺² # even a correct result :) 03:17
camelia rakudo-moar 373634: OUTPUT«16␤»
gfldex .tell TimToady should this work? m: say 2 ⁽²⁺³⁾ 03:21
yoleaux2 gfldex: I'll pass your message to TimToady.
gfldex m: say "⸨".uniname 03:22
camelia rakudo-moar 373634: OUTPUT«LEFT DOUBLE PARENTHESIS␤»
Zoffix There's little point in making 2⁽²⁺³⁾ work in core. You'd need an entire superscript EXPR to make it useful and I don't see neither superscript multiplcation, nor division, nor sigils. 04:00
m: my \ˣ = 42; my \ʰ = 72; my &infix:<⁺> = &infix:<+>; say ˣ⁺ʰ 04:01
camelia rakudo-moar 373634: OUTPUT«114␤»
ShimmerFairy Zoffix: just like I said :P 04:56
AlexDaniel #125756 #128594 ← this is pretty sad… 07:28
yoleaux2 30 Jul 2016 14:42Z <Zoffix> AlexDaniel: is is possible to make committable/bisectable join #zofbot? I don't wanna spam #perl6-dev
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=125756
Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128594
nine Zoffix: we should create the whole /var/www/tmp/.../.precomp path. The error must have a different reason. Maybe a permission problem? 08:29
AlexDaniel m: my @foo; say @foo.end 08:58
camelia rakudo-moar 373634: OUTPUT«-1␤»
AlexDaniel Zoffix: In IRC::Client, what happens if you return a string with a newline? 09:07
Zoffix: well, nothing good for sure 09:08
dalek kudo/nom: 6972d50 | lizmat++ | src/core/Any-iterable-methods.pm:
We don't need special Failure check here

Assigning a Failure will throw it anyways
09:28
lizmat japhb: the reason for me to not add any more benchmarks atm, is that it will make a page like www.moarvm.org/measurements/perl6-b...07-31.html progressively heavier and more unusable 09:29
to make this more useful, we would need a way to select one or more benchmarks over a period and show that 09:30
or is that already possible? 09:31
actually, looking at www.moarvm.org/measurements/perl6-bench/ , that's a nice benchmark in an of itself 09:36
assuming that the cronjob has started on the same time since Feb 29, 09:37
the final arrival of the benchmark has gone back from 5am to 4:44am, aka a 16 minute gain
I have no idea when it starts, so I have no idea of the relative gain there 09:38
on 23 July it went from 4:49 to 4:43, not sure what commit was responsible for that 09:40
on 30 July we lost 2 mins again: I wonder if that's the wanted work by TimToady or the MoarVM async improvements 09:42
travis-ci Rakudo build passed. Elizabeth Mattijsen 'We don't need special Failure check here 10:23
travis-ci.org/rakudo/rakudo/builds/148644879 github.com/rakudo/rakudo/compare/3...72d50b08e6
mst if larry's optimising things, be very afraid 10:29
I've seen the results in perl5 of him doing that
it is both glorious and CANNOT UNSEE
lizmat mst: TimToady wasn't optimising, he was making sink warnings better 10:30
mst reduces the alert level from 'gibbering under the table' to 'twitching slightly and eyeing the exits' 10:31
jnthn lizmat: Within the last week or so the VM that those run on was migrated from Xen to KVM and gained an extra 4GB of RAM, which probably caused the big across-the-board drop. 10:52
lizmat aha, ok *phew*
jnthn I suspect the WANTED stuff is really costly, btw. Its using annotations on every single node, while they are a mechanism designed for *occasional* annotations. :S
So it's an extra hash every node 10:53
lizmat yeah, looked like we gained a few MB's when building the setting
jnthn Yup
Too much hash is bad.
lizmat :-)
jnthn Will have to see if we can store that stuff in a better way :) 10:54
lizmat sure, if you can give me a recipe, I can do the grunt work
jnthn I'd need to understand what it's doing a bit better to come up with a recipe :)
timotimo TT already mentioned it'd be enough to have a little bitmask in nodes to store that wanted stuff 10:55
jnthn Ah, OK
timotimo i ought to find that in the irclog, gimme a sec
jnthn Could just stick an int $!flags in the QAST::Node base I guess...
timotimo right now i'm fiddling with the explosion when using :merge with proc spawning
jnthn Ah, nice. 10:56
timotimo seems to be that libuv gets extremely unhappy when the same thing is put into an event loop twice
jnthn I plan to continue with concurrency/async problem hunting in the next week...
Including figuring out why my branch that gets rid of a deadlock also oddly breaks Supply.throttle.
timotimo irclog.perlgeek.de/perl6-dev/2016-0...i_12939399 10:58
i fixed the explosion, yay 11:13
i decided to put in a new flag to signify that out and err are the same thing
that's probably better than checking if they had the same object assigned
FROGGS timotimo++ 11:17
I'm eager to see the patch
jnthn cookin' brunch & 11:18
dalek p: 1c340e1 | timotimo++ | / (3 files):
get a moarvm with PIPE_MERGED_OUT_ERR flag support
timotimo FROGGS: pretty trivial patch, actually 11:19
i think i'll wait for travis to see if jvm is happy with that patch, too
since i did nothing except add the flag ...
FROGGS ohh, setting the stdio_count to two does the trick? 11:21
timotimo oh, huh, travis only builds nqp with moar?
yes, but i'm also not calling setup_stdio in that case
it could still be wrong to have stdio be 2
i need to test it with a program that outputs to both stderr and stdin to see that, gimme a sec 11:22
FROGGS I was looking in their tests and documentation and even asked in their irc channel but got no answer in how to combine stderr and stdout
timotimo right, my fix was wrong :) 11:23
so now with :merge you get only stdout :( 11:24
ShimmerFairy jnthn: backlogging just a touch, would WANTED, erm, want to be some kind of attribute like $.node on QAST objects?
timotimo yeah, kind of like that, ShimmerFairy 11:25
ShimmerFairy First thing that came to mind in terms of something that gets attached to every QAST object :)
timotimo yeah
"has int $.wanted" or something 11:26
lizmat well, seems a bit of a waste to spend a whole int on a boolean
timotimo then it'd be $.flags 11:27
lizmat irclog.perlgeek.de/perl6-dev/2016-0...i_12939399 # TimToady pointing to a bitmap
timotimo i'm not sure if we can put more stuff into the flags there
ShimmerFairy timotimo: that's a job for "these next 63 bits reserved for future use" :P
timotimo yup
lizmat I think some type of optimisation info could live there, no ? 11:30
timotimo sure 11:31
my next idea is that we have to not set "UV_CREATE_PIPE" for the stderr in case we merge the two 11:32
but still call setup_stdio for the third one
*sigh* 11:57
why did i even think it'd be easy? it never is.
lizmat so, which one would be faster: list.min or list.min(&infix:<cmp>)
m: my @a = ^1000; for ^1000 { @a.min(&infix:<cmp>) }; say now - INIT now
camelia rakudo-moar 6972d5: OUTPUT«0.743613␤»
lizmat m: my @a = ^1000; for ^1000 { @a.min }; say now - INIT now 11:58
camelia rakudo-moar 6972d5: OUTPUT«0.9607976␤»
timotimo is that just camelia being noisy?
or ... is it just that strange?
lizmat nope
timotimo :o
lizmat the candidate with (&infix<cmp>) gets almost immediately Jitted and OSR's
'd
whereas the candidate without parameters only gets JITTED about 800 iterations in 11:59
timotimo o_O
that's really interesting
lizmat also: the &infix<cmp> gets JITTED in the parameter case, but not in the parameterless case 12:00
did we have a way to generate a profile using camelia or another bot?
timotimo yeah, prof-m i think 12:01
lizmat prof-m: my @a = ^1000; for ^1000 { @a.min(&infix:<cmp>) } 12:04
camelia prof-m : OUTPUT«No such file or directory»
.. Prof: p.p6c.org/2f96958
lizmat apparently it's borked :-(
camelia prof-m : OUTPUT«(timeout)Can't exec "./rakudo-inst/bin/perl6-m": No such file or directory at lib/EvalbotExecuter.pm line 206.␤cat: /home/camelia/rakudo-inst/revision: No such file or directory␤␤now running scp...␤/tmp/mprof.html: No such file or directory␤»
.. Prof: p.p6c.org/2f9696e
timotimo :o 12:05
:(
jnthn lizmat: (wate a whole int on a boolean) you will anyway, thanks to alignment rules, I suspect :) 12:13
*waste
lizmat jnthn: yes, but at least we will space to do more stuff, when it's interpreted as a birmap, rather than a boolean 12:14
*have
jnthn ShimmerFairy: Yes, that's what I'm thinking but maybe a more general flags field...
lizmat: Ah, right...then we're agreeing ;)
On the min thing, I don't have an immediate guess on the OSR/JIT thing, though I bet the spesh log would tell us :) 12:15
timotimo does Proc::Async even have :merge support ...
MasterDuke the string 'merge' doesn't appear in src/core/Proc/Async.pm 12:19
timotimo yeah
jnthn Don't believe so, unless somebody sneaked it in while I wasn't watching. Which would be entirely possible... :) 12:20
timotimo right ...
lizmat jnthn: got a .5M normalized diff of the spesh log, but I have no idea what I should be looking for 12:29
dalek kudo/nom: 4c773b1 | lizmat++ | src/core/Any-iterable-methods.pm:
Make .minmax about 25% faster

  - rewrite in nqp::ops
  - have a separate candidate for .minmax()
  - based on using an iterator, rather than copying, so more memory friendly
  - now also allows things like {}.minmax(*.value)
12:36
MasterDuke lizmat: japhb: we're working on making the graphing more useable (and prettier), but benchable can benchmark code over a time period (specified as commits) 12:38
timotimo lizmat: perhaps we don't generate an osrpoint for the kind of loop you have in the candidate that doesn't end up getting jitted earlier?
MasterDuke bench: releases my ($a, $b, $c, $d, $e) = ^$_ for ^10000;my $s = $a + $b + $c + $d + $e
benchable MasterDuke: gist.github.com/4d231396187f1080a4...dbc13ed9c6 12:39
timotimo is invalid? :( 12:40
lizmat timotimo: in the diff, there is only one osrpoint shared by both, all of the other osrpoints are in the (&infix:<cmp>) case 12:41
timotimo: so I think your assertion is correct
MasterDuke i can switch a setting that will produce a valid (according to github) file, but it doesn't resize correctly, so it will only show about 10 points and then cuts off on the right
timotimo i'm not sure i understand your output, but ... okay? 12:42
MasterDuke timotimo: my output? what don't you understand? 12:43
lizmat I grepped for "osrpoint" in the diff of the spesh_log
timotimo: if you want me to, I could gist the files 12:44
timotimo MasterDuke: no, liz' output :) 12:45
lizmat: what about the one shared by both?
lizmat - [Annotation: INS Deopt OSR (idx 5 -> pc 246); line 5439] 12:46
+ [Annotation: INS Deopt OSR (idx 11 -> pc 528); line 5456]
osrpoint
timotimo right, the annotation isn't so important
just important that there's an osrpoint that we run over in the "hot" loop 12:47
lizmat the first is the nqp::if( in the min() candidate
the second one is the nqp::if inside the min(&by) candidate
timotimo i think i've found a way to make the shared pipe thing work 12:50
it's a bit round-about, but it might just be the right thing
Zoffix AlexDaniel, the behaviour is currently undefined. I'm yet to decide whether I want them to be sanitized or to convert them to multiple messages. 14:25
AlexDaniel, opened an RFC github.com/zoffixznet/perl6-IRC-Cl.../issues/17 14:28
nine, but why are we creating it at all? If '/var/www/tmp/' does not exist, I definitely do not have any modules in '/var/www/tmp/IRC-Client/lib/' and the include path should be ignored 14:41
("should"; as there's a case where it can be created and populated with modules after script is started and modules loaded during runtime) 14:45
nine Zoffix: we really just need a place to store those precomp files. The way we choose it is certainly up for improvement 14:46
dalek kudo/nom: fa84f13 | lizmat++ | src/core/Array.pm:
Make Array.splice() almost infinitely faster

  - don't copy anything, just transplant internals
  - create separate candidates for :SINK and without :SINK
  - speed gains increase with size of Array
  - much easier on memory, as nothing gets copied
14:48
Zoffix :o infinitely faster.... lizmat++ 14:49
lizmat well, I couldn't really measure the difference between the bare loop and the one with the splice in it 14:50
it all drowned in the noiser
*noise
Zoffix :)
lizmat &afk 15:25
[TuxCM] This is Rakudo version 2016.07.1-94-gfa84f13 built on MoarVM version 2016.07-13-gcba3ae3 17:15
test 15.064
test-t 8.050
csv-parser 16.338
japhb MasterDuke: What I originally designed perl6-bench for is to have a suite of different tests doing lots of different things, with different sizes of code from one liners to (at least) dozens of lines, to give the compiler a decent workout 18:03
lizmat: Yes, you can filter the perl6-bench data relatively easily, and it allows you to just run tests with certain tags (or *without* certain tags, if you want to skip a particular class of tests). 18:04
There are a lot of possibilities for producing what you want. :-)
dalek p: 878960d | (Pawel Murias)++ | src/vm/js/nqp-runtime/array.js:
[js] Remove debugging leftover.
18:05
p: 36b8182 | (Pawel Murias)++ | src/vm/js/nqp-runtime/ (4 files):
[js] Add 'use strict'
p: cd6e01b | (Pawel Murias)++ | src/vm/js/ (2 files):
[js] Implement nqp::x using String.repeat.
AlexDaniel lizmat: it is slightly noisy, but you get the idea gist.github.com/Whateverable/fab83...ile-result and gist.github.com/Whateverable/5cc79...ile-result 18:34
looks very promising :) 18:35
Zoffix :o charts!@ 18:39
m: say DateTime.now.split('T') 20:10
camelia rakudo-moar fa84f1: OUTPUT«Use of uninitialized value of type Any in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block <unit> at <tmp> line 1␤Cannot resolve caller split(DateTime, Str); none of these signatures match:␤ in…»
Zoffix m: say DateTime.now.Str.split('T')
camelia rakudo-moar fa84f1: OUTPUT«(2016-07-31 22:10:28.255696+02:00)␤»
Zoffix What is .split trying to split on by default? (/me wondering if it's a bugglet)
Oh, nevermind. I didn't even bother reading the error message far enough to notice the caller resolve stuff >_< XD 20:11
masak Zoffix: somewhat relatedly, wanting to do any kind of parsing of a DateTime is a sign that a wrong turn was taken at some prior point ;) 20:22
m: say DateTime.now.month 20:23
camelia rakudo-moar fa84f1: OUTPUT«7␤»
Zoffix I'm not parsing. I'm abridging
masak just format it in a better way from its parts
strings are a very flat, boring data structure
the rich object here is the DateTime, not its stringification 20:24
Zoffix What would I gain other than more code and more places to mess it up? 20:26
masak freedom from the assumptions carried into the original stringification 20:28
clarity by dint of using the methods on DateTime that carry the data you want
Zoffix Passs 20:30
masak your call :) just sharing something I've found to be true, that happiness is seldom found by re-parsing serialized text 20:32
Zoffix The assumptions I make in stringification relies on the assumptions of Perl 6 specification and assumption that it will continue following it in a backwards compatible way. Changing to using methods would make my code more verbose and will require payment in the extra time I need to LEARN the method names and their return values and argument and to write them all in proper way AND debug any of the issues
Considering the type of code it is: a personal tool. It's perfectly fine to just split on .Str
masak *nod* 20:33
m: say sprintf "%d-%02d-%02d", .year, .month, .day for DateTime.now
camelia rakudo-moar fa84f1: OUTPUT«2016-07-31␤»
Zoffix m: DateTime.now.Str.split('.')[0].split('T').join(' ').say 20:34
camelia rakudo-moar fa84f1: OUTPUT«2016-07-31 22:34:24␤»
masak m: say DateTime.now.Str.split('.')[0].subst('T', ' ') 20:37
camelia rakudo-moar fa84f1: OUTPUT«2016-07-31 22:37:18␤»
Zoffix m: say sprintf "%d-%02d-%02d %02d:%02d:%02d", .year, .month, .day, .hour, .minute, .second given DateTime.now 20:38
camelia rakudo-moar fa84f1: OUTPUT«2016-07-31 22:38:55␤»
Zoffix c'mon :)
masak "c'mon" is a bit of an emotional argument ;) I don't think we're convincing each other here 20:40
but there's no need for that either
there are tradeoffs involved, for sure
m: say Date.today ~ " " ~ hms(DateTime.now); sub hms($_) { sprintf "%02d:%02d:%02d", .hour, .minute, .second } 20:44
camelia rakudo-moar fa84f1: OUTPUT«2016-07-31 22:44:07␤»
masak m: say Date.today, " ", hms(DateTime.now); sub hms($_) { sprintf "%02d:%02d:%02d", .hour, .minute, .second }
camelia rakudo-moar fa84f1: OUTPUT«2016-07-31 22:44:29␤»
Zoffix There's a race condition in that code (corroborating my argument about introducing bugs) 😜 20:45
masak aye; should probably work form the same snapshot, that's true 20:47
m: say .Date.today ~ " " ~ .&hms given DateTime.now; sub hms($_) { sprintf "%02d:%02d:%02d", .hour, .minute, .second }
camelia rakudo-moar fa84f1: OUTPUT«2016-07-31 22:47:46␤»
masak m: say .Date ~ " " ~ .&hms given DateTime.now; sub hms($_) { sprintf "%02d:%02d:%02d", .hour, .minute, .second } 20:50
camelia rakudo-moar fa84f1: OUTPUT«2016-07-31 22:50:48␤»
masak maybe we should have a .hms method on DateTime... 20:51
Zoffix would be neat 20:52
jnthn
.oO( Her Majesty's Ship? )
20:53
masak jnthn: the corresponding method for the date part is called .yyyy-mm-dd, so by analogy the time part should be .hh:mm:ss :) 20:55
but that's a bit of an awkward method name, perhaps
m: class C { method hh:mm:ss { say "OH HAI" } }; C.new.hh:mm:ss 20:56
camelia rakudo-moar fa84f1: OUTPUT«Method 'hh' not found for invocant of class 'C'␤ in block <unit> at <tmp> line 1␤␤»
masak also, it doesn't work
m: class C { method hh:mm:ss { say "OH HAI" } }; C.new."hh:mm:ss"()
camelia rakudo-moar fa84f1: OUTPUT«OH HAI␤»
masak or more exactly, it needs to be quoted
Zoffix 0.o 20:57
masak maybe .hh-mm-ss is a decent compromise
jnthn hah :P
Yeah, it's at least consistent with tother one 20:58
Though what does it return, and does it zero-pad? :)
masak jnthn: sprintf "%02d:%02d:%02d", .hour, .minute, .second 20:59
and yes
Zoffix buggable, rt 21:17
buggable Zoffix, TOTAL: 1355, UNTAGGED: 611, BUG: 414, LTA: 90, JVM: 62, NYI: 32, SEGV: 28, UNI: 25, RFC: 24, PERF: 19, POD: 14, CONC: 11, @LARRY: 10, TODO: 9, PRECOMP: 8, GLR: 6, BUILD: 5, STAR: 4, WEIRD: 3, LTA ERROR: 3, MOARVM: 2, OSX: 2, FEATURE REQUEST: 1, CPP: 1, SPEC: 1, LIST: 1, LHF: 1, SPESH: 1, DOCS: 1, NATIVECALL: 1 Details: bug.perl6.party/1469999846.html
Zoffix buggable, rt @larry
buggable Zoffix, Found 8 tickets tagged with @LARRY. Details: bug.perl6.party/1469999865.html
b2gills It would be nice if 「DateTime.now.fmt: 'yyyy-mm-dd hh:mm:ss'」 worked (perhaps a different name)
Zoffix Neat, eh?
buggable, rt sdafdsfsdds 21:18
buggable Zoffix, Found 0 ticket tagged with SDAFDSFSDDS. Details: bug.perl6.party/1469999937.html
geekosaur actually went looking for strftime foo before remembering that got banished to future ecosystem foo with the rest of posix 21:19
Zoffix buggable, rt docs 21:31
buggable Zoffix, Found 1 ticket tagged with DOCS. Details: bug.perl6.party/1470000719.html
gfldex lizmat: thta was the week that was: gist.github.com/gfldex/645935787bd...edfd33eb92 23:14
AlexDaniel Zoffix: pretty cool 23:26