»ö« 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.
COMBORICO m: say ~$0 if 'cacbcd' ~~ / [ a || b ] (c.) / ; 00:15
camelia cb
COMBORICO Why isn't the above output 'ca'? 00:16
sacomo m: say ~$0 if 'cacbcd' ~~ / (c [a||b]) / ; 00:41
camelia ca
COMBORICO Sacomo, Thanks! 01:07
sacomo welcome! 01:08
COMBORICO What does m: do in regex? (I already searched docs.) 01:53
timotimo it's for "ignoremark" 01:54
m: say "bäh" ~~ /:m a/
camelia 「ä」
timotimo here it matched the ä even though the regex has only an a in it 01:55
COMBORICO I understand. But this example seems different. Stand by. 01:57
m: say so 'AB' ~~ m:i/ ab/; 01:58
camelia True
timotimo yeah, that's ignorecase 01:59
the m in there is just the regex match operator, and this usage of it is problematic 02:00
m: say "ab" ~~ m/ab/
camelia 「ab」
timotimo m: $_ = "ab"; say m/ab/
camelia 「ab」
timotimo hm, maybe not problematic?
geekosaur there was a bug there at one point but I thought it was fixed 02:00
otherwise, the main use for m// instead of // is to make it easier to add adverbs (like m:i//) 02:01
timotimo i'd have used rx/ / instead i guess?
m: say r/abc/
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing required term after infix
at <tmp>:1
------> 3say r/abc/7⏏5<EOL>
expecting any of:
prefix
term
timotimo m: say rx/abc/
camelia rx/abc/
COMBORICO Timotimo, thanks; I've added the name into my notes. 02:02
COMBORICO Sleep time. Night. 02:22
Herby_ \o 02:35
KDr2 p6: say 3; 03:26
camelia 3
finanalyst Can anyone here let me know whether the following assumption is wrong? A valid perl6 module name must have a single initial character. That is a module should conform to / \w [<-[:]>|| '::' ] * / 05:27
finanalyst OR is / [<-[:]>|| '::' ] * / a valid expression, which (I think) would allow a module named '::Something' to be valid. 05:28
wander .ask finanalyst, does this code satisfy you? gist.github.com/W4anD0eR96/4cefb22...53487144fc 06:16
yoleaux wander: What kind of a name is "finanalyst,"?!
wander .ask finanalyst does this code satisfy you? gist.github.com/W4anD0eR96/4cefb22...53487144fc
yoleaux wander: I'll pass your message to finanalyst.
finanalyst yoleaux: its my nic. Short for financial analyst. 06:17
yoleaux 06:16Z <wander> finanalyst: does this code satisfy you? gist.github.com/W4anD0eR96/4cefb22...53487144fc
finanalyst yoleaux: is there a problem with my nic? 06:18
wander no, is my misspell
yoleaux is a chat-bot
finanalyst wander: ah. OK 06:19
wander for the code, alternatively you can use ::Model in Model.pm, but cannot change Model.pm to :: Model.pm
finanalyst wander: maybe you misunderstand. I am asking about the perl6 ecosystem
Would a module called "::thisIsMySpecialModule" be an acceptable name? Or should there be at least one letter? 06:20
wander I think it can, technically, be. 06:22
moritz finanalyst: my understanding is that distribution names should be valid Perl 6 identifers
*identifiers 06:23
so it needs to start with <:alpha+[_]>
wander when you `use Grammar::Tracer`, in fact it searches in perl6 path 06:24
finanalyst moritz: that was my assumption as well. But I wanted to check. I could not find a reference to this in specs 06:25
moritz: you say <:alpha> . Is that not \w ?
wander \w includes \d 06:26
finanalyst wander: I know \w includes \d, and I was thinking that a module could be called '007::SpecialAgent' 06:28
finanalyst However, I also know that perl6 identifiers may not have an initial \d 06:28
wander \w I think 06:30
github.com/cjfields/bioperl6
someone use model-name with digit
finanalyst I am just trying to check if it is theoretically possible for '::someotherpart' to be a valid module name. 06:31
wander regardless ecosystem convenience, it can 06:34
gist.github.com/W4anD0eR96/ed3e91b...a55f19aac8
lexically it looks like `::something` 06:36
m: use 123; 06:37
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
use used at line 1
wander m: use "123"; 06:38
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
use used at line 1
wander m: use Model;
camelia ===SORRY!===
Could not find Model at line 1 in:
/home/camelia/.perl6
/home/camelia/rakudo-m-inst-2/share/perl6/site
/home/camelia/rakudo-m-inst-2/share/perl6/vendor
/home/camelia/rakudo-m-inst-2/share/perl6
CompUnit::Re
wander m: use Model2;
camelia ===SORRY!===
Could not find Model2 at line 1 in:
/home/camelia/.perl6
/home/camelia/rakudo-m-inst-2/share/perl6/site
/home/camelia/rakudo-m-inst-2/share/perl6/vendor
/home/camelia/rakudo-m-inst-2/share/perl6
CompUnit::R
wander_ m: grammar AlternativeMatch { token start($patten) { $patten } }; say AlternativeMatch.parse('abab', :rule('start'), :args(\('[ a || b ] +'))); 07:28
camelia Nil
wander_ m: grammar AlternativeMatch { token start($patten) { $patten+ } }; say AlternativeMatch.parse('aaaa', :rule('start'), :args(\('a')));
camelia 「aaaa」
wander_ moritz, any way can I DWIW for the former? 07:29
interpolate regexes seems like 07:30
Guest1693 p6 : say 3; 08:10
p6: say 3;
camelia 3
no-n p6: 3.say 08:12
camelia 3
Geth doc/W4anD0eR96-patch-1: 39539835bf | (Alex Chen)++ (committed using GitHub Web editor) | doc/Type/Grammar.pod6
Rewrite Type/Grammar.pod6

Review needed
And plz help improving examples of `*%opt` arguments.
I have try : ... (12 more lines)
08:26
Geth doc: W4anD0eR96++ created pull request #1645:
Rewrite Type/Grammar.pod6
08:27
azawawi hi #perl6 08:28
m: use v6; use NativeCall; class U is repr('CUnion') { has int8 $.i8; }; class S is repr('CStruct') { has int8 $.type; has U $.union; }; my $o = S.new(:type(1), :union(U.new(i8 => 42)));
camelia Cannot assign to an immutable value
in submethod BUILDALL at <tmp> line 1
in block <unit> at <tmp> line 1
azawawi use v6; use NativeCall; class U is repr('CUnion') { has int8 $.i8; }; class S is repr('CStruct') { has int8 $.type; has U $.union is rw; }; my $o = S.new(:type(1), :union(U.new(i8 => 42))); 08:29
m: use v6; use NativeCall; class U is repr('CUnion') { has int8 $.i8; }; class S is repr('CStruct') { has int8 $.type; has U $.union is rw; }; my $o = S.new(:type(1), :union(U.new(i8 => 42)));
camelia Cannot assign to an immutable value
in submethod BUILDALL at <tmp> line 1
in block <unit> at <tmp> line 1
azawawi Any idea why im getting "cannot assign to an immutable value" on the above code? 08:30
geekosaur bisectable: use NativeCall; class U is repr('CUnion') { has int8 $.i8; }; class S is repr('CStruct') { has int8 $.type; has U $.union; }; my $o = S.new(:type(1), :union(U.new(i8 => 42))); 08:39
bisectable6 geekosaur, Bisecting by output (old=2015.12 new=d21c31e) because on both starting points the exit code is 1
geekosaur, bisect log: gist.github.com/1d3e189ec8d95993e1...f84345b67e
geekosaur, There are 6 candidates for the first “new” revision. See the log for more details
geekosaur apparently never did work, so at least lizmat's BUILDALL changes are off the hook :) 08:41
will guess CUnion was not well tested and has a glitch
azawawi oh thanks 08:42
so there is no workarounds?
geekosaur I played around a bit and couldn't find one. But I'm not an expert on NativeCall
azawawi or basically create n-different structs for n-union elements :) 08:43
azawawi or create n-int8 and play with the bits :) 08:44
# Currently making a wrapper for msgpackc (a C implementation of our currently slow Data::MessagePack) 08:45
github.com/msgpack/msgpack-c
github.com/pierre-vigier/Perl6-Data-MessagePack 08:46
Quick benchmark show that python and perl implementation are like 2.3s and 2.8s (msgpackc is 1.81) for 10_000_000 element array pack/unpack 08:48
azawawi current pure perl6 implementation is currently too slow to create even 10_000 elements :) 08:49
tbrowder .tell ugexe how can i get a local install of rakudo to find Debugger::UI::CommandLine (and its dependencies) in system-wide COMPUNITS? alternatively, how can i get zef to —install-to=/some/path? 08:54
yoleaux tbrowder: I'll pass your message to ugexe.
azawawi geekosaur: thx 08:55
Geth mu: 2dee2e0297 | (Tom Browder)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
title change
09:02
AlexDaniel squashable6: next 09:28
squashable6 AlexDaniel, ⚠🍕 Next SQUASHathon in 1 day and ≈0 hours (2017-11-04 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
DrForr m: say sprintf "foo%d",Any; 10:48
camelia Died with X::Str::Sprintf::Directives::BadType
DrForr This doesn't have a proper error with file/line. 10:49
AlexDaniel DrForr: RT#126063 10:53
synopsebot RT#126063 [new]: rt.perl.org/Ticket/Display.html?id=126063 printf omits line number in error message
DrForr Aha, good to know.
Maybe I should join the squashathon... 10:54
AlexDaniel \o/
.pizza DrForr
buggable: pizza DrForr
buggable DrForr, enjoy this slice of Chicken Mexican Red Wave pizza, my friend! Yummy 🍕
DrForr Nom. 10:57
sacomo Hi all, is there a way to dynamically load a module, require ::('Foo::Bar'), and access its `our` subroutines? 11:00
wander sacomo, docs.perl6.org/language/modules#require 11:02
so it is "require"
sacomo wander, thanks, I have been trying that... 11:03
sacomo trying to access the subs using the ::('Foo::Bar')::subname(), but that doesn't seem to work. I have also tried ::('Foo::Bar::subname')(), but no go... 11:07
ah, got it 11:08
&::('Foo')::bar();
Geth ecosystem: 52c0623124 | (Zoffix Znet)++ (committed using GitHub Web editor) | META.list
Move module from CPAN
12:19
kalkin- hi 12:24
m: class F { has @.color[4] = <1 2 3 4> }; my $f = F.new(); say $f.color; 12:25
camelia [(Any) (Any) (Any) (Any)]
kalkin- Why is the default array value not assigned?
kalkin- m: class F { has $f = 23 }; my $f = F.new(); say $f.f; 12:26
camelia No such method 'f' for invocant of type 'F'
in block <unit> at <tmp> line 1
kalkin- m: class F { has $.f = 23 }; my $f = F.new(); say $f.f;
camelia 23
Geth modules.perl6.org: aed4cb5740 | (Zoffix Znet)++ | lib/ModulesPerl6/Controller/Dist.pm
Properly escape README content; Zoffix--

Fixes #92
kalkin- If I don't use an array the default value is assigned to the class attribute, but in case of an array it's not 12:27
I think I'm missing something basic
Zoffix kalkin-: looks like a bug with defaults on shaped array attributes 12:28
kalkin-: would you file it, please?
huggable: rakudobugs
huggable Zoffix, Report bugs on github.com/rakudo/rakudo/issues/new
kalkin- m: class F { has @.color = <1 2 3 4> }; my $f = F.new(); say $f.color; 12:29
camelia [1 2 3 4]
kalkin- Zoffix: let me check first if I have an up to date rakudo version, because I remember Elizabet(?) fixed some shaped array bugs some time ago according to p6weekly 12:30
Zoffix kalkin-: I've just tried it locally on near-HEAD and it has the same bug
m: class F { has @.color[4] = <1 2 3 4> }; my $f = F.new(); say $f.color; 12:31
camelia [(Any) (Any) (Any) (Any)]
kalkin- Zoffix: ok, opening a bug thank you
Zoffix And well, the bot uses HEAD
m: class F { has @.color[4]; submethod BUILD (:@!color = <1 2 3 4>) {} }; my $f = F.new(); say $f.color;
camelia [1 2 3 4]
Zoffix m: class F { has @.color[4]; submethod TWEAK (:@!color = <1 2 3 4>) {} }; my $f = F.new(); say $f.color;
camelia [1 2 3 4]
Zoffix kalkin-: ^ you can use that as a workaround in the meantime
(the TWEAK one; BUILD works too but it disables handling of defaults on all the other attributes) 12:32
kalkin- Zoffix: thanks for the hint!
Zoffix sacomo: you can also save the thing `require` returns and use that instead of having to type ::("") thing all the time: `unit module Foo; our sub meow {say "meow"}` and then `my \M = (require ::("Foo")); M::meow'` 12:33
Zoffix & 12:34
kalkin- Done: github.com/rakudo/rakudo/issues/1226 12:37
lizmat m: class A { has @.a[4] = <a b c d e> }; dd A.new.a # this should die, but doesn't 12:40
camelia Array.new(:shape(4,), [Any, Any, Any, Any])
lizmat so it looks like .STORE is not being called
m: class A { has @.a[4] = <a b c d e> }; dd A.new.a(a => (1,2,3,4)) # also not working 12:42
camelia Array.new(:shape(4,), [Any, Any, Any, Any])
wander kalkin-, it works well on the version I use 13:15
I reply you on the issue
with version
This is Rakudo version 2017.10-64-g697e4ecff built on MoarVM version 2017.10-29-g116c7a13 implementing Perl 6.c.
$ perl6 -e 'class F { has @.color = <1 2 3 4>; }; my $f = F.new(); dd $f.color'
> Array @!color = [IntStr.new(1, "1"), IntStr.new(2, "2"), IntStr.new(3, "3"), IntStr.new(4, "4")]
oops 13:17
if you try to fix size, then the issue occurs, sorry.
sacomo Zoffix: thanks, that should come in handy. 13:33
wander timotimo, irclog.perlgeek.de/perl6/2017-11-01#i_15388148 13:42
is that means "The regex engine tries to find a match inside a string by searching from left to right." will be wrong?
kalkin- wander: I have a typo in the issue, I meant shaped arrays @.color[4] = … 13:46
Fixed the issue
m: class F { has @.color[4] = <1 2 3 4> }; my $f = F.new(); say $f.color; # @wander
camelia [(Any) (Any) (Any) (Any)]
wander In grammar, `token func-def { <type> <id> <.update-symtab> <func-body> }` with action object, its behavior depends on in which order it parse. 13:47
kalkin-, :)
wander moritz, what is the convenience we use "<|w>" and ">>", "<<" 14:14
they are quite of same usage 14:15
moritz << only matches a left word boundary
>> only matches a right word boundary
m: say "stuff here!!!".subst(:g/, />>/, '|') 14:16
camelia 5===SORRY!5=== Error while compiling <tmp>
Preceding context expects a term, but found infix , instead
at <tmp>:1
------> 3say "stuff here!!!".subst(:g/,7⏏5 />>/, '|')
moritz m: say "stuff here!!!".subst(:g, />>/, '|')
camelia stuff| here|!!!
moritz m: say "stuff here!!!".subst(:g, /<</, '|')
camelia |stuff |here!!!
moritz m: say "stuff here!!!".subst(:g, /<?wb>/, '|')
camelia |stuff| |here|!!!
wander I saw the difference, thank you 14:17
Geth doc: b00b047e8b | (Alex Chen)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
Update regexes.pod6

1. Remove `=head1 Look-around assertions` and put `Lookahead/Lookbehind assertions` into `Anchor`
2. Add example to show difference between C«<|w>» and C<«>, C<»>:
14:41
synopsebot Link: doc.perl6.org/language/regexes
COMBORICO1611 Can someone read this in English for me? / ( [ \d. ] ** 1 . . 3 \. ] ** 3 \d ** 1 . . 3 ) /; 15:19
COMBORICO Nevermind, finally got it. 15:23
AlexDaniel` squashable6: next 15:45
yoleaux 31 Oct 2017 10:51Z <wander> AlexDaniel`: ^^
squashable6 AlexDaniel`, ⚠🍕 Next SQUASHathon in ≈18 hours (2017-11-04 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
COMBORICO1611 m: my $string = "IP address: 17.125.246.28;" ; say ~$/ if $string ~~ / ( [ \d ** 1 . . 3 \. ] ** 3 \d ** 1 . . 3 ) / ; 15:50
camelia ( no output )
wander whitespace important 15:54
m: my $string = "IP address: 17.125.246.28;" ; say ~$/ if $string ~~ / ( [ \d ** 1..3 \. ] ** 3 \d ** 1..3 ) / ;
camelia 17.125.246.28
wander '1 . . 3' is surely different from '1..3'
COMBORICO1611 I see. Thank you. 15:55
I'm trying to find out how [\d] is being applied outside of its grouping
Specifically, with the second **.
(If that is even correct.) 15:56
wander m: say "IP address: 17.125.246.28;" ~~ /( ( \d ** 1..3 \. ) ** 3 (\d) ** 1..3 )/ ; 15:58
camelia 「17.125.246.28」
0 => 「17.125.246.28」
0 => 「17.」
0 => 「125.」
0 => 「246.」
1 => 「2」
1 => 「8」
wander that is it
timotimo wander: the optimizer is allowed to do whatever it wants as long as the result is the same 15:59
yoleaux 12:25Z <Zoffix> timotimo: there looks to be a stale PR by you to mp6o: github.com/perl6/modules.perl6.org...l/86/files IIRC the problem with it was that data fetcher doesn't fetch travis files
tbrowder .tell moritz check yr gmail address when you get a chance, please
yoleaux tbrowder: I'll pass your message to moritz.
timotimo i.e. it's allowed to cheat as much as it wants as long as it knows it won't get caught
COMBORICO1611 Hmm. Thank you for your help. 16:01
wander timotimo, thanks. I think anyway actions should apply from left to right, otherwise actions within grammar become unreliable. 16:02
timotimo i'm refering only to inside a single regex
wander XD 16:03
moritz actions are applied in the order their regex calls match
yoleaux 15:59Z <tbrowder> moritz: check yr gmail address when you get a chance, please
moritz with alternations or quantifiers, than can be different from left-to-right
wander sounds reasonable 16:06
cannot wait to read your 'Parsing with Perl 6 Regexes and Grammars' 16:08
COMBORICO Where ** 3, what is specifying \d? It seems ** 3 is isolated on its own. How does regex know it is suppose to be \d ? 16:13
Juerd ** applies to the one thing that comes before it 16:14
COMBORICO But before it is a group statement thing [d\ ** 1..3] . So is it d\ ** 1-3 or 3 ? 16:16
moritz COMBORICO: so, regexes are made out of terms and operators, just like regular Perl 6 code
timotimo that matches a d and then one to three spaces 16:17
moritz COMBORICO: and these operators have relative precedence, and the precedence decides what a quantifier applies to
the most common operators are concatenation (which is invisble, the default operator basically), |, || and quantifiers 16:18
wander COMBORICO: '**3' modify '[ \d ** 1..3 \. ]'
moritz quantifiers have the tightest precedence, so in "ab+" or "a b+" or however you write it, the quantifier only quantifies the last atom
moritz of course, grouping constructs have even tighter precedence, so in / [a b]+ /, it matches ab, abab, ababab etc. 16:19
wander most of these should be documented in docs.perl6.org/language/regexes 16:20
COMBORICO I'm starting to get it.
moritz wander: I tried to write down everything I knew about regexes and grammars, and it became more than 150 pages, and I still discover stuff that's I know and that's not included in the book :-) 16:21
the rabbithole goo^Hes deeeep
COMBORICO1611 So it is analogous to Order of Operations in math. [ 5x -1 ] ** 3, where the only thing that can be maniplated by ** 3 is x ( in our case, \d ). 16:22
(I'm mixing math and Regex in the above.) 16:23
wander moritz: yes, once you build a new tool/language, you can never image how people will use it 16:24
COMBORICO1611 So ** 3 knows it cannot "fraternize" with ** or 1..3, but only \d.
Thanks for the help!
wander I think '**3' modify the whole '[ \d ** 1..3 \. ]' 16:26
just like
m: my regex wrapped { \d ** 1..3 \. }; say "IP address: 17.125.246.28;" ~~ /(<wrapped> ** 3 (\d) ** 1..3 )/ ;
camelia 「17.125.246.28」
0 => 「17.125.246.28」
wrapped => 「17.」
wrapped => 「125.」
wrapped => 「246.」
0 => 「2」
0 => 「8」
COMBORICO Let me live my lie! I don't want to move on to the next page! J/k. 16:31
I mean i want to move on.
wander curious about when Learning Perl 6 publishes 16:41
COMBORICO1611 m: my $string = "IP address: 17.125.246.28;"; my $octet = = rx{(\d ** 1..3) <?{0 <= $0 <= 255 }>}; say ~$/ if $string ~~ /([<$octet> \.] ** 3 <$octet>)/; 16:50
camelia 5===SORRY!5=== Error while compiling <tmp>
Preceding context expects a term, but found infix = instead
at <tmp>:1
------> 3 address: 17.125.246.28;"; my $octet = =7⏏5 rx{(\d ** 1..3) <?{0 <= $0 <= 255 }>};
COMBORICO1611 I knew it was a typo!
I like the color coding error message. Good stuff. 16:51
I also like how the arrow thing looks like a pile of dog crap.
COMBORICO Moritz, i appreciate the insight into most common operators for rejects. It is definitely helpful to know what to focus on. 17:06
COMBORICO1611 Can someone explain this: my $str = "<c>foo</c> <a>foo</a>"; 17:19
perlpilot COMBORICO1611: it's a lexical scalar that's been assigned a string. :-) 17:20
COMBORICO1611 $str ~~ s!'<a>foo</a>'~<a>bar</a>!;
Heh. I knew I wouldn't get the rest out before a comment. 17:21
Shoot! forgot a !
$str ~~ s!'<a>foo</a>'!<a>bar</a>!; 17:22
COMBORICO1611 I need to try different IRC client -- Quassel is too small a font. Zooming in makes things worse. 17:22
perlpilot COMBORICO1611: so ... what actually needs explaining? 17:23
geekosaur it's a substitution, using ! as the delimiter
COMBORICO1611 So ! is taking the place of / / ? 17:24
perlpilot yep
geekosaur perl 6 regex has more metacharacters and you need to quote things that are to be matched literally if thet contain special characters (like < >)
COMBORICO1611 What about the middle ! one?
perlpilot s/// -> s!!!
geekosaur s/// becomes s!!!
s/ pattern / replacement /
COMBORICO1611 What the!?
COMBORICO1611 So the middle ! is some kind of operator 17:26
?
perlpilot separator
geekosaur s! pattern ! replacement !
COMBORICO1611 Are the first and last ! also separators?
geekosaur were you expecitng ti to turn back into a / or are you just confused about substitution syntax? 17:27
perlpilot COMBORICO1611: those are delimiters ;)
COMBORICO1611 I'm not sure, geekosaur. The title of the section is s/search/replace Construct
very little explaining :(
geekosaur it's missing the closing delimiter sigh
COMBORICO1611 Okay, so we got two delimiters (front and back !) and one separator, the ! inthe middle. 17:28
HUH? You saying ther eis a typo inthe book?
geekosaur apparently, since this is apparently something that needs to be explained even though it's a fairly coimmon construct 17:30
so it should probably be as pedantic as possible rather than assuming the reader has already encountered all the other uses of it
COMBORICO1611 Ya, this book needs more pedagogory. 17:31
perlpilot COMBORICO1611: which book is this?
COMBORICO1611 The only beginner programmer Perl 6 book. 17:32
I think this is the onlyone.
Think Perl 6.
Okay, armed with the knowledge that the first and last ! are delimiters, and the middle one is a separator, I'll go to lunch. 17:33
azawawi hi :) 18:12
azawawi geekosaur: ping 18:13
geekosaur muu
(qm... not entirely here) 18:14
*am
azawawi :)
geekosaur: Nearly there github.com/azawawi/scripts/blob/ma...rapper.pl6 # Packing natively msgpacks 18:15
geekosaur: turned out i need to wrap the msgpack C API since libmsgpack does not expose all pack api
once finished, Data::MessagePack will be way faster 18:17
azawawi what do you think is a good module name for a Data::MessagePack NativeCall wrapper? LibMsgPack? 18:19
moritz Data::MessagePack::Native ? 18:20
azawawi moritz: thx 18:22
ugexe if you name it LibFoo* it might end up on debian and such as liblibfoo-perl6 18:23
azawawi what about libCurl ? :) 18:24
LibCurl that is
moritz $ apt-cache search ^liblib|wc -l
4
this is on Ubuntu
ugexe only one is a legit liblib 18:25
(liblibrary and liblibre don't count) 18:26
azawawi gist.github.com/azawawi/130b6db09b...c389c39936 # A quick benchmark... Pure Perl 6 implemented excluded 18:30
implemented=implementation
COMBORICO m: my $str = "<c>foo</c> <a>foo</a>"; $str ~~ s!'<a>foo</a>'!<a>bar</a>!; 19:05
camelia ( no output )
buggable New CPAN upload: bamboo-0.000.003_20171102.tar.gz by PSIXDISTS cpan.metacpan.org/authors/id/P/PS/...102.tar.gz 19:06
New CPAN upload: DateTime-Parse-0.000.003_20171102.tar.gz by PSIXDISTS cpan.metacpan.org/authors/id/P/PS/...102.tar.gz
raschipi m: my $str = "<c>foo</c> <a>foo</a>"; say $str ~~ s!'<a>foo</a>'!<a>bar</a>!; 19:09
camelia 「<a>foo</a>」
kalkin- When I have some c code which will be build and wrapped by my project, where do I put it in the project structure? 19:10
COMBORICO m: my $str = "<c>foo</c> <a>foo</a>"; $str ~~ s!'<a>foo</a>' !<a>bar</a>!; 19:11
camelia ( no output )
kalkin- Do I put it in src? In ccode? In ext? In vendor?
raschipi COMBORICO: Camelia isn't the REPL, you need something to do output there or it won't.
COMBORICO Hmm. 19:12
So there is no typo m
M = ?
raschipi m: my $str = "<c>foo</c> <a>foo</a>"; $str ~~ s!'<a>foo</a>' !<a>bar</a>!; say $str 19:13
camelia <c>foo</c> <a>bar</a>
raschipi It's working but there wasn't any output.
COMBORICO First and last ! are delimiters, but what is middle ! 19:14
COMBORICO ! Is 19:14
geekosaur didn't we establish that? separator
s'pattern'replacement'
COMBORICO ! is separator?
geekosaur er
s!pattern!replacement!
COMBORICO Haha. Your funny.
moritz the s/// or s!!! thing consists of two parts 19:15
a search regex and a replacement string
COMBORICO HAHA this is funny.
moritz is it?
geekosaur why
MasterDuke i would say it's just another delimiter
COMBORICO I gotta talk to you guys off this phone and on a real keyboard. 19:15
geekosaur moritz, they've apparently never encountered sed-style substitutions before and are completely bewildered by it; this is the second time around asking the same questions 19:18
COMBORICO Under which subject in regex docs is this subject located? Substitution?
ugexe m: say q!hello! 19:21
camelia hello
COMBORICO Just like the search-and-replace editor's dialog box, the s/ / / operator has two sides, a left and right side. The left side is where your matching expression goes, and the right side is what you want to replace it with." 19:23
I don't believe this was ever established in the book. 19:24
Geth ecosystem: 6cffbb8c7e | (Ahmad M. Zawawi)++ (committed using GitHub Web editor) | META.list
Add MsgPack to ecosystem
19:48
AlexDaniel squashable6: next 20:00
squashable6 AlexDaniel, ⚠🍕 Next SQUASHathon in ≈13 hours (2017-11-04 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
AlexDaniel :O
squashable6 Webhook for perl6/doc is now active! Encourage flow. 20:03
AlexDaniel \o/
(that's just a webhook. The event will start in 13 hours as planned) 20:04
AlexDaniel hm somebody added 6lang tag to the doc repo. Cool :) 20:06
comborico1611 ^HOkay, one last thing on this question. Are the single quotes necessary in this Regex substitution operation: s!'<a>foo</a>'!<a>bar</a>! 20:22
geekosaur yes
comborico1611 Thanks! 20:23
geekosaur or, in that one it *might* be safe without, but <> is risky
hm, actually it's necessary hwere regardless
<> is special in perl 6 regex
comborico1611 I see. 20:24
geekosaur it would try to run a rule named a, then match foo, then become confused because </a> is not (I think) a defined extension syntax
comborico1611 So in general the use of the single quotes are a good idea with that s/ / / operator?
raschipi if you want to match literally, yes
comborico1611 Alright. Thanks. 20:25
comborico1611 At the moment, I prfer XChat the most. 20:35
raschipi m: my $new = 'word subst'; $new ~~ s/^'word'/foo/; say $new 20:36
camelia foo subst
raschipi In this substitution, the caret goes outside the quotes because it means the start of the string instead of a literal caret. 20:37
comborico1611 You're speaking of anchors ^ and $. 20:38
raschipi Yes, to get the special meaning they go outside the quotes. 20:41
comborico1611 Roger that. 20:41
raschipi m: my $new = '^word subst'; $new ~~ s/'^word'/foo/; say $new
camelia foo subst
raschipi Inside the quotes it's a literal caret.
comborico1611 I see. 20:42
comborico1611 Interesting how the substitution is done only once. $_ = 'There can be twly two'; s/tw/on/; # There can be only two, instead of, There can be only "ono" 20:45
perlpilot comborico1611: that's a bit of history. s/// == substitute once and stop. s:g/// == substitute "globally" on the string (i.e. every occurrence) 20:46
comborico1611 I see!
perlpilot I 20:47
comborico1611 Earlier, when y'all were saying s///, I was like what are y'all talking about!
Aye*
perlpilot comborico1611: it helps if you've played with tools like ed, sed, perl(5). :-) 20:48
vi(m)
etc.
comborico1611 I think I'm going to start with Emacs.
I like his tutorial.
Now I just need to figure out how to run XBindKeys so I can remap the arrow keys. 20:49
geekosaur what's wrong with the arrow keys? 20:50
comborico1611 Moving away from homerow.
azawawi Interesting, MoarVM panic: Heap corruption detected: pointer 0x7f3117f083a0 to past fromspace 21:00
AlexDaniel comborico1611: you sure you don't want to change the keyboard layout directly? 21:02
comborico1611 What do you mean?
AlexDaniel you can do stuff like 21:03
key <AC02> { [ s, S, Left, Left ] };
and then AltGr+s will be Left
comborico1611 Do that in what program?
AlexDaniel create your own xkb layout
comborico1611 I'm not talking about in code, I mean on my OS. 21:04
AlexDaniel you're using linux, right?
comborico1611 Yes.
geekosaur you can also do it with xmodmap and avoid the xkb runes
AlexDaniel here's an example gist.github.com/AlexDaniel/0ba2044...211e3d13bb
you put it somewhere, like $HOME/.xkb 21:05
geekosaur that said, rebinding arrows to be e.g. alt-foo may confuse programs that look specifically for alt+arrow keys
AlexDaniel the run something like this to activate: setxkbmap 'awesome' -option 'lv3:ralt_switch' -print | xkbcomp -I"$HOME/.xkb" - "$DISPLAY"
AlexDaniel then* 21:07
comborico1611 I see. Thanks. 21:10
ryn1x_ Why can I my @a = '/path/to/file', '/path/to/file2'; slurp @a[0], :bin; but I can't my @a = <'/path/to/file' '/path/to/file2'>; slurp @a[0], :bin; as in the second example I get: Failed to open file /currentdir'/path/to/file': Invalid argument 21:40
is an array created with < > different?
azawawi github.com/azawawi/scripts/blob/ma...sgpack.pl6 # at 100_000 list size dumps a heap corruption using rakudo latest 21:41
ryn1x_ what I access reference the string elem of the array created with < > and pass it to slurp it wants to concatenate it with ' ' to my current working directory... 21:42
when I reference*
geekosaur ryn1x_, <> acts like single quotes already 21:45
but with word splitting, minus quotes 21:46
geekosaur just omit the single quotes in the <> form 21:46
MasterDuke azawawi: have you run under gdb or valgrind? any info from them?
ryn1x_ geekosaur: Thanks... I thought it just let me omit the commas... 21:48
geekosaur if you want the quotes to work as well, use « » instead of < >
ryn1x_ ah ok. thanks! 21:49
geekosaur docs.perl6.org/language/quoting there's a rather bewildering array of quoting operators 21:50
azawawi MasterDuke: no but I saw a couple of "Heap corruption detected: pointer 0x7f3117f083a0 to past fromspace" while testing various list sizes
MasterDuke do you have valgrind and/or gdb installed? could try running with perl6-gdb-m or perl6-valgrind-m then, they'll help find the problem (especially if your moarvm is built with debugging enabled) 21:53
azawawi starts debugging it
COMBORICO That xmodmap thing is driving me nuts. 22:15
I am I'm trying to do is compose Ctrl + J 2 duplicate left
To duplicate 22:16
azawawi MasterDuke: i have also gdb installed, under perl6-debug-m.pl6 it throws an exception and stops in _pack
MasterDuke: any link to how to debug it?
MasterDuke can you type 'bt'?
azawawi gdb or perl6-debug-m? 22:17
MasterDuke and 'call MVM_dump_backtrace(tc)'
oh, gdb
i've never used perl6-debug-m much
maybe try 'say backtrace.new' 22:18
azawawi sorry a bit sleepy lol 22:22
gist.github.com/azawawi/a65f86dc84...93ed31a5b9
MasterDuke huh, not a whole lot of info there 22:24
it's not segfaulting for me
This is Rakudo version 2017.10-103-gef84aafc0 built on MoarVM version 2017.10-35-g9b9bd1bf4
azawawi MoarVM panic: Heap corruption detected: pointer 0x7fbc4bf951b0 to past fromspace 22:26
random
MasterDuke valgrind might be better in this case 22:27
azawawi i think putting passing CStruct on the stack is maybe causing that (recursively)
MasterDuke could be, i really don't know NativeCall at all, so i'm afraid i'm not going to be much help 22:28
azawawi so far CStructs and CUnions have their own weird hidden bugs 22:29
MasterDuke also, you'll get more useful info out of gdb and valgrind if you build your moarvm with '--debug=3' 22:30
azawawi any idea what's the command line using rakudobrew? 22:31
MasterDuke heh, i did know at one point 22:32
azawawi installs valgrind 22:32
ugexe --configure-opts="--debug=3" or some such 22:33
or --configure-opts="--moar-option=--debug=3" 22:35
MasterDuke do you need to go three levels deep? --configure-opts="--moar-option=--debug=3"
MasterDuke azawawi: you're getting it with Data::MessagePack or your module? 22:37
azawawi mine 22:38
MsgPack
Data::MessagePack ... forget about getting more than 1000... so much slow :) 22:39
Great even ubuntu (travis ci) apt update is failing also lol 22:42
azawawi gist.github.com/azawawi/f23cd00275...7242652d1f 22:50
timotimo dang, that's not easy to debug 22:52
is it enough to git clone your repo and run that test file or do i need something else?
azawawi gist.github.com/azawawi/ef9a0f4b17...a69a34381f # full 22:55
timotimo yeah we don't need the leak report 22:56
azawawi timotimo: zef build . # to build resources/xyz.so
timotimo: sudo apt install libmsgpack-dev
timotimo i need your scripts repository? 22:57
azawawi examples 22:58
check out the last gist
please
timotimo the full leak check is pretty useless
moarvm just literally exits when it's finished, rather than going through all of its stuff and freeing things 22:59
azawawi at 5,000 only-ones list size, MsgPack (native wrapper) can do it in 0.76 secs vs 5.61s (pure implementation Data::MessagePack) :) 23:04
more than 10k, it fails because it is just too fast :) 23:05
timotimo um, huh.
the perl6-msgpack repo doesn't have the module that test-msgpack.pl6 uses 23:06
azawawi what's the error? 23:07
timotimo Could not find Data::MessagePack at line 4 in:
this repo only has MsgPack
azawawi git pull ? 23:08
timotimo already up to date 23:09
azawawi github.com/azawawi/perl6-msgpack/b...sgpack.pl6
timotimo where should i be looking?
that's a different script!
i can't install LibraryCheck 23:11
azawawi zef install LibraryCheck # not working? 23:13
timotimo nope, it doesn't pass its tests
now i gots the segfault 23:15
now i can apply Techniques 23:18
azawawi cool
MasterDuke i see it dying in interp.c:3002 (nqp::decont) 23:23
timotimo here it crashes in a guardconc :) 23:25
bleh. dumping the backtrace crashes inside gdb 23:26
MasterDuke same thing happens in lldb 23:29
MasterDuke hm, very different results if i add a `&& STABLE(OBJ)` into that conditional 23:33
timotimo: gist.github.com/MasterDuke17/ee516...4ca4e72e82
azawawi tomorrow im going to add macOS and windows support 23:45
azawawi thanks for helping me out on this one 23:45
more tests from Data::MessagePack (Thanks to pierre-vigier++) are now passing... Current missing features are pack (no hash and bin support yet) and unpack 23:47
The funny thing i started all this to get neovim API RPC properly working and acting as a client-server for Perl 6 scripts ... see neovim.io/doc/user/msgpack_rpc.html 23:51