Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-dev, 2017-02-09

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

All times shown according to UTC.

Time Nick Message
00:01 agentzh joined #perl6-dev
00:16 pyrimidine joined #perl6-dev
00:34 pyrimidine joined #perl6-dev
00:37 Ven joined #perl6-dev
00:51 pyrimidine joined #perl6-dev
01:00 pyrimidine joined #perl6-dev
01:05 japhb .
01:10 pyrimidi_ joined #perl6-dev
01:28 pyrimidi_ joined #perl6-dev
01:35 pyrimidi_ joined #perl6-dev
01:46 pyrimidi_ joined #perl6-dev
01:54 MasterDuke IOninja++ that was fast work with Range
02:04 pyrimidi_ joined #perl6-dev
02:13 DrForr joined #perl6-dev
02:23 pyrimidine joined #perl6-dev
02:40 pyrimidine joined #perl6-dev
02:49 ilbot3 joined #perl6-dev
02:49 Topic for #perl6-dev is now Perl 6 language and compiler development 2.0 | Logs at http://irclog.perlgeek.de/perl6-dev/today
02:55 kalkin- joined #perl6-dev
02:56 pyrimidine joined #perl6-dev
02:58 dogbert11 joined #perl6-dev
02:58 pyrimidi_ joined #perl6-dev
03:01 moritz joined #perl6-dev
03:04 Hotkeys joined #perl6-dev
03:17 pyrimidi_ joined #perl6-dev
03:35 pyrimidi_ joined #perl6-dev
03:53 pyrimidi_ joined #perl6-dev
04:10 pyrimidi_ joined #perl6-dev
04:29 pyrimidi_ joined #perl6-dev
04:47 pyrimidine joined #perl6-dev
04:51 pyrimidine joined #perl6-dev
05:06 pyrimidine joined #perl6-dev
05:23 pyrimidine joined #perl6-dev
05:40 pyrimidine joined #perl6-dev
05:58 pyrimidine joined #perl6-dev
06:16 pyrimidine joined #perl6-dev
06:24 pyrimidine joined #perl6-dev
06:29 zostay_ joined #perl6-dev
06:33 moritz joined #perl6-dev
06:51 RabidGravy joined #perl6-dev
07:25 pyrimidine joined #perl6-dev
08:22 Geth ¦ rakudo/nom: 295b0bff8b | (Samantha McVey)++ | 3 files
08:22 Geth ¦ rakudo/nom: Add base 1 functionality to  .base and .parse-base
08:22 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/295b0bff8b
08:23 samcv there we go. base 1 numbers for everybody!
08:23 timotimo who gets to be 1, and who gets to be 11?
08:23 samcv 1 and 2
08:23 Geth ¦ roast: 2a3e1f9610 | (Samantha McVey)++ | 2 files
08:23 Geth ¦ roast: Test base and parse-base for base 1
08:23 Geth ¦ roast: review: https://github.com/perl6/roast/commit/2a3e1f9610
08:26 moritz samcv: have you tested it with base "1"?
08:26 samcv yes?
08:26 samcv isn't that implied
08:26 moritz with a string, not an Int, that is
08:26 samcv yes
08:26 samcv oh uhm
08:26 samcv '1'.base?
08:26 samcv m: '1'.base(2)
08:26 camelia rakudo-moar f85978: OUTPUT«No such method 'base' for invocant of type 'Str'␤  in block <unit> at <tmp> line 1␤␤»
08:26 moritz '1111'.parse-base('1')
08:26 samcv no that works
08:27 samcv Add base 1 functionality to  .base and .parse-base
08:27 samcv ^commit
08:27 moritz 'cause I see an Int:D candidate for for the base 1 case, but the base case is coercive
08:27 moritz so I wonder how that works
08:27 samcv oh
08:27 pyrimidine joined #perl6-dev
08:27 samcv m: say '11'.parse-base('1')
08:27 camelia rakudo-moar f85978: OUTPUT«Type check failed in binding to $radix; expected Int but got Str ("1")␤  in block <unit> at <tmp> line 1␤␤»
08:28 samcv dunno what you're talking about?
08:28 moritz m: say '11'.parse-base('4')
08:28 camelia rakudo-moar f85978: OUTPUT«Type check failed in binding to $radix; expected Int but got Str ("4")␤  in block <unit> at <tmp> line 1␤␤»
08:28 timotimo oh, did that break?
08:28 moritz sorry, must've been confused
08:28 moritz m: say 42.base('5')
08:28 camelia rakudo-moar f85978: OUTPUT«132␤»
08:28 samcv bisectable6, say '11.parse-base('10')
08:28 bisectable6 samcv, On both starting points (old=2015.12 new=295b0bf) the exit code is 1 and the output is identical as well
08:28 bisectable6 samcv, https://gist.github.com/1aa0ac9fdcf4026917b99ee857edaaa6
08:28 samcv bisectable6, say '11'.parse-base('10')
08:28 bisectable6 samcv, Bisecting by output (old=2015.12 new=295b0bf) because on both starting points the exit code is 1
08:29 moritz m: say 42.base('1')
08:29 camelia rakudo-moar f85978: OUTPUT«base argument to base out of range. Is: 1, should be in 2..36␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
08:29 samcv doesn't seem to ever have worked? says bisectable
08:29 bisectable6 samcv, bisect log: https://gist.github.com/b7b13ca376bb5896c5a29988f364f8d7
08:29 bisectable6 samcv, (2016-09-27) https://github.com/rakudo/rakudo/commit/222d16b0b94911fdedb06ee6ad817d0f14b9c05c
08:29 moritz that one
08:29 moritz sorry, I confused base with parse-base
08:29 moritz multi method base(Int:D: Int(Cool) $base, $digits?) {
08:29 samcv no base is not a multi
08:30 samcv err wait. nope it is
08:30 samcv i got them confused too
08:30 samcv m: say 10'.base('10')
08:30 camelia rakudo-moar 295b0b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say 107⏏5'.base('10')␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statement modifier…»
08:31 samcv m: say '10'.base('10')
08:31 camelia rakudo-moar 295b0b: OUTPUT«No such method 'base' for invocant of type 'Str'␤  in block <unit> at <tmp> line 1␤␤»
08:31 samcv m: say 10.base('10')
08:31 camelia rakudo-moar 295b0b: OUTPUT«10␤»
08:31 samcv k
08:33 robertle joined #perl6-dev
08:36 samcv will fix
08:36 samcv m: say 10.base(1)
08:36 camelia rakudo-moar 295b0b: OUTPUT«1111111111␤»
08:36 samcv sweet
08:37 samcv but uh moritz the second argument makes no sense for .base
08:37 samcv m: say 2.base(2)
08:37 camelia rakudo-moar 295b0b: OUTPUT«10␤»
08:38 samcv m: say 2.base(2, 2)
08:38 camelia rakudo-moar 295b0b: OUTPUT«10.00␤»
08:38 samcv there is no 0 in base 1
08:38 samcv i guess it's fine to ignore it
08:38 samcv since it makes no sense anyway
08:40 samcv moritz, you think it should be ignored, or to throw when somebody does 10.base(1, 1)
08:40 samcv or maybe just do 1111111111.
08:41 samcv idk either way it's dumb
08:42 samcv star: 4.2.base(1).say
08:42 camelia star-m 2016.10: OUTPUT«Attempt to divide 1.6094379124341 by zero using /␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
08:42 samcv star: 4.2.base(2).say
08:42 camelia star-m 2016.10: OUTPUT«100.001101␤»
08:42 samcv that should be fixed
08:42 samcv i guess. idk
08:43 samcv wtf would 4.2 in base 1 even be
08:43 samcv m: say '1111'.parse-base(1)
08:43 camelia rakudo-moar 295b0b: OUTPUT«4␤»
08:44 samcv m: say '11011'.parse-base(1)
08:44 camelia rakudo-moar 295b0b: OUTPUT«Cannot convert string to number: malformed base-1 number in '11⏏011' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
08:49 pyrimidine joined #perl6-dev
08:52 pyrimidi_ joined #perl6-dev
09:10 samcv m: say '111'.base('2')
09:10 camelia rakudo-moar 295b0b: OUTPUT«No such method 'base' for invocant of type 'Str'␤  in block <unit> at <tmp> line 1␤␤»
09:10 samcv m: say '111'.base('2',0)
09:10 camelia rakudo-moar 295b0b: OUTPUT«No such method 'base' for invocant of type 'Str'␤  in block <unit> at <tmp> line 1␤␤»
09:10 samcv m: say 10.base('2',0)
09:10 camelia rakudo-moar 295b0b: OUTPUT«1010␤»
09:10 samcv m: say 10.base('2')
09:10 camelia rakudo-moar 295b0b: OUTPUT«1010␤»
09:20 Geth ¦ roast: 4bcf18fd39 | (Samantha McVey)++ | 2 files
09:20 Geth ¦ roast: Test .base for Str argument as well
09:20 Geth ¦ roast: review: https://github.com/perl6/roast/commit/4bcf18fd39
09:21 Geth ¦ rakudo/nom: a21d2f9e1c | (Samantha McVey)++ | src/core/Int.pm
09:21 Geth ¦ rakudo/nom: Fix .base to allow string arguments for base 1
09:21 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a21d2f9e1c
09:21 samcv ok should all be fixed now
09:55 pyrimidine joined #perl6-dev
10:51 pyrimidine joined #perl6-dev
10:52 pyrimidi_ joined #perl6-dev
11:06 IOninja As I recall it, Str.base wasn't a thing on purpose
11:08 IOninja .base(1)?
11:10 * IOninja gets a cup of coffee to de-grumble
11:13 DrForr String to unary number... oo, that could be fun.
11:14 IOninja OK
11:14 DrForr eval: '𠀋𠂢'.base(1)
11:14 evalable6 DrForr, rakudo-moar a21d2f9: OUTPUT«(exit code 1) No such method 'base' for invocant of type 'Str'␤  in block <unit> at /tmp/am2bQXimTj line 1␤»
11:15 IOninja The Str.base wasn't a thing on purpose, to avoid confusion of people mistakenly using it instead of Str.parse-base.
11:16 IOninja If Numeric.base(1) were ever a thing, it'd use '0' for its digits, not '1'.
11:16 IOninja But Numeric.base(1) isn't a thing, because we already have infix:<x> and chars() for that purpose and people can use whatever digit they want for their base.
11:17 DrForr *so* glad :)
11:17 IOninja So my opinion is to revert both the commit that adds Str.base and one that adds .base(1).
11:19 samcv there is no Str.base?
11:19 IOninja Ah ok, misread the commit title :)
11:20 samcv yeah
11:20 samcv there's .parse-base('2') though
11:20 samcv that is Cool
11:20 samcv the commit just made .parse-base('1') work
11:20 samcv so it could be like the other numbers
11:20 IOninja m: '000000'
11:20 camelia rakudo-moar a21d2f: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant string "000000" in sink context (line 1)␤»
11:21 IOninja m: '000000'.parse-base('1').say
11:21 camelia rakudo-moar a21d2f: OUTPUT«Type check failed in binding to $radix; expected Int but got Str ("1")␤  in block <unit> at <tmp> line 1␤␤»
11:21 samcv in base 1, a 0 is basically the number not existing at that position. so it only needs ones
11:21 IOninja m: '000000'.parse-base(1).say
11:21 camelia rakudo-moar a21d2f: OUTPUT«Cannot convert string to number: malformed base-1 number in '0⏏00000' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
11:21 IOninja m: '1111'.parse-base(1).say
11:21 camelia rakudo-moar a21d2f: OUTPUT«4␤»
11:21 samcv it uses the same notation that all the other bases do
11:21 IOninja m: say chars '1111'
11:21 camelia rakudo-moar a21d2f: OUTPUT«4␤»
11:21 samcv 10 in binary, the 1 is in the 2's place and a 0 in the 1's place
11:21 samcv 11 in unary, there's a 1 in the 1's place and a 1 in the 1's place
11:21 samcv so it's 2
11:22 samcv since they're all 1's places
11:22 IOninja Ah, right
11:22 samcv i wasn't 100% sure but then i looked into it before adding base 1
11:23 IOninja OK. never mind then :)
11:23 IOninja (about reverting anything)
11:29 Geth ¦ nqp: 8371cb23c6 | (Jonathan Worthington)++ | tools/build/MOAR_REVISION
11:29 Geth ¦ nqp: Bump MOAR_REVISION for closed async socket fixes.
11:29 Geth ¦ nqp: review: https://github.com/perl6/nqp/commit/8371cb23c6
11:29 Geth ¦ nqp: version bump brought these changes: https://github.com/MoarVM/MoarVM/compare/2017.01-42-gd10ba49...2017.01-45-g2b0739d
11:35 Geth ¦ rakudo/nom: f16cf370c1 | (Jonathan Worthington)++ | tools/build/NQP_REVISION
11:35 Geth ¦ rakudo/nom: Bump for latest MoarVM.
11:35 Geth ¦ rakudo/nom:
11:35 Geth ¦ rakudo/nom: Fixes semantics of close, write, and read of async sockets.
11:35 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/f16cf370c1
11:35 Geth ¦ rakudo/nom: version bump brought these changes: https://github.com/perl6/nqp/compare/2017.01-76-g3dc2cad...2017.01-78-g8371cb2
11:36 Geth ¦ roast: c7abae472e | (Jonathan Worthington)++ | S32-io/IO-Socket-Async.t
11:36 Geth ¦ roast: Test semantics of closed async socket.
11:36 Geth ¦ roast:
11:36 Geth ¦ roast: All three of these operations did naughty things prior to recent
11:36 Geth ¦ roast: fixes.
11:36 Geth ¦ roast: review: https://github.com/perl6/roast/commit/c7abae472e
11:37 IOninja m: say 0.base: 1
11:37 camelia rakudo-moar a21d2f: OUTPUT«␤»
11:37 IOninja m: say 0.base(1).parse-base: 1
11:37 camelia rakudo-moar a21d2f: OUTPUT«0␤»
11:37 IOninja cool
11:37 IOninja m: say ''.parse-base: 2
11:37 camelia rakudo-moar a21d2f: OUTPUT«Cannot convert string to number: malformed base-2 number in '3⏏' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
11:37 IOninja hehe
11:44 IOninja There's even a usecase for it: https://en.wikipedia.org/wiki/Golomb_coding
11:44 IOninja m: -2 .base(1).say
11:44 camelia rakudo-moar a21d2f: OUTPUT«repeat count (-2) cannot be negative␤  in block <unit> at <tmp> line 1␤␤»
11:45 IOninja m: '-11'.parse-base(1).say
11:45 camelia rakudo-moar a21d2f: OUTPUT«Cannot convert string to number: malformed base-1 number in '3-11⏏' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
11:50 IOninja m: 1.1 .base(1).say
11:50 camelia rakudo-moar a21d2f: OUTPUT«Attempt to divide 2.30258509299405 by zero using /␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
11:51 pyrimidine joined #perl6-dev
11:52 IOninja IMO base 1 should still be removed. It's already implemented as a special case adding maintenance burden for little gain; and negatives/decimals crash with LTA errors right now and zero... do those even exist in unary base? Would they need even more special casing? Seems not worth to have this in core.
11:52 * IOninja &
12:15 cognominal joined #perl6-dev
12:47 pyrimidine joined #perl6-dev
12:51 geekosaur joined #perl6-dev
12:53 pyrimidine joined #perl6-dev
12:57 samcv zeros don't exist
12:57 samcv well
12:58 samcv m: say 0.base(1)
12:58 camelia rakudo-moar f16cf3: OUTPUT«␤»
12:58 samcv that is zero
12:59 samcv m: say "".parse-base(1)
12:59 camelia rakudo-moar f16cf3: OUTPUT«0␤»
12:59 IOninja Do negatives and decimals exist?
12:59 samcv sure negatives are fine. not decimals though
13:00 samcv i will have to fix it for negative numbers
13:00 IOninja or... I guess in unary they are... urinals
13:00 samcv lol
13:00 samcv i mean every place equals 1
13:01 samcv so you can't really do decimals at all
13:01 IOninja Feels weird to have this base TBH.
13:01 IOninja m: 5.5.base($_).say for 2..36
13:01 camelia rakudo-moar f16cf3: OUTPUT«101.1␤12.111112␤11.2␤10.222223␤5.3␤5.333334␤5.4␤5.444445␤5.5␤5.555556␤5.6␤5.666667␤5.7␤5.777778␤5.8␤5.888889␤5.9␤5.99999A␤5.A␤5.AAAAAB␤5.B␤5.BBBBBC␤5.C␤5.CCCCCD␤5.D␤5.DDDDDE␤5.E␤5.EEEEEF␤5.F␤5.FFFFF…»
13:03 samcv though maybe we can have decimals
13:03 samcv err wait.
13:03 samcv it would not be for all numbers
13:03 samcv i mean cause there's no zero
13:04 samcv you just have to do integers can't do decimal numbers
13:04 samcv that's the main part of how it differs from the other bases
13:05 samcv but i will make a more awesome error for "1.1".parse-base(1)
13:05 samcv you can't really parse a number that can't exist in that base can you?
13:05 samcv it's basically assumed the person already knows what base the number is in
13:07 samcv IOninja, that error when trying to do 1.5.base(2) already existed before
13:07 samcv fyi
13:07 samcv my changed did not create that error
13:07 samcv *changes
13:07 moritz I'm not sure I'm happy with base 1
13:08 moritz because it's fundametally different from the other representations
13:08 moritz the others are polynomial, base 1 isn't
13:08 IOninja Yeah, the entire base is a special case basically: empty string is not a number for other bases, but it is for base-1; other bases have decimals, but not in base-1; the digits for all bases are (flat 0..9, A..Z)[^(base-1)], but in base-1 it's `1` and zero is not a valid digit. So basically we're declaring that all Perl 6 implementations must add a special-cased base-1; despite it not being commonly needed
13:08 IOninja and trivially replicated in user's code.
13:08 IOninja infix:<x>/chars basically handle all positives
13:09 IOninja m: 1.5 .base(2).say
13:09 camelia rakudo-moar f16cf3: OUTPUT«1.1␤»
13:09 IOninja samcv: which error?
13:09 samcv m: say 1.4.base(1)
13:09 camelia rakudo-moar f16cf3: OUTPUT«Attempt to divide 1.6094379124341 by zero using /␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
13:09 IOninja huh
13:09 samcv that already was there
13:09 samcv star: say 1.4.base(1)
13:09 camelia star-m 2016.10: OUTPUT«Attempt to divide 1.6094379124341 by zero using /␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
13:10 IOninja huh²
13:10 IOninja m: say (1.4).base: 2
13:10 camelia rakudo-moar f16cf3: OUTPUT«1.011010␤»
13:10 IOninja m: say 1.4.base: 2
13:10 camelia rakudo-moar f16cf3: OUTPUT«1.011010␤»
13:10 IOninja oh ok
13:10 * IOninja needs moar coffee
13:10 IOninja s: 1.4, 'base', \(1)
13:10 SourceBaby IOninja, Sauce is at https://github.com/rakudo/rakudo/blob/f16cf37/src/core/Rational.pm#L111
13:11 IOninja Looks like the check that base is valid is missing in the Rational.base
13:11 IOninja m: say 12.base: 400
13:11 camelia rakudo-moar f16cf3: OUTPUT«base argument to base out of range. Is: 400, should be in 1..36␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
13:11 IOninja m: say 1.2.base: 400
13:11 camelia rakudo-moar f16cf3: OUTPUT«base argument to base out of range. Is: 400, should be in 1..36␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
13:12 IOninja Or rather done too late
13:15 samcv idk we support roman numerals as numbers too
13:15 samcv and those aren't likely to be commonly used
13:15 samcv and are another representation of a unary numeral system
13:16 IOninja Are roman numerals special cased?
13:16 samcv well they sort of are since they are Nl or number letters. well
13:17 samcv they break when i fix moarvm to think that <alpha> === Alphabetic property
13:17 samcv but atm they aren't
13:21 IOninja My vote on base(1) is to not implement it in core on the grounds that it needs special casing in implementation, tests, and docs. Maybe jnthn++ or TimToady++ could offer a ruling.
13:21 samcv i mean if it were in MVM would that make things any better?
13:22 samcv or is it more because base 1 just is different because 1^1 = 1
13:22 samcv and so does not offer decimals
13:31 samcv as an aside there seems to be programming language where you convert brainfuck code to binary numbers for each symbol, then convert that binary number to unary and that is the text of your program
13:31 samcv haha
13:32 * jnthn would prefer not to move more stuff into MoarVM, fwiw
13:32 samcv yeah i didn't really want to move it their either
13:34 * samcv checkouts out IOninja's Inline::Brainfuck
13:50 IOninja m: say 'NaN' ~~ NaN
13:50 camelia rakudo-moar f16cf3: OUTPUT«No such method 'isNaN' for invocant of type 'Str'␤  in block <unit> at <tmp> line 1␤␤»
13:50 IOninja m: say 'NaN'.Numeric ~~ NaN
13:50 camelia rakudo-moar f16cf3: OUTPUT«True␤»
13:54 llfourn joined #perl6-dev
13:54 pyrimidine joined #perl6-dev
13:57 llfourn joined #perl6-dev
14:00 Geth ¦ rakudo/nom: 1615c83c9a | (Zoffix Znet)++ | src/core/Numeric.pm
14:00 Geth ¦ rakudo/nom: Fix Str ~~ Numeric
14:00 Geth ¦ rakudo/nom:
14:00 Geth ¦ rakudo/nom: - Don't throw if we can't coerce Str to Numeric, just return False[^1]
14:00 Geth ¦ rakudo/nom: - Don't crash with `isNaN method not found` when Numeric is a NaN
14:00 Geth ¦ rakudo/nom:
14:00 Geth ¦ rakudo/nom: [1] https://irclog.perlgeek.de/perl6-dev/2017-02-08#i_14065906
14:00 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/1615c83c9a
14:01 Geth ¦ roast: 70dc421407 | (Zoffix Znet)++ | S03-smartmatch/any-num.t
14:01 Geth ¦ roast: Test Str ~~ Num
14:01 Geth ¦ roast:
14:01 Geth ¦ roast: - Can handle Strs that aren't numeric without exploding
14:01 Geth ¦ roast: - Can handle cases where Num is a NaN
14:01 Geth ¦ roast:
14:01 Geth ¦ roast: Rakudo fix: https://github.com/rakudo/rakudo/commit/1615c83c9a
14:01 Geth ¦ roast: review: https://github.com/perl6/roast/commit/70dc421407
14:01 llfourn joined #perl6-dev
14:02 IOninja .oO( with so much talk about explosions, this channel gotta be on some FBI watch list by now... )
14:05 llfourn joined #perl6-dev
14:13 IOninja m: say (-42e0) % 2e0
14:13 camelia rakudo-moar 1615c8: OUTPUT«0␤»
14:13 IOninja Another negative zero bugglet
14:14 IOninja m: say 42 % Inf
14:14 camelia rakudo-moar 1615c8: OUTPUT«NaN␤»
14:14 IOninja m: say 42 / Inf
14:14 camelia rakudo-moar 1615c8: OUTPUT«0␤»
14:14 IOninja The n % Inf should be 0, not NaN
14:17 IOninja (when n is not a NaN)
14:18 * IOninja will fix these
14:19 IOninja Well, some time later... I guess I should get cracking on the IO stuff :P
14:35 samcv are you still a ninja if your work is in a publically accessible repository?
14:36 IOninja :)
14:56 pyrimidine joined #perl6-dev
15:49 pyrimidine joined #perl6-dev
15:56 * [Coke] expects a status report from you, young man.
16:08 IOninja wow, the -42e0 % 2e0 sign is a lot more complex: https://en.wikipedia.org/wiki/Modulo_operation
16:09 IOninja All the langs seem to be doing whatever they want.
16:12 IOninja IEEE spec says "If r = 0, its sign shall be that of x. remainder(x, ∞) is x for finite x.
16:13 IOninja But I guess not everyone agrees whether they're doing "remainder" or "modulo" :/
16:13 moritz if r = 0, its sign doesn't matter :-)
16:14 moritz r's sign, that is
16:19 japhb Of course it does.
16:20 IOninja m: say atan2 -0e0, -1e0
16:20 camelia rakudo-moar 1615c8: OUTPUT«-3.14159265358979␤»
16:20 IOninja m: say atan2 0e0, -1e0
16:20 camelia rakudo-moar 1615c8: OUTPUT«3.14159265358979␤»
16:20 IOninja :)
16:22 moritz please don't let any mathematicians find out about this.
16:22 IOninja heh
16:22 japhb My math professor designed a fair portion of that.
16:22 IOninja :o
16:24 japhb https://en.wikipedia.org/wiki/William_Kahan
16:31 IOninja fancy pants
16:36 IOninja m: sub e ($x, $y ) {42}; say e -2, 2
16:36 camelia rakudo-moar 1615c8: OUTPUT«0.7182818284590462␤»
16:37 IOninja m: sub pi ($x, $y ) {42}; say pi -2, 2
16:37 camelia rakudo-moar 1615c8: OUTPUT«1.141592653589792␤»
16:37 IOninja m: constant meow = 70; sub meow ($x, $y ) {42}; say meow -2, 2
16:37 camelia rakudo-moar 1615c8: OUTPUT«682␤»
16:38 IOninja LTA IMO
16:40 jnthn Note that's no conflict here, since the sub's actual name in the symbol table is &meov
16:41 jnthn &meow even
16:41 IOninja yeah...
16:41 jnthn And listop syntax is unambiguously looking for a sub
16:42 jnthn camelia m: constant meow = 70; sub meow ($x, $y ) {42}; say meow, -2, 2
16:42 camelia jnthn: rakudo-moar 1615c8: OUTPUT«70-22␤»
16:43 IOninja m: constant meow = 70; sub meow ($x, $y ) {42}; say meow 2, 2
16:43 camelia rakudo-moar 1615c8: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3 = 70; sub meow ($x, $y ) {42}; say meow7⏏5 2, 2␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤ …»
16:43 IOninja All the more reason to pushback adding all bunch of core constant that jjmerelo wanted to add a while back
16:45 IOninja took me awhile to notice the problem: https://gist.github.com/zoffixznet/292d5634b8d6b652b976d36fd1b09e28
16:45 IOninja 'cause the sub was supposed to produce a number, I was just getting the wrong one :P
16:50 IOninja k, -42e0 % 2e0 => 0e0 (and not -0e0) is not a bug 'cause we don't do IEEE's remainder in that operator.
16:51 IOninja 'cause 5 % 2 would be -1 then...
16:51 IOninja Java has Math.IEEEremainder just for that heh
17:05 IOninja How does core.d stuff work? Is it just additive to core? I got this diff https://gist.github.com/zoffixznet/043124ef58a020ec8ec719c904b9ea6a but it fails these three tests: https://github.com/perl6/roast/blob/e73bb67f64c26926aa2665e64477d9a084821b48/S03-operators/div.t#L9-L11  I figured it's 6.d material... do I just stick those ops to core.d?
17:05 IOninja src/core.d/Num.pm?
17:08 IOninja and how will the non-src/core stuff be handled. Like lib/Test.pm6 will lose is_approx() in 6.d...
17:10 [Coke] test files will have to explicitly have 6.c or 6.d in them.
17:11 [Coke] (and while master can have both, maybe 6.d branch and 6.c branch have only those that apply)
17:13 IOninja well, just stuffing https://gist.github.com/zoffixznet/b981f82240020a490a34e8d5ca90d7cd into src/core.d/Num.pm didn't do anything.
17:14 IOninja Gonna leave this for now, I guess
17:17 [Coke] is there a framework to augment the default one with anything found in d?
17:48 robertle joined #perl6-dev
18:16 AlexDaniel joined #perl6-dev
18:30 pyrimidine joined #perl6-dev
19:00 * TimToady would prefer to keep base 1 out of core; would be fine in a module though
19:02 IOninja +1
19:11 pyrimidine Anyone have an idea what might be going on w/ RT #130709 or RT #130535
19:11 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130709
19:11 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130535
19:12 pyrimidine These are both linked to 'require' not working, seems to be related to bug fix for lexical module loading
19:13 pyrimidine (should say, 'not working as expected').  nine++ points out a fix may need some thought
19:15 * timotimo is surprised base1 isn't getting much love
19:16 timotimo people use it for turing machines all the time!
19:16 IOninja it's not just base1 it's its wild difference from all the other bases
19:17 timotimo you think?
19:17 IOninja think what?
19:17 timotimo i disagree, the formula is the same
19:17 timotimo 999 is 9 * 10^3 + 9 * 10^2 + 9 * 10^1
19:17 timotimo 111 is 1 * 1^3 + 1 * 1^2 + 1 * 1^1
19:17 TimToady it is fundamentally different, insofar as it cannot support fractions
19:18 timotimo that's a point i'll concede
19:18 IOninja timotimo: what's your formula for zero? :)
19:18 timotimo "" is
19:18 IOninja lol
19:18 timotimo seriously.
19:19 timotimo 10 is 1 * 1^2, 1 is 1 * 1^1,  is
19:19 perlpilot Base 1 supports an infinite number of fractions! They're just also wholes too  ;)
19:19 IOninja timotimo: so the result is ""?
19:20 IOninja timotimo: that means it'd be "" for all the other bases too :)
19:20 timotimo no, the result is evaluating the mathematical formula
19:20 IOninja that's special cased for base-1
19:20 timotimo hm.
19:21 TimToady actually, the special case is all the other bases requiring a leading 0 in-band
19:21 TimToady but I still don't think base1 belongs in core
19:21 timotimo you've got the final word if you want
19:21 timotimo just need to sit in your seat :)
19:22 timotimo the special one
19:22 TimToady plus we already have base-1 operators built in, they're just spelled funny
19:23 TimToady which is fine, since base-1 is funny
19:23 timotimo we have ~, but we don't have something corresponding to -, or any kind of "get the inverse element of a base1 number"
19:23 TimToady big loss...
19:23 timotimo well, you could "-" ~ $base-one-number
19:23 timotimo but ~ won't honour negative base one numbers
19:24 TimToady exploring all these delightful ramifications is a good use for a module
19:24 timotimo fair enough
19:25 IOninja m: say ~42
19:25 camelia rakudo-moar 1615c8: OUTPUT«42␤»
19:25 timotimo we'll also totally want a slang that'll interpret numbers that are made up of only 1 as base-1
19:27 IOninja m: sub baseit ($n, $b) {  sum do for $n.comb.reverse.pairs { .value * ($b**.key) } }; say baseit "", 2
19:27 camelia rakudo-moar 1615c8: OUTPUT«0␤»
19:27 IOninja m: sub baseit ($n, $b) {  sum do for $n.comb.reverse.pairs { .value * ($b**.key) } }; say baseit "22", 2
19:27 camelia rakudo-moar 1615c8: OUTPUT«6␤»
19:27 IOninja hehe :)
19:27 TimToady and on the roman numeral argument, we only support those to the extent they come for free with Unicode
19:30 IOninja m: say :1<111>
19:30 camelia rakudo-moar 1615c8: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Radix 1 out of range (allowed: 1..36)␤at <tmp>:1␤------> 3say :1<111>7⏏5<EOL>␤»
19:32 TimToady I'm afraid that, at least for me, this whole thing falls rather too far (for my comfort) into the "you think that's cute today" category....
19:33 TimToady it would be okay as a degenerate case if it were, in fact, a degenerate case, but it's a discontinuity, really
19:34 TimToady it's only a degenerate case if you squint
19:53 perlpilot .oO( makes me think "squinting at degenerates" is a useful phrase for something )
19:55 geekosaur only if you're usan x.x
19:55 pyrimidine joined #perl6-dev
19:58 TimToady how come there's no SQUINTING FACE?
19:58 TimToady how are supposed to convey suspicion with emoticons?
19:59 TimToady they need a DUBIOUS FACE or so...
20:02 IOninja u: 🤔
20:02 unicodable6 IOninja, U+1F914 THINKING FACE [So] (🤔)
20:02 IOninja u: 🤨
20:02 unicodable6 IOninja, U+1F928 <reserved> [Cn] (🤨)
20:04 IOninja Well, "Face With One Eyebrow Raised" is a proposed part of Unicode 10: http://emojipedia.org/unicode-10.0/
20:04 IOninja .oO( didn't they *just* make a unicode release? )
20:05 IOninja there's even 11 already: http://emojipedia.org/unicode-11.0/
20:05 IOninja That will bring the "Mooncake" emoji... can't wait
20:06 TimToady raising an eyebrow is not really quite the same as squinting
20:08 IOninja u: 😑
20:08 unicodable6 IOninja, U+1F611 EXPRESSIONLESS FACE [So] (😑)
20:08 IOninja That one looks squinting...
20:09 TimToady you can't use a neutral for a strong negative
20:11 IOninja Instead of adding all these faces they clearly should just make separate face parts that you join with ZWS :)
20:11 IOninja combine with skin tones and sex emojis for that perfect emoji face :P
20:11 TimToady then we'd have to deal with CLOWN NOSE and such..
20:12 IOninja u: CLOWN
20:12 unicodable6 IOninja, U+1F921 CLOWN FACE [So] (🤡)
20:13 IOninja Looks like you're person #11,213 to want this emoji :) https://www.emojirequest.com/r/SuspiciousEmoji
20:14 IOninja ¬_¬
20:15 TimToady that's a double negative you've got there...
20:16 IOninja heh
20:18 * TimToady wonders how space aliens with eyes on stalks express suspicion...
20:20 nine llfourn: you seem to understand https://rt.perl.org/Public/Bug/Display.html?id=130535
20:26 nine That's intriguing: method run() { require ::('C::B') } fails with No such symbol C::B while method run() { require ::('C::B'); 1 } does not throw any error when called.
20:26 nine TimToady: the wantedness seems to make the difference, right?
20:32 nine Ok, looks like require really needs a closer look or three. But not today. Good night!
20:46 timotimo nite nine!
21:26 pyrimidine joined #perl6-dev
21:28 dogbert17 jnthn, timotimo: are you good C hackers :)
21:30 dogbert17 should I use a %d format specifier to fprintf a variable of type size_t?
21:32 jnthn No, that sounds wrong :)
21:32 dogbert17 what would you suggest
21:32 jnthn %d is for int
21:32 jnthn And only 32-bit you'll get away with it
21:33 dogbert17 which I have :)
21:33 dogbert17 I'm beginnig to suspect that we have a 32 bit problem here (with the GC)
21:33 jnthn %zd I think
21:33 geekosaur joined #perl6-dev
21:33 dogbert17 look at this (printed with %d)
21:34 jnthn oh, maybe %zu for unsinged
21:34 dogbert17 is_full_collection: promoted = 29046306, rss = 299098112, percent_growth = 9.
21:34 dogbert17 looks reasonable
21:34 dogbert17 is_full_collection: promoted = 199464970, rss = 607739904, percent_growth = 4.   hmmm
21:36 dogbert17 promoted is multiplied by 100 in the percentage_growth calculation, couldn't that lead to overflow on 32 bit?
21:42 pyrimidine joined #perl6-dev
21:43 dogbert17 %zu didn't work, is_full_collection: promoted = 21361621, rss = 97067008, percent_growth = 22.    at program start
21:43 dogbert17 sry, that's ok
21:43 jnthn On overlow - hmm, what type did we do the calc in...
21:45 dogbert17 https://github.com/MoarVM/MoarVM/blob/master/src/gc/orchestrate.c#L288
21:45 dogbert17 is_full_collection: promoted = 478401828, rss = 861716480, percent_growth = 0.   #  with %zu
21:46 dogbert17 using - fprintf(stderr, "is_full_collection: promoted = %zu, rss = %zu, percent_growth = %d.\n", promoted, rss, percent_growth);
21:47 jnthn m: say 478401828 / 861716480
21:47 camelia rakudo-moar 1615c8: OUTPUT«0.5551731214␤»
21:48 jnthn oops :)
21:48 jnthn size_t rss, promoted;
21:48 jnthn d'oh
21:48 jnthn percent_growth is 64-bit
21:48 jnthn But it won't upgrade the other two before doing the calc
21:48 jnthn Let's just declare them all as MVMuint64
21:49 jnthn Oh no, that'll bust something else :)
21:49 dogbert17 m: say (100 * 478401828) / 861716480
21:49 camelia rakudo-moar 1615c8: OUTPUT«55.517312144␤»
21:49 jnthn rss must be declared size_t
21:49 jnthn Because it's an out parameter
21:49 dogbert17 at least we know the real problem now :)
21:49 jnthn Yeah, really nice catch :)
21:51 jnthn So, let's make MVMuint64 promoted
21:51 jnthn And cast rss to MVMuint64
21:51 samcv TimToady, I will revert the base 1 stuff later today when I have time, have some appointments today
21:51 samcv thank you for weighing in
21:51 dogbert17 I'll give it a shot
21:52 pyrimidi_ joined #perl6-dev
21:59 timotimo good catch dogbert
22:09 AlexDaniel joined #perl6-dev
22:45 dogbert17 jnthn, timotimo: is this correct? https://gist.github.com/dogbert17/8e0061b91ab7dcca60339fd6f663a5ed
22:49 timotimo looks correct at first glance
22:54 dogbert17 thx timotimo, running spectest now
23:13 agentzh joined #perl6-dev
23:59 pyrimidine joined #perl6-dev

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