Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-06-10

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:03 xerx joined #perl6
00:10 cokebot9000 joined #perl6
00:10 cokebot9000 Can't ssh into hack.p6c.org atm.
00:14 Juerd samcv: Finally got around to copy/pasting the huge license identifier :)
00:27 Cabanossi joined #perl6
00:35 raschipi joined #perl6
00:43 void1 joined #perl6
00:47 void1 joined #perl6
00:52 timotimo Juerd: funny, just an hour or two ago i looked at your mqtt library
01:10 aborazmeh joined #perl6
01:10 aborazmeh joined #perl6
01:12 Cabanossi joined #perl6
01:22 BenGoldberg joined #perl6
01:47 kyclark joined #perl6
01:47 DarthGandalf joined #perl6
01:47 Cabanossi joined #perl6
01:48 ilbot3 joined #perl6
01:48 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
02:16 Sgeo joined #perl6
02:17 kurahaupo joined #perl6
02:39 noganex joined #perl6
02:45 MasterDuke joined #perl6
02:46 kyclark joined #perl6
03:33 araraloren joined #perl6
03:55 geekosaur joined #perl6
03:57 Ben_Goldberg joined #perl6
03:57 Cabanossi joined #perl6
04:27 xtreak joined #perl6
04:36 curan joined #perl6
04:46 mr-foobar joined #perl6
04:48 cioran89 joined #perl6
04:52 cioran89 joined #perl6
04:54 xerx joined #perl6
05:10 xtreak joined #perl6
05:12 Actualeyes joined #perl6
05:12 xtreak joined #perl6
05:43 adu joined #perl6
05:56 Cabanossi joined #perl6
06:15 maettu left #perl6
06:26 Cabanossi joined #perl6
06:31 mr-foobar joined #perl6
06:43 domidumont joined #perl6
06:47 wamba joined #perl6
06:49 domidumont joined #perl6
06:54 rindolf joined #perl6
07:18 rindolf joined #perl6
07:23 nadim joined #perl6
07:34 xtreak joined #perl6
07:48 mr-foobar joined #perl6
07:49 xtreak joined #perl6
07:50 xtreak joined #perl6
07:53 xtreak joined #perl6
07:58 skids joined #perl6
08:06 CacoS joined #perl6
08:18 zengargoyle does anybody/everybody use `hub` (https://hub.github.com/) for their CLI based github interactions?  or is there something else i should investigate?
08:19 moritz there's also https://github.com/ingydotnet/git-hub
08:27 zengargoyle ah, i think part of my confusion was assuming Debian git-hub package was just a renamed version of hub, seems it's yet another git-hub thing (https://github.com/sociomantic/git-hub).
08:33 zengargoyle ingy's seem to be of the query/follow/star/etc things instead of the issues/pull-request things.
08:35 moritz I think it also does issues/PRs
08:36 xtreak joined #perl6
08:39 zengargoyle ah, i just looked at the quick synopsis and didn't go further down the docs.
08:41 samcv zengargoyle, i use hub
08:41 samcv it's great
08:41 samcv i've also used it to automate pull requests and such from perl 6
08:44 Cabanossi joined #perl6
08:45 zengargoyle not suprisingly, ingy's looks pretty cool on further scrolling down the page. :)   i'll have to re-check hub and the other git-hub now that i know they're different things.
09:06 paule32 joined #perl6
09:06 paule32 hello
09:07 paule32 can i run perl6 programs with perl5 by using:  use v6 ?
09:07 zengargoyle no
09:08 paule32 how can i use "our $foo"
09:10 zengargoyle same way for the most part.
09:10 zengargoyle m: our $foo = "hello"; say $foo;
09:10 camelia rakudo-moar c356d8: OUTPUT: «hello␤»
09:16 zengargoyle i thought at one time there was an idea to have 'use v6;' try to re-exec with perl6 or to have perl5 notice a #!perl6 and do something.  guess it had too many problems/pitfalls.
09:18 paule32 thank you
09:20 zengargoyle there is a 'v6' module for Perl5 that uses Perlito, but i know nothing about how close it is to implementing all of Perl6 features.
09:21 * zengargoyle only knows of Perlito by name, haven't followed it's progress.
09:24 zengargoyle https://docs.perl6.org/syntax/our
09:24 parv joined #perl6
09:30 Cabanossi joined #perl6
09:42 setty1 joined #perl6
09:44 parv joined #perl6
10:05 AlexDaniel joined #perl6
10:40 paule32 http://codepad.org/3ugXTzQD
10:41 paule32 what is that - missing lib?
10:43 lizmat m: use warnings
10:43 camelia rakudo-moar c356d8: OUTPUT: «===SORRY!===␤Could not find warnings at line 1 in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-1/share/perl6/site␤    /home/camelia/rakudo-m-inst-1/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-1/share/perl6␤    CompUnit::Re…»
10:43 lizmat hmmm...
10:43 lizmat paule32: warnings are always enabled in Perl 6
10:44 lizmat m: no warnings
10:44 camelia rakudo-moar c356d8: OUTPUT: «===SORRY!===␤Don't know how to 'no warnings' just yet␤»
10:44 lizmat and you can't silence them like that either
10:44 lizmat what you *can* do:
10:44 paule32 how is Term::ReadKey?
10:45 paule32 default, too?
10:45 Cabanossi joined #perl6
10:45 lizmat m: my $a; "$a".say
10:45 camelia rakudo-moar c356d8: OUTPUT: «Use of uninitialized value $a of type Any in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤  in block <unit> at <tmp> line 1␤␤»
10:45 lizmat m: my $a; quietly "$a".say
10:45 camelia rakudo-moar c356d8: OUTPUT: «␤»
10:46 lizmat quietly { } or quietly statement
10:47 lizmat paule32: re Term::ReadKey , please check http://modules.perl6.org
10:47 paule32 ok, thanks for helping
10:48 lizmat paule32: depends on what you need to do
10:48 paule32 have to go
10:48 salv0 joined #perl6
10:48 paule32 ehm, AI
10:48 paule32 https://ai.neocities.org/perlmind.txt
10:49 rindolf joined #perl6
11:03 lizmat joined #perl6
11:28 jferrero joined #perl6
11:31 nadim good morning! I have an object's method that returns an object that has data that shouldbe hidden for the receiver but accessed by the creating object. Something like 'friend' in C++.
11:31 nadim the questions being: can we do it in P6? Should we do it? is there another way of doint it?
11:33 jnthn It's rarely wise, but see `trusts`
11:33 jnthn Which does that
11:34 jnthn (It allows calling of private methods by the trusted class)
11:36 nadim jnthn: thanks. in this case I think it would be unwise to not do it. the only way I could think about is the opaque class to have a method to return whatever data the trusted class has and make sure it is called by a trusted class; something like Opaque::method(TrustedClass $t, ...);
11:42 nadim that has the advantage of fine granularity trusting
11:51 Geth Swapped META.info → META6.json in 2 dists in https://github.com/perl6/ecosystem/commit/af1861cfd9
11:54 eveo joined #perl6
11:54 eveo So ecosystem updater runs on www server in ecosystem-api.perl6.org user, but we don't got perlbrewed perl on that box?
11:55 eveo I need a module installed. Wondering if I should install it systemwide :/
11:57 Geth ¦ doc: a3539d0dc8 | (Jan-Olof Hendig)++ | doc/Type/Supply.pod6
11:57 Geth ¦ doc: Added jnthn++ doc of Supply.on-close
11:57 Geth ¦ doc: review: https://github.com/perl6/doc/commit/a3539d0dc8
12:00 Cabanossi joined #perl6
12:06 eveo *crickets*
12:06 eveo System wide it is then
12:07 geekosaur joined #perl6
12:10 Geth ¦ doc: 5c7fd3be88 | (Jan-Olof Hendig)++ | 2 files
12:10 Geth ¦ doc: Removed trailing ws
12:10 Geth ¦ doc:
12:10 Geth ¦ doc: Closes #1372
12:10 Geth ¦ doc: review: https://github.com/perl6/doc/commit/5c7fd3be88
12:13 aborazmeh joined #perl6
12:13 aborazmeh joined #perl6
12:18 Geth ¦ ecosystem: ffe71f7583 | (Zoffix Znet)++ | server/updatelist.pl
12:18 Geth ¦ ecosystem: Update ecosystem JSON atomically
12:18 Geth ¦ ecosystem:
12:18 Geth ¦ ecosystem: Fixes #345
12:18 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/ffe71f7583
12:24 * zengargoyle wonders if there's like an activity graph of #perl6* somewhere.
12:24 xtreak joined #perl6
12:25 MasterDuke https://irclog.perlgeek.de/ and https://irclog.perlgeek.de/perl6/
12:26 eveo talk about crap graphs.. no axis labels. Was it is? A decade or an hour? and what's the peak? 2 people talking or 2000?
12:27 Geth ¦ ecosystem: f9e499ea22 | (Zoffix Znet)++ (committed using GitHub Web editor) | README.md
12:27 Geth ¦ ecosystem: Remove travis badge
12:27 Geth ¦ ecosystem:
12:27 Geth ¦ ecosystem: Since travis tests new addition of modules, not the repo health
12:27 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/f9e499ea22
12:28 zengargoyle heh, i was thinking like a bot commandable sparkline graph or msgs/h in a rrd or graphite? like graph.
12:29 zengargoyle just because timezone seems to play a large role.
12:31 eveo oh crap
12:32 eveo :}
12:33 eveo (ecosystem json was 401 for about 30 seconds)
12:36 Geth ¦ ecosystem: dc99c51cd1 | (Zoffix Znet)++ | server/updatelist.pl
12:36 Geth ¦ ecosystem: Fix file mode in atomic write
12:36 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/dc99c51cd1
12:45 Cabanossi joined #perl6
12:46 zengargoyle ▁▂▂▇▁▂▂▂▁▁▁█▆▃▁▅▆▄▁▃▁
12:47 zengargoyle (yesterday)
12:47 travis-ci joined #perl6
12:47 travis-ci Doc build errored. Jan-Olof Hendig 'Added jnthn++ doc of Supply.on-close'
12:47 travis-ci https://travis-ci.org/perl6/doc/builds/241498696 https://github.com/perl6/doc/compare/e6c3b65958e6...a3539d0dc85b
12:47 travis-ci left #perl6
12:48 eveo heh
12:51 eveo buggable: speed 60
12:51 buggable eveo, ▁▂▁▁▃▃▃▃▃▃▂▂▁▂▆▇▂▂▂▂▃▃▃▄▂▆█▅▆▅▃▄▄▄▅▇▄▃▆▆↑▅▄▄██▄▆↑▄▅▅▃▂▄▄▅▃▄▄ data for 2017-05-15–2017-06-10; range: 4.194s–5.038s; 5% slower
12:51 eveo ZofBot: you call that a graph?! Now THIS is a graph!
12:54 zengargoyle what are the ↑ bits?
12:55 eveo outliers
12:56 eveo https://github.com/zoffixznet/perl6-buggable/blob/master/lib/Buggable/Plugin/Speed.pm6#L43-L50
12:57 zengargoyle does this mean there's already a p6 sparkline module (or at least implementation) ... seems so.
12:57 eveo Nope
12:57 eveo Well, there's the code ^ in that file.
13:00 travis-ci joined #perl6
13:00 travis-ci Doc build errored. Jan-Olof Hendig 'Removed trailing ws
13:00 travis-ci https://travis-ci.org/perl6/doc/builds/241501148 https://github.com/perl6/doc/compare/a3539d0dc85b...5c7fd3be884e
13:00 travis-ci left #perl6
13:02 eveo ^ timeout
13:03 zengargoyle close enough to steal from. :)
13:03 Geth ¦ doc: 936c854a91 | (Jan-Olof Hendig)++ | doc/Language/control.pod6
13:03 Geth ¦ doc: Fixed broken 'redo' code example
13:03 Geth ¦ doc:
13:03 Geth ¦ doc: Closes #1370
13:03 Geth ¦ doc: review: https://github.com/perl6/doc/commit/936c854a91
13:05 eveo m: my @a = 1..*; sub (|a) { say a.list.is-lazy }(|@a)
13:05 eveo booo
13:05 eveo Need to figure out the number of args in a Capture :/
13:05 camelia rakudo-moar 8b86b5: OUTPUT: «(timeout)»
13:05 * zengargoyle wonders if scraping irclogs from perlgeek.de is ok...
13:05 cdg joined #perl6
13:06 eveo zengargoyle: better ask moritz++ for a dump
13:07 eveo Oh, it's hanging even before .list or even capturing
13:07 zengargoyle yeah, sorta the plan.  there might already be raw numbers or some such already.
13:07 eveo works for me
13:07 eveo zengargoyle: the plan for what?
13:08 zengargoyle that i would ask moritz before doing more than a couple .txt dumps to test against...
13:09 eveo zengargoyle: I mean what are you doing with those text dumps?
13:09 eveo There'a repo for the log site. You could submit your graphs to add to the site: https://github.com/moritz/ilbot
13:09 zengargoyle i want to see pretty graphs of historical activity.
13:10 zengargoyle like network interface traffic graphs or something.  or d3.js sparklines month by month.
13:10 zakharyas joined #perl6
13:11 eveo k, looks like ecosystem update worked fine
13:11 * eveo flies away
13:11 eveo left #perl6
13:13 moritz zengargoyle: if you use the normal URLs with an Accept: application/json header, you get the log data in JSON format
13:13 MasterDuke zengargoyle: there's a way to get json dumps. AlexDaniel did it for quotable6
13:13 AlexDaniel and I did exactly what moritz said
13:13 AlexDaniel now, you may possibly face some issues when trying to decode these json files…
13:14 AlexDaniel but I *think* JSON::Fast should be able to do it now
13:16 zengargoyle sweet.  if it ever becomes more than a pipe dream, i was planning to store the hourly? counts locally to not really have to hit the site more than needed.  unless there's a dump somewhere.
13:18 zengargoyle i really just need the hour of the timestamp and the *? username (to filter out bots maybe) and pretty much just uniq -c them. :)
13:18 zengargoyle JSON may actually be overload.
13:19 zengargoyle but it's just another random idea at the moment. :P
13:21 Geth ¦ doc: 07a34141f2 | (Jan-Olof Hendig)++ | doc/Type/Supply.pod6
13:21 Geth ¦ doc: Added much improved documentation for Supply.migrate. Written by jnthn++
13:21 Geth ¦ doc: review: https://github.com/perl6/doc/commit/07a34141f2
13:21 kyclark joined #perl6
13:32 mr-foobar joined #perl6
13:36 anon joined #perl6
13:36 Exodist joined #perl6
13:44 Cabanossi joined #perl6
13:54 travis-ci joined #perl6
13:54 travis-ci Doc build errored. Jan-Olof Hendig 'Fixed broken 'redo' code example
13:54 travis-ci https://travis-ci.org/perl6/doc/builds/241509458 https://github.com/perl6/doc/compare/5c7fd3be884e...936c854a91de
13:54 travis-ci left #perl6
13:57 anon_ joined #perl6
14:05 cdg_ joined #perl6
14:11 travis-ci joined #perl6
14:11 travis-ci Doc build errored. Jan-Olof Hendig 'Added much improved documentation for Supply.migrate. Written by jnthn++'
14:11 travis-ci https://travis-ci.org/perl6/doc/builds/241512350 https://github.com/perl6/doc/compare/936c854a91de...07a34141f26d
14:11 travis-ci left #perl6
14:29 khw joined #perl6
14:29 Cabanossi joined #perl6
14:49 aborazmeh joined #perl6
14:49 aborazmeh joined #perl6
14:49 bioduds_ mans, how do I reuse a grammar in a grammar?
14:50 nico64 joined #perl6
14:50 nico64 left #perl6
14:51 bioduds_ https://gist.github.com/bioduds/cff61d5071e53e3b1ada177c9c4cc107 here's the idea
14:57 Geth ¦ doc: 9f60666a93 | (Jan-Olof Hendig)++ | doc/Type/Supply.pod6
14:57 Geth ¦ doc: Added some pod directives
14:57 Geth ¦ doc: review: https://github.com/perl6/doc/commit/9f60666a93
15:01 zengargoyle bioduds_: token TIMESTAMP { <TIMESTAMP::TOP> }
15:01 bioduds_ oh, very easy, beautiful, thank man
15:02 kaare_ joined #perl6
15:02 zengargoyle i'm pretty sure grammar's are just classes in disguise.  just pretend it's Class and Method and it'll probably work.
15:03 Sgeo_ joined #perl6
15:13 zengargoyle bioduds_: if you haven't, you might check out http://design.perl6.org/S05.html#Grammars  the synopses aren't really valid anymore, but sometimes they explain the ideas a bit better than the docs do.
15:13 bioduds_ great, thanks, haven't yet
15:14 zengargoyle i.e. you'll find some not-yet-implemented, and some we-just-changed-this, but on the whole, it's a better *idea* of the design goals that mostly work.
15:15 zengargoyle and a bit more verbose and techie.
15:19 eveo joined #perl6
15:20 eveo PSA: some people were asking why zef asks for github pass when installing modules and the answer they received is because of https URL in source. That's not accurate. https URLs are fine, but the password ask usually means an incorrect source-url that leads to a 404
15:21 BenGoldberg joined #perl6
15:26 Camel_ joined #perl6
15:26 Geth ¦ ecosystem: da0fa74d23 | (Zoffix Znet)++ | server/updatelist.pl
15:26 Geth ¦ ecosystem: Push to modules after all error checks
15:26 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/da0fa74d23
15:26 yadzi joined #perl6
15:27 Camel_ hello
15:27 eveo \o
15:27 yadzi joined #perl6
15:29 Camel_ hello
15:29 eveo Hi
15:29 Cabanossi joined #perl6
15:29 eveo Camel_: what's up?
15:30 Camel_ i'am trying to run perl6 program on windows 7 moar vm it doesn't worf
15:30 Camel_ "sorry error while compiling"
15:31 eveo Camel_: what's the error output? Pastebin it (e.g. on https://gist.github.com/ )
15:32 Camel_ error while compiling confused expecting any of: colon pair
15:32 eveo Camel_: and what's the code?
15:33 eveo That produces that error
15:33 araraloren This is maybe syntax error
15:33 Camel_ #!/usr/bin/env perl6 use v6; say "Hello";
15:33 Camel_ on 3 lines
15:34 araraloren How you run your code ? perl6 **scrpit** ?
15:34 eveo Camel_: what's the actual program? Pastebin it somewhere.
15:35 Camel_ i write a text file then i change the name .pl6 then i execute it in Rakudo Perl 6
15:36 araraloren In Win please use #!perl6
15:36 araraloren try it
15:36 Camel_ ok i try it now
15:37 araraloren I mean the shebang, first line in your script
15:37 eveo araraloren: does Windows even use it?
15:37 araraloren Em ?
15:38 araraloren I don't know, I use `#!/usr/bin/env perl6` under *unix
15:38 eveo araraloren: above you say "on Win please use #!perl6". Why?
15:38 Camel_ no it doesn't work it makes the same error
15:39 araraloren Windows dont' have env .
15:39 eveo araraloren: but it doesn't use shebangs at all
15:40 Camel_ i tried without shebang it doesn't work either i'm stuck
15:41 araraloren eveo, yeah, you are right
15:42 araraloren Camel_, Is command **perl6** available under your cmd ?
15:42 araraloren Try perl6 -v
15:42 Camel_ yes it works when i type directly in cmd
15:43 * zengargoyle invisible characters?  weird windows utf-16 thing?
15:43 eveo Camel_: what's the program are you running?
15:43 Camel_ just testing a hello world
15:43 Camel_ to begin
15:43 * zengargoyle wordpad vs notepad and line endings?
15:44 araraloren Yeah, maybe the file encoding is not correct ?. and line ending should not be `\r\n`
15:44 Camel_ so i should write in notepad++ ?
15:44 eveo Camel_: The actual program. Don't type it in the channel. Don't described it. Show the actual code. There's no point in retyping it and describing it since that doesn't show the actual erroneous code.
15:44 zengargoyle Camel_: what did you write it in?
15:45 Camel_ i just wrote a text file with say "Hello"; in order to test if it works
15:45 zengargoyle what did you create the text file with?
15:46 Camel_ windows notepad
15:47 * araraloren wonder is perl6 installed correctly.
15:47 eveo This is ridiculous.
15:48 travis-ci joined #perl6
15:48 travis-ci Doc build errored. Jan-Olof Hendig 'Added some pod directives'
15:48 travis-ci https://travis-ci.org/perl6/doc/builds/241529170 https://github.com/perl6/doc/compare/07a34141f26d...9f60666a93e4
15:48 travis-ci left #perl6
15:49 zengargoyle Camel_: i might try notepad++ but i don't think that's the problem.  can you paste your code and the error message you get into pastebin.com so we can maybe see what's going on.
15:50 Sgeo__ joined #perl6
15:51 Camel_ https://pastebin.com/AQJWWhFe
15:52 araraloren ...
15:52 eveo Oh my god
15:52 eveo Camel_: dude, what's the program are you running?
15:52 araraloren You should use `perl6 yuur-file.p6` run you script
15:52 araraloren eveo, He is in REPL
15:53 eveo Ah
15:53 eveo Jesus
15:53 eveo Yeah, now I remember why I hate help channels
15:53 eveo left #perl6
15:54 zengargoyle Camel_: you don't start perl6 and then ask it to run your file.  just type `perl6 C:\Users\remo\Desktop\1.pl6` on the command line.
15:54 araraloren Camel_, please exit, and type `perl6 1.pl6` in your cmd, the click enter
15:54 araraloren s/the/then/
15:55 mr-foobar joined #perl6
15:55 zengargoyle »ö«
15:56 Camel_ i'm going to log off and ask the admin to have full rights on my machine
15:56 Camel_ maybe thats the problem
15:56 raiph joined #perl6
15:56 Camel_ repl works fine
15:57 zengargoyle Camel_: exit the repl, you don't use the repl to run a program from a file.
15:57 Camel_ ok
15:58 zengargoyle instead of typing `perl6` to run the repl, you type `perl6 C:\Users\remo\Desktop\1.pl6` to run the program.
15:59 zengargoyle or `perl6 1.pl6` if you're in the same directory as the file.
16:00 Camel_ yes it works ! very nice thanks a lot sorry for my stypidy just beginning programming
16:00 BenGoldberg Does anybody know if perl6 possesses some simple equivilant of perl5's "do $file"?  Would "EVAL $file.IO" work?
16:00 Camel_ yes
16:00 Voldenet evalfile
16:00 Voldenet or EVALFILE
16:01 zengargoyle it's cool, we're mostly patient people. :)
16:01 Camel_ thank you all
16:01 araraloren :)
16:01 zacts joined #perl6
16:01 Camel_ yes of course
16:01 Camel_ everything has a beginning
16:01 Voldenet btw, why EVALFILE is uppercase?
16:01 geekosaur as a warning that it is dangerous
16:02 araraloren (๑•̀ㅂ•́)و✧
16:02 zengargoyle weird things you should think twice about using are UPPERCASE
16:02 BenGoldberg Camel_, Since perl6 has inherited from perl5, the motto "There is more than one way to do it," you could, from with the repl, type the command: EVALFILE 'C:\Users\remo\Desktop\1.pl6'
16:02 Voldenet sub evalfile(|c){ EVALFILE(|c); };
16:02 Voldenet ;-)
16:03 pilne joined #perl6
16:03 zengargoyle . o >o< »o« »ö« ...
16:03 Camel_ ok i will remember it
16:03 geekosaur you might need the MONKEY-SEE-NO-EVAL pragma to enable it
16:04 araraloren m: '(๑•̀ㅂ•́)و✧'.flip.say
16:04 camelia rakudo-moar 8b86b5: OUTPUT: «✧و)•́ㅂ•̀๑(␤»
16:04 zengargoyle and it might need to be on one line... because... REPL
16:04 Voldenet geekosaur: actually, you only need it for eval, not evalfile
16:05 Voldenet evalfile is a lot safer most of the times, because it won't execute the code that's not there
16:05 Sgeo joined #perl6
16:06 * zengargoyle wonders if anybody is working on a 'notebook' thingy for p6.
16:06 Voldenet (perl6 does not do any funky stuff with files it opens, so it doesn't execute commands anymore, right)
16:07 Voldenet s/right/right\?/
16:08 zengargoyle like '|rm -rf /'?
16:09 zengargoyle define 'funky stuff'
16:09 geekosaur it leads to evaluation of arbitrary perl 6 code in your lexical context
16:10 Voldenet Yeah, things like this exactly: open F, "ls|"; print while <F>; close F
16:11 geekosaur and you believe that is the only way things can go wrong.
16:12 Voldenet I wonder if it's safe to only escape/remove/discard '/' in path to get a "safe to use" string
16:12 Voldenet oh, and \
16:13 zengargoyle you should probably ensure that it's a child of some known location.
16:14 Voldenet with IO::Path.is-relative?
16:16 Voldenet hm, it makes sense to do that instead of relying of my own validation, thanks
16:16 Voldenet s/relying of/relying on/
16:16 zengargoyle i don't know, just throwing out ideas. :)  i doubt p6 does the magic pipe open, and there's resolving to an absolute path and ensuring that path is in a trusted location....
16:18 zengargoyle i'm not sure of the best way to check that $given is a $file somewhere under $trusted-dir
16:18 geekosaur so now we're up to arbitrary unchecked perl 6 code and race attacks.
16:18 geekosaur any more security holes you'd like to design in?
16:19 zengargoyle heh
16:20 Voldenet geekosaur: EVAL and likes are very useful in dynamic code generation and most languages support it in one way or another
16:20 geekosaur whihc is why it's enableable _witha  pragma_
16:21 geekosaur but never mind me, convenience is always far mroe important than security as everyone knows
16:21 Voldenet Yeah, I understand the reason and it's totally sane.
16:21 geekosaur and then wonders why pretty much every web server is trivially hackable
16:21 zengargoyle well IO::Path i believe is just a string that can be manipulated under the rules of the current filesystem.  you should be able to absolute it and compare it to another without ever doing something like open.
16:22 Voldenet *trivially* ;-)
16:24 zengargoyle there's no reason for it to be able to evade your decision that it *has* to be somewhere under the $top that you've determined.
16:25 zengargoyle and if they can write some other way under $top then you have a different problem. :P
16:27 Ben_Goldberg joined #perl6
16:31 * zengargoyle sorta likes the 'prog |' open sometimes.  as long as the program is only accessible to those who should be able to use the power. _muahahaha_
16:35 Geth ¦ ecosystem/meta-checker: 3cfd691ffb | (Zoffix Znet)++ | server/updatelist.pl
16:35 Geth ¦ ecosystem/meta-checker: Check for valid source URLs
16:35 Geth ¦ ecosystem/meta-checker:
16:35 Geth ¦ ecosystem/meta-checker: This is one way to address the issue[^1] of wrong source urls in META
16:35 Geth ¦ ecosystem/meta-checker: files. However, if there's github connectivity issue, we might get
16:35 Geth ¦ ecosystem/meta-checker: false negatives and temporarily toss modules from ecosystem.
16:35 Geth ¦ ecosystem/meta-checker:
16:35 Geth ¦ ecosystem/meta-checker: This needs to be done in modules.perl6.org codebase, so that the module
16:35 Geth ¦ ecosystem/meta-checker: <…commit message has 5 more lines…>
16:35 Geth ¦ ecosystem/meta-checker: review: https://github.com/perl6/ecosystem/commit/3cfd691ffb
16:35 geekosaur zengargoyle, I see you've never heard of symbolic link attacks
16:36 lucasb joined #perl6
16:36 geekosaur that's fine, we have determined security is an unnecessary impediment to convenience, carry on
16:36 eveo joined #perl6
16:37 zengargoyle no, i assume the absolute resolves links to absolute before checking wheter it's a valid file under control.
16:37 zengargoyle readlink isn't a vulnerability?
16:37 eveo Voldenet: no, it's not safe. You could have `foo/bar/ber` that leads outside of foo. Use IO::Path::ChildSecure or wait until 6.d when IO::Path.child will be secure by default
16:37 eveo buggable: eco ChildSecure
16:37 buggable eveo, IO::Path::ChildSecure 'Secure version of IO::Path.child': https://github.com/zoffixznet/perl6-IO-Path-ChildSecure
16:38 Voldenet eveo: Thanks for clarifying
16:38 kurahaupo joined #perl6
16:40 eveo zengargoyle: IO::Path is slightly more than just a string. It's a string + CWD (path that string is relative to, if it's relative) + SPEC (IO-specific rules for operating on that path)
16:40 eveo m: '.'IO.perl.say
16:40 camelia rakudo-moar 8b86b5: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3'.'7⏏5IO.perl.say␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statement modifier␤        statement m…»
16:40 eveo m: '.'.IO.perl.say
16:40 camelia rakudo-moar 8b86b5: OUTPUT: «IO::Path.new(".", :SPEC(IO::Spec::Unix), :CWD("/home/camelia"))␤»
16:43 domidumont joined #perl6
16:44 zengargoyle but does it do it's stuff as strings? can it turn '../../foo' into '/foo' without interacting with the system?
16:44 eveo Turn how? Those are different paths.
16:45 zengargoyle /home/camelia + ../../foo = /foo
16:45 BenGoldberg m: ".".IO.absolute.say;
16:45 camelia rakudo-moar 8b86b5: OUTPUT: «/home/camelia␤»
16:45 BenGoldberg m: ".".IO.absolute.perl.say;
16:45 camelia rakudo-moar 8b86b5: OUTPUT: «"/home/camelia"␤»
16:46 BenGoldberg m: "../../foo".IO.perl.say;
16:46 camelia rakudo-moar 8b86b5: OUTPUT: «IO::Path.new("../../foo", :SPEC(IO::Spec::Unix), :CWD("/home/camelia"))␤»
16:46 BenGoldberg m: "../../foo".IO.absolute.say;
16:46 camelia rakudo-moar 8b86b5: OUTPUT: «/home/camelia/../../foo␤»
16:47 BenGoldberg Clearly, it's not interacting with the system :P
16:47 zengargoyle :(
16:48 eveo zengargoyle: they're still different paths in that case, if, say, /home/camelia is a symlink
16:48 eveo You can't turn /home/camelia + ../../foo to /foo without accessing the filesystem
16:48 zengargoyle i thought it would split on / and delete before/.. in some sane manner.
16:49 zengargoyle i'm assuming readlink is a safe operation.
16:49 eveo that's "accessing the filesystem" :/
16:49 eveo You can do that with .resolve
16:49 eveo But you really shouldn't care how IO::Path does things, whether it's strings or whatever.
16:50 Voldenet m: "../../foo".IO.resolve.say
16:50 camelia rakudo-moar 8b86b5: OUTPUT: «"/foo".IO␤»
16:50 zengargoyle yeah, i think we're on different think here...  i was talking about ensuring $string as a $path was under $allowed-dir
16:51 zengargoyle you can do that without "security holes"
16:51 eveo You can't ensure that just by looking at $string. You have to access the filesystem and resolve all links and then see where it ended up at
16:51 zengargoyle right, but resolve does not change the system and is a safe operation.
16:52 zengargoyle security wise, it's safe to turn any $string into an absolute resolved path.
16:52 eveo Yeah. Probably.
16:52 eveo left #perl6
16:53 Voldenet Hm, there could be a race condition in it, when you play with symlinks too much ;)
16:53 zengargoyle and then it's trivial to assure that the resolved is a child of some safe directory (pathwise).
16:53 zengargoyle before opening or testing for existance or whatnot.
16:54 anon joined #perl6
16:55 zengargoyle Voldenet: but still in the end you have the test that it's under your controlled space.
16:56 Voldenet Yeah. I guess it could be a problem in shared environment though
16:56 zengargoyle you can totally take a string from a user and decide whether or not it's a file under what you consider to be safe.
16:56 Voldenet > ln -s /var/www/my_dir/safe test ; rm test ; ln -s /etc test
16:57 Voldenet then, make a script run as admin and use a "test/shadow" file ;)
16:57 zengargoyle before doing anything with it.  you may end up with the wrong endpoint, but still you'll only be EVAL or whatever something you trust.
16:57 Voldenet therefore, if I cared about security, I'd not follow /any/ symlinks at all, unless I got a table of symlinks that I'm allowed to follow before
16:58 Voldenet so it can't be modified at runtime
16:59 Voldenet but I think I might be too paranoid about this
16:59 zengargoyle /var/www/my_dir/safe is just a string that is matched against the absolute resolved input string.  no need to readlink on the safe dir.
17:00 itaylor57 joined #perl6
17:00 zengargoyle my absolute resolved path & /var/www/my_dir/safe ??
17:01 zengargoyle unless my absolute resolved path starts with /var/www/my_dir/safe then you can reject it.
17:01 Voldenet ah, right
17:01 zengargoyle if they can symlink safe, you've got other problems. :)
17:03 Voldenet So, .resolve used right makes it safe (but you need to resolve the full path to each file to resolve and validate resolved path every time).
17:04 zengargoyle pretty much.  in my head it's just like network routing with subnet masks and such.  it's eith inside the thing or outside the thing.
17:04 anon_ joined #perl6
17:05 zengargoyle and i expect IO::Path could do that somehow without being subject to some sort of trickery.
17:07 zengargoyle (as long as readlink isn't a security risk) :)
17:08 geekosaur joined #perl6
17:08 tinita hey YAML users! it would be cool if you would try out our new YAML module and give some feedback
17:08 tinita https://github.com/yaml/yaml-perl6
17:08 tinita everything should be in the README.md. if not, bug me (or ingy)
17:09 * zengargoyle prepares to steal some code from a Zoffix bot ...
17:15 kurahaupo joined #perl6
17:16 Voldenet tinita: I think your example should include what does $yaml contain, but I'm nitpicking
17:17 tinita Voldenet: yeah, that's a good idea
17:20 Geth ¦ doc: fe2398a56e | (Jan-Olof Hendig)++ | doc/Type/Supply.pod6
17:20 Geth ¦ doc: Added docs for Supply.skip. ugexe++
17:20 Geth ¦ doc: review: https://github.com/perl6/doc/commit/fe2398a56e
17:29 Ben_Goldberg joined #perl6
17:32 Ben_Goldberg joined #perl6
17:33 ugexe tinita: "Install from Source" can be reduced to `zef install https://github.com/yaml/yaml-perl6.git`
17:34 tinita ugexe: thanks, added
17:36 xzhao joined #perl6
17:38 Voldenet Can I tell "open" method to ignore symlinks?
17:44 zakharyas joined #perl6
17:45 Voldenet Basically, I've got this specific problem, if I could somehow tell the IO to "never follow symlinks" it would not work like that http://ix.io/x2w
17:46 Voldenet Obviously, malicious user just spams the malicious part until it succeeds, so he can get an access to the "secret"
17:46 ugexe lock the file?
17:46 Voldenet hm, but then I can't access the file concurrently
17:47 Voldenet (can I?)
17:47 ugexe you are just locking it until you "validate" it and slurp it
17:52 zengargoyle my-secrets is not readable/writeable by user.
17:53 Voldenet zengargoyle: It certainly isn't, but you don't need permissions for my-secrets to make a symlink for it! :)
17:53 Voldenet and the executing user can have access to i
17:53 Voldenet t
17:54 Voldenet Basically, "O_NOFOLLOW" might help solve this particular issue, but open method can't do this
17:56 zengargoyle i'm wondering why original user and malicious user are intermixed.
17:56 Voldenet I might temporarily use the ugexe's solution to validate the path after opening the file
17:57 zengargoyle why is the validation shared between multiple users?
17:58 Voldenet zengargoyle: it's in the same script just for the purpose of the example, I could make it more real-world-like
17:59 zengargoyle # the resolved-path is validated already   -- for different users?
18:00 zengargoyle where is the session or whatnot seperating the users from each other?
18:00 Voldenet zengargoyle: okay, basically, the example consists of two scripts
18:01 Voldenet but I couldn't show you the race condition without actually doing it like this
18:01 Voldenet oh wait, I could
18:07 cdg joined #perl6
18:11 Voldenet zengargoyle: thanks for a suggestion, I tried to make it clearer http://ix.io/x2H
18:16 Voldenet obviously it's oversimplified, and demonstrating that in real world would take a lot of time and patience, since sleep(3) in this specific place is very optimistic for the malicious user :P
18:17 raschipi joined #perl6
18:17 MilkmanDan joined #perl6
18:21 zengargoyle Voldenet: sorry, i still don't get it.  malicious user seems to have more permission than he should.  how can he make a request for my-secret/secret go anywhere else unless he can delete/link my-secret?
18:22 Voldenet zengargoyle: he doesn't, the problem is that original request has a lot higher permissions than malicious user
18:23 zengargoyle how are the requests from two users getting mixed?
18:23 Voldenet zengargoyle: try doing, as a normal user "cat /etc/shadow"
18:24 zengargoyle no problem. -rw-r--r-- 1 root root 1624 Nov 25  2016 /etc/shadow it's world readable
18:24 Voldenet ಠ_ಠ
18:25 Voldenet Wait..., so any user can read all hashes from a script?
18:26 zengargoyle yes, isn't that the point of hashes?
18:26 Voldenet > -rw-r----- uid: root, gid: shadow
18:26 zengargoyle heh.
18:27 Voldenet Hashes are secure enough, but I wouldn't count on them being unbreakable :)
18:27 Voldenet in fact, just the fact that "john the ripper" tool exists makes it a bit scary for me
18:27 Voldenet even if it takes months to crack them
18:28 zengargoyle that's why when asking for a file you restrict it to under 'trusted' path.
18:30 Voldenet But then, you can first create a regular, nice file in /var/www/safe/etc/ssl/private/ssl-cert.key
18:31 Voldenet count on the process being suspended for some reason, replace the "safe" with symlink to "/"
18:31 zengargoyle it seems your point is: symlink($secret-dir, $test-dir);  is that `ln -s /my-secret /tmp/malicious` or is it backwards?  one does nothing the other means my-secret isn't protected.
18:32 Voldenet and then, the resolved path legitimately pointing at /var/www/safe/etc/ssl/private/ssl-cert.key actually points to "/etc/ssl/private/ssl-cert.key" after being replaced
18:34 zengargoyle user A asking for my-secret/secret can only be duped if user B has write to my-secret or above.
18:35 zengargoyle unless you're sharing info between user A and user B.
18:35 bioduds joined #perl6
18:35 * zengargoyle or i just don't get it. :P
18:35 bioduds hello
18:35 bioduds is zoffixznet on?
18:36 bioduds thanks zofixznet for the fix
18:37 zengargoyle bioduds: i think he's away.
18:37 bioduds just wanted to thank him, he fixed something I didn't see in my module
18:37 zengargoyle Zoffix++
18:37 bioduds Zoffix++
18:38 zengargoyle or there's a .tell command
18:38 raschipi "/etc/shadow it's world readable" --> Shouldn't be
18:38 zengargoyle .tell Zoffix biodude says thaks
18:38 yoleaux zengargoyle: I'll pass your message to Zoffix.
18:38 Voldenet it's bioduds, but close enough :D
18:39 raschipi "-rw-r----- 1 root shadow 1719 mai  6 23:11 /etc/shadow"  in my system
18:39 bioduds thanks :D
18:40 raschipi Zoffix has a bot that sends any messages with his name on it to his twitter.
18:40 * zengargoyle just pondering mentioning that the Z word sorta pings the Z dude. :P
18:43 bioduds my $conn = IO::Socket::INET.new( :host<localhost>, :port(80) ); #Failed to connect: connection refused
18:43 bioduds any ideas?
18:43 bioduds on why? my port 80 is opened
18:43 zengargoyle strange, one of my debian boxes have different permissions and groups for {passwd,shadow}*  but one has been alive for like forever-ish.
18:47 zengargoyle is there a web server listening on port 80?
18:47 espadrine_ joined #perl6
18:48 zengargoyle m: say so IO::Socket::INET.new( :host<localhost>, :port(80) );
18:48 camelia rakudo-moar 8b86b5: OUTPUT: «IO::Socket::INET is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in method new at src/RESTRICTED.setting line 32␤  in block <unit> at <tmp> line 1␤␤»
18:48 raschipi zengargoyle: Yes, mentioning his name does summon him.
18:49 * zengargoyle remembers the days of grepping /var/spool/news
18:50 zengargoyle bioduds: perl6 -e 'say so IO::Socket::INET.new( :host<localhost>, :port(80) );' --> True on my box.
18:50 bioduds let me
18:50 zengargoyle is the server listening on 127.0.0.1?
18:50 bioduds bioduds@BITWORKERS ~/bitworkers/EscrowChain/dev $ perl6 -e 'say so IO::Socket::INET.new( :host<localhost>, :port(80) );' Failed to connect: connection refused   in block <unit> at -e line 1
18:50 rightfold Does 'use lib' use the current working directory?
18:50 bioduds weird?
18:51 zengargoyle does localhost resolve on your machine?
18:51 bioduds any ideas?
18:51 rightfold There is no documentation on 'use lib'.
18:51 bioduds let me check
18:51 zengargoyle does it connect to anywhere else?
18:51 bioduds bioduds@BITWORKERS ~/bitworkers/EscrowChain/dev $ more /etc/hosts 127.0.0.1       localhost 127.0.1.1       BITWORKERS  # The following lines are desirable for IPv6 capable hosts ::1     ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters
18:51 bioduds looks like it does
18:54 zengargoyle does `host localhost` and `curl localhost` seem reasonable?
18:55 bioduds bioduds@BITWORKERS ~/bitworkers/EscrowChain/dev $ ping localhost PING localhost (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.018 ms 64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.026 ms
18:55 rightfold Seems BEGIN { use lib "{$?FILE.IO.dirname}/../lib" } works
18:55 rightfold :)
18:56 bioduds on your box it says True?
18:56 bioduds let me test on su
18:56 bioduds might be a permission problem, right?
18:57 bioduds nope
18:57 bioduds not working as su as well
18:57 zengargoyle shouldn't be.  also try 127.0.0.1 instead of localhost
18:57 bioduds firewall?
18:58 bioduds bioduds@BITWORKERS ~/bitworkers/EscrowChain/dev $ sudo ufw enable Die Firewall ist beim System-Start aktiv und aktiviert bioduds@BITWORKERS ~/bitworkers/EscrowChain/dev $ sudo ufw status Status: Aktiv  Zu                         Aktion      Von --                         ------      --- 5000                       ALLOW       Anywhere                   80                         ALLOW       Anywhere                   5000 (v6)
18:58 zengargoyle localhost is rarely firewalled.  maybe webserver is only listening on your *real* IP?
18:58 bioduds oh, let me try with real IP
18:58 rightfold `use lib BEGIN { "{$?FILE.IO.dirname}/../lib" };` also works
18:59 zengargoyle or `curl` or `wget` or just your browser, localhost should work.....
19:00 zengargoyle or check your webserver logs for errors.
19:00 bioduds curl localhost?
19:00 rightfold Oh, `use lib "{$?FILE.IO.dirname}/../lib";`, even.
19:00 bioduds bioduds@BITWORKERS ~/bitworkers/EscrowChain/dev $ curl localhost curl: (7) Failed to connect to localhost port 80: Verbindungsaufbau abgelehnt
19:01 bioduds let me browse
19:01 bioduds Diese Website ist nicht erreichbar
19:01 bioduds it's offline
19:01 labster joined #perl6
19:02 zengargoyle you have some other probem of webserver you think you have on localhost:80 isn't really there. :)
19:03 bioduds worked
19:03 bioduds sort of
19:03 bioduds it blocks connections
19:04 bioduds perhaps because it is syncronous
19:04 bioduds let me check async
19:04 zengargoyle shouldn't matter.
19:05 zengargoyle if you can't use curl or browser, something else is wrong besides IO::Socket::INET
19:06 bioduds with async it did not hang
19:06 bioduds but also it did not respond
19:06 zengargoyle different problem... make curl work first.
19:06 bioduds weird behavior though
19:07 bioduds curl works
19:07 bioduds curl localhost:5000 <!doctype html> <html class="no-js" lang=""> <head>   <meta charset="utf-8">   <meta http-equiv="x-ua-compatible" content="ie=edge">   <title>Bitcoin ATM by bitworkers</title>
19:07 bioduds im running it
19:07 zengargoyle did you change the port?
19:07 bioduds I mean I putted up this server on port 5000
19:08 zengargoyle did you change your IO::Socket::INET to try port 5000
19:12 raschipi bioduds: You probably have a good webserver running on localhost:631 too, you could try that.
19:13 * zengargoyle does IO::Socket::INET understand IPv6?
19:14 zengargoyle :host<::1> and :host<[::1]> both fail :(
19:15 rightfold Is there a short way to export by default?
19:18 raschipi rightfold: Besides "is export(:MANDATORY)"?
19:19 rightfold I mean add `is export` to everything in the module.
19:19 rightfold Not `:DEFAULT`.
19:22 zengargoyle hrmmmmmm.....  curl [::1] works, :host<::1> doesn't, :host<fdff:baab::1> does work.....  i smell broken-ness.
19:23 * zengargoyle don't hack me bro
19:25 cdg joined #perl6
19:27 bioduds sorry, I was away for a while
19:27 bioduds raschipi why 631?
19:29 bioduds I'll try on later on
19:32 raschipi bioduds: 631 is the default port for the CUPS web interface.
19:32 raschipi CUPS is the Unix print server.
19:32 * zengargoyle OMG weirdness.  :host<fdff:baab::1> worked once and now it doesn't work anymore
19:34 zengargoyle lpd is the unix print server, CUPS is a pretender!!!!  but a better one. :P
19:36 raschipi zengargoyle: There are no valid IP numbers that start with "fdff"
19:37 raschipi You can see all alocations in this table: https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml
19:38 bioduds ok, thanks raschipi, I'll try that
19:38 Voldenet uh, can I somehow do ".resolve and .open" methods on IO::Path?
19:38 bioduds 631 refused as well
19:38 zengargoyle raschipi: it's a bridge device.  might be some other weirdness....
19:38 Voldenet but without any race conditions?
19:39 bioduds perl6 -e 'say so IO::Socket::INET.new( :host<localhost>, :port(631) );' Failed to connect: connection refused
19:39 raschipi 631 refused? That sounds like a firewall.
19:39 zengargoyle lxcbr0: ... inet6 fdff:baab::1
19:39 bioduds bioduds@BITWORKERS ~/bitworkers/EscrowChain/dev $ sudo ufw allow 631 [sudo] Passwort für bioduds:  Regel hinzugefügt Regel hinzugefügt (v6) bioduds@BITWORKERS ~/bitworkers/EscrowChain/dev $ perl6 -e 'say so IO::Socket::INET.new( :host<localhost>, :port(631) );' Failed to connect: connection refused   in block <unit> at -e line 1
19:40 bioduds not firewall, I'd say
19:40 bioduds I'm confused, I still have reading to do I believe
19:40 bioduds don't worry for now
19:40 bioduds I'll come back later if I don't figure this out
19:41 bioduds see ya :D
19:42 * zengargoyle *cough* it fails with my real global IPv6 address as well....
19:42 rightfold Crazy idea: when backtracking is possible, parse all branches parallel :D
19:42 * Voldenet pulls hairs out of his head
19:42 Voldenet I can't make this work anyhow, no matter what order of .open and .resolve I do on filepath, I can't get them both correctly http://ix.io/x36
19:44 Voldenet I can either open a handle and then get invalid path to validate out of it
19:44 zengargoyle does IO::Socket::INET even support IPv6 or does it have a weird syntac that isn't just the hex or [hex]?  because curl works and INET fails....
19:44 Voldenet or I can validate a requested path and open an invalid file
19:45 Cabanossi joined #perl6
19:45 * zengargoyle pissed if INET doesn't do IPv6 :P
19:46 * zengargoyle prepares to be pissed :)
19:47 Voldenet it does ipv6
19:47 Voldenet you need to set :family(3) parameter
19:48 Voldenet > say so IO::Socket::INET.new(:host<::> :port(80) :family(3))
19:48 anon joined #perl6
19:48 zengargoyle gah, where is transparency with regards to host?
19:49 Voldenet I see you can set family(3) for ipv4 too
19:49 Voldenet > say so IO::Socket::INET.new(:host<127.0.0.1> :port(80) :family(3))
19:49 zengargoyle if hostname is given and it resolves to v4 it works and if it resolves to v6 it breaks????
19:50 zengargoyle :family(3) does nothing.
19:51 raschipi It should do happy eyballs, per RFC6555
19:52 zengargoyle eh, strike that, it does notihing with [IPv6] but works with bare IPv6.
19:53 zengargoyle that's broken.
19:54 zengargoyle how is one to know that $hostname is v6 or v4 in order to supply the :family(3) to make it work?
19:56 raschipi zengargoyle: The standard is that you shouldn't specify and it should choose on it's own.
19:56 zengargoyle v4 without :family(3) works, v4 with :family(3) works, v6 requires the :family(3) or it fails....
19:56 zengargoyle raschipi: exactly, it's broken.
20:01 TEttinger joined #perl6
20:06 wamba joined #perl6
20:07 zengargoyle fakudobug's
20:08 zengargoyle rakudobug'd
20:08 * zengargoyle 's graarr tank is empty. :)
20:12 ingy raschipi: re: parsing something like +a + b
20:12 ingy raschipi: I think there's no conflict
20:13 * zengargoyle watches Attack on Titan and goes to bed.
20:13 ingy raschipi: because at the time you are looking for an operand, you look for a unary and then interpret it as (_ <+> a) + b
20:14 ingy raschipi: where _ is a dummy token and <+> is a unary plus (for whatever a unary plus should do.
20:14 javan joined #perl6
20:15 ingy then you just treat it as a binary op, assign it a precedence, and you are done. this *might* mean that all unary ops can be included in a binary expression grammar that way
20:16 ingy masak too: ^^
20:18 Voldenet zengargoyle_: using v4 only by default helps a lot in most common scenarios, because "try using v6 and then fall back to v4" leads you into waiting 30s for v6 timeout
20:18 Voldenet in case the network itself supports v6, but the routers don't
20:19 Voldenet i wonder what does rfc say about this, because it's very puzzling
20:20 raschipi Voldenet: The standard is to use the "happy eyballs" algorithm. i.e. Try to connect to both at the same time and keep using the first one that connects.
20:20 Voldenet Oh.
20:22 raschipi This way IPv6 isn't used if the IP legacy connection has lower latency, even.
20:23 Voldenet it's a bit wasteful, but sane
20:23 raschipi Because the v6 connection sometimes goes through a tunnel and that leads to 'IPv6 brokenness'.
20:25 raschipi Which is when the system chooses a high latency IPv6 connection over a low latency legacy connection. That's why the latency is measured by trying to connect to both.
20:26 raschipi It's not just about choosing one that works, it's important to choose the one with lower latency.
20:26 cdg joined #perl6
20:26 raschipi So, not wasteful at all, it's the only way it can actually work. Can't know which has lower latency without trying.
20:27 uberbaud joined #perl6
20:29 Voldenet well yeah, autodetection needs to do that, "wasteful" is the part where there could be just one request over one, specified proto
20:30 uberbaud joined #perl6
20:32 Voldenet but I like the name for this algorithm :)
20:33 uberbaud joined #perl6
20:34 raschipi The opposite case also happens, some mobile carriers have IPv6-only networks and all legacy IP connections go through a tunel. In that case, if v6 native connectiona are available, they should be chosen.
20:36 raschipi One can't know at all which connection should be used before trying both.
20:37 Voldenet Oh, I didn't know there are networks that actually use 6to4 tunels already
20:37 uberbaud left #perl6
20:38 Voldenet the only real scenario of disabling that is the case where user knows he doesn't have v6 (which is majority, and I guess that's why :family(2) is used by default)
20:39 raschipi If IPv6 is disabled, it will fail immediatly, so no need to deal with it at this level.
20:40 raschipi Just the fact that there won't be a default IPv6 route will make the system reject the connection.
20:42 raschipi As these things come and go, networks connect and disconnect at will, a programm running in the computer never knows what to expect. It should try IPv6 anew in every connection.
20:44 uberbaud joined #perl6
20:44 raschipi Giving an option to never try either protocol is reasonable, but the default should be what's in the RFC.
20:44 Cabanossi joined #perl6
20:44 raschipi Anything else is broken, like zengargoyle_ said.
20:45 Voldenet yeah, DWIM is "do whatever works best", definitely
20:46 szabgab joined #perl6
20:48 szabgab Hi, I hope someone can help me understand what's going on with my installation: Fresh Rakudo Star 2017.04 installation on Linux from tar.gz. 'zef install Bailador' claims to install 0.0.4, but actually sees the dependency list of 0.0.3 which was missing a dependency.  This file: https://github.com/ugexe/Perl6-ecosystems/blob/master/p6c.json still lists 0.0.3
20:50 moritz szabgab: was Bailador 0.0.4 released recently?
20:50 szabgab yes, about 2 hours ago.
20:50 * zengargoyle_ I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhäuser Gate. All those moments will be lost in time, like tears in rain. Time to die.
20:50 szabgab so as I understand that json file in the ecosystem will be updated in 1-2 hours
20:51 szabgab but then why did zef report that it is installing 0.0.4 ?
20:52 moritz it might have cloned the current version of the repo, but used the meta data from that .json file
20:52 moritz for the dependencies at least
20:53 szabgab that's my only explanation too, but now I am really afraid to guess as apparently that does not work well for me
20:54 szabgab And I could not find an explanation how these things work to understand what to really expect and how to help the other people on the Bailador channel
20:56 szabgab I hope by the time I get up this will be resolved by some cron-job. &
21:01 Voldenet re-requesting some help: how do I validate the path of opened file before opening it?
21:01 Voldenet This is what I got atm, but it's plagued by a race condition between "resolve" and "open" operation, no matter how I try http://ix.io/x36
21:04 Voldenet Oops, I copied one test twice for no reason, here's the version without that http://ix.io/x3F
21:07 Geth ¦ doc: c2de7ab667 | (Jan-Olof Hendig)++ | doc/Type/Hash.pod6
21:07 Geth ¦ doc: Fixed example output
21:07 Geth ¦ doc: review: https://github.com/perl6/doc/commit/c2de7ab667
21:14 Cabanossi joined #perl6
21:19 raschipi Voldenet: Have you tried readlink into /proc/sef/fd ?
21:20 raschipi "resolve" is just String manipulation as far as I know, you need to ask the kernel where the file descriptor in poiting at.
21:21 raschipi "/proc/self/fd"*
21:23 Voldenet raschipi: resolve is doing nqp::stat and nqp::fileislink in its core
21:26 Voldenet and readlink: https://docs.perl6.org/language/5to6-perlfunc#readlink
21:26 raschipi Well, I'm talking about using the readlink binary with run or the libc readlink function with NativeCall.
21:28 Voldenet but how do I open the file after I have the link? The link I got might be replaced with a symlink already
21:29 raschipi You look into /proc/self/fd, there will be a link there to the file each file descriptor represents. You do realink on them to see where they are pointing to. Can't do that without opening the file first.
21:29 Voldenet Ah, that sounds sane!
21:33 raschipi Well, it was created specifically to allow this operation, so it better be sane!
21:33 raschipi Create the readlink Nativecall binding and publish it as a module.
21:43 AlexDaniel joined #perl6
21:45 Geth ¦ ecosystem: 97b7439c60 | (Jonathan Scott Duff)++ | META.list
21:45 Geth ¦ ecosystem: Add Time::Duration::Parser
21:45 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/97b7439c60
21:57 travis-ci joined #perl6
21:57 travis-ci Doc build errored. Jan-Olof Hendig 'Fixed example output'
21:57 travis-ci https://travis-ci.org/perl6/doc/builds/241597515 https://github.com/perl6/doc/compare/fe2398a56e1e...c2de7ab667e2
21:57 travis-ci left #perl6
22:00 ugexe https://github.com/ugexe/Perl6-ecosystems/blob/master/p6c.json is just a mirror of the ecosystem, and its not even the primary one
22:01 ugexe and its installing because you've presumably installed it before locally so its cached. this would be apparent if you used -v
22:02 ugexe installing 0.0.4^
22:03 ugexe well, if you are using zef:ver<0.1.15+> or some such and not the 0.1.9 rakudo star 2017.04 comes with
22:04 ugexe or its already updated on the p6c ecosystem list
22:04 ugexe your dependency problem is probably related to bad versioning and caching
22:14 Cabanossi joined #perl6
22:24 |oLa| joined #perl6
22:29 BenGoldberg joined #perl6
22:31 nadim joined #perl6
22:36 BenGoldberg joined #perl6
22:49 Voldenet A propos NativeCall, is there any good way to include constants from headers, like limits.h?
22:51 timotimo there's GPTrixie which uses clang or gcc to get everything out of header files
23:06 bioduds joined #perl6
23:12 Voldenet I'm afraid it doesn't work very well for limits.h and unistd.h - how smelly is the idea of writing C/Cpp code for native methods?
23:19 raschipi Voldenet: Code is good if it's delivered before your boss fires you.
23:20 Voldenet it's even better if you're delivering it instead of getting fired ;)
23:20 Voldenet not before
23:21 raschipi Yeah, as long as you keep the job, it's good code.
23:27 Voldenet but still, some code would be trivial in C, but extremely hard in p6 (due to magic constants for error handling and so on)
23:29 jnthn It's not that hard to read a header file and turn `#define FOO 42` into `constant FOO = 42;`
23:30 jnthn Or an enum, like https://github.com/jnthn/p6-ssh-libssh/blob/master/lib/SSH/LibSSH/Raw.pm6#L40
23:41 BenGoldberg One thing we can't *yet* do in perl6 is translate `typedef int (*function_pointer_t)(blahblahblah)` into a meaningful perl6 type... which is important for things like guis.
23:42 jnthn Well, you can inline it into each signature, if that's where it's used, which is enough for callbacks, if a tad verbose.
23:42 jnthn But yeah, if it's a "fill up a struct of function pointers" then you're out of luck at the moment
23:42 * jnthn ran into that
23:45 Cabanossi joined #perl6

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

Perl 6 | Reference Documentation | Rakudo