Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-12-29

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 samcv https://pbs.twimg.com/media/C0vWrzvUcAEAhkI.jpg
00:01 Axord Ha.
00:02 samcv wish @unicode on twitter would post more than people adopting emoji
00:03 samcv well bronze sponsors. there's so many of them costs only 100 dollars
00:03 * notviki is one :}
00:04 notviki For butterfly
00:04 * notviki likes https://twitter.com/FakeUnicode
00:06 notviki [Coke]: you can still install it even if it fails tests.
00:06 notviki it's make install or something or other; it tells in the message
00:10 samcv camelia, help
00:10 camelia samcv: Usage: <(prof-m|nqp-jvm|nqp-js|star-m|rakudo-moar|debug-cat|p5-to-p6|rakudo-jvm|nqp-moarvm|nqp-m|m|j|r-jvm|nqp|r-j|r|rakudo|star|nqp-mvm|sm|r-m|p56|nom|rm|p6|nqp-q|rj|perl6)(?^::\s(?!OUTPUT)) $perl6_program>
00:10 AlexDaniel 30k/31k
00:10 AlexDaniel I CAN'T TAKE IT ANYMORE
00:12 samcv nqp-jvm: say(chars('<ୈ'))
00:12 camelia nqp-jvm: OUTPUT«#␤# There is insufficient memory for the Java Runtime Environment to continue.␤# pthread_getattr_np␤# An error report file with more information is saved as:␤# /home/camelia/hs_err_pid20644.log␤[thread 140051936204544 also had an error]»
00:12 samcv awesome
00:14 samcv j: say "test"
00:14 camelia rakudo-jvm 8ca367: OUTPUT«test␤»
00:14 samcv left #perl6
00:14 samcv joined #perl6
00:14 samcv j: say "<ୈ".chars
00:14 camelia rakudo-jvm 8ca367: OUTPUT«2␤»
00:14 samcv hmmm
00:14 samcv interesting
00:15 samcv m: say "<ୈ".chars
00:15 camelia rakudo-moar 347271: OUTPUT«1␤»
00:15 samcv looks like java handles these degenerates
00:15 samcv +1 for java
00:15 samcv j: EVAL "say Q<ୈtest>"
00:15 camelia rakudo-jvm 8ca367: OUTPUT«ୈtest␤»
00:15 samcv nice
00:16 samcv that makes me pretty happy tbh
00:16 samcv Moar does not handle them, which is not incorrect. but LTA
00:22 Xliff_ joined #perl6
00:23 grumble joined #perl6
00:25 AlexDaniel m: say "<ୈ".chars
00:25 camelia rakudo-moar 347271: OUTPUT«1␤»
00:26 AlexDaniel u: <ୈ
00:26 unicodable6 AlexDaniel, U+003C LESS-THAN SIGN [Sm] (<)
00:26 unicodable6 AlexDaniel, U+0B48 ORIYA VOWEL SIGN AI [Mc] (◌ୈ)
00:26 AlexDaniel samcv: huh? Are you saying that 2 is the right answer?
00:26 samcv no
00:27 samcv to implement unicode you MUST support certain things in handling of graphemes. but degenerates are not a MUST
00:27 samcv they are a MAY
00:27 samcv err
00:28 samcv maybe clearer is I think it should be 2
00:28 samcv and 2 is not incorrect for unicode spec, and neither is 1
00:29 samcv it is really 2. and we should take that into account in string operations and concatenation etc
00:30 djbkd joined #perl6
00:33 samcv j: say "34\x[308]5".fc
00:33 camelia rakudo-jvm 8ca367: OUTPUT«34̈5␤»
00:35 AlexDaniel dooooooooooooooooooonnnnnnnneeeeeeee
00:36 samcv m: "\x[308]".uniprop('Mark').say
00:36 camelia rakudo-moar 347271: OUTPUT«1␤»
00:36 samcv m: "a".uniprop('Mark').say
00:36 camelia rakudo-moar 347271: OUTPUT«0␤»
00:37 samcv m: "a".unimatch('Mark', 1).say
00:37 camelia rakudo-moar 347271: OUTPUT«Cannot resolve caller unimatch(Int, Str, Int); none of these signatures match:␤    (Str:D $str, |c is raw)␤    (Int:D $code, Stringy:D $pvalname, Stringy:D $propname)␤    (Int:D $code, Stringy:D $pvalname, Stringy:D $propname = { ... })␤  in block …»
00:37 AlexDaniel alright, only 1493 snippets to review :)
00:37 samcv m: "a".unimatch('Mark', 'Mark').say
00:37 camelia rakudo-moar 347271: OUTPUT«False␤»
00:37 samcv m: "a".unimatch('Mark', '1').say
00:37 camelia rakudo-moar 347271: OUTPUT«False␤»
00:37 samcv m: "a".unimatch('Mark', True).say
00:37 camelia rakudo-moar 347271: OUTPUT«Cannot resolve caller unimatch(Int, Str, Bool); none of these signatures match:␤    (Str:D $str, |c is raw)␤    (Int:D $code, Stringy:D $pvalname, Stringy:D $propname)␤    (Int:D $code, Stringy:D $pvalname, Stringy:D $propname = { ... })␤  in block…»
00:38 samcv m: "a".unimatch('Mark')
00:38 camelia rakudo-moar 347271: ( no output )
00:38 samcv m: "a".unimatch('Mark').say
00:38 camelia rakudo-moar 347271: OUTPUT«False␤»
00:38 samcv m: "\x[308]".unimatch('Mark').say
00:38 camelia rakudo-moar 347271: OUTPUT«True␤»
00:38 samcv m: "\x[308] ".unimatch('Mark').say
00:38 camelia rakudo-moar 347271: OUTPUT«True␤»
00:38 samcv m: " \x[308] ".unimatch('Mark').say
00:38 camelia rakudo-moar 347271: OUTPUT«False␤»
00:39 samcv m: " \x[308] ".».unimatch('Mark').say
00:39 camelia rakudo-moar 347271: OUTPUT«(False)␤»
00:40 BenGoldberg joined #perl6
00:40 samcv m: say " \x[308] " ~~ m/<:Mark>/
00:40 camelia rakudo-moar 347271: OUTPUT«False␤»
00:40 * samcv cries
00:40 samcv m: say " \x[308] " ~~ m/<:mark>/
00:40 camelia rakudo-moar 347271: OUTPUT«False␤»
00:41 samcv should todo's in roast have an RT? so doe sthat mean i should file one
00:41 samcv j: say " \x[308] " ~~ m/<:mark>/
00:41 camelia rakudo-jvm 8ca367: OUTPUT«「̈」␤»
00:41 samcv j: say " \x[308] " ~~ m/<:Mark>/
00:41 camelia rakudo-jvm 8ca367: OUTPUT«「̈」␤»
00:41 samcv j: say " \x[308] " ~~ m/<:MArk>/
00:41 camelia rakudo-jvm 8ca367: OUTPUT«「̈」␤»
00:41 samcv nice. jvm++
00:43 samcv notviki, you there
00:43 notviki sup
00:43 samcv regarding https://rt.perl.org/Ticket/Display.html?id=128546 the proper thing to do is compare strings without diacritics first
00:44 samcv and only if they are equal, to compare with diacritics
00:44 samcv and diacritics should be greater than the letter but less than the next letter in the sort sequence
00:44 samcv so looks like we just use cmp here?
00:45 * notviki shrugs
00:46 samcv m: say "a\x[308]" cmp "a"
00:46 camelia rakudo-moar 347271: OUTPUT«More␤»
00:46 samcv m: say "a\x[308]" cmp "ab"
00:46 camelia rakudo-moar 347271: OUTPUT«More␤»
00:47 samcv m: say "a\x[308]" cmp "abc"
00:47 camelia rakudo-moar 347271: OUTPUT«More␤»
00:47 samcv m: say "a\x[308]" cmp "a\x[900]c"
00:47 camelia rakudo-moar 347271: OUTPUT«More␤»
00:47 samcv m: say "abc" cmp "cba"
00:47 camelia rakudo-moar 347271: OUTPUT«Less␤»
00:47 samcv :(
00:48 samcv SourceBaby, infix:<cmp>
00:50 samcv looks like we just call ORDER(nqp::cmp_s(nqp::unbox_s(a), nqp::unbox_s(b)))
00:51 samcv m: say "a\x[308]".chars say "a\x[900]c".chars
00:51 camelia rakudo-moar 347271: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say "a\x[308]".chars7⏏5 say "a\x[900]c".chars␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤    …»
00:51 samcv m: say "a\x[308]".chars; say "a\x[900]c".chars
00:51 camelia rakudo-moar 347271: OUTPUT«1␤2␤»
00:53 samcv notviki, is this a bug in nqp or in perl 6
00:53 samcv or moarvm
00:53 samcv j: say "a\x[308]" cmp "a\x[900]c"
00:53 camelia rakudo-jvm 8ca367: OUTPUT«Less␤»
00:53 samcv ok looks like only on MoarVM does it fail
00:54 samcv looks like a MoarVM problem
00:59 [Coke] notviki: yes, it said "do this", so I did it, and it rebuilt it a second time.
01:00 [Coke] samcv: yes, todo's in roast should be ticketed. (theory being that without a ticket, no one is reviewing them) (in practice, no one reviews tickets either)
01:00 samcv yeah
01:00 samcv samcv> looks like it just does return ai < bi ? -1 : 1
01:00 samcv <samcv> and checks graphemes
01:00 samcv err accidently posted in dev
01:01 mojca left #perl6
01:02 samcv so it seems to just compare which grapheme is 'bigger'
01:03 samcv however it stores that grapheme. hm
01:03 samcv and it's just a MVMint32. wait
01:04 samcv that means it's just getting not the whole grapheme but just the codepoint?
01:08 samcv j: say Version.new("34\x[308]5") cmd Version.new("4")
01:08 samcv j: say Version.new("34\x[308]5") cmp Version.new("4")
01:08 camelia rakudo-jvm 8ca367: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say Version.new("34\x[308]5")7⏏5 cmd Version.new("4")␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end…»
01:08 camelia rakudo-jvm 8ca367: OUTPUT«More␤»
01:09 samcv m: say Version.new("34\x[308]5") cmp Version.new("4")
01:09 camelia rakudo-moar 347271: OUTPUT«Less␤»
01:10 notviki It's not comparing those two strings, it's breaking them up
01:10 notviki s/them/the first one/;
01:10 notviki m: say Version.new("34\x[308]5")
01:10 camelia rakudo-moar 347271: OUTPUT«v34̈5␤»
01:11 notviki m: say Version.new("34\x[308]5").parts
01:11 camelia rakudo-moar 347271: OUTPUT«(34̈5)␤»
01:11 notviki Oh, right. It breaks up only with the patch
01:11 samcv there's still a bug in cmp though
01:11 AlexDaniel m: say * + 5
01:11 camelia rakudo-moar 94df18: OUTPUT«{ ... }␤»
01:12 AlexDaniel I wonder if there's any way to print something more readable?
01:12 [Coke] notviki: crap, found the text you were referring to. ah well
01:12 AlexDaniel because { … } may look a bit scary to some
01:12 samcv breaking it up is another issue entirely
01:13 samcv [Coke], do you know moarvm right it stores codepoints in 32 bit ints right?
01:13 samcv so this MVM 32 bit grapheme HAS to be JUST a codepoint right
01:14 [Coke] samcv: dunno,s orry
01:15 samcv m: say "🐧" cmp "a\x[308";
01:15 camelia rakudo-moar 94df18: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in hex character; couldn't find final ']' ␤at <tmp>:1␤------> 3say "🐧" cmp "a\x[3087⏏5";␤    expecting any of:␤        double quotes␤        hex character␤   …»
01:15 samcv m: say "🐧" cmp "a\x[308]";
01:15 camelia rakudo-moar 94df18: OUTPUT«More␤»
01:15 samcv oh that is a bad example
01:15 samcv m: say "a" cmp "a\x[308]";
01:15 camelia rakudo-moar 94df18: OUTPUT«Less␤»
01:15 samcv m: say "ab" cmp "a\x[308]";
01:15 camelia rakudo-moar 94df18: OUTPUT«Less␤»
01:16 samcv m: say "a\x[309]" cmp "a\x[308]";
01:16 camelia rakudo-moar 94df18: OUTPUT«More␤»
01:16 samcv m: say "a\x[309]" cmp "a\x[308]b";
01:16 camelia rakudo-moar 94df18: OUTPUT«More␤»
01:16 samcv m: say "a\x[309]" cmp "b\x[310]";
01:16 camelia rakudo-moar 94df18: OUTPUT«More␤»
01:17 samcv m: say "a\x[309]" cmp "a\x[310]";
01:17 camelia rakudo-moar 94df18: OUTPUT«More␤»
01:17 samcv m: say "a\x[309]a" cmp "a\x[310]b";
01:17 camelia rakudo-moar 94df18: OUTPUT«More␤»
01:17 samcv yeah
01:17 samcv it's looking by codepoint
01:17 samcv m: say "a\x[309]a" cmp "a\x[310]🐧";
01:17 camelia rakudo-moar 94df18: OUTPUT«More␤»
01:18 samcv yep
01:18 samcv brb
01:18 dugword If I fork/clone roast, check out branch '6.c-errata' and then run the tests with Rakudo version 2016.11 should all the tests pass? Because a whole bunch fail for me. Running like `perl6 S04-phasers/begin.t`
01:18 [Coke] Yes, 6.c-errata should be passing.
01:19 notviki dugword: some tests have fudges. If you're in a built rakudo checkout you can clone roast to t/spec and then run make t/spec/S04-phasers/begin.t
01:20 [Coke] ah. yes, how are you running the tests?
01:22 dugword Cloned the repo for roast. cd-ed into the repo. checked out the '6.c-errata' branch. ran `perl6 <some-test-dir/some-test-file>`. where `perl6` is the pre-built binary .dmg download for Mac OSX from rakudo.org
01:22 dugword Wanted to see the tests pass before I built Rakudo from source, and then started making changes
01:23 notviki It has a fudge: https://github.com/perl6/roast/blob/master/S04-phasers/begin.t#L78
01:26 notviki dugword: the only failures you should see are t/spec/S10-packages/precompilation.t test 22 and t/spec/S11-modules/nested.t that dies with parse errors. That's on 6.c-errata. The master branch should have no failures.
01:26 dugword master should have no failures with or without fudges?
01:26 notviki occasionally some tests fail when you run them all in a bunch, but you can try to run them individually and if that passes then it's fine
01:26 notviki dugword: with fudges
01:27 notviki dugword: you run it with TEST_JOBS=7 make spectest
01:27 notviki or make stresstest if you like to wait around
01:27 notviki TEST_JOBS is your number of cores * 1.3
01:27 notviki And you can run individual files with make t/spec/name/of/the/file.t
01:27 dugword What directory do I run make from? I don't see a makefile
01:28 notviki .oO( need to get on with contribute.perl6.org -_- )
01:28 notviki dugword: in a Rakudo build dir
01:29 notviki dugword: not sure how much help it is, but you could scroll through this tutorial: https://perl6advent.wordpress.com/2016/12/11/day-11-perl-6-core-hacking-it-slipped-through-the-qasts/
01:29 notviki and there are a couple with "core hacking" in their name on perl6.party
01:31 samcv ok it looks like MVM_string_compare is only used for us and not like internally in MoarVM
01:31 dugword Oh nice, thanks notviki
01:32 samcv so should be fine to make it smarter
01:32 AlexDaniel MasterDuke: here?
01:38 AlexDaniel .tell MasterDuke consider taking a look at RT #130430
01:38 yoleaux AlexDaniel: I'll pass your message to MasterDuke.
01:38 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130430
01:41 notviki .tell MasterDuke too slow!
01:41 yoleaux notviki: I'll pass your message to MasterDuke.
01:46 cyphase joined #perl6
01:57 AlexDaniel commit: c6cb07e5e79^,c6cb07e5e79 say '0' ~~ /<[\0]>/
01:57 committable6 AlexDaniel, ¦«c6cb07e5e79^»: 「0」␤¦«c6cb07e»: Nil
01:57 AlexDaniel any idea about this?
01:57 AlexDaniel bisectable points to https://github.com/rakudo/rakudo/commit/c6cb07e5e792dd9a304c2b58c63c13b738910737 but that's not very helpful
02:02 cpage_ joined #perl6
02:05 Actualeyes1 joined #perl6
02:07 TEttinger joined #perl6
02:16 labster joined #perl6
02:29 SCHAAP137 joined #perl6
02:37 itcharlie joined #perl6
02:46 labster joined #perl6
02:48 ilbot3 joined #perl6
02:48 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
02:48 cyphase joined #perl6
02:55 committable6 joined #perl6
02:58 Actualeyes joined #perl6
03:08 xtreak joined #perl6
03:17 itcharlie left #perl6
03:18 spock joined #perl6
03:38 pierre_ joined #perl6
03:43 cyphase joined #perl6
03:48 lichtkind_ joined #perl6
03:49 noganex_ joined #perl6
03:53 Actualeyes joined #perl6
04:04 hoelzro joined #perl6
04:24 dugword If I am running perl6 from a Rakudo build dir, can I install modules local to my build? Running `make spectest` skips the Perl 5 integration tests because I don't have Inline::Perl5 installed. But I do have it installed for my installed version of Perl 6\
04:27 benji_ joined #perl6
04:27 benji_ how would I output sound with perl6
04:28 benji_ just a sine wave with a specific frequency
04:42 MasterDuke dugword: you could try adding ',<path/to/your/Inline::Perl5>' to line 40 of t/harness5
04:42 yoleaux 01:38Z <AlexDaniel> MasterDuke: consider taking a look at RT #130430
04:42 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130430
04:42 yoleaux 01:41Z <notviki> MasterDuke: too slow!
04:43 MasterDuke dugword: i haven't tried that, but that's where i'd start
04:44 ugexe those would be built against a different version of rakudo
04:44 MasterDuke benji_: no idea, but https://github.com/Perl6-Noise-Gang/Task-Noise should have some info
04:44 MasterDuke ugexe: those?
04:45 ugexe inline::perl5 has depends
04:47 MasterDuke i guess he could clone it and its dependencies and add all them to the -I
04:48 ugexe cd $MY_RAKUDO_DIR && git clone https://github.com/ugexe/zef && ./bin/perl6 ./zef/bin/zef -Izef/lib install Inline::Perl5
04:51 MasterDuke dugword: ^^^
04:57 dugword Nice
04:57 dugword I'll try that
04:59 ugexe to be exact: `cd $MY_RAKUDO_DIR && git clone https://github.com/ugexe/zef && ./install/bin/perl6 -Izef/lib ./zef/bin/zef install Inline::Perl5`
04:59 cyphase joined #perl6
05:03 ugexe you might need to s/install/--force install/ because File::Which is not very robust in how it tests
05:13 Cabanossi joined #perl6
05:15 dugword ugexe: Hmmm... tons of errors are being thrown on all modules being installed. Even with --force it fails
05:17 dugword Oh well, I'm moving on. I won't be making changes to anything that those tests will be testing... hopefully :)
05:38 kaare_ Seems I can't have a multi native sub. Is that "Don't do that, stoopid", or "We'll fix it in time"?
05:38 kaare_ At least I get "Cannot invoke object with invocation handler in this context" when I try
05:43 MasterDuke m: multi sub a(int $b) { say "native" }; multi sub a(Int $b) { say "non-native" }; my int $c = 1; a($c); my Int $d = 1; a($d)
05:43 camelia rakudo-moar 19df35: OUTPUT«native␤non-native␤»
05:46 MasterDuke kaare_: ^^^, is that what you were trying to do?
05:48 kaare_ MasterDuke: Yes, with the first sub being 'is native'
05:50 MasterDuke kaare_: ah, i've never used NativeCall, can't help you there, sorry
05:50 kaare_ In fact, I don't need the second multi, I get the same error with only the native version
05:52 kaare_ MasterDuke: This is boiled down: use NativeCall;  multi sub a(uint32) returns int32 is native  { * }
06:00 MasterDuke kaare_: looks like you can't multi is native stuff, https://irclog.perlgeek.de/perl6/2016-04-14#i_12339385
06:01 kaare_ MasterDuke: Good find!
06:08 kaare_ But AFAIUI, it is a bug.
06:13 kaare_ So I can file a ticket if someone is interested
06:15 MasterDuke buggable: rakudobug
06:15 MasterDuke huggable: rakudobug
06:15 huggable MasterDuke, rakudobug@perl.org or use perl6 query on http://rt.perl.org ; see https://github.com/rakudo/rakudo/#reporting-bugs
06:15 MasterDuke kaare_: ^^^
06:19 thayne joined #perl6
06:25 bpmedley joined #perl6
06:33 dataf3l joined #perl6
06:36 dataf3l joined #perl6
06:38 dataf3l joined #perl6
06:41 bjz joined #perl6
06:42 dataf3l joined #perl6
06:43 Axord joined #perl6
06:45 dataf3l joined #perl6
06:46 darutoko joined #perl6
06:49 dataf3l joined #perl6
06:51 RabidGravy joined #perl6
06:52 dataf3l joined #perl6
06:55 dataf3l joined #perl6
06:57 dataf3l joined #perl6
07:01 dataf3l joined #perl6
07:03 dataf3l joined #perl6
07:06 dataf3l joined #perl6
07:10 dataf3l joined #perl6
07:11 cibs joined #perl6
07:15 dataf3l joined #perl6
07:18 dataf3l joined #perl6
07:19 labster joined #perl6
07:22 CIAvash joined #perl6
07:23 dataf3l joined #perl6
07:26 dataf3l joined #perl6
07:29 dataf3l joined #perl6
07:32 dataf3l joined #perl6
07:33 cibs joined #perl6
07:34 bjz joined #perl6
07:37 tojo joined #perl6
07:37 pierre_ joined #perl6
07:40 dataf3l joined #perl6
07:57 domidumont joined #perl6
08:02 domidumont joined #perl6
08:04 wamba joined #perl6
08:14 mawkish_ joined #perl6
08:15 xtreak joined #perl6
08:32 tokomer joined #perl6
08:34 pyrimidine joined #perl6
08:40 * lizmat wonders whether https://www.reddit.com/r/perl/comments/5kr6e8/anything_out_there_for_using_perl_to_cast_to_a is something up RabidGravy's alley
08:40 * RabidGravy looks
08:42 dataf3l joined #perl6
08:43 RabidGravy WeEeell, possibly, if I knew how a chromecast works ;-)
08:48 lizmat Ah, I guess I remembered https://perl6advent.wordpress.com/2016/12/13/ wrong
08:48 lizmat Icecast != Chromecast
08:48 lizmat sorry!
08:49 regnarg The results of my yesterday's "REPL here" experimentation: https://gist.github.com/regnarg/1096ad4d85e430ef2fc3c57a0e85600a You can just call &repl-here anywhere in your program and you get a REPL wth access to local variables and stuff. (while I liked the ratty name, it didn't seem do deserve such a short name)
08:50 lizmat see?  that wasn't too hard  :-)
08:51 regnarg As pointed out to me yesterday, the optimizer may one day break this but right now it seems useful
08:51 regnarg But I'm not sure whether a 11-line module (albeit useful) is worth packaging and publishing in the ecosystem ;-)
08:52 lizmat regnarg: some modules are shorter than that
08:52 lizmat otoh, this feels like a nice debugging tool that we want to have available at all times
08:52 lizmat and the memory footprint of it is minimal
08:52 lizmat and the REPL is already core anyway
08:53 lizmat so I would be in favour of just adding it to the core
08:53 Actualeyes joined #perl6
08:53 lizmat albeit with another name
08:53 lizmat m: REPL
08:53 camelia rakudo-moar 19df35: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant value REPL in sink context (line 1)␤»
08:53 lizmat hmmm...
08:53 regnarg REPL.here sounds good (and self-explanatory)
08:55 lizmat that would be an option
08:55 * lizmat refrains from bikeshedding this atm until we have a bit more consensus about adding or not  :-)
08:57 RabidGravy lizmat, though I think the chromecast can consume icecast streams, I'll comment anyway :)
08:58 RabidGravy regnarg, I'm pretty sure I've got at least one 11-line module out there :)
09:00 regnarg Actually I have several enhancements to REPL in mind: (1) allow to specify a context without hacking private attributes (e.g. REPL.new ..., :context(CALLER:: ), (2) allow to execute some code in the REPL's context (like I did in the screpl.p6), (3) REPL.here might be then a shorthand for REPL.new(..., :context(CALLER:: )).repl-loop. But as notviki reminded me yesterday, accessing calller context probably will be complicated in the future
09:02 regnarg I think it might still be useful even if it works less reliably (like in GDB you cannot access "optimized out" variables but it's still useful) or you have to disable optimizations. It's a debug tool after all.
09:02 regnarg But it would probably require some discussion.
09:02 lizmat indeed
09:02 lizmat indeed
09:07 thayne joined #perl6
09:10 domidumont joined #perl6
09:15 cibs joined #perl6
09:18 mr-foobar joined #perl6
09:22 teksteiner joined #perl6
09:23 bjz_ joined #perl6
09:29 mawkish_ joined #perl6
09:38 thayne joined #perl6
09:45 dataf3l joined #perl6
09:54 rafasch joined #perl6
10:21 dogbert2 joined #perl6
10:22 rindolf joined #perl6
10:23 effbiai joined #perl6
10:23 w4and0er96_ joined #perl6
10:24 PotatoGim_ joined #perl6
10:24 kmwallio_ joined #perl6
10:26 Ulti_ joined #perl6
10:28 pyrimidi_ joined #perl6
10:31 cyphase joined #perl6
10:35 chee joined #perl6
10:36 xiaomiao joined #perl6
10:36 facetious joined #perl6
10:36 regnarg joined #perl6
10:36 azertus_ joined #perl6
10:36 TimToady joined #perl6
10:36 drrho joined #perl6
10:36 krakan_ joined #perl6
10:36 leah2 joined #perl6
10:36 r3m joined #perl6
10:36 dg joined #perl6
10:36 protium joined #perl6
10:36 xfix joined #perl6
10:36 thundergnat joined #perl6
10:36 CIAvash[m] joined #perl6
10:36 KotH joined #perl6
10:36 Alikzus joined #perl6
10:36 avar joined #perl6
10:36 breinbaas joined #perl6
10:36 smash joined #perl6
10:36 rblackwe joined #perl6
10:36 tyil joined #perl6
10:36 ranguard joined #perl6
10:36 Bucciarati joined #perl6
10:36 sQuEE joined #perl6
10:36 robinsmidsrod joined #perl6
10:36 damnlie_ joined #perl6
10:36 integral joined #perl6
10:36 d^_^b joined #perl6
10:36 Peter_R joined #perl6
10:36 jcallen joined #perl6
10:36 gabiruh joined #perl6
10:37 * moritz just spent half an hour debugging a a hairy issue in some code he wrote
10:38 moritz the code was basically sub foo {  my $sth = $dbh.prepare(...); LEAVE { $sth.finish if $sth }; $sth.execute; $sth.allrows(:array-of-hash).map(...) }
10:39 moritz the problem was that the map was lazy, and thus $sth.finish was called too early
10:40 moritz which, surprisingly, didn't lead to an exception thrown, but rather to to an extra row of all-undefined values in the list
10:41 samcv woooo collation
10:41 samcv i at least so far have unicode properties for primary secondary and tertiary collation weights
10:41 samcv and almost done coding it into moarvm to use it
10:41 moritz \o/
10:42 samcv (hopefully won't break other properties due to randomness)
10:42 moritz samcv++
10:42 rafasch Do they include Latin (u->V)?
10:42 samcv what
10:42 samcv you mean language specific collation?
10:43 samcv 'a'.uniprop('MVM_COLLATION_PRIMARY') #> 7239
10:43 samcv nice
10:44 rafasch m: say 'a'.uniprop('MVM_COLLATION_PRIMARY')
10:44 camelia rakudo-moar 19df35: OUTPUT«0␤»
10:44 samcv not yet!
10:44 samcv the secondary and primary collation weighting are more complex but the primary is not too bad
10:45 samcv though not sure how we will support for multiple codepoints
10:45 samcv since there are rules for that
10:45 samcv will figure something out eventually
10:45 rafasch It's important to make P6 better than P5 ASAP.
10:46 samcv yes
10:47 samcv will be able to fix this bug https://rt.perl.org/Ticket/Display.html?id=128546
10:47 samcv which is a bug in cmp
10:47 samcv rafasch, on jvm perl6 already compares properly
10:48 samcv moar just compares the codepoint
10:48 samcv atm
10:48 samcv > say 'z'.uniprop('MVM_COLLATION_PRIMARY'); say '1'.uniprop('mvmcollationprimary')
10:49 samcv 7969
10:49 samcv 7230
10:49 samcv \o/
10:49 rafasch m Version.new("34\x[308]5") leg Version.new("4")
10:49 samcv err
10:49 rafasch m: Version.new("34\x[308]5") leg Version.new("4")
10:49 camelia rakudo-moar 19df35: OUTPUT«WARNINGS for <tmp>:␤Useless use of "leg" in expression ".new(\"34\\x[308]5\") leg Version.new(\"4\")" in sink context (line 1)␤»
10:49 rafasch m: say Version.new("34\x[308]5") leg Version.new("4")
10:49 camelia rakudo-moar 19df35: OUTPUT«Less␤»
10:50 rafasch Unicode 11 has to be developed in P6
10:50 samcv hmm tho
10:50 cyphase joined #perl6
10:50 samcv say "û".uniprop('MVM_COLLATION_PRIMARY'); say "z".uniprop('MVM_COLLATION_PRIMARY')
10:50 samcv 0
10:50 samcv 7969
10:51 samcv say "û".ords
10:51 samcv msay "û".ords
10:51 samcv m: say "û".ords
10:51 camelia rakudo-moar 19df35: OUTPUT«(251)␤»
10:51 samcv hm
10:51 samcv maybe it's not specified
10:51 * samcv checks
10:51 samcv dunno why it wouldn't tho
10:51 samcv m: say "û".ord.base(16)
10:51 camelia rakudo-moar 19df35: OUTPUT«FB␤»
10:52 samcv yeah it has a value in the file hmm
10:54 samcv print "Ⓐ".uniprop('MVM_COLLATION_PRIMARY'); 7239
10:54 samcv that is pretty nice though
10:54 samcv letter A also has the same value
10:54 rafasch It is.
10:56 samcv "Ⓐ" cmp "B"
10:56 samcv Less
10:56 samcv woot!
10:56 * samcv does a dance
10:56 samcv not bad for one night
10:56 rafasch m: say "Ⓐ" cmp "B"
10:56 camelia rakudo-moar 19df35: OUTPUT«More␤»
10:57 rafasch Are the higher order ones easier or more diffcult?
10:57 samcv order?
10:57 samcv no just compare the uh weights
10:58 rafasch The second and third order properties.
10:58 samcv oh
10:59 samcv A primary collation element is a collation element that is not ignorable at Level 1.
10:59 samcv This is also known as a non-ignorable. In parametrized expressions, also known as a Level 0 ignorable.
10:59 samcv so basically you should always apply primary
10:59 samcv This is also known as a Level 1 ignorable or a primary ignorable.
10:59 samcv (aka secondary)
10:59 rafasch Otherwise it isn't collation at all.
10:59 samcv also
10:59 samcv A simple mapping maps one Unicode character to one collation element.
10:59 samcv D8. An expansion maps one Unicode character to a sequence of collation elements.
10:59 samcv D9. A contraction maps a sequence of Unicode characters to a sequence of (one or more) collation elements.
10:59 samcv it gets pretty complex
10:59 samcv haha
11:00 samcv MVMArray: Index out of bounds damn i get this tho
11:00 samcv trying to build rakudo
11:00 rafasch Natural language is fun.
11:00 samcv prolly did something silly
11:00 samcv in moar
11:01 rafasch "fun" in the EvE sense, not in the P6 sense.
11:01 samcv this is the new extended comparer so far https://github.com/MoarVM/MoarVM/compare/master...samcv:unicode_collation?expand=1#diff-cda4ff10539b46b0e2dc52e15c75f6d9
11:02 aku joined #perl6
11:02 samcv prolly don't like sanity check enough
11:05 samcv not sure why i get that array out of bounds though
11:05 samcv MVMArray: Index out of bounds
11:06 moritz I don't know if it's a good idea to replace the moarvm string comparison op with a Unicode-aware one
11:06 moritz or if it should be made available as a separate operation
11:07 samcv hm
11:08 rafasch It's written in C, I think the common idiom is to make it depend on an int argument.
11:08 samcv what?
11:08 xtreak joined #perl6
11:08 rafasch don't every idimatic C function need a FLAGS field?
11:08 samcv moritz, the MVM_string_compare isn't used in moar really
11:09 samcv moarvm itself uses a different one that just checks if they are the same or not
11:09 samcv not -1, 0 or 1, just binary
11:10 samcv uhm
11:10 samcv not sure why would need that rafasch
11:11 samcv is that some newer C extension thingy
11:11 samcv this is c90 i think
11:11 samcv something, makes you have to declare variables before statements in a function
11:12 moritz samcv: I don't know where exactly MVM_string_compare is used, but I could imagine it being used in Perl 6's leg or cmp infix ops, and then it might change what string ranges produces, for example
11:12 samcv well cmp infix sounds fine
11:12 moritz which might be a too big backwards-incompatible change to merge
11:12 samcv jvm already does this
11:13 moritz then it might not be so risky
11:13 samcv and leg and cmp use the same i thing
11:13 samcv *think. underlying moar function for strings
11:13 samcv nqp::cmp_s
11:13 moritz cmp is just generalized to more types
11:13 samcv yeah
11:14 rafasch It is but a joke about C coding styles.
11:15 samcv oh hah
11:15 samcv i think MVM_COLLATION_PRIMARY is a good property name
11:15 samcv to make it clear that it won't be available on jvm or other backends if it works etc. not an official unicode property
11:16 samcv well it's an official unicode thing, but it's not the same as the other properties
11:16 samcv and unlike the others can be changed easily with newer unicodes
11:16 samcv i ordered paperback unicode 9.0, two volumes 450 pages each
11:16 samcv only like 8 bucks each though
11:17 samcv unicode++
11:20 samcv interesting… i try and run a spectest
11:20 samcv and i get the MVMArray error
11:20 samcv but i can run -e or do REPL fine
11:23 azertus joined #perl6
11:23 samcv ah. looks like it doesn't check anything but the first codepoint.
11:23 samcv not getting crashes in repl but need to fix that
11:24 rafasch My language changed it's collation order in the year I was born.
11:25 samcv nice
11:25 samcv language?
11:26 rafasch Portuguese
11:26 samcv also i haven't implemented uhm what happens if the primary collation order is the same
11:27 samcv if we need more speed with string comparing, in nqp then we should change any function that doesn't need a ternary result from cmp_s to the moarvm function that only tests if they are the same
11:28 samcv timotimo said that function should be changed so seems alright. once i get the rest in moar not having that error and spectests should hopefully pass
11:30 samcv hmm ok issue
11:30 Woodi hi #perl6 :)
11:30 samcv need to change something so moar returns -1 if that codepoint has no weight instead
11:30 lukaramu joined #perl6
11:30 samcv hi Woodi
11:30 notviki \o
11:31 samcv because it otherwise will think that we should compare by codepoint, even if collation order *is* specified by unicode
11:31 [ptc] o/
11:32 rafasch \o
11:33 samcv hmm actually we shouldn't have to care about that
11:33 samcv most of the only codepoints with primary weights are like control characters and things
11:33 Woodi any idea how to have "disappering" type ? value starts as some temporary object and when some initializations are done type changes into desired type ? like in browsers: first picture is shown as empty box with right size but later picture loads ?
11:34 samcv with a 0 value for weight i mean
11:34 rafasch Soon they will be changing Unicode when we complain it's too difficult to implement something.
11:34 samcv lol
11:34 samcv tbh it could be worse
11:34 samcv they do good work
11:34 notviki m: my Int $x = 42; dd $x; $x.subst-mutate: '4', 'a'; dd $x
11:34 camelia rakudo-moar 19df35: OUTPUT«Int $x = 42␤Type check failed in assignment to $x; expected Int but got Str ("a2")␤  in block <unit> at <tmp> line 1␤␤»
11:34 samcv unicode is complicated because human language is complicated
11:34 notviki ugh
11:34 notviki m: my $x = 42; dd $x; $x.subst-mutate: '4', 'a'; dd $x
11:34 camelia rakudo-moar 19df35: OUTPUT«Int $x = 42␤Str $x = "a2"␤»
11:34 notviki Woodi: ^
11:35 notviki Woodi: you can change the invocant
11:35 samcv so yeah if we compare a control character, and then compare codepoints, it should mostly be fine
11:35 samcv er
11:35 Woodi notviki: thanx :) I see it works but no idea how... invocant ?
11:36 samcv err actually they are all like combining characters and things such as that
11:36 samcv so how we do it now at least we are fine
11:36 samcv since we don't implement multi grapheme matching
11:36 wamba joined #perl6
11:36 samcv err collation
11:37 rafasch Which makes it useless to anything but English.
11:37 notviki m: class Foo { has $.but; method init (\SELF:) { SELF = "meows" but $.but } }; my $x = Foo.new: :but(42); $x.init; dd $x; say $x.Int
11:37 camelia rakudo-moar 19df35: OUTPUT«Str+{<anon|56370992>} $x = "meows"␤42␤»
11:38 notviki Woodi: ^ it's just an arg in the method.
11:38 notviki using `self` will prolly work too
11:38 notviki m: class Foo { has $.but; method init () { self = "meows" but $.but } }; my $x = Foo.new: :but(42); $x.init; dd $x; say $x.Int
11:38 camelia rakudo-moar 19df35: OUTPUT«Cannot modify an immutable Foo␤  in method init at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
11:38 notviki Aha, no it wont :)
11:40 samcv rafasch, does it though?
11:40 rafasch ç has to be next to c
11:41 samcv is that what language independent does?
11:41 samcv let me check
11:41 samcv ugh somehow that's not returning a value but
11:41 samcv rafasch, it will be sorted next to c
11:42 samcv that's not a combining character
11:42 samcv m: 'ç'.ords.say
11:42 camelia rakudo-moar 19df35: OUTPUT«(231)␤»
11:42 samcv this is in the Composed form. not Decomposed
11:42 rafasch And this one -> ç ?
11:42 samcv m: 'ç'.NFD.say
11:42 camelia rakudo-moar 19df35: OUTPUT«NFD:0x<0063 0327>␤»
11:42 samcv m: say "ç".ords
11:42 camelia rakudo-moar 19df35: OUTPUT«(231)␤»
11:43 samcv only in _decomposed_ form does it have multiple
11:43 samcv and lets say canonical unicode form _is_ two codepoints
11:43 samcv then it will sort by the primary character (the one coming first)
11:43 notviki m: say 'ç' === 'ç'
11:43 camelia rakudo-moar 19df35: OUTPUT«True␤»
11:43 samcv and if they are both the same, it will go by grapheme value
11:44 samcv which maybe won't be correct _yet_ until we implement checking multiple graphemes
11:44 samcv err codeponits per grapheme
11:44 samcv but that is how this is going to work initially
11:45 rafasch What about 'ça' (decomposed) and (ca) ?
11:45 samcv it's not decomposed though
11:45 samcv it's composed in the internal representation in moarvm
11:45 rafasch I see.
11:45 samcv if you want to force decomposed you could use NFD to store the codeponits
11:46 samcv otherwise they are stored in NFC-ish form
11:46 samcv c=cannonical
11:46 rafasch Many languages have charachters that don't have composed forms.
11:46 notviki This is kinda scary... I thought basic and prevalent concepts like cmp were nailed down ages ago :S
11:46 samcv argh getting index out of bounds still
11:46 samcv notviki, in jvm it works fine
11:46 samcv fyi
11:47 notviki m: say "a\x[308]";
11:47 camelia rakudo-moar 19df35: OUTPUT«ä␤»
11:47 notviki m: say "a" cmp "á";
11:47 camelia rakudo-moar 19df35: OUTPUT«Less␤»
11:47 notviki j: say "a" cmp "á";
11:47 camelia rakudo-jvm 8ca367: OUTPUT«Less␤»
11:47 samcv uh
11:47 samcv bad choice
11:47 samcv m: say "b" cmp "á";
11:47 camelia rakudo-moar 19df35: OUTPUT«Less␤»
11:47 samcv j: say "b" cmp "á";
11:47 camelia rakudo-jvm 8ca367: OUTPUT«Less␤»
11:48 Woodi about failures from #perl6-dev:  https://gist.github.com/anonymous/bfa6d799ccc890be63eafa5ea75009c2  + backlog copy; it's surprising Promise do not throw just like Failure. but nice :)
11:48 samcv not sure why that one says less
11:48 samcv j: say "b" cmp "á";
11:48 camelia rakudo-jvm 8ca367: OUTPUT«Less␤»
11:48 samcv j: say "b" cmp "a";
11:48 camelia rakudo-jvm 8ca367: OUTPUT«More␤»
11:48 samcv maybe bug in jvm
11:48 samcv maybe it has a composed form or something
11:48 samcv it's multiple codepoints composed that is
11:49 samcv ones that are single codepoints in canonical form cmp properly with jvm
11:49 notviki samcv: I mean that Perl 6 is at the front of the pack as far as Unicode goes, only Swift comes close, and yet... our cmp is broken?
11:50 notviki and uniprop is broken
11:50 samcv well
11:50 samcv yeah
11:50 samcv i mean as a language it does unicode really well
11:50 rafasch m: say 'ŝa' cmp 'ŝb'
11:50 camelia rakudo-moar 19df35: OUTPUT«Less␤»
11:50 rafasch m: say 'sa' cmp 'ŝb'
11:50 camelia rakudo-moar 19df35: OUTPUT«Less␤»
11:50 rafasch m: say 'ŝa' cmp 'sb'
11:50 camelia rakudo-moar 19df35: OUTPUT«More␤»
11:51 domidumont joined #perl6
11:51 samcv the internal handling of unicode is very supirior to most things except maybe jvm and some others. mostly cause jvm has been around so long and is used for so much
11:51 samcv and better for typed language
11:51 samcv in the code
11:51 samcv much more unicode first
11:51 notviki If jvm is so awesome how come we fudge everything for it?
11:51 notviki j: "x".uniprop.say
11:51 camelia rakudo-jvm 8ca367: OUTPUT«uniprop NYI on jvm backend␤  in method throw at gen/jvm/CORE.setting line 27529␤  in sub die at gen/jvm/CORE.setting line 792␤  in sub uniprop at gen/jvm/CORE.setting line 15437␤  in method uniprop at gen/jvm/CORE.setting line 9661␤  in block <uni…»
11:51 samcv also swift prolly doesn't even have uniprop
11:52 samcv python has a core module with only like
11:52 samcv 10 properties
11:52 samcv that it has
11:52 samcv so us supporting like
11:52 samcv currently at least 40
11:52 * notviki forcees a lot of RT tickets written in broken English, calling us a "puta" for breaking user's code
11:52 samcv nis not too bad
11:52 samcv link
11:54 rafasch Is there any plans to include local variation modules in Star?
11:54 notviki rafasch: what's "local variation"?
11:54 samcv wtf
11:54 samcv i run
11:54 pyrimidine joined #perl6
11:54 rafasch Lika, local variations in collation order and such
11:54 samcv err so i can run programs
11:54 samcv it works fine
11:54 notviki no idea
11:55 samcv but i try running a .t file and i get MVMArray: Index out of bounds
11:56 samcv repl is fine
11:56 samcv can't compile nqp or rakudo though. immediatly like. instantaniously gives me that error
11:56 Gasher joined #perl6
12:00 rburkholder joined #perl6
12:08 effbiai joined #perl6
12:08 effbiai joined #perl6
12:15 Rawriful joined #perl6
12:15 darutoko- joined #perl6
12:21 clkao joined #perl6
12:24 notviki woa... Perl 6 book: http://deeptext.media/perl6-at-a-glance/
12:26 notviki "A. Shitov Perl 6 at a Glance"
12:26 notviki Is it OK to laugh at that last name?
12:27 lizmat notviki: well, it *is* his last name
12:27 samcv would look better without 1st name abbreviated
12:28 lizmat well, it's not abbreviated on the cover
12:28 samcv oh ok
12:29 notviki Sure, but translitiration is killing me :P
12:30 lizmat well, what about Dick Hardt ?
12:30 * notviki lols
12:30 notviki I forget, who is that?
12:30 notviki Or Active States ex-CEO?
12:31 lizmat https://en.wikipedia.org/wiki/Dick_Hardt
12:31 notviki He looks badass :)
12:32 lizmat :-)
12:41 lizmat moritz: perhaps tweet about http://deeptext.media/perl6-at-a-glance/ ?
12:42 dugword joined #perl6
12:47 moritz lizmat: thanks!
12:51 rafasch Anyone here got a review copy?
12:52 lizmat not yet
12:55 moritz kinda curious that there's no ebook available
12:56 dataf3l joined #perl6
13:00 rafasch I sent them an e-mail saying they should send you guys a copy of the book.
13:01 notviki they should? :)
13:01 rafasch yep
13:01 rafasch good marketing
13:02 * notviki doesn't see it
13:03 notviki Hell, giving me a copy is a bad idea even... I'll find something bad to say about it.
13:03 moritz well, if I know it's good, I'm more likely to recommend it to others :-)
13:03 rafasch That's criticism, that's why I said they are review copies.
13:04 dalek perl6-mode: 4867c6d | (Tom Browder)++ | test/test-imenu.p6:
13:04 dalek perl6-mode: add example state var
13:04 dalek perl6-mode: review: https://github.com/perl6/perl6-mode/commit/4867c6d268
13:04 rafasch Like game companies sending review copies to people that publish videos of them playing games.
13:07 notviki those are popular youtubers...
13:07 notviki and this channel usually stays as π number of people in it
13:12 rafasch Well, if the language goes up in popularity (and the publisher thinks it will, they are even publishing books about it), you guys are also getting popular, relatively speaking.
13:13 rafasch World-renowned specialists.
13:15 * notviki just makes shit up most of the time.
13:15 rafasch notviki: You have impostor syndrome.
13:16 notviki Hah
13:20 rafasch Since all software sucks¹, making shit up is exactly what you should be doing. [1]http://harmful.cat-v.org/software/
13:22 notviki Perl 6 is not in the list, so I guess we're good.
13:23 bjz joined #perl6
13:23 notviki m: say Rat.Range === -∞^…^∞
13:23 camelia rakudo-moar 19df35: OUTPUT«Stub code executed␤  in any  at /home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.setting.moarvm line 1␤  in block <unit> at <tmp> line 1␤␤»
13:23 notviki hehehe
13:24 notviki Oh right.
13:24 notviki It's supposed to be ..
13:26 mawkish_ joined #perl6
13:28 rafasch -∞^…^∞: https://thumbs.dreamstime.com/z/happy-funny-man-peeking-over-wall-white-sign-14972538.jpg
13:29 dataf3l joined #perl6
13:35 pyrimidi_ joined #perl6
13:36 notviki hm... Wonder what will happen when I give WWW::Mechanize a Perl 6 regex... via Inline::Perl6
13:36 * notviki dons the bomb suit
13:39 ChoHag joined #perl6
13:40 notviki heh doesn't work
13:40 notviki just prints "CODE(0x4f96588) passed as text_regex is not a regex at -e line 0."
13:42 notviki code I used FWIW https://gist.github.com/zoffixznet/4a128614904fb65ee9908e1bfe9aeba1
13:44 dataf3l joined #perl6
13:47 notviki I mean Inline::Perl5
13:48 rafasch I was going to point it out, but it was so obviously a typo I didn't bother.
13:57 * AlexDaniel just realized that books have no syntax highlighting
13:57 notviki They can :)
14:00 AlexDaniel $_.say :-/
14:00 finanalyst joined #perl6
14:01 AlexDaniel but yeah, the contents of the book seem rather decent!
14:01 AlexDaniel although of course I can't see the whole book
14:01 StefanSC joined #perl6
14:03 vike joined #perl6
14:04 newbie1 joined #perl6
14:06 [Coke] ooh, I think $dayjob fixed my laptop.
14:07 AlexDaniel notviki: if I recall correctly he is Russian, and “Sh” in his last name is more ш than щ, so-o-o… it doesn't sound like it looks :)
14:08 mawkish_ joined #perl6
14:09 AlexDaniel though I have to admit that I'd laugh if the full name was like “Dick Shitov”… :S
14:14 AlexDaniel anyway, good morning everyone! Let's start unwrapping the gifts…
14:14 AlexDaniel commit: 2015.12,HEAD say (‘a’..‘e’).rotor(3, Inf, :partial)'
14:14 committable6 AlexDaniel, https://gist.github.com/4d8af9fdf8f7165b9a719bab82c12332
14:14 [Coke] I am sad that the Shitov book claims to support a version of a language that doesn't exist. :(
14:14 [Coke] s/of a/of the/
14:14 AlexDaniel commit: 2015.12,HEAD say (‘a’..‘e’).rotor(3, Inf, :partial)
14:14 committable6 AlexDaniel, ¦«2015.12»: ===SORRY!===␤This type cannot unbox to a native integer «exit code = 1»␤¦«HEAD»: Cannot coerce Inf to an Int␤  in block <unit> at /tmp/3YPCLmoVHd line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/3YPCLmoVHd line 1␤ «exit code = 1»
14:14 AlexDaniel commit: 2015.12,HEAD my @a = ‘a’..‘e’; say (@a.rotor($_, Inf, :partial) for 1..^+@a)
14:14 committable6 AlexDaniel, ¦«2015.12»: (((a) (b c d e)) ((a b) (c d e)) ((a b c) (d e)) ((a b c d) (e)))␤¦«HEAD»: Cannot coerce Inf to an Int␤  in block <unit> at /tmp/iE6srpsROk line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/iE6srpsROk line 1␤ «exit code = 1»
14:15 AlexDaniel [Coke]: not sure how I missed this one :D
14:17 dataf3l joined #perl6
14:18 regnarg joined #perl6
14:20 notviki AlexDaniel: I don't pronounce Sh щ :S
14:20 pmurias joined #perl6
14:24 [Coke] AlexDaniel: did you review the book or something?
14:24 AlexDaniel not at all. But there are some pictures on the same page
14:25 [Coke] I'll email him on the feedback link.
14:27 mawkish_ joined #perl6
14:31 notviki moritz: author says "not yet" for eBoook version
14:33 mawkish_ joined #perl6
14:33 AlexDaniel m: say (0..Inf)[99999999]
14:33 AlexDaniel I wonder why can't we make this a bit smarter?
14:33 camelia rakudo-moar 19df35: OUTPUT«(timeout)»
14:34 AlexDaniel m: say (0..999999999999999999999999999999999999999)[99999999]
14:34 camelia rakudo-moar 19df35: OUTPUT«99999999␤»
14:34 AlexDaniel m: say (0..999999999999999999999999999999999999999)[*-1]
14:34 camelia rakudo-moar 19df35: OUTPUT«999999999999999999999999999999999999999␤»
14:35 AlexDaniel the only question is what (0..Inf)[*-2] is supposed to return… :)
14:36 rafasch Inf, of course
14:36 rafasch Inf-2 = Inf
14:37 AlexDaniel well, erroring out is a good alternative also.
14:37 khw joined #perl6
14:37 rafasch What does IEEE says?
14:37 AlexDaniel I don't think IEEE defines ranges
14:38 AlexDaniel this is not Inf-$x. Here we have a range with Inf on its endpoint which results in an infinite list in most cases
14:39 AlexDaniel and so we're trying to get an element from the end of an infinite list…
14:39 rafasch Which is Inf - $x = Inf
14:40 pmurias m: say (0..Inf)[*-1]
14:40 camelia rakudo-moar 19df35: OUTPUT«Cannot coerce Inf to an Int␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
14:40 rafasch Well, unless it's a convergent list.
14:41 dogbert2 m: say "123".comb.WHAT # shouldn't this be (List) ?
14:41 camelia rakudo-moar 19df35: OUTPUT«(Seq)␤»
14:41 AlexDaniel rafasch: it will only work with ranges
14:42 AlexDaniel I think @x = 0..∞; say @x[*-2] is never going to work
14:42 AlexDaniel but I could be wrong
14:43 notviki m: say Inf -2
14:43 camelia rakudo-moar 19df35: OUTPUT«Inf␤»
14:43 notviki AlexDaniel: smarter how?
14:43 jabowery joined #perl6
14:43 AlexDaniel dogbert2: oh you want a List? Here:
14:43 AlexDaniel m: say "123".comb(/./).WHAT # shouldn't this be (List) ?
14:43 camelia rakudo-moar 19df35: OUTPUT«(List)␤»
14:43 AlexDaniel dogbert2: RT #130433, feel free to leave a comment there
14:43 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130433
14:44 AlexDaniel notviki: well we can return a value easily
14:44 AlexDaniel notviki: just like we do in this case: 0..99999999999999999
14:44 notviki AlexDaniel: ah, OK, I know why it hangs
14:44 notviki it's calling .list on it
14:44 AlexDaniel sure
14:45 notviki m: (1e200..1e200+1)[1] # same reason this hangs
14:45 camelia rakudo-moar 19df35: ( no output )
14:45 notviki :(
14:45 jabowery For the record, I resolved the problem with perl6-debug-m spawning legions of mora processes by apt purging, deleting, rakudobrew nuking etc. all rakudo-related installs and reinstalling them all.
14:45 notviki m: (1e200...1e200+1)[1] # same reason this hangs
14:45 camelia rakudo-moar 19df35: ( no output )
14:45 notviki m: (1e200...1e200+1).pick # same reason this hangs
14:45 camelia rakudo-moar 19df35: ( no output )
14:45 notviki dammit
14:45 notviki m: (1e200...1e200+1).rand # same reason this hangs
14:45 camelia rakudo-moar 19df35: ( no output )
14:45 notviki :o
14:46 notviki m: (1e200..1e200+1).rand # same reason this hangs
14:46 camelia rakudo-moar 19df35: OUTPUT«Can only get a random value if the range is positive␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
14:46 AlexDaniel cool right?
14:46 jabowery mora -> moar
14:46 notviki lulz wat
14:46 notviki it is positive!
14:46 AlexDaniel :o
14:46 AlexDaniel commit: 6c (1e200..1e200+1).rand
14:46 committable6 AlexDaniel, https://gist.github.com/d496d9996275f8dcecfef9dc298ab337
14:47 notviki m: (1e200..1e200+1).roll # same reason this hangs
14:47 notviki Oh THERE! Finally found the hanging one :P
14:47 camelia rakudo-moar 19df35: OUTPUT«(timeout)»
14:48 geekosaur jabowery, I think it's a known (and likely unfixable) issue that a rakudobrew install can find stuff installed outside of rakudobrew and use it, resulting in severe confusion
14:49 dataf3l joined #perl6
14:50 rafasch geekosaur: is it because of $PATH issues?
14:51 AlexDaniel notviki: anyway, RT #130437
14:51 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130437
14:51 jabowery I'm finding the perl6-debug-m CLI a bit difficult to get used to.  Did someone write up the philosophy on why it departed so much from perl -d?
14:51 geekosaur possibly $PATH (note that removing /usr/bin from $PATH to try to avoid something installed by apt-get is not an option), possibly Configure.pl looking around for stuff
14:52 dogbert2 AlexDaniel: why the difference between "123".comb(/./).WHAT  and  "123".comb.WHAT  now that is odd
14:52 AlexDaniel dogbert2: well, there's a ticket
14:52 notviki jabowery: people who wrote it don't know or don't care about what Perl 5 does?
14:52 pe joined #perl6
14:52 dogbert2 AlexDaniel: will check it out
14:52 AlexDaniel dogbert2: I'd say it should be a Seq everywhere, but feel free to comment on the ticket saying why not
14:53 notviki jabowery: seems a "third party" module altogether
14:53 rafasch geekosaur: I see, same Unix as ever.
14:53 notviki AlexDaniel: "This can be easily solved."... um.. how?
14:54 geekosaur the real problem is likely that configure scripts are by design and specific intent going to look all over the place for things, and you can't stop them except by syscall sandboxing
14:54 AlexDaniel notviki: just check if it's Inf and do the same kind of maths?
14:54 dogbert2 AlexDaniel: one of my euler programs failed because of the change to Seq that's why I noticed. Changing to your version, i.e. (/./) fixed it
14:54 rafasch Yep, lightweight conteiners.
14:54 AlexDaniel notviki: or are there any reasons why it cannot be done?
14:55 AlexDaniel dogbert2: I think it also made it slower :)
14:55 dogbert2 AlexDaniel: probably :)
14:55 notviki AlexDaniel: I've not looked at it, but I figured the "it can be easily done" comment can come with description of what it is :)
14:55 notviki m: my @a := 1..Inf; dd @a[999999]
14:55 camelia rakudo-moar 19df35: OUTPUT«1000000␤»
14:56 notviki m: my @a := 1.2..Inf; dd @a[999999]
14:56 notviki hah
14:56 camelia rakudo-moar 19df35: OUTPUT«1000000.2␤»
14:56 rafasch Doesn't .cache turns a Seq into a List?
14:57 notviki m: my @a := 1..Inf; dd @a[999999]; say now - INIT now
14:57 camelia rakudo-moar 19df35: OUTPUT«1000000␤0.8055577␤»
14:57 notviki m: my @a := 1.2..Inf; dd @a[999999]; say now - INIT now
14:57 camelia rakudo-moar 19df35: OUTPUT«1000000.2␤11.6952814␤»
14:57 * notviki takes a look at wtf that's so much slower
14:57 itcharlie_linux joined #perl6
14:58 AlexDaniel notviki: well, it checks $!is-int and performs a math solution if it's true-ish. $!is-int = nqp::istype($!min,Int) && nqp::istype($!max,Int);
14:58 dogbert2 AlexDaniel: I wish there was a faster way to split a string on a 'char' by 'char' basis
14:58 notviki AlexDaniel: but $!max isn't Int
14:59 AlexDaniel notviki: yea, which is why it doesn't work
14:59 notviki OK
14:59 AlexDaniel notviki: so making it check for $!min only (in AT-POS) can possibly make it work
15:00 notviki I'd it it making a "math solution" instead of reifying everything it worth trying, would fix the hang in (1e200..1e200+1).roll too
15:00 notviki Engrish
15:00 Woodi notviki: example class Foo from before is not what I wanted - after .init is still "meows" :)  idea is that at first object work as tie/Proxy - same behaviour and API and then, after some event (eg. loading) it disappears as in "pointer switch". or morphs, whatever...
15:01 Woodi ...so method calls can reach true wanted object
15:01 notviki The container containing object instance doesn't meow
15:01 notviki the value gets replaced
15:01 Woodi dd still do :)
15:02 Woodi it needs to be proxy-like and then real object like eg. Picture. some bind trick ?
15:02 notviki m: class Foo { has $.but; method init (\SELF:) { SELF = "meows" but $.but } }; my $x = Foo.new: :but(42); $x.init; dd $x; say $x.Int; say $x.but
15:03 camelia rakudo-moar 19df35: OUTPUT«Str+{<anon|62899856>} $x = "meows"␤42␤No such method 'but' for invocant of type 'Str+{<anon|62899856>}'␤  in block <unit> at <tmp> line 1␤␤»
15:03 notviki "no such method"
15:03 notviki Object has been replaced
15:03 Woodi checking :)
15:03 notviki Foo hasn't been replaced, if that's what you're asking
15:05 dataf3l joined #perl6
15:08 notviki huh
15:08 notviki m: say (0..Inf).iterator.pull-at-least(999999)
15:08 camelia rakudo-moar 19df35: OUTPUT«No such method 'pull-at-least' for invocant of type '<anon|430927840>'␤  in block <unit> at <tmp> line 1␤␤»
15:09 dataf3l joined #perl6
15:09 Woodi notviki: possibly it's what I want. just need to learn more... thanx
15:09 notviki m: say given (0..Inf).iterator { gather { take .pull-one for ^999999 } } }
15:09 camelia rakudo-moar 19df35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument, or use &say to refer to the function as a noun␤at <tmp>:1␤------> 3say7⏏5 given (0.…»
15:09 notviki ffs
15:09 notviki m: say(given (0..Inf).iterator { gather { take .pull-one for ^999999 } } })
15:09 camelia rakudo-moar 19df35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> 3say(given 7⏏5(0..Inf).iterator { gather { take .pull-␤»
15:10 notviki m: say do given (0..Inf).iterator { gather { take .pull-one for ^999999 } } }
15:10 camelia rakudo-moar 19df35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unexpected closing bracket␤at <tmp>:1␤------> 3gather { take .pull-one for ^999999 } } 7⏏5}␤»
15:10 notviki -_-
15:10 notviki AlexDaniel: but the huh was it already has a elsif nqp::istype($!min, Numeric) && $!max === Inf { shortcurcuit in its iterator
15:10 rafasch m: say do given (0..Inf).iterator { gather { take .pull-one for ^999999 } }
15:10 camelia rakudo-moar 19df35: OUTPUT«No such method 'pull-one' for invocant of type 'Int'␤  in block  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
15:12 notviki m: my $i = 1; $i++ for ^100000; say now - INIT now
15:12 camelia rakudo-moar 19df35: OUTPUT«0.059461␤»
15:12 notviki m: my $i = 1.1; $i++ for ^100000; say now - INIT now
15:12 camelia rakudo-moar 19df35: OUTPUT«0.891530125␤»
15:13 notviki holy crap
15:13 notviki it uses .succ
15:15 domidumont joined #perl6
15:15 notviki m: my $i = 1e0; $i++ for ^100000; say now - INIT now
15:15 camelia rakudo-moar 19df35: OUTPUT«0.06945909␤»
15:16 bwisti joined #perl6
15:17 mawkish_ joined #perl6
15:20 dataf3l joined #perl6
15:22 rafasch m: say 0.891530125/0.059461
15:22 camelia rakudo-moar 19df35: OUTPUT«14.9935273␤»
15:23 mawkish_ joined #perl6
15:23 dataf3l joined #perl6
15:24 * notviki doesn't get the difference between Rat and FatRat :/
15:24 notviki both are " is Cool does Rational[Int, Int] {"
15:25 notviki and only provide their own Rat<->FatRat and perl methods, the rest is shared :/
15:25 rafasch One has UInt64 in the denominator and the other has Int
15:26 notviki Where do you see that?
15:26 rafasch class Rat is Cool does Rational[Int, UInt64] { } <--> class FatRat is Cool does Rational[Int, Int] {}
15:27 rafasch Rat has limited precision, unlike FatRat
15:27 notviki rafasch: where is that from?
15:27 rafasch https://docs.perl6.org/type/Rat
15:27 notviki heh
15:27 rafasch It's the first thing after the menu.
15:28 * notviki is looking at actual implementation
15:28 notviki # XXX: should be Rational[Int, UInt64]
15:28 notviki my class Rat is Cool does Rational[Int, Int] {
15:28 notviki And UInt64 is just a subset of Int, so why have it in the first place?
15:29 rafasch "To prevent the numerator and denominator from becoming pathologically large, the denominator is limited to 64 bit storage. On overflow of the denominator a Num (floating-point number) is returned instead."
15:29 geekosaur because large denominators are VERY BAD
15:29 notviki What's "pathologically large"?
15:29 geekosaur and will absolutely kill performance
15:30 notviki So that's it? Performance? And right now our Rats are FatRats?
15:30 rafasch Bigger than 18,446,744,073,709,551,615
15:30 geekosaur performance, and you are welcome to play around with it and find out exactly why it is an issue
15:30 geekosaur (not just in perl 6)
15:30 geekosaur large denominators are the bane of rational representations, regardless of implementation
15:31 geekosaur and it's all too easy to end up with them
15:31 notviki :(
15:32 cgfbee joined #perl6
15:33 dataf3l joined #perl6
15:36 dataf3l joined #perl6
15:38 mawkish_ joined #perl6
15:39 dataf3l joined #perl6
15:42 dataf3l joined #perl6
15:45 dataf3l joined #perl6
15:45 rafasch I'm thinking about extended and quad precision floating point, is there any plans to make use of it, like in D?
15:49 mawkish_ joined #perl6
15:52 dataf3l_ joined #perl6
15:54 AlexDaniel rafasch: I haven't heard about any plans for it, but perhaps you can draft something?
15:54 AlexDaniel or at least an RFC ticket describing how things should work could help
15:55 rafasch I have heard plans about it: https://design.perl6.org/S09.html
15:55 rafasch > num128
15:55 AlexDaniel oooh!
15:56 AlexDaniel https://github.com/perl6/roast/blob/d1baf2e7a3e56cd6619c46040d04ed6daebc1d02/S02-types/declare.t#L414
15:56 AlexDaniel that's interesting
15:57 rafasch NYI RT #124481
15:57 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=124481
16:00 dataf3l_ joined #perl6
16:02 rafasch m: say (1+1/18_446_744_073_709_551_615)/(1 + 2**(-1074))
16:02 camelia rakudo-moar 19df35: OUTPUT«Numeric underflow␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
16:03 dataf3l joined #perl6
16:03 rafasch m: say (1+1/2)/(1 + 2**(-1074))
16:03 camelia rakudo-moar 19df35: OUTPUT«Numeric underflow␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
16:06 dataf3l joined #perl6
16:06 Ulti_ win 2
16:06 Ulti_ erk
16:09 dataf3l joined #perl6
16:10 notviki m: say 10.071/6.378
16:10 camelia rakudo-moar 19df35: OUTPUT«1.579022␤»
16:11 rafasch m: say (10_071/100)/(6378/100)
16:11 camelia rakudo-moar 19df35: OUTPUT«1.579022␤»
16:11 notviki ironic... my 1.5x increase to Ratty ++/.. broke `now` so I couldn't measure the improvement with Perl 6 itself :(
16:11 notviki rafasch: 10.071 is a Rat
16:12 rafasch I know, I was just fiddling around to see for myself.
16:12 rafasch Seeing is believing.
16:13 notviki m: .nude.say for 10.071, 6.378, 10.071/6.378
16:13 camelia rakudo-moar 19df35: OUTPUT«(10071 1000)␤(3189 500)␤(3357 2126)␤»
16:13 rafasch m: say 10_071/100/6378/100
16:13 camelia rakudo-moar 19df35: OUTPUT«0.000157902␤»
16:13 rafasch m: say 10_071/6378
16:13 camelia rakudo-moar 19df35: OUTPUT«1.579022␤»
16:14 rafasch (1/18_446_744_073_709_551_615).nude
16:14 rafasch m: say (1/18_446_744_073_709_551_615).nude
16:14 camelia rakudo-moar 19df35: OUTPUT«(1 18446744073709551615)␤»
16:14 jabowery Having developed hardware neural network using limited precision integer math it is apparent that a lot of the rational arithmetic systems need to take advantage of functional programming semantics so they can do the algebraic transforms (perhaps assisted by programmer-provided pragmas) to reduce (if not minimize) the bits required to avoid loss of information.
16:15 rafasch Like, making √ a function?
16:16 rafasch Lazy function.
16:16 notviki This was the 1.5x imrovement to Rat++ (by extension .succ and range op with it): https://gist.github.com/zoffixznet/69d1e519c71a594288aea0ad6f55f564  Makes `say now` crash with "P6opaque: get_boxed_ref could not unbox for the representation '20' of type Scalar"; don't care enough to find out why, but maybe it's useful for someone else.
16:16 jabowery More like keeping the √ unevaluated during algebra until it is necessary to output a numeric value.
16:16 rafasch > More like keeping the √ unevaluated during algebra until it is necessary to output a numeric value.
16:17 rafasch That's what I said.
16:17 notviki m: dd WHAT 5**.3
16:17 camelia rakudo-moar 19df35: OUTPUT«Num␤»
16:17 notviki m: dd WHAT 5**(1/3)
16:17 camelia rakudo-moar 19df35: OUTPUT«Num␤»
16:17 StefanSC joined #perl6
16:17 * geekosaur thinking you confuse functional programming with algebraic transformation
16:17 geekosaur the two often go together, but neither actually implies the other
16:18 rafasch Who confuses?
16:18 jabowery No, I specifically said "functional programming semantics".
16:20 jabowery For the relationship with algebra, see:
16:20 jabowery https://www.cs.cmu.edu/~crary/819-f09/Backus78.pdf
16:20 rafasch I don't think it would fit into a GP language, it has to be bindints to a computer algebra system.
16:20 rafasch bindings*
16:20 dataf3l joined #perl6
16:21 rafasch Perl6 is very enabled to have good bindings because a grammar could be made for it, which would call the CAS underneath.
16:24 jabowery The point of the algebra in this case is to permit demand for numeric output to drive the algebra to optimize the lazy evaluation of otherwise unconstrained precision rational arithmetic.
16:24 acrussell joined #perl6
16:25 _4d47 joined #perl6
16:28 rafasch jabowery: if you need that, use specialized software.
16:30 jabowery Certainly and that's what I do.  However if I had time to work on programming language implementation I'd take John Backus's advice.
16:32 rafasch Have a link?
16:32 dataf3l joined #perl6
16:32 jabowery See the prior link to Backus's 1978 Turing Award lecture.
16:33 notviki tl;dr; summarize it in 3 sentences
16:34 notviki 1978... jesus... like a decade before I even existed :/
16:35 dakkar joined #perl6
16:35 jabowery Programming language design and implementation has not kept up with Moore's Law.
16:35 jabowery 3 Sentences relevant in the present context.
16:35 jabowery 1) From the abstract "Unlike von Neumann languages, these systems have semantics loosely coupled to states--only one state transition occurs per major computation."
16:36 jabowery 2) A "state transition" in functional programming is necessary at output of a functional form.
16:37 jabowery 3) Until output is required, you have practical recourse to algebraic transformations which can optimize the program to serve only that information demanded by the output.
16:38 dugword joined #perl6
16:38 rafasch You want a even-more complicated language?
16:38 zacts joined #perl6
16:38 jabowery It's a more complicated implementation that simplifies the language.
16:39 rafasch People took 16 years as it is, how much time do you think is reasonable?
16:40 jabowery You permit programmer-provided pragmas to guide the interpreter/compiler, but those pragmas are _not_ essential to the expression of the programmer's intent.
16:40 jabowery There is no reason this has to hold anything up.  It's just something to keep in mind.
16:40 rafasch Like Macros? It's comming.
16:41 jabowery "pragmas" in the sense I mean, are better thought of as information provided by the programmer to the compiler/interpreter that is not formally necessary to the expression of intended meaning.
16:42 jabowery They are pragmatic guides that could, in fact, be provided in a separate file or as command line arguments to the interpreter/compiler.  Most strongly typed programming languages would be better implemented as an untyped semantics with a pragma language containing type declarations to the compiler/interpreter.
16:45 _4d47 left #perl6
16:48 jabowery The relevance to high precision computation is that declaration of precision in the expression is not strictly necessary to the intended meaning -- except at output.  However, doing algebra is hard for computers and some guidance from the programmer to the algebra system may be helpful -- as it is in existing computer assisted algebra systems like COQ.
16:49 Rawriful joined #perl6
16:49 rafasch Perl6 has plenty of space for pragmas/modules like that. It's what I suggested up there.
16:49 jabowery Ah, thanks for clarifying.  I did think of that but it is a general language design concept.
16:51 TEttinger joined #perl6
16:52 rafasch P6 guts are completely open for redefinition.
16:55 jabowery That's a major strength (and, of course, a weakness when recklessly used).
16:57 rafasch p6 will still have goto, "can be recklessly used" isn't an argument that works for us.
16:57 jabowery Nor should it be.
16:57 jabowery Programming is a pragmatic activity.
16:58 jabowery (That's why I like "pragmas" :) )
16:58 notviki jabowery: does that paper also describe how to do that stuff? We do it for division where we can (we have Rational types), but I can't think off hand what else can be done.
17:00 jabowery There's been a huge amount of work done since that 1978 lecture in the field.  I wouldn't read that paper for anything but a general introduction to seminal philosophy.
17:01 Rawriful joined #perl6
17:02 notviki It sure has lots of symbols I've no idea the meaning of :(
17:02 jabowery I got interested in this stuff while trying to design a relational programming system for the viewtron system's nation-wide videotex network, so I've lost track of a lot of the functional programming world.  I'll poke around a bit.
17:02 rafasch notviki: you should read it, almost all of his recommendations are followed by Perl6. jabowery is complaining it's not 100%, but like we were saying, it can come later because the language is so extensible.
17:03 Xliff m: $_ = "femtofemtofarads"; s:g[ « femto\-?     ] = 'f,'; .say
17:03 camelia rakudo-moar 19df35: OUTPUT«f,femtofarads␤»
17:04 Xliff ^ Does that form of substitution support the global modifier?
17:04 Xliff (And I'm just doing it wrong, above)
17:04 notviki God, I hope that's PhD level CS and not something normal programmers know
17:04 notviki Xliff: yes
17:05 notviki m: $_ = "femtofemtofarads"; s:g[ femto\-?     ] = 'f,'; .say
17:05 camelia rakudo-moar 19df35: OUTPUT«f,f,farads␤»
17:05 Xliff Oh! LOL!
17:05 Xliff It was actually working properly!
17:05 Xliff m: $_ = "femto femtofarads"; s:g[ « femto\-?     ] = 'f,'; .say
17:05 camelia rakudo-moar 19df35: OUTPUT«f, f,farads␤»
17:06 Xliff Thanks, notviki++
17:07 jabowery Here is a good web page with multiple sources:
17:07 jabowery https://wiki.haskell.org/Exact_real_arithmetic
17:07 jabowery "Exact reals must allow us to run a huge series of computations, prescribing only the precision of the end result. Intermediate computations, and determining their necessary precision must be achieved automatically, dynamically."
17:07 notviki Thanks.
17:07 * notviki adds it to Notes file... for later reading
17:12 pyrimidine joined #perl6
17:13 pierre_ joined #perl6
17:15 rafasch One simple way of improving it would be to return a Rat even when dealing with irrational numbers, instead of forcing them into Num.
17:16 moritz sounds totally simple, if you want to implement all those transcedental functions yourself
17:17 rafasch Those numbers are calculated by computers using some form of the Taylor series. Numbers will have limited precision anyway, so calculate the partial sum up to the term that provides the required precision and return that instead of forcing it into floating point.
17:18 wamba joined #perl6
17:19 TEttinger "the" taylor series?
17:19 TEttinger isn't there an infinitely large family of taylor approximations of functions?
17:19 moritz rafasch: it's not so simple
17:20 moritz rafasch: you *really* don't want to implement sin(1e308) as a naive Taylor series
17:20 TEttinger m: sin(1e308)
17:20 camelia rakudo-moar 19df35: OUTPUT«WARNINGS for <tmp>:␤Useless use of "sin(1e308)" in expression "sin(1e308)" in sink context (line 1)␤»
17:20 TEttinger m: say sin(1e308)
17:20 camelia rakudo-moar 19df35: OUTPUT«0.453396490501649␤»
17:20 TEttinger pretty good, moar
17:21 moritz rafasch: you need to old the input to a specific range, need some tables for reference, and then interpolate between the table elements to get a decent precision and stability
17:21 notviki m: say sin(my num $ = 1e308)
17:21 camelia rakudo-moar 19df35: OUTPUT«0.453396490501649␤»
17:21 moritz which is a whole lot of work, and rather error-prone
17:22 rafasch Oh, sure. I'm just making a tought experiment. Exactly to find flaws with this position.
17:22 TEttinger alternately, an Irrat class to complement Rat
17:23 andreoss joined #perl6
17:23 rafasch Do you know of some way of representing infinite fractions on a computer?
17:24 TEttinger Irrat might be defined not by a numerator and denominator, but by a Rat and a function of some kind to determine the irrational part to the precision required
17:24 andreoss m: say 1 ** 100 == 1e100
17:24 camelia rakudo-moar 19df35: OUTPUT«False␤»
17:24 andreoss m: say 10 ** 100 == 1e100
17:24 camelia rakudo-moar 19df35: OUTPUT«True␤»
17:24 andreoss m: say sprintf("%d", 10 ** 100)
17:24 camelia rakudo-moar 19df35: OUTPUT«10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000␤»
17:24 TEttinger infinite non-repeating or infinite repeating?
17:24 andreoss m: say sprintf("%d", 1e100)
17:24 camelia rakudo-moar 19df35: OUTPUT«10000000000000000159028911097599180468360808563945281389781327557747838772170381060813469985856815104␤»
17:24 moritz TEttinger: patches for such an implemetation are very welcome
17:24 andreoss why does this happen?
17:25 notviki andreoss: floating point math
17:25 moritz andreoss: sprintf uses floating points under the hood
17:25 notviki andreoss: it has enough precion to store 10000000000000000 exact, and the rest of space is used to store the 10th power
17:25 andreoss moritz: but it works with 10**100
17:25 notviki andreoss: because that's an Int and not a Num
17:25 moritz m: say (10**100).^name
17:25 TEttinger moritz, neat, although I don't currently use perl6
17:25 camelia rakudo-moar 19df35: OUTPUT«Int␤»
17:26 notviki m: say sprintf("%d", 1e100.Int)
17:26 camelia rakudo-moar 19df35: OUTPUT«10000000000000000159028911097599180468360808563945281389781327557747838772170381060813469985856815104␤»
17:26 notviki right
17:26 moritz m: say (1e100).^name
17:26 camelia rakudo-moar 19df35: OUTPUT«Num␤»
17:26 rafasch ϕ can be represented by an infinite repeating.
17:26 TEttinger is that the golden ratio?
17:26 rafasch yes
17:26 TEttinger hm
17:27 TEttinger not totally sure there, is that in a particular radix?
17:27 moritz it's (sqrt(5) - 1)/2 or something like that
17:28 moritz it's not even a transcendental number
17:28 moritz +1, not -1
17:28 rafasch It's the most irrational number, though
17:29 rafasch pi is transcendental but not that irrational
17:29 andreoss shouldn't it switch to Rat (or something )at some point?
17:29 moritz rafasch: by what measure? I only know irrational as a boolean trait
17:29 notviki andreoss: switch what to Rat?
17:30 andreoss notviki: the internal representation of this number
17:30 moritz of what number?
17:30 andreoss m: say 1e+30.Int
17:30 camelia rakudo-moar 19df35: OUTPUT«1000000000000000019884624838656␤»
17:30 rafasch moritz: We were talking about representing numbers as infinite fractions. Phi is the one most difficult to represent as an infinite fraction.
17:31 moritz rafasch: by what measure?
17:31 rafasch The more difficult to represent as a fraction, the more irrational is the number.
17:31 notviki andreoss: 1e100 has two pieces of info: 1.0000000000000000 and that its raised to e100. As you can see, there's no information for all the digits.
17:31 TEttinger moritz: weirdly, you were still right about (sqrt(5) - 1)/2 , that's the inverse of phi
17:31 notviki andreoss: so you get that noise
17:31 moritz rafasch: please define "difficult"
17:31 notviki andreoss: I'm sure how it can switch to something with more information. You can do it yourself tho, as you did with 10**100
17:32 jmerelo joined #perl6
17:32 rafasch By the measure of the number of fractions to be calculated to achieve a certain precision
17:32 notviki andreoss: I meant unsure
17:32 moritz 1e100 is explictly a Num literal, so it makes sense to use Num semantics
17:32 andreoss why e100 isn't doing the same as **100?
17:33 notviki andreoss: because it'd need a ton more space to do that
17:33 moritz andreoss: because it's the notation for Num literals
17:33 andreoss so perl doesn't evaluate it at all
17:33 andreoss i see
17:34 rafasch "e100" is assossiated with the type "Num" (IEEE 754)
17:34 moritz rafasch: is there any proof for that (re phi and infinite fractions)? I've never heard of that before
17:35 rafasch Yes, just a moment.
17:37 rafasch moritz: Hurwitz' Theorem: http://www.ams.org/samplings/feature-column/fcarc-irrational4
17:37 andreoss left #perl6
17:37 moritz rafasch: thanks
17:37 rafasch np
17:37 mawkish_ joined #perl6
17:39 notviki m: say 467748-458456
17:39 camelia rakudo-moar 19df35: OUTPUT«9292␤»
17:40 notviki ... and they left... OK
17:40 moritz eeks, the original publication to the Hurwitz Theorem costs more than 40€
17:42 [Coke] /away
17:43 rafasch There's proofs in wikipedia: https://en.wikipedia.org/wiki/Hurwitz%27s_theorem_(composition_algebras)
17:44 rafasch Opps, wrong Theorem: https://en.wikipedia.org/wiki/Hurwitz%27s_theorem_(number_theory)
17:45 rafasch Here it is: https://zbmath.org/?format=complete&amp;q=an:23.0222.02
17:55 dugword joined #perl6
18:04 skids joined #perl6
18:08 pyrimidine joined #perl6
18:12 sufrostico joined #perl6
18:13 rafasch TEttinger: As a ratio, 2 and 1/2 are the same. Same for the golden one: (sqrt(5)+1)/2 and (sqrt(5)-1)/2
18:14 rafasch m: say ((sqrt(5)+1)/2)/((sqrt(5)-1)/2)
18:14 camelia rakudo-moar 19df35: OUTPUT«2.61803398874989␤»
18:15 rafasch m: say 1/((sqrt(5)+1)/2)  == ((sqrt(5)-1)/2)
18:15 camelia rakudo-moar 19df35: OUTPUT«False␤»
18:15 rafasch m: say 1/((sqrt(5)+1)/2) , ((sqrt(5)-1)/2)
18:15 camelia rakudo-moar 19df35: OUTPUT«0.6180339887498950.618033988749895␤»
18:19 jmerelo Hey, that's phi :-)
18:21 rafasch Only one of them or both?
18:22 jmerelo First one.
18:23 jmerelo Funny you've mentioned it because I hacked a version of Perl6 that includes it as a constant https://github.com/JJ/rakudo/commit/97b276c602c8f73452ab0f7f82cebed7a17d3237
18:23 jmerelo So maybe there's an use case here :-)
18:23 notviki m: say 1/((sqrt(5)+1)/2) ≅ ((sqrt(5)-1)/2)
18:23 camelia rakudo-moar 19df35: OUTPUT«True␤»
18:23 notviki m: say WHAT $_ for 1/((sqrt(5)+1)/2), ((sqrt(5)-1)/2)
18:23 camelia rakudo-moar 19df35: OUTPUT«(Num)␤(Num)␤»
18:24 rafasch One is Φ and the other is Ø, both are the golden ratio.
18:24 jmerelo @moritz I can get into the university VPN and download it for you if you need it
18:25 rafasch Sorry, wrong symbol. One is Φ and the other is φ
18:26 notviki :o
18:30 rafasch One is the reciprocate of the other, so they represent the same ratio.
18:47 moritz jmerelo: I don't need it; just idle curiosity
18:55 notviki m: dd 123456.roots
18:55 camelia rakudo-moar 19df35: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤  in block <unit> at <tmp> line 1␤␤»
18:56 notviki m: dd 123456.roots: pi
18:56 camelia rakudo-moar 19df35: OUTPUT«(<49.7932798467405+0i>, <-24.8966399233702+43.122245285025i>, <-24.8966399233703-43.122245285025i>).Seq␤»
18:56 notviki TIL we have that
18:58 rafasch my @l = roots(0, 1);say @l.elems; say has_approx(0, @l)
18:58 rafasch m: my @l = roots(0, 1);say @l.elems; say has_approx(0, @l)
18:58 camelia rakudo-moar 19df35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    has_approx used at line 1␤␤»
18:58 samcv notviki, want to thank you (again?), for implementing DateTime - DateTime
18:58 rafasch m: my @l = roots(0, 1);say @l.elems; say @l
18:58 camelia rakudo-moar 19df35: OUTPUT«1␤[0+0i]␤»
18:59 samcv idk small change but. I think it's pretty important
19:00 samcv notviki, also spectested 6.c-errata again and passing all tests but package tests
19:00 samcv basic.t, precompilation.t, nested.t
19:09 [Coke] gfldex: doc commit ffb9ce74f81e2113dd3 - why did you change BEGIN to X<BEGIN|BEGIN (phasers)> ?
19:10 [Coke] This causes the search to have a section called "BEGIN (phasers)" with a single element in it, "BEGIN"
19:11 [Coke] I think if we changed all those to |Phasers , that would be OK.
19:11 samcv +1
19:12 * [Coke] goes ahead and does that.
19:14 dugword joined #perl6
19:15 dalek doc: 3e8922b | coke++ | doc/Language/phasers.pod6:
19:15 dalek doc: use same search category for all phasers
19:15 dalek doc: review: https://github.com/perl6/doc/commit/3e8922bde3
19:15 synopsebot6 Link: http://doc.perl6.org/language/phasers
19:19 Deep_Thought joined #perl6
19:22 loveperl joined #perl6
19:23 loveperl (Can't serialize an object of type DateTime) in perl6
19:23 notviki m: DateTime.now.perl.EVAL.say
19:23 camelia rakudo-moar 19df35: OUTPUT«2016-12-29T20:23:49.553226+01:00␤»
19:24 notviki you can?
19:24 rindolf joined #perl6
19:25 loveperl Can't serialize an object of type DateTime
19:25 notviki -_-
19:25 loveperl Can't serialize an object of type DateTime in json::tyny
19:26 notviki loveperl: right, you need to convert it into something first
19:31 notviki m: dd duckmap -> $_ where { not $_ ~~ Numeric|Stringy|Iterable } { .Str }, [1, "two", DateTime.now, { foo => [ 4.5, DateTime.now.utc ] } ]
19:31 camelia rakudo-moar 19df35: OUTPUT«[1, "two", "2016-12-29T20:31:43.441276+01:00", {:foo($[4.5, "2016-12-29T19:31:43.442765Z"])}]␤»
19:31 notviki star: use JSON::Tiny; dd to-json duckmap -> $_ where { not $_ ~~ Numeric|Stringy|Iterable } { .Str }, [1, "two", DateTime.now, { foo => [ 4.5, DateTime.now.utc ] } ]
19:31 camelia star-m 2016.10: OUTPUT«Odd number of elements found where hash initializer expected:␤Found 3 (implicit) elements:␤Last element seen: "2016-12-29T19:31:53.293785Z"␤  in any  at /home/camelia/star-2016.10/share/perl6/runtime/CORE.setting.moarvm line 1␤  in block <unit> at <tmp…»
19:32 notviki huh
19:32 * notviki shrugs and moves on
19:32 japhb notviki: loveperl may be saying that if a DateTime is somewhere deep in a structure that you attempt to serialize, JSON::Tiny will fail to serialize the whole thing, and LTA results.
19:33 japhb I see what you're doing with the duckmap though, that's a cool idea.
19:33 pierre_ joined #perl6
19:34 dugword m: use JSON::Tiny; to-json {foo => 'bar'};
19:34 camelia rakudo-moar 19df35: OUTPUT«===SORRY!===␤Could not find JSON::Tiny at line 1 in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-2/share/perl6/site␤    /home/camelia/rakudo-m-inst-2/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-2/share/perl6␤    CompUnit::Re…»
19:34 japhb dugword: It's in star
19:34 dugword star: use JSON::Tiny; to-json {foo => 'bar'};
19:34 camelia star-m 2016.10: ( no output )
19:35 dugword star: use JSON::Tiny; say to-json {foo => 'bar'};
19:35 camelia star-m 2016.10: OUTPUT«{ "foo" : "bar" }␤»
19:35 dugword star: use JSON::Tiny; say to-json {foo => 'bar', now => DateTime.now};
19:35 camelia star-m 2016.10: OUTPUT«Can't serialize an object of type DateTime␤  in sub to-json at /home/camelia/star-2016.10/share/perl6/site/sources/9B467EEF9267A777BB53BAA2F19BE2C9D756BEED (JSON::Tiny) line 51␤  in sub to-json at /home/camelia/star-2016.10/share/perl6/site/sources/9B467EE…»
19:35 japhb m: say to-json {foo => 'bar'};
19:35 camelia rakudo-moar 19df35: OUTPUT«{␤  "foo" : "bar"␤}␤»
19:35 japhb DLS
19:36 dugword m: say to-json.WHAT
19:36 camelia rakudo-moar 19df35: OUTPUT«Cannot resolve caller to-json(...); none of these signatures match:␤    (Version:D $v, :$indent = 0, :$first = 0)␤    (Real:D $d, :$indent = 0, :$first = 0)␤    (Bool:D $d, :$indent = 0, :$first = 0)␤    (Str:D $d, :$indent = 0, :$first = 0)␤    …»
19:36 dugword m: say &to-json.WHAT
19:36 camelia rakudo-moar 19df35: OUTPUT«(Sub)␤»
19:36 dugword m: say &to-json.perl
19:36 camelia rakudo-moar 19df35: OUTPUT«sub to-json (|c is raw) { #`(Sub|47265480) ... }␤»
19:37 japhb dugword: It's in Rakudo for hysterical raisins but is not in any way standard.  You should use the module for normal code.  Convenient when using the bots though.
19:37 dataf3l joined #perl6
19:38 dugword That makes sense
19:38 dugword Thanks
19:38 pmurias jabowery: re doing algebraic level transform on hybrid Perl 6 with function level programming added on would be a lot harder then in a more pure function level programming language?
19:44 jabowery I'm just catching up with perl6 (programmed a lot of perl starting in early 90s) but I thought perl6 was not only multiparadigm but specifically had as one paradigm functional programming:  https://docs.perl6.org/language/functions
19:44 jabowery "Functions and Functional Programming in Perl 6"
19:45 jabowery Also this includes lazy evaluation IIRC:  https://github.com/perl6/perl6-examples/blob/master/categories/tutorial/lazy-evaluation.pl
19:46 cdg joined #perl6
19:46 pmurias jabowery: isn't what Bacus proposes something a bit different then what's commonly known as functional programming?
19:46 jabowery In other words, there is a functional sub-language in Perl6 with supporting internals.
19:46 mst I've been playing around with using binds more than assignment so my variables end up single-assingment then readonly
19:48 jabowery Only because functional programming has, apparently, not incorporated computer aided algebra advances to the degree envisioned by Backus was trying to argue for maximizing the degree to which programming used functional semantics so that the formal power could be leveraged for a lot of purposes.
19:48 pmurias * Backus
19:49 * [Coke] tries to diagram that sentence.
19:49 jabowery Backus -> Backus.  Backus
19:49 jabowery Sorry.
19:49 notviki m: my @mst := [1..10]; @mst = 42; dd @mst
19:49 camelia rakudo-moar 19df35: OUTPUT«[42]␤»
19:50 jabowery Backus was -> Backus was trying
19:50 jabowery strike that... i had the "trying"  sheesh
19:50 pmurias mst: what Backus was proposing in his paper was to stop using variables for values and just combine functions together
19:52 mst hm, I don't see a link to the paper in scrollback
19:52 kurahaupo joined #perl6
19:52 jabowery https://www.cs.cmu.edu/~crary/819-f09/Backus78.pdf
19:56 jabowery He was trying to minimize stateful variables.  I actually had lunch with him at the 1982 CMU Lisp and Functional Programming conference to talk with him about atomic actions and he admitted he hadn't adequately addressed that aspect.  That was when I decided relational, rather than functional, approaches would be necessary to model asynchronous semantics correctly.  However that's a long and sordid history.
19:56 jabowery Single assignment variables are simply symbol definitions.
19:56 notviki :o
19:57 * notviki wasn't even born that far ago
19:57 [Coke] I found the CS guy.
19:57 [Coke] notviki: whippersnapper.
19:59 notviki committable6, 2015.12 say <a b c d e f g h i j k>.list.rotor: 3 => -Inf, 5, :partial
19:59 committable6 notviki, ¦«2015.12»: Cannot coerce Inf or NaN to an Int␤  in block <unit> at /tmp/niykVkEzFc line 1␤␤Actually thrown at:␤ «exit code = 1»
19:59 notviki AlexDaniel: so what would that do if we allow Inf?
19:59 mst right, I mentioned binding use because 'state is the enemy. state is always the enemy.'
20:00 moritz .oO( replace state by anarchy )
20:00 notviki m: say <a b c d e f g h i j k>.[1..3, (4,), 1..*]
20:00 camelia rakudo-moar 19df35: OUTPUT«((b c d) (e) (b c d e f g h i j k))␤»
20:01 jabowery moritz, you're a poet or at least a purveyor of bad puns.
20:01 jabowery High praise in any event.
20:01 notviki AlexDaniel: cause there's also ^ that way to get "the rest" of stuff
20:03 moritz jabowery: I don't always know myself whethere it's poetry or puns :-)
20:03 rje_ joined #perl6
20:04 rje_ POD text is read as a single line.  How do I split it?  Do I need a magic delimiter in my text?
20:04 samcv notviki, v1.13.1 atom-language-perl6 released as of 4 secs ago
20:04 samcv fixes that anonying `/` bug
20:04 notviki rje_: context/code?
20:05 notviki What do you mean by single line....
20:05 moritz if it's a single string, .lines tends to help
20:05 notviki samcv++ thanks
20:05 rje_ Multi-line pod appears to be read as one big 'ol line...
20:05 rje_ Can I post a multi-line comment here?  (If so, how?)
20:06 notviki rje_: paste the code that reproduces the problem on https://gist.github.com
20:07 rje_ Cool.  OK, gist is https://gist.github.com/bobbyjim/24fd0c5bbeb1bc919f67065fd19135d9
20:07 AlexDaniel eval: https://gist.github.com/bobbyjim/24fd0c5bbeb1bc919f67065fd19135d9
20:07 evalable6 AlexDaniel, It looks like a URL, but mime type is ‘text/html; charset=utf-8’ while I was expecting something with ‘text/plain’ or ‘perl’ in it. I can only understand raw links, sorry.
20:08 AlexDaniel eval: https://gist.githubusercontent.com/bobbyjim/24fd0c5bbeb1bc919f67065fd19135d9/raw/07e7c054a794d828131ca87132cfb094e003163b/gistfile1.txt
20:08 evalable6 AlexDaniel, Successfully fetched the code from the provided URL.
20:08 samcv you can do multiline comment
20:08 evalable6 AlexDaniel, rakudo-moar 19df358: OUTPUT«[FREE TRADER A1 200 S 1 1 22 10 --0 1 1 82 8 0 8 0 0 0 0 0 42  FAR TRADER A2 200 S 1 2 42 11 -…»
20:08 evalable6 AlexDaniel, Full output: https://gist.github.com/760b08c3c9b5872d8a5f97e0ae80657b
20:08 samcv #`{{   ... }}
20:08 samcv or any other delimiter you want
20:08 samcv should have a bot that does .pick on a set of brackets
20:09 samcv out of all the ones ;P
20:09 AlexDaniel notviki: I don't know vOv
20:09 moritz samcv: and give it a blacklist of brackets to not use :-)
20:09 rje_ I'd like the pod to read lines as lines.
20:09 notviki AlexDaniel: I think I'll reject that ticket.
20:10 samcv rje_, does .lines work?
20:10 rje_ Or rather, I'd like Perl6 to read the lines of the pod as lines.  And I don't know how to do that.
20:10 samcv @$=pod.lines
20:10 notviki rje_: reproduced
20:10 samcv is it a bug notviki ?
20:10 samcv does it strip the ␤
20:10 rje_ I don't think it's a bug.
20:10 rje_ I think it's behavior.
20:10 notviki samcv: not sure, but .lines won't help
20:10 rje_ sam, I'll try pod.lines
20:10 samcv it has no nl?
20:11 samcv well if you print it out does it have anything in it? like newlines
20:11 samcv also.
20:11 notviki no new lines
20:11 samcv you need
20:12 rje_ The gist output is the same output I'm seeing: the entire hunk of text, sans newline, bracketed.  (Does that mean it's an array or strings?)
20:12 samcv :allow<S>
20:12 AlexDaniel notviki: uh, your suggested workaround does not seem to work
20:12 samcv and then enclose the whole thing in a S<… > across lines
20:13 samcv or maybe you don't need allow. not sure
20:13 notviki AlexDaniel: what doesn't work?
20:13 rje_ Hey, eval + gist is a neat trick.
20:13 AlexDaniel notviki: → #zofbot
20:13 notviki TOOMANYCHANNELS!
20:13 samcv oh you want
20:13 samcv =begin whatever :formatted<S>
20:13 samcv to retain space and newlinse
20:14 rje_ thanks <samcv>
20:14 samcv does it work?
20:14 notviki samcv: doesn't work
20:14 samcv dammit
20:14 rje_ oops, doesn't appear to work
20:14 notviki committable6: HEAD https://gist.github.com/zoffixznet/123f56db023d349644de0e66b76eb996
20:14 samcv try <C>
20:14 committable6 notviki, It looks like a URL, but mime type is ‘text/html; charset=utf-8’ while I was expecting something with ‘text/plain’ or ‘perl’ in it. I can only understand raw links, sorry.
20:14 notviki committable6: stupid bot
20:14 committable6 notviki, ¦«stupid»: Cannot find this revision
20:14 samcv idk try everything
20:14 notviki TRY ALL THE THINGS
20:15 samcv ^
20:15 rje_ lol
20:15 samcv some combination of options SHOULD do it
20:15 samcv and if there is none. then needs to be fixed
20:15 AlexDaniel eval: https://gist.githubusercontent.com/zoffixznet/123f56db023d349644de0e66b76eb996/raw/19410fdbb6cf52fcb6a9b27d5dea2283be182f10/p6.p6
20:15 evalable6 AlexDaniel, Successfully fetched the code from the provided URL.
20:15 evalable6 AlexDaniel, rakudo-moar 19df358: OUTPUT«Array @!contents = [Pod::Block::Para.new(config => {}, contents => ["FREE TRADER A1 200 S 1 1 …»
20:15 evalable6 AlexDaniel, Full output: https://gist.github.com/fad51781acdd659ef8e4106dd190e9ed
20:15 rje_ looks promising
20:15 samcv uh do C and S
20:15 notviki do how?
20:15 samcv :formatted<C S>
20:16 notviki same thing
20:16 samcv ok
20:16 rje_ yup
20:16 samcv then you want
20:16 samcv =begin data
20:16 notviki heh
20:17 samcv =begin data :key<boats>
20:17 samcv $=data<Boats>
20:17 samcv to access
20:17 notviki rje_: FWIW, perhaps you wanted a table? =begin table  =end table does give structured data
20:17 samcv tho it might like take out newlines
20:17 samcv yea'h table might be better
20:17 rje_ maybe so
20:17 samcv data and S
20:17 notviki committable6: HEAD https://gist.githubusercontent.com/zoffixznet/d1aca35dfe28fbf0f03a30eec723d25d/raw/dfc8a6b5a0e11e90fab2223786d9424b53dc686b/p6.p6
20:17 committable6 notviki, Successfully fetched the code from the provided URL.
20:17 notviki rje_: https://gist.githubusercontent.com/zoffixznet/d1aca35dfe28fbf0f03a30eec723d25d/raw/dfc8a6b5a0e11e90fab2223786d9424b53dc686b/p6.p6
20:17 committable6 notviki, https://gist.github.com/8398e39d6848c67905f6a127651d2734
20:17 samcv data and S should prolly work
20:17 samcv or do a table
20:18 samcv if you don't set a data key it will just be in $=data
20:18 samcv =begin data :formatted<S>
20:18 notviki That doesn't even parse
20:19 samcv damn
20:19 samcv m: =begin data :formatted<S>
20:19 camelia rakudo-moar 19df35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix = instead␤at <tmp>:1␤------> 3=begin data :formatted<7⏏5S>␤»
20:19 rje_ I assume "dd" data-dump?
20:19 notviki Pod variable $=data not yet implemented. Sorry.
20:19 notviki rje_: yes, it's non-standard Perl 6
20:19 rje_ ach
20:19 labster joined #perl6
20:20 samcv m: =begin data ␤ something on the 1st line ␤ something on 2nd␤ =end data␤␤ say dd $=data
20:20 camelia rakudo-moar 19df35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix = instead␤at <tmp>:4␤------> 3<BOL>7⏏5 =end data␤»
20:20 notviki AlexDaniel: so what doesn't work with my solution to rotor?
20:20 samcv m: =begin data :key<stuff>␤ something on the 1st line ␤ something on 2nd␤ =end data␤␤ say dd $=data<stuff>
20:20 camelia rakudo-moar 19df35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix = instead␤at <tmp>:4␤------> 3<BOL>7⏏5 =end data␤»
20:20 pmurias why isn't dd specced?
20:20 samcv it's rakudo specific
20:20 [Coke] because it's just rakudo.
20:20 notviki pmurias: why should it?
20:20 rje_ Typically I like to read the line and then use regexes to rip it apart.  A table might be nicer though.
20:20 samcv the output format is not standardized like .perl
20:21 samcv or just use a heredoc rje_
20:21 espadrine joined #perl6
20:21 rje_ So I could "say .contents.perl" ?
20:21 samcv no
20:21 [Coke] pmurias: could always test it in rakudo's t/, but we're not guaranteeing the format is stable.
20:21 rje_ It looks like it works.
20:21 samcv oh
20:21 samcv i guess it was in $_
20:21 rje_ yah
20:21 AlexDaniel notviki: well, what's the equivalent for .rotor(3, 2, 3, ∞, :partial) ?
20:21 samcv show code rje_
20:21 rje_ that new dot notation threw me
20:22 notviki committable6: 2015.12 <a b c d e f g h i g j>.rotor(3, 2, 3, ∞, :partial).say
20:22 committable6 notviki, ¦«2015.12»: ((a b c) (d e) (f g h) (i g j))
20:22 notviki committable6: 2015.12 <a b c>.rotor(3, 2, 3, ∞, :partial).say
20:22 committable6 notviki, ¦«2015.12»: ((a b c))
20:23 rje_ https://gist.github.com/bobbyjim/139d126c636955c6e75808e1f17ec438#file-test42-txt
20:23 cdg_ joined #perl6
20:24 rje_ eval https://gist.githubusercontent.com/bobbyjim/139d126c636955c6e75808e1f17ec438/raw/c157a7ff6caef4bc9ebcf0c2da5e09f162a1a898/test42.p6
20:25 rje_ eval: https://gist.githubusercontent.com/bobbyjim/139d126c636955c6e75808e1f17ec438/raw/c157a7ff6caef4bc9ebcf0c2da5e09f162a1a898/test42.p6
20:25 evalable6 rje_, Successfully fetched the code from the provided URL.
20:25 evalable6 rje_, rakudo-moar 19df358: OUTPUT«[["FREE TRADER A1 200 S 1 1", "22 10", "--0 1 1 82 8 0 8", "0 0 0 0 0 42"], ["FAR TRADER A2 20…»
20:25 evalable6 rje_, Full output: https://gist.github.com/20fa377ba52d7e21f95bd06abc384fe4
20:25 rje_ strings are diced up sorta funny, but I didn't specify any headers, so...
20:27 rje_ eval: https://gist.githubusercontent.com/bobbyjim/139d126c636955c6e75808e1f17ec438/raw/c157a7ff6caef4bc9ebcf0c2da5e09f162a1a898/test42.p6
20:27 evalable6 rje_, Successfully fetched the code from the provided URL.
20:27 notviki AlexDaniel: OK, yeah
20:27 evalable6 rje_, rakudo-moar 19df358: OUTPUT«[["FREE TRADER A1 200 S 1 1", "22 10", "--0 1 1 82 8 0 8", "0 0 0 0 0 42"], ["FAR TRADER A2 20…»
20:27 evalable6 rje_, Full output: https://gist.github.com/899b8cb6aa8818ae1b9326fa94982fa9
20:28 AlexDaniel notviki: perhaps a :slurp named arg to rotor can be added or something
20:28 notviki rje_: some docs for tables (not all of that may be implemeneted): http://design.perl6.org/S26.html#Tables
20:28 pmurias notviki: we could spec that &dd exists and does implementation specific data dumping stuff
20:28 avuserow joined #perl6
20:29 notviki pmurias: so we'd spec just its existence?
20:33 dataf3l joined #perl6
20:34 rje_ Much better.  eval: https://gist.githubusercontent.com/bobbyjim/139d126c636955c6e75808e1f17ec438/raw/a1ea3e26e9958d2bf1e9db27be55657cc41db2b7/test42.p6
20:34 rje_ eval: https://gist.githubusercontent.com/bobbyjim/139d126c636955c6e75808e1f17ec438/raw/a1ea3e26e9958d2bf1e9db27be55657cc41db2b7/test42.p6
20:34 evalable6 rje_, Successfully fetched the code from the provided URL.
20:34 evalable6 rje_, rakudo-moar 19df358: OUTPUT«[["FREE TRADER", "A1", "200", "S", "1", "1", "22", "10", "--0", "1", "1", "82", "8", "0", "8",…»
20:34 evalable6 rje_, Full output: https://gist.github.com/1d73c587c9ab8b3fba02a16e6bfa209a
20:35 notviki rje_: how come you're using POD for this anyway?
20:35 rje_ I dunno.  With Perl5 I'd use __DATA__, so I looked for the alternative.
20:36 notviki rje_: how come you'd use DATA for this anyway?
20:36 rje_ lol.
20:36 Tonik joined #perl6
20:36 notviki as opposed to... quoted word list or a HEREDOC?
20:36 kyan joined #perl6
20:36 rje_ I guess I've always used __DATA__ for input, and HERE for output.
20:37 notviki m: qqww<"Free Trader" A1 200 "Paid Traider" A2 300">.rotor(3).say
20:37 camelia rakudo-moar 19df35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in double quotes; couldn't find final '"' ␤at <tmp>:1␤------> 200 "Paid Traider" A2 300">.rotor(3).say7⏏5<EOL>␤    expecting any of:␤        double quotes␤»
20:37 rje_ *Usually* used HERE for output.
20:37 notviki m: qqww<"Free Trader" A1 200 "Paid Traider" A2 300>.rotor(3).say
20:37 camelia rakudo-moar 19df35: OUTPUT«((Free Trader A1 200) (Paid Traider A2 300))␤»
20:37 notviki m: dd qqww<"Free Trader" A1 200 "Paid Traider" A2 300>.rotor(3)
20:37 camelia rakudo-moar 19df35: OUTPUT«(("Free Trader", "A1", "200"), ("Paid Traider", "A2", "300")).Seq␤»
20:38 rje_ It was the easiest way to bang in input so I could get on with processing it...
20:38 notviki heh
20:38 rje_ I'm not rendering the data into Perl arrays: I'm using Perl as a code generator.
20:38 rje_ Ah, THAT was your question.
20:38 pierre_ joined #perl6
20:38 rje_ If I were writing this for a Perl app, I'd probably read it from a YAML stream...
20:39 rje_ anyhoo... I'm using Perl to generate a BASIC program that writes the data to a sequential disk image.
20:40 rje_ Sorry, a SEQ file on a disk image.
20:40 rje_ And the reason I'm doing THAT is "just because" or "insanity" or some other reason.
20:41 RabidGravy gosh that really is a blast from the past
20:41 rje_ Right.
20:41 rje_ I wrote modules in Perl5 to fold, spindle, and mutilate various Commodore disk images.
20:41 rje_ Again, "just because" / "insanity" / etc
20:42 notviki committable6: HEAD https://gist.githubusercontent.com/zoffixznet/57e2cad25d387ad74bbfa35348354ed6/raw/05ff6ca5d8a28bf90a6d6e79ff8e65a8a9e9fb32/p6.p6
20:42 committable6 notviki, Successfully fetched the code from the provided URL.
20:42 committable6 notviki, https://gist.github.com/968d65aa15f0a558cbba21e8ef71d2b3
20:42 rje_ So I'm banging data around, and decide "hey, I'll just do this in Perl6."
20:42 notviki rje_: I meant use ^ that instead of PODs or whatever
20:42 notviki and output it anyway you wan
20:42 dugword rje_: perl6 makes reading in other files so much easier than perl5 though, I've found that `for 'some_file.txt'.IO.lines -> $line {...}` really replaced my need to stick data in __DATA__
20:43 rje_ <dugword> I fully expect P6 to be better.  As I am quite new to it, though, I lack experience.
20:45 rje_ So now I gotta figure out how to wrangle the table Perl6 has just handed to me on a platter.
20:45 dugword I am quite new as well, and also used to use Perl5s __DATA__ all the time. That strategy has just worked for me
20:45 cdg joined #perl6
20:45 rje_ I will use __DATA__ when the dataset is restricted.  I happily change to files when I want a more general tool.
20:46 rje_ Looks like tables in P6 speeds things up for me.
20:47 Deep_Thought left #perl6
20:49 notviki That's What We Do(tm)
20:49 notviki That's What We Do™
20:51 cdg joined #perl6
20:53 notviki AlexDaniel: another footgun with Inf in .rotor:
20:53 notviki zoffix@VirtualBox:~/CPANPRC/Standard-Rakudo$ ./perl6 --ll-exception -e 'dd <a b c d e f g>.rotor: 2, 3, Inf'
20:53 notviki (("a", "b"), ("c", "d", "e")).Seq
20:53 cognominal joined #perl6
20:53 notviki Or is that a feature?
20:53 notviki "discard the rest"
20:54 moritz it can't reach Inf elements, so without :partial, it discards them
20:55 notviki Yeah, that's my point.
20:55 notviki You can never get a result for Inf rotation
20:55 notviki without a :partial stuck on
20:57 cooper joined #perl6
20:57 cooper joined #perl6
21:00 notviki m: (^Inf).rotor(3, 4, 5)[^3].say
21:00 camelia rakudo-moar dc7b68: OUTPUT«((0 1 2) (3 4 5 6) (7 8 9 10 11))␤»
21:00 notviki AlexDaniel: and ^ that would hang trying to reify infinitel number of elements....
21:01 AlexDaniel notviki: the previous one looks correct
21:01 AlexDaniel you cannot get an infinite number of elements, you can only get as many as there are
21:01 AlexDaniel which is why :partial is needed
21:01 AlexDaniel if you asked for 999999999 elements it wouldn't give you that, right?
21:01 AlexDaniel only with :partial
21:02 AlexDaniel so the behavior with Inf seems to be consistent
21:03 notviki AlexDaniel: and what about the hang?
21:04 notviki committable6: 2015.12 say <a b c d e f g h i j k l m n>.rotor(3, 4, Inf, :partial)
21:04 committable6 notviki, ¦«2015.12»: ((a b c) (d e f g) (h i j k l m n))
21:04 notviki committable6: 2015.12 say <a b c d e f g h i j k l m n>.rotor(3, 4, -Inf, :partial)
21:04 committable6 notviki, ¦«2015.12»: ===SORRY!===␤Cannot have elems < 1, did you mean to specify a Pair with => -Inf? «exit code = 1»
21:04 notviki committable6: 2015.12 say <a b c d e f g h i j k l m n>.rotor(3, 4, NaN, :partial)
21:04 committable6 notviki, ¦«2015.12»: ((a b c) (d e f g) (h i j k l m n))
21:05 notviki committable6: 2015.12 say (^Inf).rotor(3, 4, NaN, :partial)
21:05 committable6 notviki, ¦«2015.12»: ===SORRY!===␤This type cannot unbox to a native integer «exit code = 1»
21:05 notviki committable6: 2015.12 say (^Inf).list.rotor(3, 4, NaN, :partial)
21:05 committable6 notviki, ¦«2015.12»: ===SORRY!===␤This type cannot unbox to a native integer «exit code = 1»
21:07 notviki committable6: 2015.12 say <a b c d e f g h i j k l m n>.rotor(Inf => 2, :partial)
21:07 committable6 notviki, ¦«2015.12»: Must specify *how* to rotor a List␤  in block <unit> at /tmp/KtAMDVVXoO line 1␤ «exit code = 1»
21:07 notviki committable6: 2015.12 say <a b c d e f g h i j k l m n>.rotor("Inf" => 2, :partial)
21:07 committable6 notviki, ¦«2015.12»: ((a b c d e f g h i j k l m n))
21:10 notviki we don't have any good indicator of infinite lists, right?
21:10 lizmat is-lazy is the closest thing
21:15 bjz joined #perl6
21:15 AlexDaniel notviki: hang? What hang…
21:16 notviki AlexDaniel: dd (1..*).rotor: 2, 3, Inf, :partial
21:17 AlexDaniel oh, well
21:17 AlexDaniel DIHWIDT ?
21:17 AlexDaniel you've asked for as many elements as it can get
21:17 AlexDaniel sure enough it will hang, no?
21:18 AlexDaniel I mean, you don't even need Inf for this
21:18 AlexDaniel m: dd (1..*).rotor: 2, 3
21:18 AlexDaniel m: say (1..*).rotor: 2, 3
21:18 cdg joined #perl6
21:18 camelia rakudo-moar dc7b68: OUTPUT«(timeout)»
21:18 camelia rakudo-moar dc7b68: OUTPUT«((1 2) (3 4 5) (6 7) (8 9 10) (11 12) (13 14 15) (16 17) (18 19 20) (21 22) (23 24 25) (26 27) (28 29 30) (31 32) (33 34 35) (36 37) (38 39 40) (41 42) (43 44 45) (46 47) (48 49 50) (51 52) (53 54 55) (56 57) (58 59 60) (61 62) (63 64 65) (66 67) (68 69 70…»
21:18 dalek doc: ff89b2b | samcv++ | / (2 files):
21:18 dalek doc: Remove references in *.md to Inline::Python and pygments
21:18 dalek doc:
21:18 dalek doc: Add references to needing nodejs and GCC 4.8
21:18 dalek doc: review: https://github.com/perl6/doc/commit/ff89b2bdc9
21:19 AlexDaniel the problem is that it will hang trying to get the third element. But it's fine, I guess?
21:20 notviki :/
21:20 notviki What if you don't know what you're rotoring?
21:21 notviki m: say (1..*).rotor: 2, 3, ^Inf
21:21 camelia rakudo-moar dc7b68: OUTPUT«Cannot have elems < 1, did you mean to specify a Pair with => 0?␤  in block <unit> at <tmp> line 1␤␤»
21:21 notviki wat
21:21 notviki oh it slurps
21:21 cdg_ joined #perl6
21:27 AlexDaniel m: say (^Inf).max
21:27 camelia rakudo-moar dc7b68: OUTPUT«Inf␤»
21:27 AlexDaniel m: say (^Inf).maxpairs
21:27 AlexDaniel well, it was stupid to assume that this is going to work, right? :)
21:27 AlexDaniel m: say (^Inf).min
21:27 camelia rakudo-moar dc7b68: OUTPUT«(timeout)»
21:27 camelia rakudo-moar dc7b68: OUTPUT«0␤»
21:27 mst notviki: if you rotor this rotor you'll say() that this rotor was not worth rotoring?
21:27 AlexDaniel m: say (^Inf).minpairs
21:28 camelia rakudo-moar dc7b68: OUTPUT«(timeout)»
21:28 notviki m: say (^10).minpairs
21:28 camelia rakudo-moar dc7b68: OUTPUT«[0 => 0]␤»
21:28 notviki m: say (^10).maxpairs
21:28 camelia rakudo-moar dc7b68: OUTPUT«[9 => 9]␤»
21:28 notviki .oO( why do we have this... )
21:28 webstrand joined #perl6
21:29 AlexDaniel notviki: so that you can get an index?
21:29 notviki m: say (^10).pairs.max
21:29 camelia rakudo-moar dc7b68: OUTPUT«9 => 9␤»
21:29 notviki m: say (^10+20).pairs.max
21:29 camelia rakudo-moar dc7b68: OUTPUT«9 => 29␤»
21:29 notviki m: say (^10+20).maxpairs
21:29 camelia rakudo-moar dc7b68: OUTPUT«[9 => 29]␤»
21:29 AlexDaniel … um… so that you can get the index efficiently… …?
21:29 notviki hah
21:30 AlexDaniel it probably works on hashes too?
21:30 AlexDaniel m: say { a => 42, b => 50 }.maxpairs
21:30 camelia rakudo-moar dc7b68: OUTPUT«[b => 50]␤»
21:30 AlexDaniel \o/
21:30 AlexDaniel m: say { a => 42, b => 50 }.pairs.max
21:30 camelia rakudo-moar dc7b68: OUTPUT«b => 50␤»
21:30 AlexDaniel :/
21:30 AlexDaniel m: say [15,8,3,15,9].maxpairs
21:30 camelia rakudo-moar dc7b68: OUTPUT«[0 => 15 3 => 15]␤»
21:31 AlexDaniel m: say [15,8,3,15,9].pairs.max
21:31 camelia rakudo-moar dc7b68: OUTPUT«4 => 9␤»
21:31 AlexDaniel \o/
21:31 notviki :)
21:31 lucasb joined #perl6
21:31 notviki m: say [15,8,3,15,9].pairs
21:31 camelia rakudo-moar aa3506: OUTPUT«(0 => 15 1 => 8 2 => 3 3 => 15 4 => 9)␤»
21:31 AlexDaniel yeah, wait… pairs.max does something completely different
21:31 ttkp6 joined #perl6
21:31 webstrand Is there a /dev/null IO::Handle or IO::Pipe? Specifically I want to run a system process with its STD* closed. What's the best way to do this?
21:31 AlexDaniel m: say [15,8,3,15,9].pairs.max(*.value)
21:31 camelia rakudo-moar aa3506: OUTPUT«0 => 15␤»
21:32 ChoHag joined #perl6
21:32 AlexDaniel webstrand: have you tried Nil ?
21:32 AlexDaniel I think it works
21:33 notviki s: Proc, 'new'
21:33 SourceBaby notviki, Sauce is at https://github.com/rakudo/rakudo/blob/aa35065/src/core/Mu.pm#L95
21:33 notviki s: Proc, 'new', \("foo"
21:33 SourceBaby notviki, Something's wrong: â�¤ERR: [31m===[0mSORRY![31m===[0m Error while compiling -eâ�¤Unable to parse expression in argument list; couldn't find final ')' â�¤at -e:7â�¤------> [32m<BOL>[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        argument listâ�¤
21:33 notviki s: Proc, 'new', \("foo")_
21:33 SourceBaby notviki, Something's wrong: â�¤ERR: [31m===[0mSORRY![31m===[0m Error while compiling -eâ�¤Unable to parse expression in argument list; couldn't find final ')' â�¤at -e:6â�¤------> [32m    put sourcery( Proc, 'new', \("foo")[33mâ��[31m_ )[1];[0mâ�¤    expecting any of:â�¤        infixâ�¤        infix stopperâ�¤
21:33 notviki screw you robot
21:33 geekosaur closed is a terrible idea unless you are digging for security holes
21:34 notviki AlexDaniel: if it works... it's not documented
21:34 geekosaur althoguh if you meant open on /dev/null, that's ok (and strongly preferred)
21:34 notviki geekosaur: why security holes?
21:34 AlexDaniel m: … 42
21:34 camelia rakudo-moar aa3506: OUTPUT«42␤  in any  at /home/camelia/rakudo-m-inst-1/share/perl6/runtime/CORE.setting.moarvm line 1␤  in block <unit> at <tmp> line 1␤␤»
21:35 AlexDaniel at first I was like “what? Why is 42 printed to stdout?”
21:35 geekosaur because lots of things tend to use the standard file descriptors, and a program started with them closed will open data files on them and invoked programs will then inherit them by default, which is bad when it's a daemon that may open files and then launch other stuff with lower privilehges
21:36 geekosaur (because, the fd being already open, it will be readable/writable regardless of whether the program could have opened it itself with its current perms)
21:36 notviki magic... got it.
21:36 webstrand p6: run 'false', :in=Nil;
21:36 camelia rakudo-moar aa3506: OUTPUT«Cannot modify an immutable Pair␤  in block <unit> at <tmp> line 1␤␤»
21:37 webstrand Am I doing something wrong?
21:37 notviki webstrand: it'd be :in(Nil)
21:37 notviki And running is disabled on the bot
21:37 webstrand geekosaur: If you don't close stdin for a process that sometimes expects input, it will block forever, right?
21:38 notviki webstrand: and lastly, `false` exists unsuccessfully and you're letting the returned Proc sink and unsucessful procs explode when sunk
21:38 geekosaur /dev/null will return EOF if read
21:38 geekosaur if the program hangs on that, it will hang at the end of a normal file or on ^D in terminal
21:38 pyrimidine joined #perl6
21:41 mawkish_ joined #perl6
21:45 * notviki rolls eyes
21:45 dataf3l joined #perl6
21:45 pierre__ joined #perl6
21:46 notviki Out of dosens of random videos I have on my YouTube channel... and the most discussed video I've been getting notifications daily about now has 21K views and a wall of discussion: https://www.youtube.com/watch?v=IFlAQB39W6E
21:46 notviki And it's 51 seconds of a dude cutting off a girl at a busy road
21:46 notviki That's why humanity will end. We discuss nonsense.
21:47 notviki Don't forget to leave a comment.
21:47 notviki R.I.P
21:47 bjz joined #perl6
21:50 labster joined #perl6
21:50 dugword https://gist.github.com/dugword/a19a5f50bea2a8e06f4850dad71de991
21:51 dugword Is that a bug, or am I using multi methods wrong?
21:52 newbie1 joined #perl6
21:56 Derderderd joined #perl6
21:56 webstrand With Proc.new().spawn(), does the process run in parallel or does spawn wait for the process to exit first?
21:56 mst dugword: try re-ordering them and see what you get, but IIRC named params aren't used as strongly to dispatch as positionals
21:56 Derderderd hey guys! is there a built in http module to send a simple get request to a server? i can't find info on this anywhere
21:57 dugword HTTP::UserAgent can be installed by zef|panda
21:57 dugword That seems to work fairly well for me
21:57 Derderderd hmmm it's strange that you have to install a 3rd party package for something that seems to be so basic
21:58 Derderderd thanks though dugword
21:59 dugword :mst Switching the order changes it
22:01 dataf3l joined #perl6
22:01 cognominal how come the Perl6 REPL proposes me to install LineNoise with zef while I install modules with panda. Are zef an panda interoperable ? Is zef preferable to panda ?
22:01 dugword https://gist.github.com/dugword/d4e5b0dfbf02484df5802d49d4f59ba4
22:02 dugword Putting the more specifc multi method gives me the behavior I want. Should that matter, i.e. should I put in a bug report?
22:03 mst dugword: I believe named params match based on 'first that makes sense at all'
22:03 mst notviki: yo, am I making sense here?
22:04 notviki what you guys are talking about?
22:04 notviki star: use HTTP::UserAgent
22:04 camelia star-m 2016.10: OUTPUT«===SORRY!===␤Could not find HTTP::UserAgent at line 1 in:␤    /home/camelia/.perl6␤    /home/camelia/star-2016.10/share/perl6/site␤    /home/camelia/star-2016.10/share/perl6/vendor␤    /home/camelia/star-2016.10/share/perl6␤    CompUnit::Repository…»
22:04 notviki star: use LWP::Simple
22:04 camelia star-m 2016.10: ( no output )
22:05 notviki well, we have that ^
22:05 notviki mst: I've no idea
22:05 dugword When I pass in 2 args, should it ever call the 1 arg multi?
22:06 notviki dugword: you mean named args, right? Methods ignore extra named args
22:06 masak yo #perl6 -- slightly OT but possibly interesting to more than a few: I'm having a lambda-calculus phase, and I started writing this: https://gist.github.com/masak/8e082999e06bfb4d03b8d12899bbcde5
22:06 dugword Oh....
22:06 dugword Okay
22:06 dugword That makes it make sense
22:06 mst hence why the one-arg candidate matches
22:06 mst and you need to put the two-arg one first
22:06 notviki dugword: but I think the actual reason you're experiencing this is we don't (yet) give required named args any weight in MMD and there's a ticket for that
22:07 notviki Hence why ordering matters; otherwise they're equal
22:07 mst I thought not weighting them was a Choice
22:07 notviki And this is the ticket: https://rt.perl.org/Ticket/Display.html?id=129329#ticket-history
22:07 mst see, this is the bit I summoned you to correct me on :P
22:07 * notviki knows very little on MMD
22:07 * notviki knows very little
22:08 lucs notviki knows
22:10 geekosaur masak, perhaps I should have forgotten Haskell before reading that :p
22:10 sufrostico joined #perl6
22:11 masak geekosaur: I don't think that's necessary. :) Haskell and lambda calculus have a lot in common.
22:11 geekosaur that was my point :)
22:12 geekosaur from my pov it was kinda "oh look, masak discovered haskell :p "
22:12 masak I wish :P
22:12 dugword Based on my initial assumption I'm glad its not a choice to not weight them :) Seems intuitive to have them weighted
22:13 mst I'm torn between "oh look, masak discovered haskell" and "oh look, masak discovered J"
22:14 cdg joined #perl6
22:14 * masak .oO( lambda calculus looks like whatever last gave you a headache )
22:14 mst I do love smalltalk's thing of having then/else be methods on boolean
22:14 mst masak: yeah, I resemble that remark
22:14 masak yes, I couldn't help thinking of Smalltalk's thing too
22:14 masak I almost mentioned it, in fact. might still do so.
22:15 geekosaur (now, if only knowing Haskell well enough to maintain xmonad and answer many questions in #haskell meant I could make sense of au++'s Pugs code...)
22:16 dataf3l joined #perl6
22:17 masak mst: do you have any sense of, if applicative order is used as the evaluation strategy, both `thenExpr` and `elseExpr` always end up fully evaluated? (I think they do.)
22:17 masak mst: in that case, that's a difference from Smalltalk, where those are blocks and one remains un-evaluated.
22:19 mst masak: oh, hrm, I was reading it in context of haskell style lazy evaluation
22:19 masak does lambda calculus have a default? :)
22:20 mst I think from lambda calculus' point of view, given there are no side effects, it's equivalent
22:20 masak you know, I was *going* to say that
22:20 masak but
22:20 masak in the precense of things like the Y combinator
22:20 masak you might run into an infinite loop that you otherwise wouldn't've
22:20 mst it only stops being an implementation detail/optimisation when there are side effects
22:20 geekosaur lambda calculus doesn't specify, but it makes more sense if you consider it lazy
22:21 mst well, yes, I guess the argument of "accidentally sort-of-working programs would be less-working" exists
22:21 mst but I don't find it particulartly convincing
22:21 masak hm, yes
22:21 geekosaur especially since you generally want to think of lambda calculus in terms of reductions, instead of evaluation /per se/
22:21 masak even in a strictly evaluating setting, you could always protect yourself from infinite loops with extra layers of abstraction
22:23 geekosaur (it is a calculus, after all, you want analytic solutions :)
22:24 masak geekosaur: I've never quite figured out why it's not the "lambda algebra"
22:24 masak I'd expect a calculus to have something like a derivative operator :)
22:27 mawkish_ joined #perl6
22:27 moritz the German "Kalkül" means a system of rules and axioms
22:27 moritz it's probably closer to that than what you usually think of as calculus
22:27 * notviki wishes we had some sort of safe Inf.Int call
22:28 notviki I'd sure use it more often than that .maxpairs or whatever it was...
22:28 geekosaur mm, to the extent that the term calculus has a formal definition, it doesn't include derivatives (those are particular reductions in a particular calculus, strictly speaking), algebras have a more formal definition and lambda calculus doesn't quite fit it https://en.wikipedia.org/wiki/Abstract_algebra
22:28 mst not sure mathemtically how Inf.Int can make sense?
22:28 samcv NaN
22:28 samcv NaI?
22:28 samcv lol.
22:29 notviki It'd just return Inf
22:29 masak NaN is a very Num-y notion, not very Int-y
22:29 masak we never quite got Inf to be as type-hoppy as TimToady hoped
22:29 samcv make it an Int undefined :P
22:29 webstrand After spawning a Proc, how can I block until it exits?
22:30 notviki m: use MONKEY; augment class Num { method SafeInt { self == Inf || self == -Inf || self == NaN ?? self !! self.Int }; say .SafeInt for 1e0, -4e0, Inf, -Inf, NaN;
22:30 camelia rakudo-moar aa3506: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3 .SafeInt for 1e0, -4e0, Inf, -Inf, NaN;7⏏5<EOL>␤»
22:30 notviki m: use MONKEY; augment class Num { method SafeInt { self == Inf || self == -Inf || self == NaN ?? self !! self.Int } }; say .SafeInt for 1e0, -4e0, Inf, -Inf, NaN;
22:30 camelia rakudo-moar aa3506: OUTPUT«1␤-4␤Inf␤-Inf␤Cannot coerce NaN to an Int␤  in method SafeInt at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
22:30 notviki :|
22:30 notviki oh
22:30 notviki WTF
22:30 notviki can"t type up arrow
22:30 notviki types AAAAAAAA
22:31 notviki ?QUIT
22:31 notviki Oh, I may need to clean my keyboard ^_^
22:32 notviki m: use MONKEY; augment class Num { method SafeInt { self == Inf || self == -Inf || self === NaN ?? self !! self.Int } }; say .SafeInt for 1e0, -4e0, Inf, -Inf, NaN;
22:32 camelia rakudo-moar aa3506: OUTPUT«1␤-4␤Inf␤-Inf␤NaN␤»
22:32 notviki there we go
22:32 geekosaur webstrand, for run you probably want to wait on input/output. otherwise you may want Proc::Async instead of Proc
22:35 samcv m: my Int $var = 10; $var = $var * Inf;
22:35 camelia rakudo-moar aa3506: OUTPUT«Type check failed in assignment to $var; expected Int but got Num (Inf)␤  in block <unit> at <tmp> line 1␤␤»
22:35 samcv m: my Int $var = 10; $var = $var / Inf;
22:35 camelia rakudo-moar aa3506: OUTPUT«Type check failed in assignment to $var; expected Int but got Num (0e0)␤  in block <unit> at <tmp> line 1␤␤»
22:35 petrutrimbitas joined #perl6
22:35 samcv 0e0?
22:36 petrutrimbitas p6 say 3+4
22:36 notviki samcv: the result is a Num
22:36 samcv yes
22:36 samcv i know
22:36 notviki What's the question then?
22:36 geekosaur m: say 3e0 / Inf
22:36 camelia rakudo-moar aa3506: OUTPUT«0␤»
22:37 geekosaur per IEEE754
22:37 samcv got Num (0e0)
22:37 samcv why doesn't it just set Int to 0
22:37 samcv i mean should it? would it be more awesome?
22:37 notviki because you're not using a coercer?
22:38 geekosaur there's another IEEE754 gotcha
22:38 notviki No it wouldn't
22:38 geekosaur m: say 3e0 / -Inf
22:38 camelia rakudo-moar aa3506: OUTPUT«-0␤»
22:38 geekosaur Num's 0 is *signed*
22:38 geekosaur (because this is important for limits, and for quadrants (see: atan2)
22:39 notviki m: say 3 / -Inf
22:39 camelia rakudo-moar aa3506: OUTPUT«-0␤»
22:39 notviki m: say "3" / -Inf
22:39 camelia rakudo-moar aa3506: OUTPUT«-0␤»
22:39 notviki good
22:40 AlexDaniel joined #perl6
22:40 AlexDaniel yay… emacs crashed
22:40 AlexDaniel awesome
22:41 notviki You're running IRC from... your editor?
22:42 cdg joined #perl6
22:42 notviki m: say -1+i / Inf
22:42 camelia rakudo-moar aa3506: OUTPUT«-1+0i␤»
22:42 notviki m: say -1 + i / Inf
22:42 camelia rakudo-moar aa3506: OUTPUT«-1+0i␤»
22:42 notviki m: say <-1+i> / Inf
22:42 camelia rakudo-moar aa3506: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3-1+⏏5i' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
22:42 notviki hehe
22:42 notviki m: say <-1+1i> / Inf
22:42 camelia rakudo-moar aa3506: OUTPUT«-0+0i␤»
22:43 notviki m: say <+1-1i> / Inf
22:43 camelia rakudo-moar aa3506: OUTPUT«0-0i␤»
22:48 cdg joined #perl6
22:48 * masak discovers the term https://en.wikipedia.org/wiki/Muntzing
22:48 masak very close to what I mean when I say "golfing" (about bugs)
22:49 notviki AlexDaniel: what about <a b c d e f g>.rotor: 5, -Inf => 1 ? Whats the behaviour for that?
22:49 notviki Or <a b c d e f g>.rotor: 5, -Inf => Inf
22:49 AlexDaniel :o
22:50 notviki <a b c d e f g>.rotor: 5, -5555 => 1
22:50 notviki m: <a b c d e f g>.rotor: 5, -5555 => 1
22:50 camelia rakudo-moar aa3506: OUTPUT«.rotor position is out of range. Is: -5549, should be in 0..Inf; (ensure the negative gap is not larger than the length of the sublist)␤  in block <unit> at <tmp> line 1␤␤»
22:50 regnarg joined #perl6
22:50 AlexDaniel an error is probably appropriate?
22:51 notviki m: <a b c d e f g>.rotor: 5, 3 => Inf
22:51 camelia rakudo-moar aa3506: ( no output )
22:51 notviki m: dd <a b c d e f g>.rotor: 5, 3 => Inf
22:51 camelia rakudo-moar aa3506: OUTPUT«(("a", "b", "c", "d", "e"),).Seq␤»
22:52 notviki m: dd <a b c d e f g>.rotor: 1, 2 => Inf
22:52 camelia rakudo-moar aa3506: OUTPUT«Cannot coerce Inf to an Int␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
22:53 * notviki gives up on that for the day....
22:54 masak might as well ask here: does anyone know if "variable declarations are syntactic sugar for IIFEs" is a law or principle named after someone? been looking but coming up empty.
23:13 webstrand geekosaur: Proc::Async doesn't present an interface for redirecting stderr/stdin to /dev/null. I'm trying to replace a bash script with some complicated piping with perl6.
23:14 webstrand Is there really no way to do asynchronus piping without writing my own fork/exec?
23:15 notviki webstrand: use a normal proc and just stick it into a start {} block?
23:16 notviki You can tap .stderr/.stdout on Proc::Async and just ignore it
23:16 notviki stdin...
23:16 * notviki looks at code
23:17 notviki Don't see anything useful other than .close-stdin
23:17 notviki webstrand: but yeah, our IO sucks and in need of love
23:18 webstrand Is there a spec that just hasn't been implemented?
23:19 notviki webstrand: it's complicated. Somewhat political/social. There's a bitrotted better version that needs to be unrotted, reviewed, and pushed to master, but likely it won't happen until 6.d language
23:19 notviki webstrand: what was the issue with regular Proc again?
23:20 webstrand It seems to block until the spawned process exits
23:20 webstrand I'm trying to do the equivalent of 'prog_a | prog_b'
23:20 webstrand Along with closing some pipes
23:20 notviki AlexDaniel: MasterDuke ^ you did something like that, no?
23:20 masak 'night, #perl6
23:20 notviki for the bots?
23:21 notviki masak: night
23:21 TEttinger notviki: sociopolitical progress can only be made when the proletariat are liberated from the heels of the bourgoisie dogs!
23:22 AlexDaniel well yea, you can take this as an example: https://github.com/perl6/whateverable/blob/master/Whateverable.pm6#L100
23:22 AlexDaniel but unless you want merged stdout and stderr I'm not sure why would you go through these troubles
23:22 ugexe m: my $proc = shell "sleep 5 && echo XXX", :out; sleep 5; say "Doesnt sleep another 5 seconds"; say $proc.out.lines
23:22 camelia rakudo-moar aa3506: OUTPUT«shell is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub shell at src/RESTRICTED.setting line 15␤  in block <unit> at <tmp> line 1␤␤»
23:23 ugexe no need for start blocks
23:23 notviki webstrand: and as I've said, you can try sticking your run into a Promise: my $prom = start run blah blah; and then you can await $prom; if you need to wait for the proc to exit
23:23 notviki ugexe: well, that just shells out
23:24 notviki webstrand: ^ yeah you can just shell out? Not sure if that works for your usecase
23:24 ugexe run works the same
23:24 AlexDaniel run works the same, yes
23:24 AlexDaniel no need for shell
23:24 ugexe shell was convienient for the sleep
23:24 notviki huh
23:25 AlexDaniel my $proc = run ‘sleep’, ‘5’, :out; say now; say $proc.out.slurp-rest; say now
23:25 webstrand ugexe: Well, your example works fine. Here's mine: my $proc = Proc.new; $proc.spawn: |qw/sleep 5000/; There's probably something else wrong with it, but it hangs forever
23:25 AlexDaniel hmm what's spawn…
23:26 ugexe its what run/shell are wrappers around
23:26 notviki What do you mean with "run works the same"?
23:26 AlexDaniel notviki: meaning that it won't block
23:27 notviki OK. I'll just assume communication streams crossed at some point :S
23:27 AlexDaniel webstrand: why use spawn when you can use run?
23:28 webstrand Huh. Proc.new(:out).spawn('sleep', '5000') Doesn't block.
23:28 AlexDaniel yea
23:29 webstrand I assumed that run was synchronous, like system or qx//, so I was using spawn to be asynchronous
23:29 ugexe m: my $proc = run "perl6", "-e", "sleep 5 && say q|XXX|", :out; sleep 5; say "Doesnt sleep another 5 seconds"; say $proc.out.lines
23:29 camelia rakudo-moar aa3506: OUTPUT«run is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub run at src/RESTRICTED.setting line 14␤  in block <unit> at <tmp> line 1␤␤»
23:30 ugexe it was just easier to write the shell version of that before
23:30 notviki But what I was taking about is piping
23:30 notviki Not sleeping
23:31 webstrand Well, thanks for your help. Proc will serve my purposes just fine, though I'm not sure why it blocks with :out("-")
23:31 geekosaur webstrand, it's synchrponous *on IO*
23:32 AlexDaniel webstrand: if at some point you realize it's not good enough, I guess you can switch to Proc::Async
23:32 geekosaur if you out to - then it blocks with output to perl's standard output
23:32 geekosaur with :out, you block by reading from $proc.out
23:33 webstrand Ah, so perl is trying to read from the spawned processes stdout? I'd thought "-" meant the process inherited the current stdout
23:33 mawkish_ joined #perl6
23:33 geekosaur it does, but when you used :out it did not block because blocking is done by reading $proc.out
23:33 geekosaur that is what you asked for there
23:33 geekosaur you asked it to give you its stdout as $proc.out and you would then block by reading from that
23:34 geekosaur which is what you generally want from a pipe, as opposed to just running a command
23:35 geekosaur because running it synchronously/blocking is kinda useless when running it as a pipe
23:35 webstrand So if I do Proc.new(:out($*ERR)).spawn('sleep', '5000'); it shouldn't block either?
23:36 webstrand or how can I pass to the process the default stdout/stderr?
23:36 geekosaur you gave it a handle to output to that is not a pipe for you to read from, so it should block I think
23:37 geekosaur it's whne you request a pipe mode that it has to run async, because you kinda can't usefully read/write a pipe if you're blocked waiting for the program to exit :)
23:37 geekosaur and, if you don't specify, it uses perl's default
23:38 geekosaur so just omit any :out to have it use perl6's own stdout. or use :out($*OUT) which is the explicit form of that
23:39 webstrand For example in perl5 if I fork/exec, the child process inherits the parent's stdout (file descriptor). Both the parent and child process keep running, and their output is intermingled in stdout. Can I do this with Proc?
23:39 geekosaur or use '-' which is another way to get the default
23:40 geekosaur that is Proc::Async
23:40 geekosaur run is not fork/exec; it is system and open in pipe mode rolled up into one
23:42 webstrand Ah. Now I think I understand the difference. So even if I did: $a = Proc.new(:out); $b = Proc.new(:in($a.out)); Perl would still need to manually copy over data from one process to the other?
23:43 geekosaur no, it should be able to just connect those
23:43 geekosaur there are cases when you'd need to copy data but I think you are forced to do that copying yourself
23:44 webstrand Then why couldn't perl do the same with it's own stdout?
23:44 geekosaur it could, if you decided that there is no use for system and run should pretend to be fork/exec
23:46 geekosaur this is not a technical limitation. this is "emulate system() as found in C, Perl 5, etc."
23:57 xui_nya[m] joined #perl6
23:59 dataf3l joined #perl6

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

Perl 6 | Reference Documentation | Rakudo