»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
samcv pbs.twimg.com/media/C0vWrzvUcAEAhkI.jpg 00:00
Axord Ha. 00:01
samcv wish @unicode on twitter would post more than people adopting emoji 00:02
well bronze sponsors. there's so many of them costs only 100 dollars 00:03
notviki is one :}
For butterfly 00:04
notviki likes twitter.com/FakeUnicode
[Coke]: you can still install it even if it fails tests. 00:06
it's make install or something or other; it tells in the message
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>
AlexDaniel 30k/31k
I CAN'T TAKE IT ANYMORE
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]»
samcv awesome
00:12 dataf3l left
samcv j: say "test" 00:14
camelia rakudo-jvm 8ca367: OUTPUT«test␤»
00:14 samcv joined
samcv j: say "<ୈ".chars 00:14
camelia rakudo-jvm 8ca367: OUTPUT«2␤»
samcv hmmm
interesting
m: say "<ୈ".chars 00:15
camelia rakudo-moar 347271: OUTPUT«1␤»
samcv looks like java handles these degenerates
+1 for java
j: EVAL "say Q<ୈtest>"
camelia rakudo-jvm 8ca367: OUTPUT«ୈtest␤»
samcv nice
that makes me pretty happy tbh 00:16
Moar does not handle them, which is not incorrect. but LTA
00:22 Xliff_ joined, grumble left 00:23 grumble joined, troys_ is now known as troys
AlexDaniel m: say "<ୈ".chars 00:25
camelia rakudo-moar 347271: OUTPUT«1␤»
AlexDaniel u: <ୈ 00:26
unicodable6 AlexDaniel, U+003C LESS-THAN SIGN [Sm] (<)
AlexDaniel, U+0B48 ORIYA VOWEL SIGN AI [Mc] (◌ୈ)
AlexDaniel samcv: huh? Are you saying that 2 is the right answer?
samcv no
to implement unicode you MUST support certain things in handling of graphemes. but degenerates are not a MUST 00:27
they are a MAY
err
maybe clearer is I think it should be 2 00:28
and 2 is not incorrect for unicode spec, and neither is 1
it is really 2. and we should take that into account in string operations and concatenation etc 00:29
00:29 djbkd_ left 00:30 djbkd joined
samcv j: say "34\x[308]5".fc 00:33
camelia rakudo-jvm 8ca367: OUTPUT«34̈5␤»
AlexDaniel dooooooooooooooooooonnnnnnnneeeeeeee 00:35
samcv m: "\x[308]".uniprop('Mark').say 00:36
camelia rakudo-moar 347271: OUTPUT«1␤»
samcv m: "a".uniprop('Mark').say
camelia rakudo-moar 347271: OUTPUT«0␤»
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 …»
AlexDaniel alright, only 1493 snippets to review :)
samcv m: "a".unimatch('Mark', 'Mark').say
camelia rakudo-moar 347271: OUTPUT«False␤»
samcv m: "a".unimatch('Mark', '1').say
camelia rakudo-moar 347271: OUTPUT«False␤»
samcv m: "a".unimatch('Mark', True).say
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…»
samcv m: "a".unimatch('Mark') 00:38
camelia ( no output )
samcv m: "a".unimatch('Mark').say
camelia rakudo-moar 347271: OUTPUT«False␤»
samcv m: "\x[308]".unimatch('Mark').say
camelia rakudo-moar 347271: OUTPUT«True␤»
samcv m: "\x[308] ".unimatch('Mark').say
camelia rakudo-moar 347271: OUTPUT«True␤»
samcv m: " \x[308] ".unimatch('Mark').say 00:39
camelia rakudo-moar 347271: OUTPUT«False␤»
samcv m: " \x[308] ".».unimatch('Mark').say
camelia rakudo-moar 347271: OUTPUT«(False)␤»
00:40 BenGoldberg joined
samcv m: say " \x[308] " ~~ m/<:Mark>/ 00:40
camelia rakudo-moar 347271: OUTPUT«False␤»
samcv cries
m: say " \x[308] " ~~ m/<:mark>/
camelia rakudo-moar 347271: OUTPUT«False␤»
samcv should todo's in roast have an RT? so doe sthat mean i should file one 00:41
j: say " \x[308] " ~~ m/<:mark>/
camelia rakudo-jvm 8ca367: OUTPUT«「̈」␤»
samcv j: say " \x[308] " ~~ m/<:Mark>/
camelia rakudo-jvm 8ca367: OUTPUT«「̈」␤»
samcv j: say " \x[308] " ~~ m/<:MArk>/
camelia rakudo-jvm 8ca367: OUTPUT«「̈」␤»
samcv nice. jvm++
00:42 Rawriful left
samcv notviki, you there 00:43
notviki sup
samcv regarding rt.perl.org/Ticket/Display.html?id=128546 the proper thing to do is compare strings without diacritics first
and only if they are equal, to compare with diacritics 00:44
and diacritics should be greater than the letter but less than the next letter in the sort sequence
so looks like we just use cmp here?
notviki shrugs 00:45
samcv m: say "a\x[308]" cmp "a" 00:46
camelia rakudo-moar 347271: OUTPUT«More␤»
samcv m: say "a\x[308]" cmp "ab"
camelia rakudo-moar 347271: OUTPUT«More␤»
samcv m: say "a\x[308]" cmp "abc" 00:47
camelia rakudo-moar 347271: OUTPUT«More␤»
samcv m: say "a\x[308]" cmp "a\x[900]c"
camelia rakudo-moar 347271: OUTPUT«More␤»
samcv m: say "abc" cmp "cba"
camelia rakudo-moar 347271: OUTPUT«Less␤»
samcv :(
SourceBaby, infix:<cmp> 00:48
looks like we just call ORDER(nqp::cmp_s(nqp::unbox_s(a), nqp::unbox_s(b))) 00:50
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␤ …»
samcv m: say "a\x[308]".chars; say "a\x[900]c".chars
camelia rakudo-moar 347271: OUTPUT«1␤2␤»
samcv notviki, is this a bug in nqp or in perl 6 00:53
or moarvm
j: say "a\x[308]" cmp "a\x[900]c"
camelia rakudo-jvm 8ca367: OUTPUT«Less␤»
samcv ok looks like only on MoarVM does it fail
looks like a MoarVM problem 00:54
[Coke] notviki: yes, it said "do this", so I did it, and it rebuilt it a second time. 00:59
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
samcv> looks like it just does return ai < bi ? -1 : 1
<samcv> and checks graphemes
err accidently posted in dev
01:01 mojca left
samcv so it seems to just compare which grapheme is 'bigger' 01:02
however it stores that grapheme. hm 01:03
and it's just a MVMint32. wait
that means it's just getting not the whole grapheme but just the codepoint? 01:04
j: say Version.new("34\x[308]5") cmd Version.new("4") 01:08
j: say Version.new("34\x[308]5") cmp Version.new("4")
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…»
rakudo-jvm 8ca367: OUTPUT«More␤»
samcv m: say Version.new("34\x[308]5") cmp Version.new("4") 01:09
camelia rakudo-moar 347271: OUTPUT«Less␤»
notviki It's not comparing those two strings, it's breaking them up 01:10
s/them/the first one/;
m: say Version.new("34\x[308]5")
camelia rakudo-moar 347271: OUTPUT«v34̈5␤»
notviki m: say Version.new("34\x[308]5").parts 01:11
camelia rakudo-moar 347271: OUTPUT«(34̈5)␤»
notviki Oh, right. It breaks up only with the patch
samcv there's still a bug in cmp though
AlexDaniel m: say * + 5
camelia rakudo-moar 94df18: OUTPUT«{ ... }␤»
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
AlexDaniel because { … } may look a bit scary to some
samcv breaking it up is another issue entirely
[Coke], do you know moarvm right it stores codepoints in 32 bit ints right? 01:13
so this MVM 32 bit grapheme HAS to be JUST a codepoint right
[Coke] samcv: dunno,s orry 01:14
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␤ …»
samcv m: say "🐧" cmp "a\x[308]";
camelia rakudo-moar 94df18: OUTPUT«More␤»
samcv oh that is a bad example
m: say "a" cmp "a\x[308]";
camelia rakudo-moar 94df18: OUTPUT«Less␤»
samcv m: say "ab" cmp "a\x[308]";
camelia rakudo-moar 94df18: OUTPUT«Less␤»
samcv m: say "a\x[309]" cmp "a\x[308]"; 01:16
camelia rakudo-moar 94df18: OUTPUT«More␤»
samcv m: say "a\x[309]" cmp "a\x[308]b";
camelia rakudo-moar 94df18: OUTPUT«More␤»
samcv m: say "a\x[309]" cmp "b\x[310]";
camelia rakudo-moar 94df18: OUTPUT«More␤»
samcv m: say "a\x[309]" cmp "a\x[310]"; 01:17
camelia rakudo-moar 94df18: OUTPUT«More␤»
samcv m: say "a\x[309]a" cmp "a\x[310]b";
camelia rakudo-moar 94df18: OUTPUT«More␤»
samcv yeah
it's looking by codepoint
m: say "a\x[309]a" cmp "a\x[310]🐧";
camelia rakudo-moar 94df18: OUTPUT«More␤»
samcv yep 01:18
brb
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`
[Coke] Yes, 6.c-errata should be passing.
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:19
[Coke] ah. yes, how are you running the tests? 01:20
01:22 Gasher left
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
Wanted to see the tests pass before I built Rakudo from source, and then started making changes
notviki It has a fudge: github.com/perl6/roast/blob/master...egin.t#L78 01:23
01:24 Ven left
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?
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
dugword: with fudges
dugword: you run it with TEST_JOBS=7 make spectest 01:27
or make stresstest if you like to wait around
TEST_JOBS is your number of cores * 1.3
And you can run individual files with make t/spec/name/of/the/file.t
01:27 troys is now known as troys_
dugword What directory do I run make from? I don't see a makefile 01:27
notviki
.oO( need to get on with contribute.perl6.org -_- )
01:28
dugword: in a Rakudo build dir
dugword: not sure how much help it is, but you could scroll through this tutorial: perl6advent.wordpress.com/2016/12/...the-qasts/ 01:29
and there are a couple with "core hacking" in their name on perl6.party
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
samcv so should be fine to make it smarter 01:32
AlexDaniel MasterDuke: here?
.tell MasterDuke consider taking a look at RT #130430 01:38
yoleaux AlexDaniel: I'll pass your message to MasterDuke.
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130430
notviki .tell MasterDuke too slow! 01:41
yoleaux notviki: I'll pass your message to MasterDuke.
01:41 cyphase left 01:43 BenGoldberg left 01:46 cyphase joined 01:47 Xliff_ is now known as Xliff 01:48 newbie1 left 01:56 labster left
AlexDaniel commit: c6cb07e5e79^,c6cb07e5e79 say '0' ~~ /<[\0]>/ 01:57
committable6 AlexDaniel, ¦«c6cb07e5e79^»: 「0」␤¦«c6cb07e»: Nil
AlexDaniel any idea about this?
bisectable points to github.com/rakudo/rakudo/commit/c6...b738910737 but that's not very helpful
02:02 cpage_ joined 02:05 TEttinger left, Actualeyes1 joined 02:07 TEttinger joined 02:08 Actualeyes left 02:16 labster joined 02:29 SCHAAP137 joined, espadrine left 02:32 troys_ is now known as troys 02:37 SCHAAP137 left, itcharlie joined 02:42 labster left 02:43 cyphase left 02:45 labster joined 02:46 ilbot3 left, SCHAAP137 joined 02:47 FROGGS_ joined 02:48 ilbot3 joined, cyphase joined 02:51 FROGGS left 02:52 Actualeyes1 left 02:55 committable6 joined, ChanServ sets mode: +v committable6 02:58 Actualeyes joined 03:08 xtreak joined 03:10 Actualeyes left 03:17 itcharlie left 03:18 spock joined, spock is now known as Guest41216 03:38 cyphase left, pierre_ joined 03:40 wamba left 03:43 cyphase joined 03:44 pierre_ left 03:48 lichtkind_ joined 03:49 noganex_ joined 03:51 lichtkind left 03:52 noganex left 03:53 Actualeyes joined 04:04 hoelzro joined
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:24
04:27 benji_ joined
benji_ how would I output sound with perl6 04:27
just a sine wave with a specific frequency 04:28
04:40 troys is now known as troys_
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
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130430
yoleaux 01:41Z <notviki> MasterDuke: too slow!
MasterDuke dugword: i haven't tried that, but that's where i'd start 04:43
ugexe those would be built against a different version of rakudo 04:44
MasterDuke benji_: no idea, but github.com/Perl6-Noise-Gang/Task-Noise should have some info
ugexe: those?
ugexe inline::perl5 has depends 04:45
MasterDuke i guess he could clone it and its dependencies and add all them to the -I 04:47
ugexe cd $MY_RAKUDO_DIR && git clone github.com/ugexe/zef && ./bin/perl6 ./zef/bin/zef -Izef/lib install Inline::Perl5 04:48
MasterDuke dugword: ^^^ 04:51
04:55 cyphase left
dugword Nice 04:57
I'll try that
ugexe to be exact: `cd $MY_RAKUDO_DIR && git clone github.com/ugexe/zef && ./install/bin/perl6 -Izef/lib ./zef/bin/zef install Inline::Perl5` 04:59
04:59 cyphase joined 05:02 rpburkholder left
ugexe you might need to s/install/--force install/ because File::Which is not very robust in how it tests 05:03
05:03 troys_ is now known as troys 05:10 Cabanossi left 05:13 Cabanossi joined
dugword ugexe: Hmmm... tons of errors are being thrown on all modules being installed. Even with --force it fails 05:15
Oh well, I'm moving on. I won't be making changes to anything that those tests will be testing... hopefully :) 05:17
05:18 kyan left 05:20 khw left
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
At least I get "Cannot invoke object with invocation handler in this context" when I try
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:44 troys is now known as troys_
MasterDuke kaare_: ^^^, is that what you were trying to do? 05:46
kaare_ MasterDuke: Yes, with the first sub being 'is native' 05:48
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
MasterDuke: This is boiled down: use NativeCall; multi sub a(uint32) returns int32 is native { * } 05:52
MasterDuke kaare_: looks like you can't multi is native stuff, irclog.perlgeek.de/perl6/2016-04-14#i_12339385 06:00
kaare_ MasterDuke: Good find! 06:01
But AFAIUI, it is a bug. 06:08
So I can file a ticket if someone is interested 06:13
MasterDuke buggable: rakudobug 06:15
huggable: rakudobug
huggable MasterDuke, [email@hidden.address] or use perl6 query on rt.perl.org ; see github.com/rakudo/rakudo/#reporting-bugs
MasterDuke kaare_: ^^^
06:16 troys_ is now known as troys 06:19 thayne joined 06:23 labster left 06:25 bpmedley joined 06:33 dataf3l joined 06:35 dataf3l left 06:36 dataf3l joined 06:38 dataf3l left, dataf3l joined 06:41 dataf3l left, bjz joined 06:42 dataf3l joined, Axord left 06:43 Axord joined 06:44 dataf3l left 06:45 dataf3l joined 06:46 darutoko joined 06:47 dataf3l left 06:49 dataf3l joined 06:51 dataf3l left, RabidGravy joined 06:52 dataf3l joined 06:54 dataf3l left 06:55 dataf3l joined 06:57 dataf3l left, dataf3l joined 06:58 troys left 07:00 bjz left, dataf3l left 07:01 dataf3l joined 07:03 dataf3l left, dataf3l joined 07:06 dataf3l left, dataf3l joined 07:09 dataf3l left, cibs left 07:10 dataf3l joined 07:11 cibs joined 07:14 dataf3l left 07:15 dataf3l joined 07:17 dataf3l left 07:18 dataf3l joined 07:19 labster joined 07:22 CIAvash joined, dataf3l left 07:23 dataf3l joined 07:25 dataf3l left 07:26 dataf3l joined 07:28 dataf3l left 07:29 dataf3l joined 07:31 dataf3l left 07:32 dataf3l joined, cibs left 07:33 cibs joined 07:34 bjz joined 07:36 benji_ left 07:37 tojo joined, pyrimidine left, pierre_ joined 07:39 dataf3l left, Actualeyes left 07:40 dataf3l joined 07:41 dugword left 07:44 dataf3l left 07:57 domidumont joined 08:01 domidumont left 08:02 domidumont joined 08:04 wamba joined 08:12 xtreak left 08:13 tojo left 08:14 mawkish_ joined 08:15 xtreak joined 08:22 skids left 08:32 tokomer joined 08:34 pyrimidine joined
lizmat wonders whether www.reddit.com/r/perl/comments/5kr..._cast_to_a is something up RabidGravy's alley 08:40
RabidGravy looks
08:42 dataf3l joined
RabidGravy WeEeell, possibly, if I knew how a chromecast works ;-) 08:43
08:44 dataf3l left
lizmat Ah, I guess I remembered perl6advent.wordpress.com/2016/12/13/ wrong 08:48
Icecast != Chromecast
sorry!
regnarg The results of my yesterday's "REPL here" experimentation: gist.github.com/regnarg/1096ad4d85...7a0e85600a 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:49
08:50 thayne left
lizmat see? that wasn't too hard :-) 08:50
regnarg As pointed out to me yesterday, the optimizer may one day break this but right now it seems useful 08:51
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
otoh, this feels like a nice debugging tool that we want to have available at all times
and the memory footprint of it is minimal
and the REPL is already core anyway
so I would be in favour of just adding it to the core 08:53
08:53 Actualeyes joined
lizmat albeit with another name 08:53
m: REPL
camelia rakudo-moar 19df35: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant value REPL in sink context (line 1)␤»
lizmat hmmm...
regnarg REPL.here sounds good (and self-explanatory) 08:54
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:56 mr-foobar left
RabidGravy lizmat, though I think the chromecast can consume icecast streams, I'll comment anyway :) 08:57
regnarg, I'm pretty sure I've got at least one 11-line module out there :) 08:58
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:00
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
But it would probably require some discussion.
lizmat indeed
09:06 domidumont left 09:07 thayne joined 09:10 domidumont joined 09:14 cibs left 09:15 cibs joined 09:18 mr-foobar joined 09:21 domidumont left 09:22 teksteiner joined, bjz left 09:23 bjz_ joined 09:28 mawkish_ left 09:29 mawkish_ joined 09:33 thayne left 09:38 labster left, thayne joined 09:45 dataf3l joined 09:47 djbkd left, dataf3l left 09:54 rafasch joined 09:58 CIAvash left 10:02 Guest41216 left 10:16 tokomer left, effbiai left 10:21 dogbert2 joined 10:22 rindolf joined 10:23 effbiai joined, w4and0er96_ joined 10:24 PotatoGim_ joined, kmwallio_ joined, chee left 10:26 Ulti_ joined, cyphase left 10:28 pyrimidi_ joined, pyrimidine left, TEttinger left 10:29 effbiai left 10:30 xiaomiao left, facetious left, dogbert17 left, regnarg left, TimToady left, drrho left, krakan_ left, azertus_ left, smash left, rblackwe left, tyil left, ranguard left, Bucciarati left, Ulti left, sQuEE left, robinsmidsrod left, damnlie_ left, integral left, d^_^b left, Peter_R left, jcallen left, kmwallio left, gabiruh left, kmwallio_ is now known as kmwallio 10:31 cyphase joined 10:32 w4and0er96_ is now known as w4and0er96 10:34 PotatoGim_ is now known as PotatoGim 10:35 chee joined 10:36 xiaomiao joined, facetious joined, regnarg joined, azertus_ joined, TimToady joined, drrho joined, krakan_ joined, leah2 joined, r3m joined, dg joined, protium joined, xfix joined, thundergnat joined, CIAvash[m] joined, KotH joined, Alikzus joined, avar joined, breinbaas joined, smash joined, rblackwe joined, tyil joined, ranguard joined, Bucciarati joined, sQuEE joined, robinsmidsrod joined, damnlie_ joined, integral joined, d^_^b joined, Peter_R joined, jcallen joined, gabiruh joined
moritz just spent half an hour debugging a a hairy issue in some code he wrote 10:37
the code was basically sub foo { my $sth = $dbh.prepare(...); LEAVE { $sth.finish if $sth }; $sth.execute; $sth.allrows(:array-of-hash).map(...) } 10:38
the problem was that the map was lazy, and thus $sth.finish was called too early 10:39
which, surprisingly, didn't lead to an exception thrown, but rather to to an extra row of all-undefined values in the list 10:40
samcv woooo collation 10:41
i at least so far have unicode properties for primary secondary and tertiary collation weights
and almost done coding it into moarvm to use it
moritz \o/
samcv (hopefully won't break other properties due to randomness) 10:42
moritz samcv++
rafasch Do they include Latin (u->V)?
samcv what
you mean language specific collation?
'a'.uniprop('MVM_COLLATION_PRIMARY') #> 7239 10:43
nice
rafasch m: say 'a'.uniprop('MVM_COLLATION_PRIMARY') 10:44
camelia rakudo-moar 19df35: OUTPUT«0␤»
samcv not yet!
the secondary and primary collation weighting are more complex but the primary is not too bad
though not sure how we will support for multiple codepoints 10:45
since there are rules for that
will figure something out eventually
rafasch It's important to make P6 better than P5 ASAP.
10:46 cyphase left
samcv yes 10:46
will be able to fix this bug rt.perl.org/Ticket/Display.html?id=128546 10:47
which is a bug in cmp
rafasch, on jvm perl6 already compares properly
moar just compares the codepoint 10:48
atm
> say 'z'.uniprop('MVM_COLLATION_PRIMARY'); say '1'.uniprop('mvmcollationprimary') 10:49
7969
7230
\o/
rafasch m Version.new("34\x[308]5") leg Version.new("4")
samcv err
rafasch m: Version.new("34\x[308]5") leg Version.new("4")
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)␤»
rafasch m: say Version.new("34\x[308]5") leg Version.new("4")
camelia rakudo-moar 19df35: OUTPUT«Less␤»
rafasch Unicode 11 has to be developed in P6 10:50
samcv hmm tho
10:50 cyphase joined
samcv say "û".uniprop('MVM_COLLATION_PRIMARY'); say "z".uniprop('MVM_COLLATION_PRIMARY') 10:50
0
7969
say "û".ords 10:51
msay "û".ords
m: say "û".ords
camelia rakudo-moar 19df35: OUTPUT«(251)␤»
samcv hm
maybe it's not specified
samcv checks
10:51 wamba left
samcv dunno why it wouldn't tho 10:51
m: say "û".ord.base(16)
camelia rakudo-moar 19df35: OUTPUT«FB␤»
samcv yeah it has a value in the file hmm 10:52
print "Ⓐ".uniprop('MVM_COLLATION_PRIMARY'); 7239 10:54
that is pretty nice though
letter A also has the same value
rafasch It is.
samcv "Ⓐ" cmp "B" 10:56
Less
woot!
samcv does a dance
not bad for one night
rafasch m: say "Ⓐ" cmp "B"
camelia rakudo-moar 19df35: OUTPUT«More␤»
rafasch Are the higher order ones easier or more diffcult? 10:57
samcv order?
no just compare the uh weights
rafasch The second and third order properties. 10:58
samcv oh
A primary collation element is a collation element that is not ignorable at Level 1. 10:59
This is also known as a non-ignorable. In parametrized expressions, also known as a Level 0 ignorable.
so basically you should always apply primary
This is also known as a Level 1 ignorable or a primary ignorable.
(aka secondary)
rafasch Otherwise it isn't collation at all.
samcv also
A simple mapping maps one Unicode character to one collation element.
D8. An expansion maps one Unicode character to a sequence of collation elements.
D9. A contraction maps a sequence of Unicode characters to a sequence of (one or more) collation elements.
it gets pretty complex
haha 11:00
MVMArray: Index out of bounds damn i get this tho
trying to build rakudo
rafasch Natural language is fun.
samcv prolly did something silly
in moar
rafasch "fun" in the EvE sense, not in the P6 sense. 11:01
samcv this is the new extended comparer so far github.com/MoarVM/MoarVM/compare/m...e15c75f6d9
11:02 aku joined
samcv prolly don't like sanity check enough 11:02
not sure why i get that array out of bounds though 11:05
MVMArray: Index out of bounds
11:05 xtreak left
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
or if it should be made available as a separate operation
samcv hm 11:07
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
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
moarvm itself uses a different one that just checks if they are the same or not 11:09
not -1, 0 or 1, just binary
uhm 11:10
not sure why would need that rafasch
is that some newer C extension thingy 11:11
this is c90 i think
something, makes you have to declare variables before statements in a function
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
moritz which might be a too big backwards-incompatible change to merge
samcv jvm already does this
moritz then it might not be so risky 11:13
samcv and leg and cmp use the same i thing
*think. underlying moar function for strings
nqp::cmp_s
moritz cmp is just generalized to more types
samcv yeah
11:13 azertus_ left
rafasch It is but a joke about C coding styles. 11:14
samcv oh hah 11:15
i think MVM_COLLATION_PRIMARY is a good property name
to make it clear that it won't be available on jvm or other backends if it works etc. not an official unicode property
well it's an official unicode thing, but it's not the same as the other properties 11:16
and unlike the others can be changed easily with newer unicodes
i ordered paperback unicode 9.0, two volumes 450 pages each
only like 8 bucks each though
unicode++ 11:17
interesting… i try and run a spectest 11:20
and i get the MVMArray error
but i can run -e or do REPL fine
11:23 azertus joined
samcv ah. looks like it doesn't check anything but the first codepoint. 11:23
not getting crashes in repl but need to fix that
rafasch My language changed it's collation order in the year I was born. 11:24
samcv nice 11:25
language?
rafasch Portuguese 11:26
samcv also i haven't implemented uhm what happens if the primary collation order is the same
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:27
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:28
hmm ok issue 11:30
Woodi hi #perl6 :)
samcv need to change something so moar returns -1 if that codepoint has no weight instead
11:30 lukaramu joined
samcv hi Woodi 11:30
notviki \o
samcv because it otherwise will think that we should compare by codepoint, even if collation order *is* specified by unicode 11:31
[ptc] o/
rafasch \o 11:32
samcv hmm actually we shouldn't have to care about that 11:33
most of the only codepoints with primary weights are like control characters and things
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 ?
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.
samcv lol
tbh it could be worse
they do good work
notviki m: my Int $x = 42; dd $x; $x.subst-mutate: '4', 'a'; dd $x
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␤␤»
samcv unicode is complicated because human language is complicated
notviki ugh
m: my $x = 42; dd $x; $x.subst-mutate: '4', 'a'; dd $x
camelia rakudo-moar 19df35: OUTPUT«Int $x = 42␤Str $x = "a2"␤»
notviki Woodi: ^
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
er
Woodi notviki: thanx :) I see it works but no idea how... invocant ?
samcv err actually they are all like combining characters and things such as that 11:36
so how we do it now at least we are fine
since we don't implement multi grapheme matching
11:36 wamba joined
samcv err collation 11:36
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
camelia rakudo-moar 19df35: OUTPUT«Str+{<anon|56370992>} $x = "meows"␤42␤»
notviki Woodi: ^ it's just an arg in the method. 11:38
using `self` will prolly work too
m: class Foo { has $.but; method init () { self = "meows" but $.but } }; my $x = Foo.new: :but(42); $x.init; dd $x; say $x.Int
camelia rakudo-moar 19df35: OUTPUT«Cannot modify an immutable Foo␤ in method init at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
notviki Aha, no it wont :)
samcv rafasch, does it though? 11:40
rafasch ç has to be next to c
samcv is that what language independent does? 11:41
let me check
ugh somehow that's not returning a value but
rafasch, it will be sorted next to c
that's not a combining character 11:42
m: 'ç'.ords.say
camelia rakudo-moar 19df35: OUTPUT«(231)␤»
samcv this is in the Composed form. not Decomposed
rafasch And this one -> c􏿽xCC􏿽xA7 ?
samcv m: 'ç'.NFD.say
camelia rakudo-moar 19df35: OUTPUT«NFD:0x<0063 0327>␤»
samcv m: say "c􏿽xCC􏿽xA7".ords
camelia rakudo-moar 19df35: OUTPUT«(231)␤»
samcv only in _decomposed_ form does it have multiple 11:43
and lets say canonical unicode form _is_ two codepoints
then it will sort by the primary character (the one coming first)
notviki m: say 'ç' === 'c􏿽xCC􏿽xA7'
camelia rakudo-moar 19df35: OUTPUT«True␤»
samcv and if they are both the same, it will go by grapheme value
which maybe won't be correct _yet_ until we implement checking multiple graphemes 11:44
err codeponits per grapheme
but that is how this is going to work initially
rafasch What about 'c􏿽xCC􏿽xA7a' (decomposed) and (ca) ? 11:45
samcv it's not decomposed though
it's composed in the internal representation in moarvm
rafasch I see.
samcv if you want to force decomposed you could use NFD to store the codeponits
otherwise they are stored in NFC-ish form 11:46
c=cannonical
rafasch Many languages have charachters that don't have composed forms.
notviki This is kinda scary... I thought basic and prevalent concepts like cmp were nailed down ages ago :S
samcv argh getting index out of bounds still
notviki, in jvm it works fine
fyi
notviki m: say "a\x[308]"; 11:47
camelia rakudo-moar 19df35: OUTPUT«ä␤»
notviki m: say "a" cmp "á";
camelia rakudo-moar 19df35: OUTPUT«Less␤»
notviki j: say "a" cmp "á";
camelia rakudo-jvm 8ca367: OUTPUT«Less␤»
samcv uh
bad choice
m: say "b" cmp "á";
camelia rakudo-moar 19df35: OUTPUT«Less␤»
samcv j: say "b" cmp "á";
camelia rakudo-jvm 8ca367: OUTPUT«Less␤»
Woodi about failures from #perl6-dev: gist.github.com/anonymous/bfa6d799...5ea75009c2 + backlog copy; it's surprising Promise do not throw just like Failure. but nice :) 11:48
samcv not sure why that one says less
j: say "b" cmp "á";
camelia rakudo-jvm 8ca367: OUTPUT«Less␤»
samcv j: say "b" cmp "a";
camelia rakudo-jvm 8ca367: OUTPUT«More␤»
samcv maybe bug in jvm
maybe it has a composed form or something
it's multiple codepoints composed that is 11:49
ones that are single codepoints in canonical form cmp properly with jvm
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?
and uniprop is broken 11:50
samcv well
yeah
i mean as a language it does unicode really well
rafasch m: say 'ŝa' cmp 'ŝb'
camelia rakudo-moar 19df35: OUTPUT«Less␤»
rafasch m: say 'sa' cmp 'ŝb'
camelia rakudo-moar 19df35: OUTPUT«Less␤»
rafasch m: say 'ŝa' cmp 'sb'
camelia rakudo-moar 19df35: OUTPUT«More␤»
11:51 domidumont joined
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
and better for typed language
in the code
much more unicode first
notviki If jvm is so awesome how come we fudge everything for it?
j: "x".uniprop.say
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…»
samcv also swift prolly doesn't even have uniprop
python has a core module with only like 11:52
10 properties
that it has
so us supporting like
currently at least 40
notviki forcees a lot of RT tickets written in broken English, calling us a "puta" for breaking user's code
samcv nis not too bad
link
rafasch Is there any plans to include local variation modules in Star? 11:54
11:54 pyrimidi_ left
notviki rafasch: what's "local variation"? 11:54
samcv wtf
i run
11:54 pyrimidine joined
rafasch Lika, local variations in collation order and such 11:54
samcv err so i can run programs
it works fine
notviki no idea 11:55
samcv but i try running a .t file and i get MVMArray: Index out of bounds
repl is fine 11:56
can't compile nqp or rakudo though. immediatly like. instantaniously gives me that error
11:56 Gasher joined 12:00 rburkholder joined 12:08 effbiai joined 12:15 Rawriful joined, darutoko- joined 12:16 darutoko left 12:21 clkao joined
notviki woa... Perl 6 book: deeptext.media/perl6-at-a-glance/ 12:24
"A. Shitov Perl 6 at a Glance" 12:26
Is it OK to laugh at that last name?
12:27 xtreak left
lizmat notviki: well, it *is* his last name 12:27
samcv would look better without 1st name abbreviated
lizmat well, it's not abbreviated on the cover 12:28
samcv oh ok
notviki Sure, but translitiration is killing me :P 12:29
lizmat well, what about Dick Hardt ? 12:30
notviki lols
I forget, who is that?
Or Active States ex-CEO?
lizmat en.wikipedia.org/wiki/Dick_Hardt 12:31
notviki He looks badass :)
lizmat :-) 12:32
moritz: perhaps tweet about deeptext.media/perl6-at-a-glance/ ? 12:41
12:42 dugword joined
moritz lizmat: thanks! 12:47
12:47 dugword left
rafasch Anyone here got a review copy? 12:51
lizmat not yet 12:52
12:53 ChoHag left
moritz kinda curious that there's no ebook available 12:55
12:56 dataf3l joined 12:59 dataf3l left
rafasch I sent them an e-mail saying they should send you guys a copy of the book. 13:00
notviki they should? :) 13:01
rafasch yep
good marketing
notviki doesn't see it 13:02
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 :-)
rafasch That's criticism, that's why I said they are review copies.
dalek rl6-mode: 4867c6d | (Tom Browder)++ | test/test-imenu.p6:
add example state var
13:04
rafasch Like game companies sending review copies to people that publish videos of them playing games.
notviki those are popular youtubers... 13:07
and this channel usually stays as π number of people in it
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:12
World-renowned specialists. 13:13
notviki just makes shit up most of the time. 13:15
rafasch notviki: You have impostor syndrome.
notviki Hah 13:16
rafasch Since all software sucks¹, making shit up is exactly what you should be doing. [1]harmful.cat-v.org/software/ 13:20
notviki Perl 6 is not in the list, so I guess we're good. 13:22
13:22 bjz_ left 13:23 bjz joined
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␤␤»
notviki hehehe 13:24
Oh right.
It's supposed to be ..
13:26 mawkish_ left, mawkish_ joined
rafasch -∞^…^∞: thumbs.dreamstime.com/z/happy-funn...972538.jpg 13:28
13:29 dataf3l joined 13:31 dataf3l left 13:35 pyrimidine left, pyrimidi_ joined
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
notviki heh doesn't work 13:40
just prints "CODE(0x4f96588) passed as text_regex is not a regex at -e line 0."
code I used FWIW gist.github.com/zoffixznet/4a12861...1bfe9aeba1 13:42
13:44 dataf3l joined 13:47 dataf3l left
notviki I mean Inline::Perl5 13:47
rafasch I was going to point it out, but it was so obviously a typo I didn't bother. 13:48
AlexDaniel just realized that books have no syntax highlighting 13:57
notviki They can :)
13:58 regnarg left
AlexDaniel $_.say :-/ 14:00
14:00 finanalyst joined
AlexDaniel but yeah, the contents of the book seem rather decent! 14:01
although of course I can't see the whole book
14:01 finanalyst left, StefanSC joined 14:03 vike joined 14:04 newbie1 joined
[Coke] ooh, I think $dayjob fixed my laptop. 14:06
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:07
14:08 mawkish_ left, mawkish_ joined
AlexDaniel though I have to admit that I'd laugh if the full name was like “Dick Shitov”… :S 14:09
anyway, good morning everyone! Let's start unwrapping the gifts… 14:14
commit: 2015.12,HEAD say (‘a’..‘e’).rotor(3, Inf, :partial)'
committable6 AlexDaniel, gist.github.com/4d8af9fdf8f7165b9a...ab82c12332
[Coke] I am sad that the Shitov book claims to support a version of a language that doesn't exist. :(
s/of a/of the/
AlexDaniel commit: 2015.12,HEAD say (‘a’..‘e’).rotor(3, Inf, :partial)
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»
AlexDaniel commit: 2015.12,HEAD my @a = ‘a’..‘e’; say (@a.rotor($_, Inf, :partial) for 1..^+@a)
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:16 domidumont left 14:17 dataf3l joined 14:18 bjz left, regnarg joined
notviki AlexDaniel: I don't pronounce Sh щ :S 14:20
14:20 pmurias joined 14:22 dataf3l left
[Coke] AlexDaniel: did you review the book or something? 14:24
AlexDaniel not at all. But there are some pictures on the same page
[Coke] I'll email him on the feedback link. 14:25
14:26 mawkish_ left 14:27 StefanSC left, mawkish_ joined 14:30 mawkish_ left
notviki moritz: author says "not yet" for eBoook version 14:31
14:33 mawkish_ joined
AlexDaniel m: say (0..Inf)[99999999] 14:33
I wonder why can't we make this a bit smarter?
camelia rakudo-moar 19df35: OUTPUT«(timeout)»
AlexDaniel m: say (0..999999999999999999999999999999999999999)[99999999] 14:34
camelia rakudo-moar 19df35: OUTPUT«99999999␤»
AlexDaniel m: say (0..999999999999999999999999999999999999999)[*-1]
camelia rakudo-moar 19df35: OUTPUT«999999999999999999999999999999999999999␤»
AlexDaniel the only question is what (0..Inf)[*-2] is supposed to return… :) 14:35
rafasch Inf, of course 14:36
Inf-2 = Inf
AlexDaniel well, erroring out is a good alternative also. 14:37
14:37 khw joined
rafasch What does IEEE says? 14:37
AlexDaniel I don't think IEEE defines ranges
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:38
and so we're trying to get an element from the end of an infinite list… 14:39
rafasch Which is Inf - $x = Inf
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␤␤»
rafasch Well, unless it's a convergent list.
dogbert2 m: say "123".comb.WHAT # shouldn't this be (List) ? 14:41
camelia rakudo-moar 19df35: OUTPUT«(Seq)␤»
AlexDaniel rafasch: it will only work with ranges
I think @x = 0..∞; say @x[*-2] is never going to work 14:42
but I could be wrong
notviki m: say Inf -2 14:43
camelia rakudo-moar 19df35: OUTPUT«Inf␤»
notviki AlexDaniel: smarter how?
14:43 jabowery joined
AlexDaniel dogbert2: oh you want a List? Here: 14:43
m: say "123".comb(/./).WHAT # shouldn't this be (List) ?
camelia rakudo-moar 19df35: OUTPUT«(List)␤»
AlexDaniel dogbert2: RT #130433, feel free to leave a comment there
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130433
AlexDaniel notviki: well we can return a value easily 14:44
notviki: just like we do in this case: 0..99999999999999999
notviki AlexDaniel: ah, OK, I know why it hangs
it's calling .list on it
AlexDaniel sure
notviki m: (1e200..1e200+1)[1] # same reason this hangs 14:45
camelia ( no output )
notviki :(
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.
notviki m: (1e200...1e200+1)[1] # same reason this hangs
camelia ( no output )
notviki m: (1e200...1e200+1).pick # same reason this hangs
camelia ( no output )
notviki dammit
m: (1e200...1e200+1).rand # same reason this hangs
camelia ( no output )
notviki :o
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␤␤»
AlexDaniel cool right?
jabowery mora -> moar
notviki lulz wat
it is positive!
AlexDaniel :o
commit: 6c (1e200..1e200+1).rand
committable6 AlexDaniel, gist.github.com/d496d9996275f8dcec...dc298ab337
notviki m: (1e200..1e200+1).roll # same reason this hangs 14:47
Oh THERE! Finally found the hanging one :P
camelia rakudo-moar 19df35: OUTPUT«(timeout)»
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:48
14:49 dataf3l joined
rafasch geekosaur: is it because of $PATH issues? 14:50
AlexDaniel notviki: anyway, RT #130437 14:51
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130437
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?
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
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
notviki jabowery: people who wrote it don't know or don't care about what Perl 5 does?
14:52 pe joined
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
notviki jabowery: seems a "third party" module altogether 14:53
14:53 pe left, dataf3l left
rafasch geekosaur: I see, same Unix as ever. 14:53
notviki AlexDaniel: "This can be easily solved."... um.. how?
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?
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
rafasch Yep, lightweight conteiners.
AlexDaniel notviki: or are there any reasons why it cannot be done?
dogbert2: I think it also made it slower :) 14:55
dogbert2 AlexDaniel: probably :)
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 rburkholder left
notviki m: my @a := 1..Inf; dd @a[999999] 14:55
camelia rakudo-moar 19df35: OUTPUT«1000000␤»
notviki m: my @a := 1.2..Inf; dd @a[999999] 14:56
hah
camelia rakudo-moar 19df35: OUTPUT«1000000.2␤»
rafasch Doesn't .cache turns a Seq into a List?
notviki m: my @a := 1..Inf; dd @a[999999]; say now - INIT now 14:57
camelia rakudo-moar 19df35: OUTPUT«1000000␤0.8055577␤»
notviki m: my @a := 1.2..Inf; dd @a[999999]; say now - INIT now
camelia rakudo-moar 19df35: OUTPUT«1000000.2␤11.6952814␤»
notviki takes a look at wtf that's so much slower
14:57 itcharlie_linux joined
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
notviki AlexDaniel: but $!max isn't Int
AlexDaniel notviki: yea, which is why it doesn't work 14:59
notviki OK
AlexDaniel notviki: so making it check for $!min only (in AT-POS) can possibly make it work
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
Engrish
15:00 thayne left
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:00
...so method calls can reach true wanted object 15:01
notviki The container containing object instance doesn't meow
the value gets replaced
Woodi dd still do :)
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␤␤»
notviki "no such method"
Object has been replaced
Woodi checking :)
notviki Foo hasn't been replaced, if that's what you're asking
15:05 dataf3l joined 15:07 dataf3l left
notviki huh 15:08
m: say (0..Inf).iterator.pull-at-least(999999)
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
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 } } }
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.…»
notviki ffs
m: say(given (0..Inf).iterator { gather { take .pull-one for ^999999 } } })
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-␤»
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}␤»
notviki -_-
AlexDaniel: but the huh was it already has a elsif nqp::istype($!min, Numeric) && $!max === Inf { shortcurcuit in its iterator
rafasch m: say do given (0..Inf).iterator { gather { take .pull-one for ^999999 } }
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␤␤»
notviki m: my $i = 1; $i++ for ^100000; say now - INIT now 15:12
camelia rakudo-moar 19df35: OUTPUT«0.059461␤»
notviki m: my $i = 1.1; $i++ for ^100000; say now - INIT now
camelia rakudo-moar 19df35: OUTPUT«0.891530125␤»
notviki holy crap 15:13
it uses .succ
15:15 domidumont joined
notviki m: my $i = 1e0; $i++ for ^100000; say now - INIT now 15:15
camelia rakudo-moar 19df35: OUTPUT«0.06945909␤» 15:16
15:16 bwisti joined, mawkish_ left 15:17 mawkish_ joined 15:20 dataf3l left, mawkish_ left, dataf3l joined
rafasch m: say 0.891530125/0.059461 15:22
camelia rakudo-moar 19df35: OUTPUT«14.9935273␤»
15:22 dataf3l left 15:23 mawkish_ joined, dataf3l joined
notviki doesn't get the difference between Rat and FatRat :/ 15:24
both are " is Cool does Rational[Int, Int] {"
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
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] {}
Rat has limited precision, unlike FatRat 15:27
notviki rafasch: where is that from?
rafasch docs.perl6.org/type/Rat
notviki heh
rafasch It's the first thing after the menu.
notviki is looking at actual implementation 15:28
# XXX: should be Rational[Int, UInt64]
my class Rat is Cool does Rational[Int, Int] {
And UInt64 is just a subset of Int, so why have it in the first place?
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
notviki What's "pathologically large"?
geekosaur and will absolutely kill performance
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
geekosaur performance, and you are welcome to play around with it and find out exactly why it is an issue
(not just in perl 6)
large denominators are the bane of rational representations, regardless of implementation
and it's all too easy to end up with them 15:31
notviki :(
15:32 cgfbee joined, dataf3l left 15:33 dataf3l joined 15:36 dataf3l left, mawkish_ left, dataf3l joined 15:38 dataf3l left, mawkish_ joined 15:39 dataf3l joined 15:41 dataf3l left 15:42 dataf3l joined 15:44 dataf3l left 15:45 dataf3l joined
rafasch I'm thinking about extended and quad precision floating point, is there any plans to make use of it, like in D? 15:45
15:46 aku left 15:48 mawkish_ left 15:49 mawkish_ joined 15:52 dataf3l_ joined, dataf3l left, dataf3l_ is now known as dataf3l
AlexDaniel rafasch: I haven't heard about any plans for it, but perhaps you can draft something? 15:54
or at least an RFC ticket describing how things should work could help
rafasch I have heard plans about it: design.perl6.org/S09.html 15:55
> num128
AlexDaniel oooh!
github.com/perl6/roast/blob/d1baf2...are.t#L414 15:56
that's interesting
rafasch NYI RT #124481 15:57
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=124481
16:00 dataf3l_ joined, dataf3l left, dataf3l_ is now known as dataf3l
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:02 dataf3l left 16:03 dataf3l joined
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:05 dataf3l left 16:06 dataf3l joined
Ulti_ win 2 16:06
erk
16:06 Ulti_ is now known as Ulti 16:08 dataf3l left 16:09 dataf3l joined
notviki m: say 10.071/6.378 16:10
camelia rakudo-moar 19df35: OUTPUT«1.579022␤»
rafasch m: say (10_071/100)/(6378/100) 16:11
camelia rakudo-moar 19df35: OUTPUT«1.579022␤»
notviki ironic... my 1.5x increase to Ratty ++/.. broke `now` so I couldn't measure the improvement with Perl 6 itself :(
rafasch: 10.071 is a Rat 16:12
rafasch I know, I was just fiddling around to see for myself.
Seeing is believing.
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)␤»
rafasch m: say 10_071/100/6378/100
camelia rakudo-moar 19df35: OUTPUT«0.000157902␤»
rafasch m: say 10_071/6378
camelia rakudo-moar 19df35: OUTPUT«1.579022␤»
rafasch (1/18_446_744_073_709_551_615).nude 16:14
m: say (1/18_446_744_073_709_551_615).nude
camelia rakudo-moar 19df35: OUTPUT«(1 18446744073709551615)␤»
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.
rafasch Like, making √ a function? 16:15
Lazy function. 16:16
notviki This was the 1.5x imrovement to Rat++ (by extension .succ and range op with it): gist.github.com/zoffixznet/69d1e51...ad6f55f564 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.
jabowery More like keeping the √ unevaluated during algebra until it is necessary to output a numeric value.
rafasch > More like keeping the √ unevaluated during algebra until it is necessary to output a numeric value.
That's what I said. 16:17
notviki m: dd WHAT 5**.3
camelia rakudo-moar 19df35: OUTPUT«Num␤»
notviki m: dd WHAT 5**(1/3)
camelia rakudo-moar 19df35: OUTPUT«Num␤»
16:17 StefanSC joined
geekosaur thinking you confuse functional programming with algebraic transformation 16:17
the two often go together, but neither actually implies the other
rafasch Who confuses? 16:18
jabowery No, I specifically said "functional programming semantics".
For the relationship with algebra, see: 16:20
16:20 dataf3l left
jabowery 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.
bindings*
16:20 dataf3l joined
rafasch Perl6 is very enabled to have good bindings because a grammar could be made for it, which would call the CAS underneath. 16:21
16:23 wamba left
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
16:24 acrussell joined 16:25 _4d47 joined
rafasch jabowery: if you need that, use specialized software. 16:28
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:30
16:31 dataf3l left
rafasch Have a link? 16:32
16:32 dataf3l joined
jabowery See the prior link to Backus's 1978 Turing Award lecture. 16:32
notviki tl;dr; summarize it in 3 sentences 16:33
1978... jesus... like a decade before I even existed :/ 16:34
16:34 dataf3l left 16:35 dakkar joined
jabowery Programming language design and implementation has not kept up with Moore's Law. 16:35
3 Sentences relevant in the present context.
1) From the abstract "Unlike von Neumann languages, these systems have semantics loosely coupled to states--only one state transition occurs per major computation."
2) A "state transition" in functional programming is necessary at output of a functional form. 16:36
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:37
16:38 dugword joined
rafasch You want a even-more complicated language? 16:38
16:38 zacts joined
jabowery It's a more complicated implementation that simplifies the language. 16:38
rafasch People took 16 years as it is, how much time do you think is reasonable? 16:39
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
There is no reason this has to hold anything up. It's just something to keep in mind.
rafasch Like Macros? It's comming.
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:41
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:42
16:44 darutoko- left 16:45 _4d47 left 16:46 Rawriful left
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:48
16:49 Rawriful joined
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
rafasch P6 guts are completely open for redefinition. 16:52
jabowery That's a major strength (and, of course, a weakness when recklessly used). 16:55
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.
Programming is a pragmatic activity.
(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.
16:59 Rawriful left 17:00 dakkar left
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:00
17:01 Rawriful joined
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.
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.
Xliff m: $_ = "femtofemtofarads"; s:g[ « femto\-? ] = 'f,'; .say 17:03
camelia rakudo-moar 19df35: OUTPUT«f,femtofarads␤»
Xliff ^ Does that form of substitution support the global modifier? 17:04
(And I'm just doing it wrong, above)
notviki God, I hope that's PhD level CS and not something normal programmers know
Xliff: yes
m: $_ = "femtofemtofarads"; s:g[ femto\-? ] = 'f,'; .say 17:05
camelia rakudo-moar 19df35: OUTPUT«f,f,farads␤»
Xliff Oh! LOL!
It was actually working properly!
m: $_ = "femto femtofarads"; s:g[ « femto\-? ] = 'f,'; .say
camelia rakudo-moar 19df35: OUTPUT«f, f,farads␤»
Xliff Thanks, notviki++ 17:06
jabowery Here is a good web page with multiple sources: 17:07
wiki.haskell.org/Exact_real_arithmetic
"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."
notviki Thanks.
notviki adds it to Notes file... for later reading
17:12 mawkish_ left, pyrimidi_ left, pyrimidine joined 17:13 pierre_ left, pierre_ joined
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:15
moritz sounds totally simple, if you want to implement all those transcedental functions yourself 17:16
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:17
17:18 pierre_ left, wamba joined
TEttinger "the" taylor series? 17:19
isn't there an infinitely large family of taylor approximations of functions?
moritz rafasch: it's not so simple
rafasch: you *really* don't want to implement sin(1e308) as a naive Taylor series 17:20
TEttinger m: sin(1e308)
camelia rakudo-moar 19df35: OUTPUT«WARNINGS for <tmp>:␤Useless use of "sin(1e308)" in expression "sin(1e308)" in sink context (line 1)␤»
TEttinger m: say sin(1e308)
camelia rakudo-moar 19df35: OUTPUT«0.453396490501649␤»
TEttinger pretty good, moar
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)
camelia rakudo-moar 19df35: OUTPUT«0.453396490501649␤»
moritz which is a whole lot of work, and rather error-prone
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
rafasch Do you know of some way of representing infinite fractions on a computer? 17:23
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
camelia rakudo-moar 19df35: OUTPUT«False␤»
andreoss m: say 10 ** 100 == 1e100
camelia rakudo-moar 19df35: OUTPUT«True␤»
andreoss m: say sprintf("%d", 10 ** 100)
camelia rakudo-moar 19df35: OUTPUT«10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000␤»
TEttinger infinite non-repeating or infinite repeating?
andreoss m: say sprintf("%d", 1e100)
camelia rakudo-moar 19df35: OUTPUT«10000000000000000159028911097599180468360808563945281389781327557747838772170381060813469985856815104␤»
moritz TEttinger: patches for such an implemetation are very welcome
andreoss why does this happen?
notviki andreoss: floating point math 17:25
moritz andreoss: sprintf uses floating points under the hood
notviki andreoss: it has enough precion to store 10000000000000000 exact, and the rest of space is used to store the 10th power
andreoss moritz: but it works with 10**100
notviki andreoss: because that's an Int and not a Num
moritz m: say (10**100).^name
TEttinger moritz, neat, although I don't currently use perl6
camelia rakudo-moar 19df35: OUTPUT«Int␤»
notviki m: say sprintf("%d", 1e100.Int) 17:26
camelia rakudo-moar 19df35: OUTPUT«10000000000000000159028911097599180468360808563945281389781327557747838772170381060813469985856815104␤»
notviki right
moritz m: say (1e100).^name
camelia rakudo-moar 19df35: OUTPUT«Num␤»
rafasch ϕ can be represented by an infinite repeating.
TEttinger is that the golden ratio?
rafasch yes
TEttinger hm
not totally sure there, is that in a particular radix? 17:27
moritz it's (sqrt(5) - 1)/2 or something like that
it's not even a transcendental number 17:28
+1, not -1
rafasch It's the most irrational number, though
pi is transcendental but not that irrational 17:29
andreoss shouldn't it switch to Rat (or something )at some point?
moritz rafasch: by what measure? I only know irrational as a boolean trait
notviki andreoss: switch what to Rat?
andreoss notviki: the internal representation of this number 17:30
moritz of what number?
andreoss m: say 1e+30.Int
camelia rakudo-moar 19df35: OUTPUT«1000000000000000019884624838656␤»
rafasch moritz: We were talking about representing numbers as infinite fractions. Phi is the one most difficult to represent as an infinite fraction.
moritz rafasch: by what measure? 17:31
rafasch The more difficult to represent as a fraction, the more irrational is the number.
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.
TEttinger moritz: weirdly, you were still right about (sqrt(5) - 1)/2 , that's the inverse of phi
notviki andreoss: so you get that noise
moritz rafasch: please define "difficult"
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
rafasch By the measure of the number of fractions to be calculated to achieve a certain precision 17:32
notviki andreoss: I meant unsure
moritz 1e100 is explictly a Num literal, so it makes sense to use Num semantics
andreoss why e100 isn't doing the same as **100?
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
andreoss so perl doesn't evaluate it at all
i see
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
rafasch Yes, just a moment. 17:35
17:35 dugword left
rafasch moritz: Hurwitz' Theorem: www.ams.org/samplings/feature-colum...rrational4 17:37
17:37 andreoss left
moritz rafasch: thanks 17:37
rafasch np
17:37 mawkish_ joined
notviki m: say 467748-458456 17:39
camelia rakudo-moar 19df35: OUTPUT«9292␤»
notviki ... and they left... OK 17:40
moritz eeks, the original publication to the Hurwitz Theorem costs more than 40€
[Coke] /away 17:42
rafasch There's proofs in wikipedia: en.wikipedia.org/wiki/Hurwitz%27s_..._algebras) 17:43
Opps, wrong Theorem: en.wikipedia.org/wiki/Hurwitz%27s_...er_theory) 17:44
Here it is: zbmath.org/?format=complete&q=an:23.0222.02 17:45
17:52 mawkish_ left 17:55 dugword joined 18:02 dugword left 18:04 skids joined 18:08 pyrimidine left, pyrimidine joined 18:12 sufrostico joined
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:13
m: say ((sqrt(5)+1)/2)/((sqrt(5)-1)/2) 18:14
camelia rakudo-moar 19df35: OUTPUT«2.61803398874989␤»
rafasch m: say 1/((sqrt(5)+1)/2) == ((sqrt(5)-1)/2) 18:15
camelia rakudo-moar 19df35: OUTPUT«False␤»
rafasch m: say 1/((sqrt(5)+1)/2) , ((sqrt(5)-1)/2)
camelia rakudo-moar 19df35: OUTPUT«0.6180339887498950.618033988749895␤»
18:16 StefanSC left
jmerelo Hey, that's phi :-) 18:19
rafasch Only one of them or both? 18:21
jmerelo First one. 18:22
Funny you've mentioned it because I hacked a version of Perl6 that includes it as a constant github.com/JJ/rakudo/commit/97b276...d7a17d3237 18:23
So maybe there's an use case here :-)
notviki m: say 1/((sqrt(5)+1)/2) ≅ ((sqrt(5)-1)/2)
camelia rakudo-moar 19df35: OUTPUT«True␤»
notviki m: say WHAT $_ for 1/((sqrt(5)+1)/2), ((sqrt(5)-1)/2)
camelia rakudo-moar 19df35: OUTPUT«(Num)␤(Num)␤»
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
rafasch Sorry, wrong symbol. One is Φ and the other is φ 18:25
notviki :o 18:26
rafasch One is the reciprocate of the other, so they represent the same ratio. 18:30
moritz jmerelo: I don't need it; just idle curiosity 18:47
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␤␤»
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␤»
notviki TIL we have that
rafasch my @l = roots(0, 1);say @l.elems; say has_approx(0, @l) 18:58
m: my @l = roots(0, 1);say @l.elems; say has_approx(0, @l)
camelia rakudo-moar 19df35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤ has_approx used at line 1␤␤»
samcv notviki, want to thank you (again?), for implementing DateTime - DateTime
rafasch m: my @l = roots(0, 1);say @l.elems; say @l
camelia rakudo-moar 19df35: OUTPUT«1␤[0+0i]␤»
samcv idk small change but. I think it's pretty important 18:59
notviki, also spectested 6.c-errata again and passing all tests but package tests 19:00
basic.t, precompilation.t, nested.t
19:03 rafasch left 19:04 cooper left
[Coke] gfldex: doc commit ffb9ce74f81e2113dd3 - why did you change BEGIN to X<BEGIN|BEGIN (phasers)> ? 19:09
This causes the search to have a section called "BEGIN (phasers)" with a single element in it, "BEGIN" 19:10
I think if we changed all those to |Phasers , that would be OK. 19:11
19:11 rindolf left
samcv +1 19:11
[Coke] goes ahead and does that. 19:12
19:14 dugword joined
dalek c: 3e8922b | coke++ | doc/Language/phasers.pod6:
use same search category for all phasers
19:15
synopsebot6 Link: doc.perl6.org/language/phasers
19:19 Deep_Thought joined 19:22 loveperl joined
loveperl (Can't serialize an object of type DateTime) in perl6 19:23
notviki m: DateTime.now.perl.EVAL.say
camelia rakudo-moar 19df35: OUTPUT«2016-12-29T20:23:49.553226+01:00␤»
notviki you can? 19:24
19:24 rindolf joined
loveperl Can't serialize an object of type DateTime 19:25
notviki -_-
loveperl Can't serialize an object of type DateTime in json::tyny
notviki loveperl: right, you need to convert it into something first 19:26
19:30 loveperl left
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"])}]␤»
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 ] } ]
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…»
notviki huh 19:32
notviki shrugs and moves on
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.
I see what you're doing with the duckmap though, that's a cool idea. 19:33
19:33 pierre_ joined
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…»
japhb dugword: It's in star
dugword star: use JSON::Tiny; to-json {foo => 'bar'};
camelia ( no output ) 19:35
dugword star: use JSON::Tiny; say to-json {foo => 'bar'};
camelia star-m 2016.10: OUTPUT«{ "foo" : "bar" }␤»
dugword star: use JSON::Tiny; say to-json {foo => 'bar', now => DateTime.now};
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…»
japhb m: say to-json {foo => 'bar'};
camelia rakudo-moar 19df35: OUTPUT«{␤ "foo" : "bar"␤}␤»
japhb DLS
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)␤ …»
dugword m: say &to-json.WHAT
camelia rakudo-moar 19df35: OUTPUT«(Sub)␤»
dugword m: say &to-json.perl
camelia rakudo-moar 19df35: OUTPUT«sub to-json (|c is raw) { #`(Sub|47265480) ... }␤»
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
19:37 pierre_ left, dataf3l joined
dugword That makes sense 19:38
Thanks
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?
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: docs.perl6.org/language/functions 19:44
"Functions and Functional Programming in Perl 6"
Also this includes lazy evaluation IIRC: github.com/perl6/perl6-examples/bl...luation.pl 19:45
19:46 cdg joined
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.
mst I've been playing around with using binds more than assignment so my variables end up single-assingment then readonly
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
[Coke] tries to diagram that sentence. 19:49
jabowery Backus -> Backus. Backus
Sorry.
notviki m: my @mst := [1..10]; @mst = 42; dd @mst
camelia rakudo-moar 19df35: OUTPUT«[42]␤»
jabowery Backus was -> Backus was trying 19:50
19:50 jmerelo left
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:51
mst hm, I don't see a link to the paper in scrollback 19:52
19:52 kurahaupo joined
jabowery www.cs.cmu.edu/~crary/819-f09/Backus78.pdf 19:52
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
Single assignment variables are simply symbol definitions.
notviki :o
notviki wasn't even born that far ago 19:57
[Coke] I found the CS guy.
notviki: whippersnapper.
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»
notviki AlexDaniel: so what would that do if we allow Inf?
mst right, I mentioned binding use because 'state is the enemy. state is always the enemy.'
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..*]
camelia rakudo-moar 19df35: OUTPUT«((b c d) (e) (b c d e f g h i j k))␤»
jabowery moritz, you're a poet or at least a purveyor of bad puns. 20:01
High praise in any event.
notviki AlexDaniel: cause there's also ^ that way to get "the rest" of stuff
moritz jabowery: I don't always know myself whethere it's poetry or puns :-) 20:03
20:03 rje_ joined
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
fixes that anonying `/` bug
notviki rje_: context/code?
What do you mean by single line.... 20:05
moritz if it's a single string, .lines tends to help
notviki samcv++ thanks
rje_ Multi-line pod appears to be read as one big 'ol line...
Can I post a multi-line comment here? (If so, how?)
notviki rje_: paste the code that reproduces the problem on gist.github.com 20:06
rje_ Cool. OK, gist is gist.github.com/bobbyjim/24fd0c5bb...5fd19135d9 20:07
AlexDaniel eval: gist.github.com/bobbyjim/24fd0c5bb...5fd19135d9
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.
AlexDaniel eval: gist.githubusercontent.com/bobbyji...tfile1.txt 20:08
evalable6 AlexDaniel, Successfully fetched the code from the provided URL.
samcv you can do multiline comment
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 -…»
AlexDaniel, Full output: gist.github.com/760b08c3c9b5872d8a...e0ae80657b
samcv #`{{ ... }}
or any other delimiter you want
should have a bot that does .pick on a set of brackets
out of all the ones ;P 20:09
AlexDaniel notviki: I don't know vOv
moritz samcv: and give it a blacklist of brackets to not use :-)
rje_ I'd like the pod to read lines as lines.
notviki AlexDaniel: I think I'll reject that ticket.
20:09 domidumont left
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.
samcv @$=pod.lines
notviki rje_: reproduced
samcv is it a bug notviki ?
does it strip the ␤
rje_ I don't think it's a bug.
I think it's behavior.
notviki samcv: not sure, but .lines won't help
rje_ sam, I'll try pod.lines
samcv it has no nl?
well if you print it out does it have anything in it? like newlines 20:11
also.
notviki no new lines
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?)
samcv :allow<S>
AlexDaniel notviki: uh, your suggested workaround does not seem to work
samcv and then enclose the whole thing in a S<… > across lines
or maybe you don't need allow. not sure 20:13
notviki AlexDaniel: what doesn't work?
rje_ Hey, eval + gist is a neat trick.
AlexDaniel notviki: → #zofbot
notviki TOOMANYCHANNELS!
samcv oh you want
=begin whatever :formatted<S>
to retain space and newlinse 20:14
rje_ thanks <samcv>
samcv does it work?
notviki samcv: doesn't work
samcv dammit
rje_ oops, doesn't appear to work
20:14 sufrostico left
notviki committable6: HEAD gist.github.com/zoffixznet/123f56d...66b76eb996 20:14
samcv try <C>
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.
notviki committable6: stupid bot
committable6 notviki, ¦«stupid»: Cannot find this revision
samcv idk try everything
notviki TRY ALL THE THINGS
samcv ^ 20:15
rje_ lol
samcv some combination of options SHOULD do it
and if there is none. then needs to be fixed
AlexDaniel eval: gist.githubusercontent.com/zoffixz...2f10/p6.p6
evalable6 AlexDaniel, Successfully fetched the code from the provided URL.
AlexDaniel, rakudo-moar 19df358: OUTPUT«Array @!contents = [Pod::Block::Para.new(config => {}, contents => ["FREE TRADER A1 200 S 1 1 …»
AlexDaniel, Full output: gist.github.com/fad51781acdd659ef8...6dd190e9ed
rje_ looks promising
samcv uh do C and S
notviki do how?
samcv :formatted<C S>
notviki same thing 20:16
samcv ok
rje_ yup
samcv then you want
=begin data
notviki heh
samcv =begin data :key<boats> 20:17
$=data<Boats>
to access
notviki rje_: FWIW, perhaps you wanted a table? =begin table =end table does give structured data
samcv tho it might like take out newlines
yea'h table might be better
rje_ maybe so
samcv data and S
notviki committable6: HEAD gist.githubusercontent.com/zoffixz...686b/p6.p6
committable6 notviki, Successfully fetched the code from the provided URL.
notviki rje_: gist.githubusercontent.com/zoffixz...686b/p6.p6
committable6 notviki, gist.github.com/8398e39d6848c67905...27651d2734
samcv data and S should prolly work
or do a table 20:18
if you don't set a data key it will just be in $=data
=begin data :formatted<S>
notviki That doesn't even parse
samcv damn 20:19
m: =begin data :formatted<S>
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>␤»
rje_ I assume "dd" data-dump?
notviki Pod variable $=data not yet implemented. Sorry.
rje_: yes, it's non-standard Perl 6
rje_ ach
20:19 labster joined
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␤»
notviki AlexDaniel: so what doesn't work with my solution to rotor?
samcv m: =begin data :key<stuff>␤ something on the 1st line ␤ something on 2nd␤ =end data␤␤ say dd $=data<stuff>
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␤»
pmurias why isn't dd specced?
samcv it's rakudo specific
[Coke] because it's just rakudo.
notviki pmurias: why should it?
rje_ Typically I like to read the line and then use regexes to rip it apart. A table might be nicer though.
samcv the output format is not standardized like .perl
or just use a heredoc rje_ 20:21
20:21 espadrine joined
rje_ So I could "say .contents.perl" ? 20:21
samcv no
[Coke] pmurias: could always test it in rakudo's t/, but we're not guaranteeing the format is stable.
rje_ It looks like it works.
samcv oh
i guess it was in $_
rje_ yah
AlexDaniel notviki: well, what's the equivalent for .rotor(3, 2, 3, ∞, :partial) ?
samcv show code rje_
rje_ that new dot notation threw me
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))
notviki committable6: 2015.12 <a b c>.rotor(3, 2, 3, ∞, :partial).say
committable6 notviki, ¦«2015.12»: ((a b c))
rje_ gist.github.com/bobbyjim/139d126c6...test42-txt 20:23
20:23 cdg_ joined
rje_ eval gist.githubusercontent.com/bobbyji.../test42.p6 20:24
eval: gist.githubusercontent.com/bobbyji.../test42.p6 20:25
evalable6 rje_, Successfully fetched the code from the provided URL.
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…»
rje_, Full output: gist.github.com/20fa377ba52d7e21f9...6abc384fe4
rje_ strings are diced up sorta funny, but I didn't specify any headers, so...
20:25 cdg left
rje_ eval: gist.githubusercontent.com/bobbyji.../test42.p6 20:27
evalable6 rje_, Successfully fetched the code from the provided URL.
notviki AlexDaniel: OK, yeah
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…»
rje_, Full output: gist.github.com/899b8cb6aa8818ae1b...fa94982fa9
20:28 avuserow left
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): design.perl6.org/S26.html#Tables
pmurias notviki: we could spec that &dd exists and does implementation specific data dumping stuff
20:28 avuserow joined
notviki pmurias: so we'd spec just its existence? 20:29
20:29 dataf3l left 20:33 dataf3l joined
rje_ Much better. eval: gist.githubusercontent.com/bobbyji.../test42.p6 20:34
eval: gist.githubusercontent.com/bobbyji.../test42.p6
evalable6 rje_, Successfully fetched the code from the provided URL.
rje_, rakudo-moar 19df358: OUTPUT«[["FREE TRADER", "A1", "200", "S", "1", "1", "22", "10", "--0", "1", "1", "82", "8", "0", "8",…»
rje_, Full output: gist.github.com/1d73c587c9ab8b3fba...6e6bfa209a
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.
notviki rje_: how come you'd use DATA for this anyway? 20:36
rje_ lol.
20:36 Tonik joined
notviki as opposed to... quoted word list or a HEREDOC? 20:36
20:36 kyan joined
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
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␤------> 03200 "Paid Traider" A2 300">.rotor(3).say7⏏5<EOL>␤ expecting any of:␤ double quotes␤»
rje_ *Usually* used HERE for output.
notviki m: qqww<"Free Trader" A1 200 "Paid Traider" A2 300>.rotor(3).say
camelia rakudo-moar 19df35: OUTPUT«((Free Trader A1 200) (Paid Traider A2 300))␤»
notviki m: dd qqww<"Free Trader" A1 200 "Paid Traider" A2 300>.rotor(3)
camelia rakudo-moar 19df35: OUTPUT«(("Free Trader", "A1", "200"), ("Paid Traider", "A2", "300")).Seq␤»
rje_ It was the easiest way to bang in input so I could get on with processing it... 20:38
notviki heh
rje_ I'm not rendering the data into Perl arrays: I'm using Perl as a code generator.
Ah, THAT was your question.
20:38 pierre_ joined
rje_ If I were writing this for a Perl app, I'd probably read it from a YAML stream... 20:39
anyhoo... I'm using Perl to generate a BASIC program that writes the data to a sequential disk image.
Sorry, a SEQ file on a disk image. 20:40
And the reason I'm doing THAT is "just because" or "insanity" or some other reason.
RabidGravy gosh that really is a blast from the past 20:41
rje_ Right.
I wrote modules in Perl5 to fold, spindle, and mutilate various Commodore disk images.
Again, "just because" / "insanity" / etc
20:42 holli left
notviki committable6: HEAD gist.githubusercontent.com/zoffixz...fb32/p6.p6 20:42
committable6 notviki, Successfully fetched the code from the provided URL.
notviki, gist.github.com/968d65aa15f0a558cb...e8ef71d2b3
rje_ So I'm banging data around, and decide "hey, I'll just do this in Perl6."
notviki rje_: I meant use ^ that instead of PODs or whatever
and output it anyway you wan
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__
rje_ <dugword> I fully expect P6 to be better. As I am quite new to it, though, I lack experience. 20:43
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
rje_ I will use __DATA__ when the dataset is restricted. I happily change to files when I want a more general tool. 20:45
Looks like tables in P6 speeds things up for me. 20:46
20:47 Deep_Thought left 20:48 cdg_ left 20:49 cdg left
notviki That's What We Do(tm) 20:49
That's What We Do™
20:51 cdg joined
notviki AlexDaniel: another footgun with Inf in .rotor: 20:53
zoffix@VirtualBox:~/CPANPRC/Standard-Rakudo$ ./perl6 --ll-exception -e 'dd <a b c d e f g>.rotor: 2, 3, Inf'
(("a", "b"), ("c", "d", "e")).Seq
20:53 cognominal joined
notviki Or is that a feature? 20:53
"discard the rest"
20:54 Gasher left
moritz it can't reach Inf elements, so without :partial, it discards them 20:54
notviki Yeah, that's my point. 20:55
You can never get a result for Inf rotation
without a :partial stuck on
20:56 cdg left 20:57 cooper joined, cooper left, cooper joined
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))␤»
notviki AlexDaniel: and ^ that would hang trying to reify infinitel number of elements....
AlexDaniel notviki: the previous one looks correct 21:01
you cannot get an infinite number of elements, you can only get as many as there are
which is why :partial is needed
if you asked for 999999999 elements it wouldn't give you that, right?
only with :partial
so the behavior with Inf seems to be consistent 21:02
notviki AlexDaniel: and what about the hang? 21:03
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))
notviki committable6: 2015.12 say <a b c d e f g h i j k l m n>.rotor(3, 4, -Inf, :partial)
committable6 notviki, ¦«2015.12»: ===SORRY!===␤Cannot have elems < 1, did you mean to specify a Pair with => -Inf? «exit code = 1»
notviki committable6: 2015.12 say <a b c d e f g h i j k l m n>.rotor(3, 4, NaN, :partial)
committable6 notviki, ¦«2015.12»: ((a b c) (d e f g) (h i j k l m n))
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»
notviki committable6: 2015.12 say (^Inf).list.rotor(3, 4, NaN, :partial)
committable6 notviki, ¦«2015.12»: ===SORRY!===␤This type cannot unbox to a native integer «exit code = 1»
21:06 ChoHag left
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»
notviki committable6: 2015.12 say <a b c d e f g h i j k l m n>.rotor("Inf" => 2, :partial)
committable6 notviki, ¦«2015.12»: ((a b c d e f g h i j k l m n))
21:08 Tonik left
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
AlexDaniel notviki: hang? What hang… 21:15
notviki AlexDaniel: dd (1..*).rotor: 2, 3, Inf, :partial 21:16
AlexDaniel oh, well 21:17
DIHWIDT ?
you've asked for as many elements as it can get
sure enough it will hang, no?
I mean, you don't even need Inf for this 21:18
m: dd (1..*).rotor: 2, 3
m: say (1..*).rotor: 2, 3
21:18 cdg joined
camelia rakudo-moar dc7b68: OUTPUT«(timeout)» 21:18
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…»
dalek c: ff89b2b | samcv++ | / (2 files):
Remove references in *.md to Inline::Python and pygments

Add references to needing nodejs and GCC 4.8
AlexDaniel the problem is that it will hang trying to get the third element. But it's fine, I guess? 21:19
notviki :/ 21:20
What if you don't know what you're rotoring?
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␤␤»
notviki wat
oh it slurps
21:21 cdg_ joined 21:22 cdg left, bjz left
AlexDaniel m: say (^Inf).max 21:27
camelia rakudo-moar dc7b68: OUTPUT«Inf␤»
AlexDaniel m: say (^Inf).maxpairs
well, it was stupid to assume that this is going to work, right? :)
m: say (^Inf).min
camelia rakudo-moar dc7b68: OUTPUT«(timeout)»
rakudo-moar dc7b68: OUTPUT«0␤»
mst notviki: if you rotor this rotor you'll say() that this rotor was not worth rotoring?
AlexDaniel m: say (^Inf).minpairs
camelia rakudo-moar dc7b68: OUTPUT«(timeout)» 21:28
notviki m: say (^10).minpairs
camelia rakudo-moar dc7b68: OUTPUT«[0 => 0]␤»
notviki m: say (^10).maxpairs
camelia rakudo-moar dc7b68: OUTPUT«[9 => 9]␤»
notviki
.oO( why do we have this... )
21:28 webstrand joined
AlexDaniel notviki: so that you can get an index? 21:29
notviki m: say (^10).pairs.max
camelia rakudo-moar dc7b68: OUTPUT«9 => 9␤»
notviki m: say (^10+20).pairs.max
camelia rakudo-moar dc7b68: OUTPUT«9 => 29␤»
notviki m: say (^10+20).maxpairs
camelia rakudo-moar dc7b68: OUTPUT«[9 => 29]␤»
AlexDaniel … um… so that you can get the index efficiently… …?
notviki hah
AlexDaniel it probably works on hashes too? 21:30
m: say { a => 42, b => 50 }.maxpairs
camelia rakudo-moar dc7b68: OUTPUT«[b => 50]␤»
AlexDaniel \o/
m: say { a => 42, b => 50 }.pairs.max
camelia rakudo-moar dc7b68: OUTPUT«b => 50␤»
AlexDaniel :/
m: say [15,8,3,15,9].maxpairs
camelia rakudo-moar dc7b68: OUTPUT«[0 => 15 3 => 15]␤»
AlexDaniel m: say [15,8,3,15,9].pairs.max 21:31
camelia rakudo-moar dc7b68: OUTPUT«4 => 9␤»
AlexDaniel \o/
notviki :)
21:31 lucasb joined
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)␤»
AlexDaniel yeah, wait… pairs.max does something completely different
21:31 ttkp6 joined
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)
camelia rakudo-moar aa3506: OUTPUT«0 => 15␤»
21:32 ChoHag joined
AlexDaniel webstrand: have you tried Nil ? 21:32
I think it works
notviki s: Proc, 'new' 21:33
SourceBaby notviki, Sauce is at github.com/rakudo/rakudo/blob/aa35.../Mu.pm#L95
notviki s: Proc, 'new', \("foo"
SourceBaby notviki, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Unable to parse expression in argument list; couldn't find final ')' ␤at -e:7␤------> <BOL>⏏<EOL>␤ expecting any of:␤ argument list␤
notviki s: Proc, 'new', \("foo")_
SourceBaby notviki, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Unable to parse expression in argument list; couldn't find final ')' ␤at -e:6␤------> put sourcery( Proc, 'new', \("foo")⏏_ )[1];␤ expecting any of:␤ infix␤ infix stopper␤
notviki screw you robot
geekosaur closed is a terrible idea unless you are digging for security holes
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)
notviki geekosaur: why security holes?
AlexDaniel m: … 42
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␤␤»
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
(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.
webstrand p6: run 'false', :in=Nil;
camelia rakudo-moar aa3506: OUTPUT«Cannot modify an immutable Pair␤ in block <unit> at <tmp> line 1␤␤»
webstrand Am I doing something wrong? 21:37
notviki webstrand: it'd be :in(Nil)
And running is disabled on the bot
21:37 pyrimidine left
webstrand geekosaur: If you don't close stdin for a process that sometimes expects input, it will block forever, right? 21:37
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
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 21:41 mawkish_ joined 21:43 dataf3l left
notviki rolls eyes 21:45
21:45 labster left, dataf3l joined, pierre__ joined
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: www.youtube.com/watch?v=IFlAQB39W6E 21:46
And it's 51 seconds of a dude cutting off a girl at a busy road
That's why humanity will end. We discuss nonsense.
Don't forget to leave a comment. 21:47
R.I.P
21:47 bjz joined 21:48 pierre_ left 21:50 labster joined
dugword gist.github.com/dugword/a19a5f50be...dad71de991 21:50
Is that a bug, or am I using multi methods wrong? 21:51
21:51 newbie1 left 21:52 newbie1 joined 21:56 acrussell left, Derderderd joined
webstrand With Proc.new().spawn(), does the process run in parallel or does spawn wait for the process to exit first? 21:56
21:56 dataf3l left
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
dugword HTTP::UserAgent can be installed by zef|panda 21:57
That seems to work fairly well for me
Derderderd hmmm it's strange that you have to install a 3rd party package for something that seems to be so basic
thanks though dugword 21:58
dugword :mst Switching the order changes it 21:59
22:01 dataf3l joined
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 gist.github.com/dugword/d4e5b0dfbf...49d4f59ba4
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:02
22:02 Derderderd left
mst dugword: I believe named params match based on 'first that makes sense at all' 22:03
notviki: yo, am I making sense here?
notviki what you guys are talking about? 22:04
star: use HTTP::UserAgent
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…»
notviki star: use LWP::Simple
camelia ( no output )
notviki well, we have that ^ 22:05
mst: I've no idea
dugword When I pass in 2 args, should it ever call the 1 arg multi?
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: gist.github.com/masak/8e082999e06b...2899bbcde5
dugword Oh....
Okay
That makes it make sense
mst hence why the one-arg candidate matches
and you need to put the two-arg one first
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
Hence why ordering matters; otherwise they're equal 22:07
mst I thought not weighting them was a Choice
notviki And this is the ticket: rt.perl.org/Ticket/Display.html?id...et-history
mst see, this is the bit I summoned you to correct me on :P
notviki knows very little on MMD
notviki knows very little
lucs notviki knows 22:08
22:09 FROGGS_ left
geekosaur masak, perhaps I should have forgotten Haskell before reading that :p 22:10
22:10 sufrostico joined
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 :)
from my pov it was kinda "oh look, masak discovered haskell :p " 22:12
masak I wish :P
dugword Based on my initial assumption I'm glad its not a choice to not weight them :) Seems intuitive to have them weighted
mst I'm torn between "oh look, masak discovered haskell" and "oh look, masak discovered J" 22:13
22:14 cdg joined
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
masak: yeah, I resemble that remark
masak yes, I couldn't help thinking of Smalltalk's thing too
I almost mentioned it, in fact. might still do so.
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:15
22:15 cdg_ left 22:16 dataf3l left, dataf3l joined
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
mst: in that case, that's a difference from Smalltalk, where those are blocks and one remains un-evaluated.
mst masak: oh, hrm, I was reading it in context of haskell style lazy evaluation 22:19
masak does lambda calculus have a default? :)
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
but
in the precense of things like the Y combinator
you might run into an infinite loop that you otherwise wouldn't've
mst it only stops being an implementation detail/optimisation when there are side effects
geekosaur lambda calculus doesn't specify, but it makes more sense if you consider it lazy
22:21 RabidGravy left
mst well, yes, I guess the argument of "accidentally sort-of-working programs would be less-working" exists 22:21
but I don't find it particulartly convincing
masak hm, yes
geekosaur especially since you generally want to think of lambda calculus in terms of reductions, instead of evaluation /per se/
masak even in a strictly evaluating setting, you could always protect yourself from infinite loops with extra layers of abstraction
geekosaur (it is a calculus, after all, you want analytic solutions :) 22:23
masak geekosaur: I've never quite figured out why it's not the "lambda algebra" 22:24
22:24 kurahaupo left
masak I'd expect a calculus to have something like a derivative operator :) 22:24
22:26 mawkish_ left 22:27 mawkish_ joined
moritz the German "Kalkül" means a system of rules and axioms 22:27
22:27 lucasb left
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
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 en.wikipedia.org/wiki/Abstract_algebra
mst not sure mathemtically how Inf.Int can make sense?
samcv NaN
NaI?
lol.
notviki It'd just return Inf 22:29
masak NaN is a very Num-y notion, not very Int-y
we never quite got Inf to be as type-hoppy as TimToady hoped
samcv make it an Int undefined :P
webstrand After spawning a Proc, how can I block until it exits?
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>␤»
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;
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␤␤»
notviki :|
oh
WTF
can"t type up arrow
types AAAAAAAA
22:31 sufrostico left
notviki ?QUIT 22:31
Oh, I may need to clean my keyboard ^_^
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␤»
notviki there we go
geekosaur webstrand, for run you probably want to wait on input/output. otherwise you may want Proc::Async instead of Proc
22:32 regnarg left 22:33 rindolf left 22:34 rje_ left
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␤␤»
samcv m: my Int $var = 10; $var = $var / Inf;
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
samcv 0e0? 22:35
petrutrimbitas p6 say 3+4 22:36
notviki samcv: the result is a Num
samcv yes
i know
notviki What's the question then?
geekosaur m: say 3e0 / Inf
camelia rakudo-moar aa3506: OUTPUT«0␤»
geekosaur per IEEE754 22:37
samcv got Num (0e0)
why doesn't it just set Int to 0
i mean should it? would it be more awesome?
notviki because you're not using a coercer?
22:37 bjz left
geekosaur there's another IEEE754 gotcha 22:38
notviki No it wouldn't
geekosaur m: say 3e0 / -Inf
camelia rakudo-moar aa3506: OUTPUT«-0␤»
geekosaur Num's 0 is *signed*
(because this is important for limits, and for quadrants (see: atan2)
notviki m: say 3 / -Inf 22:39
camelia rakudo-moar aa3506: OUTPUT«-0␤»
notviki m: say "3" / -Inf
camelia rakudo-moar aa3506: OUTPUT«-0␤»
notviki good
22:39 AlexDaniel left 22:40 AlexDaniel joined
AlexDaniel yay… emacs crashed 22:40
awesome
notviki You're running IRC from... your editor? 22:41
22:42 cdg left, cdg joined
notviki m: say -1+i / Inf 22:42
camelia rakudo-moar aa3506: OUTPUT«-1+0i␤»
notviki m: say -1 + i / Inf
camelia rakudo-moar aa3506: OUTPUT«-1+0i␤»
notviki m: say <-1+i> / Inf
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␤␤»
notviki hehe
m: say <-1+1i> / Inf
camelia rakudo-moar aa3506: OUTPUT«-0+0i␤»
notviki m: say <+1-1i> / Inf 22:43
camelia rakudo-moar aa3506: OUTPUT«0-0i␤»
22:45 cdg left 22:48 cdg joined
masak discovers the term en.wikipedia.org/wiki/Muntzing 22:48
very close to what I mean when I say "golfing" (about bugs)
notviki AlexDaniel: what about <a b c d e f g>.rotor: 5, -Inf => 1 ? Whats the behaviour for that? 22:49
Or <a b c d e f g>.rotor: 5, -Inf => Inf
AlexDaniel :o
notviki <a b c d e f g>.rotor: 5, -5555 => 1 22:50
m: <a b c d e f g>.rotor: 5, -5555 => 1
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
AlexDaniel an error is probably appropriate? 22:50
notviki m: <a b c d e f g>.rotor: 5, 3 => Inf 22:51
camelia ( no output )
notviki m: dd <a b c d e f g>.rotor: 5, 3 => Inf
camelia rakudo-moar aa3506: OUTPUT«(("a", "b", "c", "d", "e"),).Seq␤»
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␤␤»
notviki gives up on that for the day.... 22:53
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. 22:54
23:09 Rawriful left, teksteiner left
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:13
Is there really no way to do asynchronus piping without writing my own fork/exec? 23:14
notviki webstrand: use a normal proc and just stick it into a start {} block? 23:15
You can tap .stderr/.stdout on Proc::Async and just ignore it 23:16
stdin...
notviki looks at code
Don't see anything useful other than .close-stdin 23:17
webstrand: but yeah, our IO sucks and in need of love
webstrand Is there a spec that just hasn't been implemented? 23:18
23:18 lukaramu left
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
webstrand: what was the issue with regular Proc again?
webstrand It seems to block until the spawned process exits 23:20
I'm trying to do the equivalent of 'prog_a | prog_b'
Along with closing some pipes
notviki AlexDaniel: MasterDuke ^ you did something like that, no?
masak 'night, #perl6
notviki for the bots?
masak: night 23:21
TEttinger notviki: sociopolitical progress can only be made when the proletariat are liberated from the heels of the bourgoisie dogs!
AlexDaniel well yea, you can take this as an example: github.com/perl6/whateverable/blob...e.pm6#L100 23:22
but unless you want merged stdout and stderr I'm not sure why would you go through these troubles
ugexe m: my $proc = shell "sleep 5 && echo XXX", :out; sleep 5; say "Doesnt sleep another 5 seconds"; say $proc.out.lines
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␤␤»
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
ugexe: well, that just shells out
23:23 mawkish_ left
notviki webstrand: ^ yeah you can just shell out? Not sure if that works for your usecase 23:24
23:24 pmurias left
ugexe run works the same 23:24
AlexDaniel run works the same, yes
no need for shell
ugexe shell was convienient for the sleep
notviki huh
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
AlexDaniel hmm what's spawn…
ugexe its what run/shell are wrappers around 23:26
notviki What do you mean with "run works the same"?
AlexDaniel notviki: meaning that it won't block
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?
webstrand Huh. Proc.new(:out).spawn('sleep', '5000') Doesn't block. 23:28
AlexDaniel yea
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
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␤␤»
ugexe it was just easier to write the shell version of that before 23:30
notviki But what I was taking about is piping
Not sleeping
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*
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
with :out, you block by reading from $proc.out
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
23:33 mawkish_ joined
geekosaur it does, but when you used :out it did not block because blocking is done by reading $proc.out 23:33
23:33 dataf3l left
geekosaur that is what you asked for there 23:33
you asked it to give you its stdout as $proc.out and you would then block by reading from that
which is what you generally want from a pipe, as opposed to just running a command 23:34
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?
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
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
and, if you don't specify, it uses perl's default
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:38
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
that is Proc::Async 23:40
run is not fork/exec; it is system and open in pipe mode rolled up into one
23:41 petrutrimbitas left
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:42
geekosaur no, it should be able to just connect those 23:43
there are cases when you'd need to copy data but I think you are forced to do that copying yourself
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
this is not a technical limitation. this is "emulate system() as found in C, Perl 5, etc." 23:46
23:57 xui_nya[m] joined 23:59 dataf3l joined