Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-12-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:00 kaare__ joined #perl6
00:08 Cabanossi joined #perl6
00:36 mcmillhj joined #perl6
00:41 raiph joined #perl6
00:49 mattp_ left #perl6
00:59 mcmillhj joined #perl6
01:20 jeromelanteri joined #perl6
01:24 Cabanossi joined #perl6
01:35 TimToady joined #perl6
01:50 comborico1611 Yup.
01:54 Cabanossi joined #perl6
02:11 astronavt joined #perl6
02:20 mson joined #perl6
02:20 kitsunenokenja joined #perl6
03:00 ilbot3 joined #perl6
03:00 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!
03:09 Cabanossi joined #perl6
03:22 char_var[buffer] joined #perl6
03:25 char_var[buffer] joined #perl6
04:08 Cabanossi joined #perl6
04:08 piojo_ joined #perl6
04:38 Cabanossi joined #perl6
04:38 cpage joined #perl6
04:42 rmusial joined #perl6
05:12 committable6 joined #perl6
05:46 AlexDaniel joined #perl6
06:04 releasable6 joined #perl6
06:24 piojo_ joined #perl6
06:29 thou m: say $*REPO.repo-chain».?installed.flat».?meta».<provides>».keys.flat;
06:29 camelia rakudo-moar 1dbf5f589: OUTPUT: «(Zef::Distribution::Local Zef::Service::FetchPath Zef::Service::TAP Zef::Service::Shell::unzip Zef::Identity Zef::Test Zef::Repository::LocalCache Zef::Service::Shell::prove Zef Zef::Client Zef::Config Zef::Extract Zef::Repository Zef::Repository::Met…»
06:30 thou m: say $*REPO.repo-chain».?installed.flat».?meta».<name>.flat;
06:30 camelia rakudo-moar 1dbf5f589: OUTPUT: «(zef CSV::Parser Inline::Perl5 CORE Nil Nil Nil)␤»
06:39 kaare_ joined #perl6
06:59 Sgeo joined #perl6
07:04 coffeebyte[m] joined #perl6
07:04 darutoko joined #perl6
07:18 cdg joined #perl6
07:18 piojo_ joined #perl6
07:20 cdg_ joined #perl6
07:23 Cabanossi joined #perl6
07:24 wamba joined #perl6
07:35 reportable6 joined #perl6
07:45 cdg joined #perl6
07:50 abraxxa joined #perl6
07:53 cdg joined #perl6
07:55 cdg_ joined #perl6
08:09 coffeebyte[m] left #perl6
08:23 piojo_ joined #perl6
08:30 cdg joined #perl6
08:45 domidumont joined #perl6
08:51 cdg joined #perl6
08:52 domidumont joined #perl6
08:55 parv joined #perl6
09:03 geospeck joined #perl6
09:18 araraloren joined #perl6
09:29 araraloren o/
09:53 Cabanossi joined #perl6
10:12 moritz \o
10:16 DrForr /macarena
10:19 sena_kun joined #perl6
10:23 Cabanossi joined #perl6
10:27 CQ joined #perl6
10:32 eliasr joined #perl6
10:39 poohman joined #perl6
10:40 poohman hello all - I have a question regarding grammars -
10:40 poohman token link {[<!before '</FORM>'>.]*}
10:41 poohman Is it possible to feed the text matching this token to another grammar
10:41 poohman without writing it to file
10:43 DrForr If you can capture it in a string you can certainly pass it along.
10:46 poohman For that will I have to use an action ?Can I do it directly using an operator of some sort?
10:48 DrForr While there's probaby a way to do that, it's probably the equivalent of an action. I think you can include a method along with the token...
10:51 CQ left #perl6
10:52 mcmillhj joined #perl6
10:54 DrForr *probably
10:58 poohman any tips where I can search in the doku?
11:00 DrForr I don't actually see it there :/ If it were just me I'd make it into an action. You can probably simply add 'method link($/){}' to your grammar.
11:00 DrForr Checking now...
11:03 DrForr Never mind, it collides as I hoped it wouldn't.
11:03 DrForr There *is* a new Apress book on grammars that's out on ebook, might be usefu to read that.
11:04 poohman The Moritz Lenz one?
11:04 DrForr Yep.
11:04 poohman thought it was out in 2018
11:04 DrForr I think the ebook version is already out.
11:04 poohman nice -ill check it out
11:40 poohman joined #perl6
11:42 Voldenet m: say [*] ^6 Z** ^6
11:42 camelia rakudo-moar 1dbf5f589: OUTPUT: «86400000␤»
11:42 Voldenet I've got new favourite way to write "24 hours in milliseconds"
11:51 AlexDaniel joined #perl6
11:53 Cabanossi joined #perl6
11:57 AlexDaniel Voldenet: may I suggest something? :)
11:57 Voldenet go ahead
11:58 AlexDaniel m: say 𒐳×𐄚
11:58 camelia rakudo-moar 1dbf5f589: OUTPUT: «86400000␤»
11:59 Voldenet :O
11:59 Voldenet magic
12:00 * parv curses both Voldenet & AlexDaniel the enabler
12:12 parv AlexDaniel, what was second operand supposed to be? Lacking a suitable font, all I see is [?].
12:13 AlexDaniel u: 𐄚
12:13 unicodable6 AlexDaniel, U+1011A AEGEAN NUMBER TWO HUNDRED [No] (𐄚)
12:13 parv thanks, AlexDaniel
12:13 AlexDaniel u: 0d65818 0d66292 0d68051 0d69235
12:13 unicodable6 AlexDaniel, Found nothing!
12:14 AlexDaniel err… not exactly what I meant!
12:14 AlexDaniel say <65818 66292 68051 69235>».base: 16
12:14 evalable6 AlexDaniel, rakudo-moar 1dbf5f589: OUTPUT: «(1011A 102F4 109D3 10E73)␤»
12:14 AlexDaniel u: 0x1011A 0x102F4 0x109D3 0x10E73
12:14 unicodable6 AlexDaniel, U+1011A AEGEAN NUMBER TWO HUNDRED [No] (𐄚)
12:14 unicodable6 AlexDaniel, U+102F4 COPTIC EPACT NUMBER TWO HUNDRED [No] (𐋴)
12:14 unicodable6 AlexDaniel, 4 characters in total (𐄚𐋴𐧓𐹳): https://gist.github.com/193f9eb4cf260f5bd3e4ce6cb1afe161
12:14 AlexDaniel ↑ all these are 200
12:16 parv what is the meaning of "[No]" in " U+ ... [No] ... "?
12:19 lizmat pretty sure the N is for Numeric, and the o for "ordinal", but of the latter I'm not so sure
12:21 moritz in general, those are Unicode properties
12:22 moritz https://en.wikipedia.org/wiki/Unicode_character_property#General_Category has the list of GC properties
12:22 moritz it explains No as "Number, other"
12:23 parv thanks moritz
12:23 moritz (in contrast to Nd (Number, digit) and Nl (Number, letter))
12:23 moritz m: say (1..0x1FFFF)».chr.join.comb: /<:Nl>/
12:23 camelia rakudo-moar 1dbf5f589: OUTPUT: «(ᛮ ᛯ ᛰ Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ Ⅺ Ⅻ Ⅼ Ⅽ Ⅾ Ⅿ ⅰ ⅱ ⅲ ⅳ ⅴ ⅵ ⅶ ⅷ ⅸ ⅹ ⅺ ⅻ ⅼ ⅽ ⅾ ⅿ ↀ ↁ ↂ ↅ ↆ ↇ ↈ 〇 〡 〢 〣 〤 〥 〦 〧 〨 〩〪〭〮〯〫〬 〸 〹 〺 ꛦ ꛧ ꛨ …»
12:24 moritz m: say (1..0x1FFFF)».chr.join.comb: /<:No>/
12:24 camelia rakudo-moar 1dbf5f589: OUTPUT: «(² ³ ¹ ¼ ½ ¾ ৴ ৵ ৶ ৷ ৸ ৹ ୲ ୳ ୴ ୵ ୶ ୷ ௰ ௱ ௲ ౸ ౹ ౺ ౻ ౼ ౽ ౾ ൘ ൙ ൚ ൛ ൜ ൝ ൞ ൰ ൱ ൲ ൳ ൴ ൵ ൶ ൷ ൸ ༪ ༫ ༬ ༭ ༮ ༯ ༰ ༱ ༲ ༳ ፩ ፪ ፫ ፬ ፭ ፮ ፯ ፰ ፱ ፲ …»
12:26 cosimo joined #perl6
12:26 * parv supposes obfu in perl6 could be harder
12:27 AlexDaniel u: Nl
12:27 unicodable6 AlexDaniel, U+16EE RUNIC ARLAUG SYMBOL [Nl] (ᛮ)
12:27 unicodable6 AlexDaniel, U+16EF RUNIC TVIMADUR SYMBOL [Nl] (ᛯ)
12:27 unicodable6 AlexDaniel, 236 characters in total: https://gist.github.com/c03017dc61bdac6de5b9739d67672390
12:27 AlexDaniel moritz: ↑ :)
12:29 colomon joined #perl6
12:29 colomon o/
12:32 colomon updated rakudo to 2017.11-78-g1dbf5f5 yesterday.  Now Inline::Python seems to have stopped working.  “Could not find python at line 0 in:”
12:32 colomon Is this familiar to anyone?
12:34 Ven`` joined #perl6
12:37 colomon full —ll-exception traceback, just in case that helps anyone: https://gist.github.com/colomon/8a94ea329d8ad3bf511c4860ab6e5f87
12:38 markong joined #perl6
12:55 El_Che joined #perl6
13:07 lizmat am I correct in not seeing an advent post today so far ?
13:12 lizmat moritz: perhaps move your 12 dec post to today ?
13:13 lizmat colomon: confirm Inline::Python issue: cannot install with zef: Cannot locate native library
13:13 MasterDuke lizmat: i just saw some emails suggesting it's scheduled for a couple hours from now
13:14 lizmat why a few  hours from now?  Or isn't it ready yet ?
13:14 MasterDuke probably timezone confusion, but they didn't say
13:15 MasterDuke https://github.com/perl6/mu/issues/32
13:23 colomon lizmat: cannot confirm that because it installs just fine
13:23 colomon … or does it?
13:23 colomon zef install Inline::Python
13:23 colomon ===> Searching for: Inline::Python
13:23 colomon ===> Building: Inline::Python:ver<0.3>:auth<github:niner>
13:23 colomon ===> Building [OK] for Inline::Python:ver<0.3>:auth<github:niner>
13:23 colomon ===> Testing: Inline::Python:ver<0.3>:auth<github:niner>
13:23 colomon ===> Testing [OK] for Inline::Python:ver<0.3>:auth<github:niner>
13:23 colomon ===> Installing: Inline::Python:ver<0.3>:auth<github:niner>
13:23 colomon should that end with an “Installing [OK]” ?
13:27 kitsunenokenja joined #perl6
13:29 rgrau joined #perl6
13:35 lizmat hmm... in my case it seems to still depend on panda?
13:36 colomon lizmat: I appear to have panda:ver<2016.02> installed
13:38 colomon errr, doesn’t actually work: resolve stage failed for panda: Dependency JSON::Fast is not present in the module ecosystem
13:39 colomon AFK # any hints welcome
13:41 jnthn colomon: Does a "zef update" work? JSON::Fast lives on CPAN these days, I believe.
13:41 jnthn s/work/help/ :)
13:41 patrickz joined #perl6
13:58 scimon joined #perl6
13:58 scimon Oh look find_method... That's what I wanted.
13:59 scimon (Using lookup in Game::Sudoku at the moment)
14:08 ZzZombo joined #perl6
14:10 Geth joined #perl6
14:36 ZzZombo joined #perl6
14:49 DrForr Well, cr*p. I'm now thinking about rewriting Pod::TreeWalker - it doesn't look like it's handling table headers correctly. And I'm doing things that make it kind of redundant.
14:54 comborico1611 joined #perl6
14:56 unicodable6 joined #perl6
14:59 DrForr find . -name '*.t'|xargs grep ^= # isn't very encouraging.
15:02 scimon Oh dear.
15:03 DrForr Yeah. I'm willing to whip up a test suite if it's not been done already.
15:05 geospeck joined #perl6
15:06 scimon So.... my Sudoku Solver is now good enough to solve a complete empty grid...
15:06 timotimo how does it decide what to put where, then? randomly?
15:07 timotimo or does an empty grid always turn into the same pattern?
15:07 DrForr I was wondering the same thing.
15:07 scimon If it's run out of obvious values it picks the cell with the least possible values and tries both. And keep recursing.
15:08 timotimo ah, ok
15:08 scimon Interestingly it solves an empty grid the same way every time :)
15:08 DrForr Right, but on an empty grid there are always all 9 :)
15:08 DrForr How well does it handle the minimum of 14 clues?
15:08 scimon So I downloaded 50 tests from project euler. It nows solves all 50 of them.
15:09 scimon 40 it can do without guessing.
15:09 scimon And lots of Sets. And Junctions.
15:10 scimon I think next up will be a creator.
15:11 DickClark left #perl6
15:11 scimon Still I'm happy with it and I've learnt some fun things.
15:12 DrForr Do you randomly choose an option, or run through the possibilities and backtrack?
15:14 scimon Run through and backtrack.
15:16 DrForr Ah, cool. I wasn't sure what 'guessing' contained. (I've solved 49x49 sudoku before...)
15:16 scimon Debating threading that bit in the future.
15:16 scimon Weeeeee
15:16 DrForr Maybe do it as promises
15:17 domidumont joined #perl6
15:17 scimon Was thinking that. Going to upload this for now. :)
15:19 natrys joined #perl6
15:21 zakharyas joined #perl6
15:22 timotimo i'm not entirely happy with "promise" being used to refer to "background-executed tasks" when promises by themselves aren't for introducing parallelism
15:23 scimon Well I could put the options into a Supply.
15:24 DrForr True, I was speaking loosely.
15:24 timotimo supplies are also about managing existing parallelism :)
15:24 timotimo without a "start" or "schedule-on" you won't add parallelism just by using supplies
15:24 timotimo there are things that are by themselves "parallely" that are exposed using supplies, of course
15:26 timotimo this is a muddy topic, that's what troubles me, just mildly
15:27 zakharyas joined #perl6
15:27 timotimo as in, i'm not saying it's your fault at all
15:29 kitsunenokenja left #perl6
15:31 DrForr No offense taken; I haven't delved enough into Promises to know what they're really good for; I was just suggesting it as a way to play with some new ideas.
15:32 scimon Together Promises, Channels and Supplies give you a lot of functionality.
15:32 timotimo at the most basic, a promise is a container for a value that can be set once (either to a value or an exception). code can either stop executing until the value gets set (with await or .result) or it can install a "reaction" with .then
15:33 timotimo the power comes from what you can use to give you promises, and what their eventual fulfillment (or breaking) signifies (to say it in the most poetic, dramatic words i could come up with)
15:34 buggable New CPAN upload: Game-Sudoku-1.0.0.tar.gz by SCIMON https://cpan.metacpan.org/authors/id/S/SC/SCIMON/Perl6/Game-Sudoku-1.0.0.tar.gz
15:34 timotimo i.e. with "start" you can shove a piece of code into a task queue and get back a promise that will be fulfilled or broken by the scheduler when that piece of code finishes execution, either by returning a value or by throwing an exception
15:35 scimon joined #perl6
15:36 scimon Signing off now. Ciao.
15:38 timotimo oh, missed the chance to say bye
15:38 khw joined #perl6
15:51 geospeck joined #perl6
16:00 Geth ¦ ecosystem: 69cde387d1 | gabrielash++ (committed using GitHub Web editor) | META.list
16:00 Geth ¦ ecosystem: added Net::Jupyter
16:00 Geth ¦ ecosystem:
16:00 Geth ¦ ecosystem: https://github.com/gabrielash/p6-net-jupyter
16:00 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/69cde387d1
16:13 * DrForr contemplates a like-deeply...
16:16 DrForr Or maybe a :max-depth adverb on is-deeply.
16:18 timotimo hmm.
16:18 timotimo i wonder if we could have something like .tree that works on two structures at the same time, as it were
16:19 timotimo m: my $a = (1, 2, ("foo", 9), (1, (1, (1,)))); my $b = (1, 2, ("bar", 9), (1, (1, (2,)))); say ($a >>,<< $b).perl
16:19 camelia rakudo-moar 1dbf5f589: OUTPUT: «$((1, 1), (2, 2), (("foo", "bar"), (9, 9)), ((1, 1), ((1, 1), ((1, 2),))))␤»
16:20 timotimo m: my $a = (1, 2, ("foo", 9), (1, (1, (1,)))); my $b = (1, 2, ("bar", 9), (1, (1, (2,)))); say ($a >>,<< $b).tree(* === *).perl
16:20 camelia rakudo-moar 1dbf5f589: OUTPUT: «Too few positionals passed; expected 2 arguments but got 1␤  in block <unit> at <tmp> line 1␤␤»
16:20 DrForr I'm writing some tests here and "Has a Pod::Heading that has these attributes, but I really don't care about what's below it." would certainly cut down on noise.
16:20 timotimo m: my $a = (1, 2, ("foo", 9), (1, (1, (1,)))); my $b = (1, 2, ("bar", 9), (1, (1, (2,)))); say ($a >>,<< $b).tree(*[0] === *[1]).perl
16:20 camelia rakudo-moar 1dbf5f589: OUTPUT: «Too few positionals passed; expected 2 arguments but got 1␤  in block <unit> at <tmp> line 1␤␤»
16:20 timotimo hm, not at all
16:20 DrForr eqv instead of ===? Or are those two the same?
16:21 timotimo good enough, but it's about what different things it's being called on
16:21 timotimo m: my $a = (1, 2, ("foo", 9), (1, (1, (1,)))); my $b = (1, 2, ("bar", 9), (1, (1, (2,)))); say ($a >>,<< $b).tree(*.say).perl
16:21 camelia rakudo-moar 1dbf5f589: OUTPUT: «((1 1) (2 2) ((foo bar) (9 9)) ((1 1) ((1 1) ((1 2)))))␤Bool::True␤»
16:21 timotimo tree only recurses as deep as you give it arguments
16:22 timotimo m: ((1, 2), ((1, 2), (2, 3)), (((9, 9), (8, 7)),))
16:22 camelia rakudo-moar 1dbf5f589: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant integer 1 in sink context (lines 1, 1, 1, 1)␤Useless use of constant integer 8 in sink context (lines 1, 1)␤Useless use of constant integer 2 in sink context (lines 1, 1, 1, 1, 1, 1)␤Useless use of c…»
16:23 timotimo m: ((1, 2), ((1, 2), (2, 3)), (((9, 9), (8, 7)),)).tree({"l1: $_"},{"l2: $_"},{"l3: $_"}, {"l4: $_"}).perl.say
16:23 camelia rakudo-moar 1dbf5f589: OUTPUT: «"l1: l2: 1 2 l2: l3: 1 2 l3: 2 3 l2: l3: l4: 9 9 l4: 8 7"␤»
16:23 timotimo it's a really neat function that i didn't find many uses for yet
16:23 DrForr Maybe I'll add that to the suite.
16:33 thou joined #perl6
16:47 setty1 joined #perl6
16:51 MNI joined #perl6
16:52 geospeck joined #perl6
16:52 MNI Tell me about
16:52 MNI no you
16:52 MNI Where is history?
16:55 DrForr https://irclog.perlgeek.de/perl6/today # should work, but the site may have issues.
16:55 MNI yeah, thanks
16:56 MNI Long is that is all.
16:58 geospeck joined #perl6
17:04 integral joined #perl6
17:04 integral joined #perl6
17:27 roguelazer joined #perl6
17:32 robertle joined #perl6
17:35 M_o_C joined #perl6
17:38 Cabanossi joined #perl6
17:48 evalable6 joined #perl6
17:52 Sgeo joined #perl6
17:52 DrForr There's no '=code' analog to '=para'... Probably too late to add it, but just noticing.
18:01 cdg joined #perl6
18:01 tbrowder o/ #perl6
18:02 patrickz .tell Zoffix Big thumbs up for the containers advent post. It finally got containers into my head. I really liked that it started *without* containers and thus gave context to containers.
18:02 yoleaux patrickz: I'll pass your message to Zoffix.
18:03 tbrowder can anyone point to an easy method to extract data m
18:04 tbrowder xxx data from an regex match without leaving nqp land?
18:07 tbrowder that is an nqp regex match...
18:08 jnthn nqp: my $m := 'abc123' ~~ /(\d+)/; say($m[0])
18:08 camelia nqp-moarvm: OUTPUT: «123␤»
18:08 Cabanossi joined #perl6
18:08 jnthn nqp: my $m := 'abc123' ~~ /$<x>=[\d+]/; say($m<x>)
18:08 camelia nqp-moarvm: OUTPUT: «123␤»
18:12 leah2 joined #perl6
18:20 melezhik joined #perl6
18:22 melezhik Hi! There is error on Rakudo Perl version > 2017.09.00 , Fedora25 - https://github.com/melezhik/sparky/issues/4#issuecomment-350459257 , any ideas? thanks ...
18:22 melezhik s/Perl/Perl6/
18:25 MilkmanDan joined #perl6
18:25 moritz sorry, can't read the prose. "Can't use unknown trait 'is native' in a sub+{callable[str]} declaration.
18:25 moritz "
18:26 moritz sounds like somebody forgot a "use NativeCall;" line
18:26 tbrowder jnthn: thnx! as dr watson used to to sherlock, that’s so obvious when you explain it my dear fellow.
18:27 melezhik yeah, my main concern is this code works with others Perl6, distributions, it only hits this for mentioned environment ...
18:27 tbrowder s/to to/say to/
18:28 melezhik here is the source - https://github.com/melezhik/sparky/blob/master/db-init.pl6
18:28 melezhik pretty simple one
18:28 tbrowder isn’t that slightly different syntax from Perl 6? ...looking again at docs...
18:29 lizmat melezhik: perhaps this suffers from the lexical scope fixes to "use" ?
18:29 lizmat earlier versions of Rakudo erroneously used p5 semantics of "use" regarding visibility of loaded modules
18:30 lizmat nine and ugexe fixed that at some point, but with potential breakage
18:31 tbrowder yeah, it is. i still think it would be a good idea to have a doc section on nqp as used in rakudo, perhaps under the programs tab.
18:32 melezhik lizmat, could please point me a culprit lines in my code, so I could understand more clearly what you mean, thanks
18:32 melezhik s/could/could you/
18:32 tbrowder using the rakudo wiki is (1) too hard to find and (2) not nearly as attractive imho.
18:34 lizmat melehzik: I don't see any "is native" in that code, so the problem isn't there
18:34 lizmat melezhik: ^^^
18:39 melezhik lizmat: what can I do with that?
18:41 konsolebox joined #perl6
18:42 lizmat melezhik: I'm trying to figure out where the source for DBDish::SQLite::Native lives on the web
18:42 melezhik ah, ok
18:43 lizmat inside that class, there's probably an "use NativeCall" missing that wasn't necessary before, but is necessary now
18:44 melezhik yeah, it makes a sense now ...
18:45 melezhik probably this type of issue then might be could by unit tests against recent Rakudos?
18:45 melezhik s/could/caught/
18:48 lizmat it probably should
18:48 lizmat if I understand you correctly  :-)
18:48 geospeck joined #perl6
18:49 rindolf joined #perl6
18:49 melezhik I will try to create a small test to localize the issue, and run it against disered Rakudo, and let see
18:52 tbrowder jnthn: just to confirm, there is no $/ directly availablle after the regex match in nqp—we have to capture it in our own var (or some other method)?
18:54 buggable New CPAN upload: PDF-Font-Loader-0.1.4.tar.gz by WARRINGD https://cpan.metacpan.org/authors/id/W/WA/WARRINGD/Perl6/PDF-Font-Loader-0.1.4.tar.gz
18:54 buggable New CPAN upload: PDF-Font-0.1.3.tar.gz by WARRINGD https://cpan.metacpan.org/authors/id/W/WA/WARRINGD/Perl6/PDF-Font-0.1.3.tar.gz
18:57 jnthn tbrowder: Correct, no magical $/ setting
18:57 jnthn tbrowder: However
18:57 jnthn m: my $/ := 'abc123' ~~ /$<x>=[\d+]/; say($<x>)
18:57 camelia rakudo-moar 1dbf5f589: OUTPUT: «Potential difficulties:␤    Redeclaration of symbol '$/'␤    at <tmp>:1␤    ------> 3my $/7⏏5 := 'abc123' ~~ /$<x>=[\d+]/; say($<x>)␤Cannot call method 'STORE' on a null object␤  in block <unit> at <tmp> line 1␤␤»
18:57 jnthn m: $/ := 'abc123' ~~ /$<x>=[\d+]/; say($<x>)
18:57 camelia rakudo-moar 1dbf5f589: OUTPUT: «「123」␤»
18:57 jnthn You can bind to $/ :)
18:57 jnthn Or take it as a parameter
18:59 tbrowder ok, thanks!
19:09 AlexDaniel` huggable: log
19:09 huggable AlexDaniel`, Comes out 2.41x faster than core .log10 and can handle Ints larger than 1.8e308: https://gist.github.com/zoffixznet/2539e8bebe9c5e19ab38ca43e173fe8f
19:09 AlexDaniel` huggable: irc log
19:09 huggable AlexDaniel`, nothing found
19:09 AlexDaniel` huggable: irclog
19:09 huggable AlexDaniel`, nothing found
19:17 AlexDaniel` huggable: irc
19:17 huggable AlexDaniel`, nothing found
19:21 astronavt joined #perl6
19:23 R0b0t1` joined #perl6
19:26 Zoffix joined #perl6
19:28 tyil for anyone on HN: https://news.ycombinator.com/item?id=15891300
19:34 cdg joined #perl6
19:38 Cabanossi joined #perl6
19:48 AndChat|688961 joined #perl6
19:55 cdg joined #perl6
19:55 kitsunenokenja joined #perl6
19:58 cdg_ joined #perl6
20:06 TEttinger joined #perl6
20:06 bazzaar_ joined #perl6
20:08 moritz yay, already three reviews on amazon: https://smile.amazon.com/dp/1484232275/#customerReviews
20:09 Zoffix moritz++
20:09 moritz reviewers++
20:21 AlexDaniel joined #perl6
20:23 astronavt joined #perl6
20:24 kitsunenokenja left #perl6
20:28 astronav_ joined #perl6
20:30 AndChat|688961 Pretty decent price for a brand new book of 200 pages.
20:32 manchicken joined #perl6
20:33 benchable6 joined #perl6
20:33 manchicken Hey all, is there a good tutorial anywhere on how to package modules involving native library dependencies? I've been on DDG for about 30m now and I can't find anything.
20:33 manchicken Of course now that I say that I see the modules directory.
20:34 manchicken Wow... that's fun. https://github.com/tony-o/perl6-libyaml/blob/master/Build.pm <-- Looks like what I was looking for.
20:35 SourceBaby joined #perl6
20:36 manchicken OK, so it kinda seems like you make a `Makefile.in`, and then use `LibraryMake`... neat. I've really been enjoying the `NativeCall` module, it's so much easier than XS that I'm actually finding it a little disorienting how much easier it is.
20:36 Zoffix :)
20:41 eater joined #perl6
20:42 manchicken One question, though. I'm a maintainer for the `Net::AMQP::RabbitMQ` module in P5, and I'm planning to implement something in P6 now. I'd like to make sure I do so in a way that is more idiomatically correct. Is there anything which documents common idioms for blocking and non-blocking network protocols?
20:43 manchicken RabbitMQ has the ability to play nice with async operations with things like promises and such in NodeJS, and with Perl6 I'd like to use Promises if that's the common and appropriate convention.
20:44 Zoffix Perhaps this module could be an appropriate example:
20:44 jnthn manchicken: For non-blocking, expose async commands or async queries returning one value as a Promise, and expose async streams as a Supply
20:44 Zoffix eco: IO::Socket::SSL::Async
20:44 buggable Zoffix, Nothing found
20:44 manchicken Also, if people tend to want to manage that in their own code and wrap the libraries with blocking system calls, maybe I write synchronous functions and then let callers wrap promises and such if they want.
20:44 Zoffix :/
20:44 jnthn eco: IO::Socket::Async::SSL
20:44 buggable jnthn, IO::Socket::Async::SSL 'Provides an API like IO::Socket::Async, but with SSL support.': http://www.cpan.org/authors/id/J/JN/JNTHN/Perl6/IO-Socket-Async-SSL-0.5.0.tar.gz
20:44 manchicken Oooooh
20:44 jnthn Also a decent example is
20:44 jnthn eco: SSH::LibSSH
20:44 buggable jnthn, SSH::LibSSH 'Asynchronous binding for libssh; client-only and limited functionality so far.': https://github.com/jnthn/p6-ssh-libssh
20:46 Zoffix Repo for IO::S::A::SSl, since the bot is useless: https://github.com/jnthn/p6-io-socket-async-ssl
20:46 astronavt joined #perl6
20:46 rmusial joined #perl6
20:47 manchicken So for that `SSH::LibSSH` module, that's using a thread to manage an event loop, and then having callers return promises which resolve whenever that thread gets back to it?
20:47 manchicken I'm pretty familiar with Promises in ES6, but I'm not sure what the differences are. I suspect that there are some.
20:48 jnthn manchicken: Yes. And the other module just uses a lock to serialize use of the library
20:48 manchicken I'm trying to read through this, please let me know if there's a better doc: https://docs.perl6.org/language/concurrency#Promises
20:48 jnthn But lets it be used from whatever thread wants
20:48 manchicken (I'm not only reading the Promises section)
20:49 jnthn If you happen to have a C library to bind that does its own concurrency control then of course life is easier, but that isn't common :)
20:50 jnthn The event loop or lock approaches can both work. Having done both, I didn't really feel one was "easier". Both had interesting ways to screw up.
20:50 manchicken Naw, the `librabbitmq-c` library is serial.
20:50 manchicken I'm wondering if having a serial library which returns promises on the same thread may be easier.
20:51 manchicken This is my first time doing anything in P6, I just haven't had cause to dig yet.
20:51 jnthn A Promise is just a synchronization construct really
20:51 jnthn There can be anything behind it
20:51 jnthn In that sense, it's very much the same idea as with ES6
20:52 astronavt joined #perl6
20:52 jnthn The big difference to keep in mind compared to ES6 is that in Perl 6 there really are threads
20:52 jnthn Not just a single thread with an event loop
20:53 manchicken Does Perl6 have an async event loop?
20:53 jnthn No
20:53 jnthn I mean, sure, the VM does as an implementation detail
20:54 jnthn But that's never exposed.
20:54 jnthn So at a language level, no, there's just a scheduler which event handlers are pushed to
20:55 jnthn Or seen another way, yes, every thread in the thread pool is an event loop. :)
20:55 manchicken OK, so does a Promise run transparently as though it were coprocessing?
20:55 manchicken I suppose maybe I should just read the doc :)
20:55 jnthn A Promise is just the data structure for conveying a result.
20:55 jnthn If you do something like `my $promise = start { ...code here...}`
20:56 jnthn Then that does two things: 1) schedule the code to run on the thread pool, 2) return a Promise that will be Kept with the result of the code, or Broken if it throws an exception
20:56 jnthn There are various other Promise factories, like Promise.in($seconds)
20:57 jnthn Which are similar: set something up, arrange for it to keep/break the Promise, return the Promise
20:57 comborico1611 joined #perl6
20:57 manchicken So is the threading run transparently?
20:57 manchicken Or is that something I'll want to manage in my module?
20:58 manchicken Just trying to think of how I need to structure this thing.
20:58 jnthn "It depends" :)
20:58 manchicken That's what I was afraid of.
20:58 jnthn For the typical Perl 6 user, there's rarely any need to think directly about threads.
20:58 manchicken Still not terribly clear about how P6 runs with this stuff.
20:58 jnthn Writing bindings to C libraries is, however, once place where the language can't save you from that.
20:58 jnthn *one
20:59 manchicken OK, so you think that having a management thread which interacts with the program via promises is the best way since I'm binding to C?
20:59 jnthn Yeah, that's how I did it in SSH::LibSSH
20:59 manchicken OK, cool.
20:59 jnthn And it works out pretty fine
21:00 jnthn The approach boils down to, create Promise, take Vow, stick some code into a queue to do the task on the management thread, have the management thread run that code and use the vow to keep the Promise.
21:00 jnthn So the management thread just sits in a loop reading stuff out of the queue. Can use a Channel for the queue.
21:01 jnthn Only word of warning: Supply is probably very interesting or a message queue, since it models really well what a message queue is: a stream of async messages
21:01 jnthn But, emitting into a Supply will by default run the handlers on the calling thread
21:02 jnthn Which would potentially "clog" the management thread
21:02 jnthn Thus the .Supply.Channel.Supply or similar tricks you'll see in SSH::LibSSH
21:06 nightfrog joined #perl6
21:09 astronavt joined #perl6
21:32 manchicken joined #perl6
21:43 imcsk8 joined #perl6
21:50 Zoffix left #perl6
21:50 manchicken I should probably use a submodule for the lib, as the existing p5 module does.
21:56 rindolf joined #perl6
22:10 bisectable6 joined #perl6
22:13 shmibs joined #perl6
22:15 greppable6 joined #perl6
22:16 squashable6 joined #perl6
22:19 cdg joined #perl6
22:20 noganex_ joined #perl6
22:48 BenGoldberg joined #perl6
22:51 mcmillhj joined #perl6
22:51 cdg joined #perl6
22:59 kitsunenokenja joined #perl6
22:59 kitsunenokenja left #perl6
23:23 mcmillhj joined #perl6
23:24 comborico1611 joined #perl6
23:29 colomon_ joined #perl6
23:38 Rawriful joined #perl6
23:52 llfourn joined #perl6
23:57 epony joined #perl6
23:58 mspo moritz: thanks for the doing the * link on https://perl6.org/whatever/; it's, like, literally 1000000x better
23:59 epony joined #perl6

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

Perl 6 | Reference Documentation | Rakudo