Perl 6 language and compiler development | Logs at colabti.org/irclogger/irclogger_log/perl6-dev | For toolchain/installation stuff see #perl6-toolchain | For MoarVM see #moarvm
Set by Zoffix on 27 July 2018.
AlexDaniel O_o 01:21
my program just ended with “Floating point exception”
m: dd <0/0> 01:23
camelia <0/0>
AlexDaniel m: say <0/0>.round
camelia (signal FPE)
AlexDaniel I mean… yeah… but…
6c: say <0/0>.round
committable6 AlexDaniel, gist.github.com/94854a749ae9ccb808...dd5df9e3b0
AlexDaniel bisect: old=2018.06 say <0/0>.round 01:24
bisectable6 AlexDaniel, Bisecting by exit signal (old=2018.06 new=1611795). Old exit signal: 0 (None)
AlexDaniel, bisect log: gist.github.com/407bb0f73363556c20...e7e8dc192a
AlexDaniel, (2018-07-31) github.com/rakudo/rakudo/commit/09...7dfa4fc5d7
AlexDaniel R#2569 01:26
synopsebot R#2569 [open]: github.com/rakudo/rakudo/issues/2569 [regression][severe] SIGFPE when rounding a 0/0 Rat
Geth rakudo: d39e2fc4f8 | (Nick Logan)++ (committed using GitHub Web editor) | src/core/CompUnit/Repository/FileSystem.pm6
Cache files-prefix
03:26
[TuxCM] Rakudo version 2018.12-48-gd39e2fc4f - MoarVM version 2018.12-8-g45d15efe9
csv-ip5xs0.949 - 0.971
csv-ip5xs-207.139 - 7.163
csv-parser21.934 - 22.690
csv-test-xs-200.427 - 0.432
test7.530 - 7.558
test-t1.803 - 1.843
test-t --race0.812 - 0.818
test-t-2029.404 - 30.848
test-t-20 --race9.414 - 9.524
10:39
Geth rakudo: 11da0fb489 | (Elizabeth Mattijsen)++ | src/core/Rational.pm6
Fix FPE on Rat.round

Fixes R#2569, but makes Rat.round 30% slower :-(
12:54
synopsebot R#2569 [open]: github.com/rakudo/rakudo/issues/2569 [regression][severe] SIGFPE when rounding a 0/0 Rat
Geth rakudo: cf0a6eaa24 | (Elizabeth Mattijsen)++ | src/core/Rational.pm6
Streamline Rational.floor/ceiling/Int

  - use ternaries
  - use Failure.new instead of fail, just returning the Failure directly
  - set return value on signature for possible future optimization possibilities
  - makes them about 10% faster
13:22
Geth rakudo: 236351adeb | (Elizabeth Mattijsen)++ | src/core/Rational.pm6
Streamline Rational.Num

  - the Rational attributes are always bound, so no decont necessary
  - the defaults in the attribute definition therefore have no meaning
  - makes Rational.Num about 5% faster
13:51
timotimo lizmat: can you tell if method round became bigger than the inline limit because of that change? 15:04
if so, perhaps turning the whole Failure.new stuff into a sub call could be wortwhile
lizmat I tried that already, didn't make a difference
so I didn't :-)
it's the extra check on $!denominator, I think 15:05
lizmat m: dd <1/-1> # why isn't this a Rat ? 16:48
camelia RatStr.new(-1.0, "1/-1")
lizmat m: dd <-1/1> # this is!
camelia -1.0
timotimo mathematicians decided that i guess? 19:43
lizmat what do mathematicians have to do with -1/1 vs 1/-1 ? they're both -1 ? 21:11
timotimo: feels more like a parsing issue to me
deliberate, maybe, but still
AlexDaniel lizmat: yeah, there was a list somewhere with all the ways < > syntax is broken
lizmat my feeling is that either both should be RatStr or both should be Rat
timotimo hm. perhaps the canonical representation of a rat doesn't have to be RatStr anyway 21:12
m: dd <-2/2>
camelia -1.0
timotimo hum.
gfldex the Rat literal is a construct of convenience and one form not working is not very convenient at all. 21:14
timotimo well, they're both Rat, only one of them is RatStr
gfldex and since when did mathematicians ever stop us from doing the right thing? :->
lucasb github.com/rakudo/rakudo/blob/mast....nqp#L3256 21:15
<de=.signed-integer> would help?
gfldex m: sub s(Rat $r){ dd $r }; s(<-1/1>); s(<1/-1>); 21:16
camelia -1.0
RatStr.new(-1.0, "1/-1")
gfldex m: sub s(Rat $r){ dd $r.gist, $r.Str }; s(<-1/1>); s(<1/-1>); 21:17
camelia "-1"
"-1"
"1/-1"
"1/-1"
gfldex is there a notable performance hit for RatStr?
timotimo haven't checked yet, but i wouldn't assume it's a whole lot 21:18
gfldex m: dd (<1/-1> * 2).WHAT;
camelia Rat
gfldex the RatStr doesn't survive for long it seams 21:19
AlexDaniel lizmat: fwiw I think if we want <> syntax to be there, we should create a table or something with a list of inputs and and expected outputs, or something
I remember having some good laughs about it with Zoffix
gfldex It will take more RAM tho. That might become an issue in corner cases.
AlexDaniel it may be convenient for simple cases, but in more complex (haha) cases it's very unpredictable 21:20
like, if in the end you have to check what value is created anyway, why not use a more readable syntax 21:21
m: dd <1> 21:24
camelia IntStr.new(1, "1")
AlexDaniel m: dd <-1>
camelia IntStr.new(-1, "-1")
AlexDaniel m: dd <42.5>
camelia RatStr.new(42.5, "42.5")
lucasb github.com/rakudo/rakudo/commit/04...8ec60f2cf7 21:25
AlexDaniel > <TimToady> the reasoning is pragmatic; there's good reason to write <1/2> and <1+2i> as literals, and no good reason to write <42>, since you could just write 42 instead 21:26
colabti.org/irclogger/irclogger_lo...-11-27#l38
lucasb ^^ he introduced the signed-integer token in that commit
made the numerator 'signed-integer' but not the denominator 21:27
AlexDaniel yeah but that's just for parsing
lucasb I thought it was the issue here 21:28
AlexDaniel <nu=.signed-integer> '/' <de=integer> }
lucasb: you're right 21:29
lucasb is there any reason that it isn't "<de=.signed-integer>" ?
lizmat not that I know of 21:30
lucasb '1/+2' looks strange, but... I guess it's orthogonal :)
ah, I guess TimToady thought of that
AlexDaniel m: .^name.say for <1/2>, <1/2*10>, <1/2*10**10> 21:31
camelia Rat
Str
RatStr
lucasb what?! 21:32
m: dd <1/2*10**10>
camelia RatStr.new(0.00000000005, "1/2*10**10")
AlexDaniel you can put a minus here 21:34
m: say .^name for <-1/2*10**10>
camelia RatStr
AlexDaniel and here and here
m: say .^name for <-1/-2*-10**10>
camelia RatStr
AlexDaniel but not here
m: say .^name for <-1/-2*-10**-10>
camelia Str
AlexDaniel although it can be a + 21:35
m: say .^name for <-1/-2*-10**+10>
camelia RatStr
japhb There are surely some bugs there, but I suspect there's a reason <1/-1> is a RatStr instead of a Rat: Because <1/-1> is not in canonical form, thus there's a reason that the original intent should be saved in the Str side of the allotrope. 21:37
Basically, Perl 6 assumes you have a reason for doing things in an odd way, and that there may be meaning to that.
Just like <42> Creates an allotrope, because the only reason for you to not just write 42 is because you wanted something special. 21:38
AlexDaniel heh canonical form
japhb Sorry, allo*morph* 21:39
SmokeMachine m: dd <2/4>
camelia 0.5
japhb has spent too much time the last few days explaining all the cool things about carbon
AlexDaniel I mean, japhb is right, that's the actual intent indeed
but IMO we should throw it away and start again with simpler rules 21:40
m: say WHAT <0xf.8*:2[1,0]**0b11/0o200+2.0e2i>
camelia (ComplexStr)
AlexDaniel m: say <0xf.8*:2[1,0]**0b11/0o200+2.0e2i>
camelia 0xf.8*:2[1,0]**0b11/0o200+2.0e2i
AlexDaniel m: say +<0xf.8*:2[1,0]**0b11/0o200+2.0e2i> 21:41
camelia 0.96875+200i
SmokeMachine 2/4 isnt the canonical form ether, right?
AlexDaniel SmokeMachine: no, it's right, it gave you a Rat
m: say WHAT <2/4>
camelia (Rat)
SmokeMachine I mean by what japhb was saying, it should be an RatStr, right? 21:42
AlexDaniel SmokeMachine: no, the idea is that it is a syntax for Rat and Complex literals 21:43
so in a “canonical form” you'll get a pure Rat or pure Complex
japhb There's a reason I was willing to write Str.Numeric but considered val() a bit above my pay grade ... 21:46
timotimo are you talking about carbon, the element? 21:47
japhb timotimo: Yes, that's why I fumbled "allomorph" as "allotrope" instead
"What's the difference between graphite and diamond?" "Do you want the short answer or the long answer?" "I've got all the time in the world, Daddy." 21:49
AlexDaniel lizmat: see also R#1827
synopsebot R#1827 [open]: github.com/rakudo/rakudo/issues/1827 <1i> should be a Complex literal, not ComplexStr
AlexDaniel m: dd <0x_FF.FF> 21:57
camelia RatStr.new(255.99609375, "0x_FF.FF")
AlexDaniel arguably the rules for getting a plain Rat or Complex are fairly simple 21:58
timotimo japhb: one of those days i'll watch a five hour lecture on the topic or something :) 22:24
japhb timotimo: Heh. :-) 22:29
Geth rakudo: 5c0ac4db9f | (Elizabeth Mattijsen)++ | src/core/Rational.pm6
Streamline Rational.Str

  - compartmentalize the logic into private methods
  - <42/21> is now about 2.2x as fast
  - <42/17> is now about 1.2x as fast
  - keep comments as much as possible
22:48
lizmat afk& 22:51
Ven`` Am I the only one seeing an issue with perl6advent.wordpress.com/2018/12/...happiness/ ? 23:51
masak
Even perl6advent.wordpress.com/2015/12/...et-agents/ looks a bit weird :o) 23:52
masak++ # for blogging 23:54