»ö« 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.
00:00 kaare__ joined 00:08 Cabanossi left, Cabanossi joined 00:36 mcmillhj joined 00:41 raiph joined, mcmillhj left 00:49 mattp_ left 00:54 cdg left 00:57 sena_kun left 00:59 mcmillhj joined 01:04 mcmillhj left 01:11 BenGoldberg left 01:20 jeromelanteri joined 01:22 Cabanossi left 01:24 Cabanossi joined 01:31 wamba left 01:33 TimToady left 01:35 TimToady joined 01:36 mson left
comborico1611 Yup. 01:50
01:51 Cabanossi left 01:54 Cabanossi joined 01:59 comborico1611 left 02:04 astronavt left 02:11 astronavt joined 02:17 kitsunenokenja left 02:20 mson joined, kitsunenokenja joined 02:27 kitsunenokenja left 02:45 ilbot3 left 02:53 Rawriful left 03:00 ilbot3 joined, ChanServ sets mode: +v ilbot3 03:06 Cabanossi left 03:09 Cabanossi joined 03:22 char_var[buffer] joined 03:23 char_var[buffer] left 03:25 char_var[buffer] joined 03:58 cpage left 04:07 Cabanossi left 04:08 Cabanossi joined, piojo_ joined 04:35 Cabanossi left 04:38 Cabanossi joined, cpage joined 04:42 rmusial joined 04:56 mson left 05:12 committable6 left, committable6 joined 05:46 AlexDaniel joined 06:04 releasable6 left, releasable6 joined, ChanServ sets mode: +v releasable6 06:16 piojo_ left 06:24 piojo_ joined
thou m: say $*REPO.repo-chain».?installed.flat».?meta».<provides>».keys.flat; 06:29
camelia (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
thou m: say $*REPO.repo-chain».?installed.flat».?meta».<name>.flat; 06:30
camelia (zef CSV::Parser Inline::Perl5 CORE Nil Nil Nil)
06:31 piojo_ left 06:36 khw left 06:39 kaare_ joined, kaare__ left 06:58 Sgeo left 06:59 Sgeo joined 07:04 coffeebyte[m] joined, darutoko joined 07:18 cdg joined, piojo_ joined 07:20 cdg_ joined 07:22 cdg left, Cabanossi left 07:23 Cabanossi joined 07:24 wamba joined 07:25 cdg_ left 07:26 AlexDaniel left 07:35 reportable6 left, reportable6 joined, ChanServ sets mode: +v reportable6 07:45 cdg joined 07:46 thou left 07:50 cdg left, abraxxa joined 07:53 cdg joined 07:55 abraxxa left, cdg_ joined 07:57 piojo_ left 07:58 cdg left 08:00 cdg_ left 08:09 coffeebyte[m] left 08:23 piojo_ joined 08:30 cdg joined 08:35 cdg left 08:45 domidumont joined 08:51 cdg joined 08:52 domidumont left, domidumont joined 08:55 cdg left, parv joined 09:03 geospeck joined 09:08 geospeck left 09:18 araraloren joined
araraloren o/ 09:29
09:39 cosimo left 09:52 Cabanossi left 09:53 Cabanossi joined 09:56 piojo_ left 09:58 llfourn left 10:06 raiph left
moritz \o 10:12
DrForr /macarena 10:16
10:18 MilkmanDan left 10:19 sena_kun joined 10:20 Cabanossi left 10:23 Cabanossi joined 10:27 CQ joined 10:32 eliasr joined 10:36 TEttinger left 10:37 astronavt left 10:39 poohman joined
poohman hello all - I have a question regarding grammars - 10:40
token link {[<!before '</FORM>'>.]*}
Is it possible to feed the text matching this token to another grammar 10:41
without writing it to file
DrForr If you can capture it in a string you can certainly pass it along. 10:43
poohman For that will I have to use an action ?Can I do it directly using an operator of some sort? 10:46
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:48
10:51 CQ left 10:52 mcmillhj joined
DrForr *probably 10:54
10:57 mcmillhj left
poohman any tips where I can search in the doku? 10:58
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
Checking now...
Never mind, it collides as I hoped it wouldn't. 11:03
There *is* a new Apress book on grammars that's out on ebook, might be usefu to read that.
poohman The Moritz Lenz one? 11:04
DrForr Yep.
poohman thought it was out in 2018
DrForr I think the ebook version is already out.
poohman nice -ill check it out
11:39 poohman left 11:40 poohman joined
Voldenet m: say [*] ^6 Z** ^6 11:42
camelia 86400000
Voldenet I've got new favourite way to write "24 hours in milliseconds"
11:51 AlexDaniel joined 11:52 Cabanossi left 11:53 Cabanossi joined
AlexDaniel Voldenet: may I suggest something? :) 11:57
Voldenet go ahead
AlexDaniel m: say 𒐳×𐄚 11:58
camelia 86400000
Voldenet :O 11:59
magic
parv curses both Voldenet & AlexDaniel the enabler 12:00
AlexDaniel, what was second operand supposed to be? Lacking a suitable font, all I see is [?]. 12:12
AlexDaniel u: 𐄚 12:13
unicodable6 AlexDaniel, U+1011A AEGEAN NUMBER TWO HUNDRED [No] (𐄚)
parv thanks, AlexDaniel
AlexDaniel u: 0d65818 0d66292 0d68051 0d69235
unicodable6 AlexDaniel, Found nothing!
AlexDaniel err… not exactly what I meant! 12:14
say <65818 66292 68051 69235>».base: 16
evalable6 (1011A 102F4 109D3 10E73)
AlexDaniel u: 0x1011A 0x102F4 0x109D3 0x10E73
unicodable6 AlexDaniel, U+1011A AEGEAN NUMBER TWO HUNDRED [No] (𐄚)
AlexDaniel, U+102F4 COPTIC EPACT NUMBER TWO HUNDRED [No] (𐋴)
AlexDaniel, 4 characters in total (𐄚𐋴𐧓𐹳): gist.github.com/193f9eb4cf260f5bd3...6cb1afe161
AlexDaniel ↑ all these are 200
parv what is the meaning of "[No]" in " U+ ... [No] ... "? 12:16
lizmat pretty sure the N is for Numeric, and the o for "ordinal", but of the latter I'm not so sure 12:19
moritz in general, those are Unicode properties 12:21
en.wikipedia.org/wiki/Unicode_char...l_Category has the list of GC properties 12:22
it explains No as "Number, other"
parv thanks moritz 12:23
moritz (in contrast to Nd (Number, digit) and Nl (Number, letter))
m: say (1..0x1FFFF)».chr.join.comb: /<:Nl>/
camelia (ᛮ ᛯ ᛰ Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ Ⅺ Ⅻ Ⅼ Ⅽ Ⅾ Ⅿ ⅰ ⅱ ⅲ ⅳ ⅴ ⅵ ⅶ ⅷ ⅸ ⅹ ⅺ ⅻ ⅼ ⅽ ⅾ ⅿ ↀ ↁ ↂ ↅ ↆ ↇ ↈ 〇 〡 〢 〣 〤 〥 〦 〧 〨 〩〪〭〮〯〫〬 〸 〹 〺 ꛦ ꛧ ꛨ …
moritz m: say (1..0x1FFFF)».chr.join.comb: /<:No>/ 12:24
camelia (² ³ ¹ ¼ ½ ¾ ৴ ৵ ৶ ৷ ৸ ৹ ୲ ୳ ୴ ୵ ୶ ୷ ௰ ௱ ௲ ౸ ౹ ౺ ౻ ౼ ౽ ౾ ൘ ൙ ൚ ൛ ൜ ൝ ൞ ൰ ൱ ൲ ൳ ൴ ൵ ൶ ൷ ൸ ༪ ༫ ༬ ༭ ༮ ༯ ༰ ༱ ༲ ༳ ፩ ፪ ፫ ፬ ፭ ፮ ፯ ፰ ፱ ፲ …
12:26 cosimo joined
parv supposes obfu in perl6 could be harder 12:26
AlexDaniel u: Nl 12:27
unicodable6 AlexDaniel, U+16EE RUNIC ARLAUG SYMBOL [Nl] (ᛮ)
AlexDaniel, U+16EF RUNIC TVIMADUR SYMBOL [Nl] (ᛯ)
AlexDaniel, 236 characters in total: gist.github.com/c03017dc61bdac6de5...9d67672390
AlexDaniel moritz: ↑ :)
12:29 colomon joined
colomon o/ 12:29
12:30 itaylor57 left
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
Is this familiar to anyone?
12:34 Ven`` joined
colomon full —ll-exception traceback, just in case that helps anyone: gist.github.com/colomon/8a94ea329d...60ab6e5f87 12:37
12:38 markong joined 12:40 poohman left 12:43 parv left 12:53 domidumont left 12:54 El_Che left 12:55 El_Che joined, AmazingPudding is now known as bonsaikitten
lizmat am I correct in not seeing an advent post today so far ? 13:07
moritz: perhaps move your 12 dec post to today ? 13:12
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
lizmat why a few hours from now? Or isn't it ready yet ? 13:14
MasterDuke probably timezone confusion, but they didn't say
github.com/perl6/mu/issues/32 13:15
colomon lizmat: cannot confirm that because it installs just fine 13:23
… or does it?
zef install Inline::Python
===> Searching for: Inline::Python
===> Building: Inline::Python:ver<0.3>:auth<github:niner>
===> Building [OK] for Inline::Python:ver<0.3>:auth<github:niner>
===> Testing: Inline::Python:ver<0.3>:auth<github:niner>
===> Testing [OK] for Inline::Python:ver<0.3>:auth<github:niner>
===> Installing: Inline::Python:ver<0.3>:auth<github:niner>
should that end with an “Installing [OK]” ?
13:27 kitsunenokenja joined 13:29 rgrau joined
lizmat hmm... in my case it seems to still depend on panda? 13:35
colomon lizmat: I appear to have panda:ver<2016.02> installed 13:36
errr, doesn’t actually work: resolve stage failed for panda: Dependency JSON::Fast is not present in the module ecosystem 13:38
AFK # any hints welcome 13:39
jnthn colomon: Does a "zef update" work? JSON::Fast lives on CPAN these days, I believe. 13:41
s/work/help/ :)
13:41 patrickz joined 13:56 jeromelanteri left 13:58 scimon joined
scimon Oh look find_method... That's what I wanted. 13:58
(Using lookup in Game::Sudoku at the moment) 13:59
14:08 ZzZombo left, ZzZombo joined 14:10 Geth left, Geth joined, ChanServ sets mode: +v Geth 14:36 ZzZombo left, ZzZombo joined 14:40 Ven`` left 14:42 AlexDaniel left
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:49
14:54 comborico1611 joined 14:56 unicodable6 left, unicodable6 joined, ChanServ sets mode: +v unicodable6
DrForr find . -name '*.t'|xargs grep ^= # isn't very encouraging. 14:59
scimon Oh dear. 15:02
15:02 araraloren left
DrForr Yeah. I'm willing to whip up a test suite if it's not been done already. 15:03
15:05 geospeck joined
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?
or does an empty grid always turn into the same pattern? 15:07
DrForr I was wondering the same thing.
scimon If it's run out of obvious values it picks the cell with the least possible values and tries both. And keep recursing.
timotimo ah, ok 15:08
scimon Interestingly it solves an empty grid the same way every time :)
DrForr Right, but on an empty grid there are always all 9 :)
How well does it handle the minimum of 14 clues?
scimon So I downloaded 50 tests from project euler. It nows solves all 50 of them.
40 it can do without guessing. 15:09
And lots of Sets. And Junctions.
I think next up will be a creator. 15:10
15:11 DickClark left
scimon Still I'm happy with it and I've learnt some fun things. 15:11
DrForr Do you randomly choose an option, or run through the possibilities and backtrack? 15:12
scimon Run through and backtrack. 15:14
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.
Weeeeee
DrForr Maybe do it as promises
15:17 domidumont joined
scimon Was thinking that. Going to upload this for now. :) 15:17
15:19 natrys joined 15:21 zakharyas joined
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:22
scimon Well I could put the options into a Supply. 15:23
DrForr True, I was speaking loosely. 15:24
timotimo supplies are also about managing existing parallelism :)
without a "start" or "schedule-on" you won't add parallelism just by using supplies
15:24 zakharyas left
timotimo there are things that are by themselves "parallely" that are exposed using supplies, of course 15:24
15:25 geospeck left
timotimo this is a muddy topic, that's what troubles me, just mildly 15:26
15:27 zakharyas joined
timotimo as in, i'm not saying it's your fault at all 15:27
15:29 kitsunenokenja left
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:31
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
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:33
buggable New CPAN upload: Game-Sudoku-1.0.0.tar.gz by SCIMON cpan.metacpan.org/authors/id/S/SC/...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 left, scimon joined
scimon Signing off now. Ciao. 15:36
15:36 scimon left
timotimo oh, missed the chance to say bye 15:38
15:38 khw joined 15:51 geospeck joined 15:53 Sgeo left 15:56 geospeck left
Geth ecosystem: 69cde387d1 | gabrielash++ (committed using GitHub Web editor) | META.list
added Net::Jupyter

  github.com/gabrielash/p6-net-jupyter
16:00
DrForr contemplates a like-deeply... 16:13
16:13 integral left
DrForr Or maybe a :max-depth adverb on is-deeply. 16:16
timotimo hmm. 16:18
i wonder if we could have something like .tree that works on two structures at the same time, as it were
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 $((1, 1), (2, 2), (("foo", "bar"), (9, 9)), ((1, 1), ((1, 1), ((1, 2),))))
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 Too few positionals passed; expected 2 arguments but got 1
in block <unit> at <tmp> line 1
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.
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
camelia Too few positionals passed; expected 2 arguments but got 1
in block <unit> at <tmp> line 1
timotimo hm, not at all
DrForr eqv instead of ===? Or are those two the same?
timotimo good enough, but it's about what different things it's being called on 16:21
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
camelia ((1 1) (2 2) ((foo bar) (9 9)) ((1 1) ((1 1) ((1 2)))))
Bool::True
timotimo tree only recurses as deep as you give it arguments
m: ((1, 2), ((1, 2), (2, 3)), (((9, 9), (8, 7)),)) 16:22
camelia 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…
timotimo m: ((1, 2), ((1, 2), (2, 3)), (((9, 9), (8, 7)),)).tree({"l1: $_"},{"l2: $_"},{"l3: $_"}, {"l4: $_"}).perl.say 16:23
camelia "l1: l2: 1 2 l2: l3: 1 2 l3: 2 3 l2: l3: l4: 9 9 l4: 8 7"
timotimo it's a really neat function that i didn't find many uses for yet
DrForr Maybe I'll add that to the suite.
16:33 thou joined 16:47 setty1 joined 16:48 thou left 16:51 MNI joined 16:52 geospeck joined
MNI Tell me about 16:52
no you
Where is history?
DrForr irclog.perlgeek.de/perl6/today # should work, but the site may have issues. 16:55
MNI yeah, thanks
Long is that is all. 16:56
16:58 geospeck left, geospeck joined 17:01 MNI left 17:04 integral joined, integral left, integral joined 17:27 roguelazer joined 17:32 robertle joined 17:35 M_o_C joined 17:37 Cabanossi left 17:38 Cabanossi joined 17:44 M_o_C left 17:48 evalable6 left, evalable6 joined, ChanServ sets mode: +v evalable6 17:50 geospeck left 17:52 Sgeo joined
DrForr There's no '=code' analog to '=para'... Probably too late to add it, but just noticing. 17:52
18:01 cdg joined
tbrowder o/ #perl6 18:01
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.
tbrowder can anyone point to an easy method to extract data m 18:03
xxx data from an regex match without leaving nqp land? 18:04
18:05 Cabanossi left
tbrowder that is an nqp regex match... 18:07
18:07 zakharyas left
jnthn nqp: my $m := 'abc123' ~~ /(\d+)/; say($m[0]) 18:08
camelia 123
18:08 Cabanossi joined
jnthn nqp: my $m := 'abc123' ~~ /$<x>=[\d+]/; say($m<x>) 18:08
camelia 123
18:08 leah2 left 18:12 leah2 joined 18:20 melezhik joined
melezhik Hi! There is error on Rakudo Perl version > 2017.09.00 , Fedora25 - github.com/melezhik/sparky/issues/...-350459257 , any ideas? thanks ... 18:22
s/Perl/Perl6/
18:25 MilkmanDan joined
moritz sorry, can't read the prose. "Can't use unknown trait 'is native' in a sub+{callable[str]} declaration. 18:25
"
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.
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:27 darutoko left
melezhik here is the source - github.com/melezhik/sparky/blob/ma...b-init.pl6 18:28
pretty simple one
tbrowder isn’t that slightly different syntax from Perl 6? ...looking again at docs...
lizmat melezhik: perhaps this suffers from the lexical scope fixes to "use" ? 18:29
earlier versions of Rakudo erroneously used p5 semantics of "use" regarding visibility of loaded modules
nine and ugexe fixed that at some point, but with potential breakage 18:30
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:31
melezhik lizmat, could please point me a culprit lines in my code, so I could understand more clearly what you mean, thanks 18:32
s/could/could you/
tbrowder using the rakudo wiki is (1) too hard to find and (2) not nearly as attractive imho.
lizmat melehzik: I don't see any "is native" in that code, so the problem isn't there 18:34
melezhik: ^^^
18:35 konsolebox left
melezhik lizmat: what can I do with that? 18:39
18:41 rindolf left, konsolebox joined
lizmat melezhik: I'm trying to figure out where the source for DBDish::SQLite::Native lives on the web 18:42
melezhik ah, ok
lizmat inside that class, there's probably an "use NativeCall" missing that wasn't necessary before, but is necessary now 18:43
melezhik yeah, it makes a sense now ... 18:44
probably this type of issue then might be could by unit tests against recent Rakudos? 18:45
s/could/caught/
lizmat it probably should 18:48
if I understand you correctly :-)
18:48 geospeck joined 18:49 rindolf joined
melezhik I will try to create a small test to localize the issue, and run it against disered Rakudo, and let see 18:49
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:52
buggable New CPAN upload: PDF-Font-Loader-0.1.4.tar.gz by WARRINGD cpan.metacpan.org/authors/id/W/WA/...1.4.tar.gz 18:54
New CPAN upload: PDF-Font-0.1.3.tar.gz by WARRINGD cpan.metacpan.org/authors/id/W/WA/...1.3.tar.gz
18:54 melezhik left
jnthn tbrowder: Correct, no magical $/ setting 18:57
tbrowder: However
m: my $/ := 'abc123' ~~ /$<x>=[\d+]/; say($<x>)
camelia 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
jnthn m: $/ := 'abc123' ~~ /$<x>=[\d+]/; say($<x>)
camelia 「123」
jnthn You can bind to $/ :)
Or take it as a parameter
tbrowder ok, thanks! 18:59
AlexDaniel` huggable: log 19:09
huggable AlexDaniel`, Comes out 2.41x faster than core .log10 and can handle Ints larger than 1.8e308: gist.github.com/zoffixznet/2539e8b...43e173fe8f
AlexDaniel` huggable: irc log
huggable AlexDaniel`, nothing found
AlexDaniel` huggable: irclog
huggable AlexDaniel`, nothing found
AlexDaniel` huggable: irc 19:17
huggable AlexDaniel`, nothing found
19:20 R0b0t1` left 19:21 astronavt joined 19:23 R0b0t1` joined 19:26 Zoffix joined
tyil for anyone on HN: news.ycombinator.com/item?id=15891300 19:28
19:34 cdg left, cdg joined 19:35 Cabanossi left 19:38 Cabanossi joined 19:39 patrickz left, cdg left 19:48 comborico1611 left, AndChat|688961 joined 19:55 cdg joined, kitsunenokenja joined 19:58 cdg_ joined 20:00 cdg left 20:02 cdg_ left 20:06 TEttinger joined, bazzaar_ joined
moritz yay, already three reviews on amazon: smile.amazon.com/dp/1484232275/#customerReviews 20:08
Zoffix moritz++ 20:09
moritz reviewers++
20:12 domidumont left 20:21 AlexDaniel joined 20:22 astronavt left 20:23 astronavt joined 20:24 kitsunenokenja left 20:27 SourceBaby left 20:28 astronav_ joined, astronavt left
AndChat|688961 Pretty decent price for a brand new book of 200 pages. 20:30
20:31 eater left 20:32 manchicken joined 20:33 benchable6 left, benchable6 joined
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
Of course now that I say that I see the modules directory.
Wow... that's fun. github.com/tony-o/perl6-libyaml/bl...r/Build.pm <-- Looks like what I was looking for. 20:34
20:35 astronav_ left, SourceBaby joined, ChanServ sets mode: +v SourceBaby
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:40 rmusial left 20:41 eater joined
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:42
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:43
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
Zoffix eco: IO::Socket::SSL::Async
buggable Zoffix, Nothing found
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.
Zoffix :/
jnthn eco: IO::Socket::Async::SSL
buggable jnthn, IO::Socket::Async::SSL 'Provides an API like IO::Socket::Async, but with SSL support.': www.cpan.org/authors/id/J/JN/JNTHN/...5.0.tar.gz
manchicken Oooooh
jnthn Also a decent example is
eco: SSH::LibSSH
buggable jnthn, SSH::LibSSH 'Asynchronous binding for libssh; client-only and limited functionality so far.': github.com/jnthn/p6-ssh-libssh
Zoffix Repo for IO::S::A::SSl, since the bot is useless: github.com/jnthn/p6-io-socket-async-ssl 20:46
20:46 astronavt joined, natrys left, rmusial joined
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
I'm pretty familiar with Promises in ES6, but I'm not sure what the differences are. I suspect that there are some.
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: docs.perl6.org/language/concurrency#Promises
jnthn But lets it be used from whatever thread wants
manchicken (I'm not only reading the Promises section)
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:49
20:49 astronavt left
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.
I'm wondering if having a serial library which returns promises on the same thread may be easier.
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
There can be anything behind it
In that sense, it's very much the same idea as with ES6
20:52 astronavt joined
jnthn The big difference to keep in mind compared to ES6 is that in Perl 6 there really are threads 20:52
Not just a single thread with an event loop
manchicken Does Perl6 have an async event loop? 20:53
jnthn No
I mean, sure, the VM does as an implementation detail
But that's never exposed. 20:54
So at a language level, no, there's just a scheduler which event handlers are pushed to
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?
I suppose maybe I should just read the doc :)
jnthn A Promise is just the data structure for conveying a result.
If you do something like `my $promise = start { ...code here...}`
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
20:56 astronavt left
jnthn There are various other Promise factories, like Promise.in($seconds) 20:56
20:57 AndChat|688961 left
jnthn Which are similar: set something up, arrange for it to keep/break the Promise, return the Promise 20:57
20:57 comborico1611 joined
manchicken So is the threading run transparently? 20:57
Or is that something I'll want to manage in my module?
Just trying to think of how I need to structure this thing. 20:58
jnthn "It depends" :)
manchicken That's what I was afraid of.
jnthn For the typical Perl 6 user, there's rarely any need to think directly about threads.
manchicken Still not terribly clear about how P6 runs with this stuff.
jnthn Writing bindings to C libraries is, however, once place where the language can't save you from that.
*one
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
manchicken OK, cool.
jnthn And it works out pretty fine
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
So the management thread just sits in a loop reading stuff out of the queue. Can use a Channel for the queue.
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
But, emitting into a Supply will by default run the handlers on the calling thread
Which would potentially "clog" the management thread 21:02
Thus the .Supply.Channel.Supply or similar tricks you'll see in SSH::LibSSH
21:06 manchicken left, nightfrog joined 21:09 astronavt joined 21:13 AlexDaniel left 21:22 comborico1611 left 21:25 rindolf left 21:32 manchicken joined 21:42 imcsk8 left 21:43 imcsk8 joined 21:50 Zoffix left
manchicken I should probably use a submodule for the lib, as the existing p5 module does. 21:50
21:56 rindolf joined 22:01 manchicken left 22:02 geospeck left 22:10 bisectable6 left, bisectable6 joined 22:12 shmibs left 22:13 shmibs joined 22:14 robertle left 22:15 greppable6 left, squashable6 left, greppable6 joined, ChanServ sets mode: +v greppable6 22:16 squashable6 joined 22:19 cdg joined 22:20 noganex_ joined 22:23 noganex left, cdg left 22:35 setty1 left 22:48 BenGoldberg joined 22:51 mcmillhj joined, cdg joined 22:56 cdg left 22:59 kitsunenokenja joined, kitsunenokenja left 23:09 rindolf left 23:12 mcmillhj left 23:23 mcmillhj joined, mcmillhj left 23:24 comborico1611 joined 23:29 colomon_ joined 23:31 colomon left, colomon_ is now known as colomon 23:38 Rawriful joined 23:45 Rawriful left 23:52 llfourn joined 23:57 epony joined
mspo moritz: thanks for the doing the * link on perl6.org/whatever/; it's, like, literally 1000000x better 23:58
23:58 epony left 23:59 epony joined