Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-07-17

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 nicq201 joined #perl6
00:01 nicq201 Anyone know of a way to get more verbose output from '--target=parse'?
00:02 timotimo what is it that you need?
00:02 nicq201 I want to see what it grabs as whitespace.
00:03 timotimo ah, hehe
00:03 timotimo so the problem is it prints out the whitespace but you can't tell because it doesn't put it in quotes or anything
00:04 timotimo you can change how it dumps match objects by changing src/QRegex/Cursor.nqp "method dump"
00:04 timotimo after recompiling and reinstalling nqp you'll also have to recompile and reinstall rakudo
00:04 nicq201 Well, more that it does not tell me anything about whitespace...
00:05 timotimo oh?
00:05 timotimo ah
00:05 timotimo of courske
00:05 timotimo whitespace is matched as <.ws>, which means "don't capture it"
00:05 nicq201 Right.
00:06 nicq201 I was kind of hoping there was some hidden magic to have the kind of info shown.
00:06 timotimo there's also rxtrace, which shows a bunch of calls to _ws and ws and such, but it doesn't show from where it tries to match
00:07 timotimo --target=parse will not be able to do this at all, as it just dumps what the pase target spits out, and at that point the info is lost already
00:07 timotimo but rxtrace does see these calls, because it doesn't care about capturing or non-capturing
00:07 timotimo it's just not very informative
00:08 nicq201 Ah, I see...
00:09 nicq201 Well, now that I run some more tests, looks like that may not be my problem.
00:09 kurahaupo_ joined #perl6
00:09 nicq201 Seems I still can't get my slang to apply.  :/
00:13 timotimo dang
00:13 timotimo i think rxtrace should show when calls go to a different type than the parent caller had
00:13 nadim joined #perl6
00:13 timotimo so you could see exactly where a slang (or just going from main to regex or quote) happens
00:14 nicq201 Oh, that would be super useful! :D
00:18 timotimo hmm. the functionality is actually for very general call tracing
00:21 timotimo not quite sure how i'd put match-specific infrastructure there
00:23 nicq201 Well, this confirms that my slang does get applied until in another scope.
00:23 BenGoldberg joined #perl6
00:32 Cabanossi joined #perl6
00:35 nicq201 Do I need to re-apply a slang after re-defining it?
00:44 lookatme joined #perl6
00:44 lookatme morning
00:47 nicq201 lookatme: o/
00:47 lookatme nicq201, \o
00:54 lookatme Any link about this week blog?
00:57 nicq201 lookatme: This is the most recent I could find: https://p6weekly.wordpress.com/2017/07/10/2017-28-rakudo-is-hot/
00:59 lookatme nicq201, Thanks, I have read it yet
01:03 rmusial joined #perl6
01:52 samb1 joined #perl6
02:02 noganex joined #perl6
02:02 Cabanossi joined #perl6
02:03 faraco joined #perl6
02:08 mr-foobar joined #perl6
02:09 entonian joined #perl6
02:11 wamba joined #perl6
02:25 epony joined #perl6
02:35 entonian joined #perl6
03:00 noganex_ joined #perl6
03:06 nicq201 left #perl6
03:17 Cabanossi joined #perl6
03:24 gdonald joined #perl6
03:30 lookatme A running script start by old version rakudo. After I update rakudo to last version, it throw an exception when exit
03:44 AlexDaniel lookatme: ok, that's interesting
03:45 AlexDaniel lookatme: more information? :)
03:46 Cabanossi joined #perl6
03:48 lookatme https://gist.github.com/araraloren/6d29da6b001ed2ea2ae206a7dfebcaa1
03:48 lookatme AlexDaniel, code and exception
03:49 lookatme lunch time
03:50 AlexDaniel that's very interesting :)
03:52 AlexDaniel oh… that's also on 2017.07
03:54 AlexDaniel lookatme: I think you should submit a ticket
03:54 geekosaur o.O
03:54 geekosaur random strings more or less
04:05 El_Che joined #perl6
04:16 lizmat joined #perl6
04:22 entonian joined #perl6
04:29 mr-foobar joined #perl6
04:36 entonian joined #perl6
04:39 xtreak joined #perl6
04:43 lookatme AlexDaniel, Hmm, thanks
04:44 AlexDaniel lookatme: really, please do. Right now everyone is sleeping I think, so not much help
04:44 AlexDaniel lookatme: but if this is indeed a regression, then we probably want to do something with it…
04:46 lookatme ok, I will report later
04:48 mr-foobar joined #perl6
04:48 faraco joined #perl6
05:01 Cabanossi joined #perl6
05:06 Khisanth joined #perl6
05:12 nadim joined #perl6
05:25 lowbro joined #perl6
05:25 lowbro joined #perl6
05:28 parv joined #perl6
05:31 Cabanossi joined #perl6
05:42 mr-foobar joined #perl6
05:43 entonian joined #perl6
05:53 xtreak joined #perl6
05:53 statisfiable6 joined #perl6
06:08 espadrine joined #perl6
06:12 mr-fooba_ joined #perl6
06:30 xtreak joined #perl6
06:39 domidumont joined #perl6
06:44 domidumont joined #perl6
06:46 lizmat joined #perl6
06:47 andrzejku joined #perl6
06:54 nadim joined #perl6
06:58 domidumont joined #perl6
07:26 Manifest0 joined #perl6
07:29 zakharyas joined #perl6
07:29 abraxxa joined #perl6
07:39 rindolf joined #perl6
07:46 lizmat joined #perl6
07:52 wamba joined #perl6
07:54 darutoko joined #perl6
07:56 cosimo joined #perl6
07:57 gdonald joined #perl6
08:02 rindolf joined #perl6
08:15 dakkar joined #perl6
08:27 wamba joined #perl6
08:31 Cabanossi joined #perl6
08:42 xtreak joined #perl6
08:44 mingdao joined #perl6
08:46 xtreak joined #perl6
08:57 zakharyas joined #perl6
08:59 robertle joined #perl6
09:02 lizmat joined #perl6
09:06 abraxxa joined #perl6
09:13 andrzejku joined #perl6
09:36 samcv how do i grep all the modules?
09:55 xtreak joined #perl6
10:01 Cabanossi joined #perl6
10:05 ufobat joined #perl6
10:31 Cabanossi joined #perl6
10:43 xtreak joined #perl6
10:51 moritz git grep in https://github.com/moritz/perl6-all-modules
10:51 moritz oops, that hasn't updated in a month :(
11:02 lizmat joined #perl6
11:10 rindolf joined #perl6
11:19 lizmat joined #perl6
11:42 lumimies joined #perl6
11:42 stmuk http://pl6anet.org/drop/rakudo-star-2017.07-RC0.tar.gz
11:45 Juerd My mother always told me never to run arbitrary code from the internet without checking signatures first
11:46 Morfent joined #perl6
11:47 stmuk did she explain how to distribute keys as well?
11:49 Juerd Heh, nope :)
11:59 xtreak_ joined #perl6
12:02 ocn joined #perl6
12:03 ocn left #perl6
12:08 xtreak joined #perl6
12:14 [Coke] .
12:31 perlpilot joined #perl6
12:31 Cabanossi joined #perl6
12:42 zakharyas joined #perl6
12:51 daxim http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0244r2.html    #  C++ 2020 string handling, being able to iterate over code points, will be as good as 2002 Perl
12:58 domidumont joined #perl6
13:01 devmikey joined #perl6
13:02 mcmillhj joined #perl6
13:04 tyil[m] are there any dbgp compatible debugging systems for perl 6 yet?
13:13 daxim do you have a specific debugger you want to use in mind? (just curious)
13:17 nowan joined #perl6
13:46 skids joined #perl6
14:01 Cabanossi joined #perl6
14:16 cdg joined #perl6
14:19 cdg_ joined #perl6
14:22 dogbert17 joined #perl6
14:28 tyil[m] p6: "pomf".reverse.say
14:28 camelia rakudo-moar 2f5a6c: OUTPUT: «(pomf)␤»
14:28 tyil[m] why is this not reversed :(
14:28 jnthn Because reverse is for reversing lists
14:28 tyil[m] hmm
14:28 tyil[m] that makes sense
14:28 jnthn Use .flip
14:29 tyil[m] thanks :>
14:30 * [Coke] wonders what problem having .reverse on a Str is intended to fix.
14:30 Geth ¦ doc: b09385a173 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/IO/Handle.pod6
14:30 Geth ¦ doc: Document .DESTROY doesn't close standard handles
14:30 Geth ¦ doc: review: https://github.com/perl6/doc/commit/b09385a173
14:31 timotimo [Coke]: it's just about having all listy methods on single things
14:31 jnthn [Coke]: Not having to remember which list operations turn an item into a 1-element list and which don't, by having them all do so
14:34 Geth ¦ doc: a75410cfd6 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/IO/Handle.pod6
14:34 Geth ¦ doc: Document '-' path specialness in 6.c language
14:34 Geth ¦ doc: review: https://github.com/perl6/doc/commit/a75410cfd6
14:36 Geth ¦ doc: 075503b40b | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/IO/Handle.pod6
14:36 Geth ¦ doc: Document .closing standard handles
14:36 Geth ¦ doc:
14:36 Geth ¦ doc: will lead to inability to open them again
14:36 Geth ¦ doc: review: https://github.com/perl6/doc/commit/075503b40b
14:37 gabc left #perl6
14:46 Cabanossi joined #perl6
14:50 evanm joined #perl6
14:50 khw joined #perl6
14:53 domidumont1 joined #perl6
14:53 AlexDaniel joined #perl6
14:56 Voldenet What's the fastest method to store large hashes in p6? I need to store parsed logfiles that are quite large in size and the parsing process takes a while
15:01 araraloren joined #perl6
15:03 pmurias joined #perl6
15:04 araraloren Can I have an attachment when report a bug ?
15:05 pmurias jnthn: for example nqp::continuationcontrol($protect, ...) has a $protect flag that can be 0 or 1 while rakudo always seems to pass 0 there
15:13 alimon joined #perl6
15:14 araraloren OK, I report that bug : perl #131758
15:14 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=131758
15:18 araraloren And the gist: https://gist.github.com/araraloren/6d29da6b001ed2ea2ae206a7dfebcaa1
15:33 timotimo Voldenet: if you store them split by null bytes you can write them out and read them back pretty fast
15:33 timotimo if it's just a hash with string keys and string values
15:48 domidumont joined #perl6
15:56 wamba joined #perl6
16:01 zakharyas joined #perl6
16:11 nadim joined #perl6
16:12 mcmillhj joined #perl6
16:32 mcmillhj joined #perl6
16:44 domidumont joined #perl6
16:44 mspo joined #perl6
16:45 shmibs joined #perl6
16:47 ribasushi joined #perl6
16:47 mcmillhj joined #perl6
16:48 robertle joined #perl6
16:55 Geth ¦ doc: 643eb79375 | MasterDuke17++ (committed using GitHub Web editor) | doc/Language/concurrency.pod6
16:55 Geth ¦ doc: Remove space before a period
16:55 Geth ¦ doc: review: https://github.com/perl6/doc/commit/643eb79375
16:59 Voldenet timotimo: well, it's a hash that contains arrays, so I guess I'd need to use some legit serialization format, but "what's the fastest" question still remains
17:00 timotimo if it's just a hash from string to array, it'll be rather easy to do with null separators only
17:00 timotimo as long as your strings will never have null in them, of course
17:00 timotimo just put two nulls in a row after the last entry of the array, or put the number of entries in the array in front of the entries
17:01 |oLa| joined #perl6
17:03 zakharyas joined #perl6
17:04 Geth ¦ doc: 4009d72210 | MasterDuke17++ (committed using GitHub Web editor) | doc/Language/concurrency.pod6
17:04 Geth ¦ doc: Correct an i.e. to e.g.
17:04 Geth ¦ doc: review: https://github.com/perl6/doc/commit/4009d72210
17:09 kurahaupo joined #perl6
17:21 nhywyll joined #perl6
17:22 mienaikage joined #perl6
17:22 leont_ joined #perl6
17:22 sjoshi joined #perl6
17:29 Matthew[m] joined #perl6
17:29 ilmari[m] joined #perl6
17:29 tyil[m] joined #perl6
17:29 unclechu joined #perl6
17:29 mack[m] joined #perl6
17:29 tadzik joined #perl6
17:30 CIAvash[m] joined #perl6
17:30 dp[m] joined #perl6
17:30 xui_nya[m] joined #perl6
17:31 Manifest0 joined #perl6
17:32 lizmat joined #perl6
17:39 zengargoyle Voldenet, timotimo: there are a plethora of control characters other than \0 that could be used in serialization. SOH, STX, ETX, EOT, FS, GS, RS, US, maybe others that shouldn't interfere with ascii/utf8 data. (i'm sure they meant something else at some point in the past for serial communications... but they work pretty well as multiple \0 types).
17:41 amalia__ joined #perl6
17:42 zengargoyle you can probably use everything below 0x20 as long as you're not going to try and send it to a terminal in raw form.
17:43 zengargoyle well modulo the BS/CR/NL/VT/FF type stuff which may be in data already.
17:59 geekosaur a common way to deal with embedded nul in utf8 data is to encode it non-normalized (c0 80 being the most common; also used to roundtrip them through C APIs).
18:01 geekosaur (and note that if someone actually used that in data it should probably be utf8-c8 which again encodes differently, so c0 80 should still be safe for this)
18:06 zengargoyle geekosaur: can the c0 be used to embed all of the ascii chars?
18:08 geekosaur yes, it's just the non-normalized form (so technically illegal but somewhat widely used as an extension). it's the trivial case for the protocol that lets codepoints >0x7f be encoded in bytes
18:08 geekosaur well, not the trivial case, that's normalized <0x80. but it's how those would get encoded if run through the protocol
18:10 zengargoyle *nods* i think i get it.
18:24 Dunearhp joined #perl6
18:28 Voldenet Oh, I just assumed there was such a /trivial serialization/ lib, but I think writing one isn't going to be extremely hard
18:28 Voldenet The trivial version could be far from fast though, I'm afraid
18:43 zengargoyle Voldenet: out of curiosity, how large of a hash-of-arrays is 'large'?
18:43 zengargoyle and how slow is 'slow'?
18:44 Voldenet 400k rows with a ~20 fields each atm, slow is 4-5 minutes
18:44 Voldenet but since it's log-like, it will grow
18:45 zengargoyle plain ascii like generic log file text or anything really weird?
18:46 Cabanossi joined #perl6
18:48 * zengargoyle tended to use '^' as a field sep and "n" as record sep because it worked for my data and was still text-mungeable.
18:48 Voldenet plain-ish, there are some rows connected to each other
18:48 Voldenet so you have to build hashes, compare 3-4 fields during import
18:50 Voldenet it just occured to me I could use plain and simple CSVs with a bit of hacks :>
18:51 Voldenet it'll feel a lot like reinventing the wheel
18:53 espadrine joined #perl6
18:54 sjoshi joined #perl6
18:54 Voldenet and I'd welcome some high-performance serialization lib recommendation for p6 :)
18:54 zengargoyle about 50% of last $WORK was p5 hackery by tailing or otherwise large logfiles so i'm curious but have no answers. :)
18:56 zengargoyle i have a slightly buggy p5 module that can tail intermittantly via cronjobs that handles rotations and compression.  on my TODO list....
18:57 Voldenet hmm, I could just implement it in C as a part of moarvm and smuggle nqp::deserialize_native and nqp::serialize_native in :>
18:57 zengargoyle last time it broke was when hardware went *boom* and was restored from backups and it got a bit confused.
18:59 Voldenet that'd be the ultimate "hacky solution", but I'm sure I can count on C's performance :-)
19:00 jnthn Voldenet: Less hacky would be to call the C code from NativeCall :)
19:00 jnthn There's even a module that handles compiling the C code on different platforms
19:03 Voldenet oh, I see there's MVM_serialization_serialize already
19:05 geekosaur that is likely to be specific to mvm bytecode though
19:06 Voldenet Usage is okay-ish, if it fails I can just discard all the pre-parsed data
19:09 evanm joined #perl6
19:10 jnthn If you're going to use it, you should know that all data you serialize with it will be invalidated whenever you upgrade your Rakudo
19:11 Voldenet Yeah, it's totally fine, at the moment I just re-parse logs whenever I start the app, so trying to use pre-parsed data would be some boost anyway :P
19:12 jnthn Though note that if you just write a module that does something like constant foo = do { ...code that parses the logs... }
19:12 jnthn Then it'll use that very mechanism under the hood to serialize the result of that do block :)
19:12 jnthn Plus you'll get automatic invalidation if you upgrade your Rakudo.
19:13 jnthn Similar tricks are possible with sub EXPORT
19:13 jnthn Which could be even neater :)
19:14 evanm Hi, is itemization the same idea as hashrefs / arrayrefs in Perl 5?
19:16 evanm The docs don't really define itemization, they just start talking about it with no context (eg https://docs.perl6.org/language/list#Arrays)
19:19 TEttinger joined #perl6
19:20 zengargoyle i thought item was more like don't do any auto flat/slip sort of thing in places where @ or % would DWIM into multiple things.
19:22 zengargoyle m: my @x = <one two>; for @x -> $x { $x.say }; for @x.item -> $x { $x.say }; for $@x -> $x { $x.say }
19:22 camelia rakudo-moar 91be8b: OUTPUT: «one␤two␤[one two]␤[one two]␤»
19:22 Zoffix joined #perl6
19:23 Zoffix evanm: this is a better read: https://docs.perl6.org/language/containers
19:23 zengargoyle m: my @x = <one two>; for @x, -> $x { $x.say }
19:23 camelia rakudo-moar 91be8b: OUTPUT: «5===SORRY!5===␤Expression needs parens to avoid gobbling block␤at <tmp>:1␤------> 3@x = <one two>; for @x, -> $x { $x.say }7⏏5<EOL>␤Missing block (apparently claimed by expression)␤at <tmp>:1␤------> 3@x = <one two>; for @x, -> $x …»
19:24 evanm Zoffix: thanks, I'll take a look
19:24 zengargoyle m: my @x = <one two>; for (@x,) -> $x { $x.say }
19:24 camelia rakudo-moar 91be8b: OUTPUT: «[one two]␤»
19:24 evanm The first mentions of itemization in the Array docs are pretty confusing
19:24 evanm The first mention is: "Arrays differ from lists in three major ways: Their elements may be typed, they automatically itemize their elements, and they are mutable." (no definition provided)
19:24 Zoffix evanm: I'd say it's similar to behaviour in Perl 5, yes, but has an entirely different concept under the hood. Iterables in scalar containers will get treated as single items, rather than examined for the items they contain
19:25 Zoffix evanm: yeah, itemization is a poorly documented concept. Probably not a good term either (that I may be guilty of popularizing).
19:25 geekosaur it's addressing the same issue, but doing so very differently
19:25 evanm The second mention is: "First, be aware that because itemization in Arrays is assumed, it essentially means that $(…)s are being put around everything that you assign to an array, if you do not put them there yourself." (still not sure what they're talking about)
19:25 geekosaur the issue being "when are you talking about the container itself, vs. when are you talking about its contents?"
19:26 Zoffix evanm: would you write down your comments as an Issue in the docs repo, so the docs could be improved? https://github.com/perl6/doc/issues/new
19:26 evanm geekosaur: thanks.
19:27 evanm When $(...) is mentioned, does this mean it's the equivalent of putting  $(...) around only arrays/lists/hashes, or around everything (Ints, scalars, whatever)?
19:27 Zoffix Arrays give containers to their items, which is how they end up being mutable. Lists don't. So when you put another list in a list, it's still just a list you can iterate over, but if you shove one into an array, it'll get a scalar container for itself
19:27 Zoffix evanm: yeah, everything.
19:28 Zoffix m: my @a = (1, 2, 3), 42; .say for @a.head
19:28 camelia rakudo-moar 91be8b: OUTPUT: «(1 2 3)␤»
19:28 Zoffix m: my @a := (1, 2, 3), 42; .say for @a.head
19:28 camelia rakudo-moar 91be8b: OUTPUT: «1␤2␤3␤»
19:28 Zoffix ^ first one is an array that got the inner list in a container. Second one's a list that didn't give the list a container and you can see in second case, the items of the inner list got individually looped ovcer
19:29 Zoffix m: my @a := $(1, 2, 3), 42; .say for @a.head
19:29 Zoffix ...
19:29 camelia rakudo-moar 91be8b: OUTPUT: «Resource temporarily unavailable»
19:30 Zoffix Well, the output is `«(1 2 3)␤»` and this is 'cause we put that `$` up in there, giving the list a scalar container
19:30 Zoffix So it ended up being iterated as a single item, instead of the stuff inside of it being considered individually
19:30 Zoffix m: my @a := $(1, 2, 3), 42; .say for @a.head
19:30 camelia rakudo-moar 91be8b: OUTPUT: «(1 2 3)␤»
19:30 Zoffix m: my @a := $(1, 2, 3), 42; .say for @(@a.head)
19:30 camelia rakudo-moar 91be8b: OUTPUT: «1␤2␤3␤»
19:30 Zoffix ^ and here we took it outta that scalar container with the @() thing
19:31 setty1 joined #perl6
19:32 Zoffix And the difference between Perl 5 is you don't *need* to "itemize" Iterables to prevent them from being flattened when storing them in other things.
19:32 Zoffix m: say (1, (2, (3, %(:52a, :70b))))
19:32 camelia rakudo-moar 91be8b: OUTPUT: «(1 (2 (3 {a => 52, b => 70})))␤»
19:32 Zoffix m: say (1, (2, (3, %(:52a, :70b)))).flat # you can call .flat to flatten 'em
19:32 camelia rakudo-moar 91be8b: OUTPUT: «(1 2 3 a => 52 b => 70)␤»
19:33 Zoffix m: say (1, (2, $(3, %(:52a, :70b)))).flat # but "itemized" things won't get flattened, because they're being considered as an item in themselves instead of gutted for their contents
19:33 camelia rakudo-moar 91be8b: OUTPUT: «(1 2 (3 {a => 52, b => 70}))␤»
19:33 Zoffix </soliloquy>
19:33 Zoffix :)
19:33 Zoffix left #perl6
19:35 andrzejk_ joined #perl6
19:44 |oLa| joined #perl6
19:47 cdg joined #perl6
19:47 mr-foobar joined #perl6
19:51 moritz .
19:51 yoleaux 17:09Z <Zoffix> moritz: so I launched my own ilbot on v5.24.0 and there ain't no encoding issues. Is it possible the database was exported/imported incorrectly when the box was upgraded? I'm sick of broken logs and I wanna fix the issue. How?
19:52 moritz zoffix: I think it might be related to the upgrade from mysql do mariadb that was part of the Debian upgrade
19:52 moritz zoffix: if you want to help debug, /msg an ssh pubkey, and I can give you access
19:52 cdg_ joined #perl6
19:54 moritz ilbot has a wild, historically grown way of storing its data: as UTF-8 in latin 1 columns, iirc
19:59 lizmat decommute&
20:02 lizmat joined #perl6
20:02 lizmat PSA: Perl 6 Weekly will be a little later today
20:04 evanm yep still confused about containers
20:05 seatek joined #perl6
20:05 evanm are an array's containers immutable in a sense? Like the array can grow or shrink, and the contained things can change, but should I think of all arrays just as being arrays of containers?
20:05 Voldenet jnthn: the const trick in the module is quite neat, but then I suppose the module wouldn't allow passing arbitrary filenames to it and make things more magical
20:06 moritz evanm: there's nothing about arrays that's immutable; you can even replace the container by binding to an array element
20:06 Voldenet ...so I'll just stick to plain and /simple/ serialization (I guess it would require some additional magic describing expected moarvm version) :)
20:07 evanm moritz: right. okay.
20:09 Zoffix joined #perl6
20:10 moritz m: say 42
20:10 camelia rakudo-moar 91be8b: OUTPUT: «42␤»
20:11 Zoffix moritz: it's the last one in the list: https://github.com/zoffixznet.keys
20:15 moritz Zoffix: try ssh ilbot@tina.perlgeek.de
20:18 evanm So internally, even parameterized P6 arrays never look like C arrays, right? the array holds containers, and the containers point to objects which could be all over memory?
20:18 Zoffix evanm: in my imperfect understanding: you can thing of there just being scalar containers. A pudding cup is a scallar container and it contains one pudding (the stuff inside the container). Arrays are like a bunch of sequentially linked scalar containers: you can ask them for a third pudding cup and get it. Hashes are like labeled scalar containers: you can ask them for a lemon pudding cup and get it. However,
20:19 Zoffix nothing's stopping you from putting a bunch of jelly-beans inside of your pudding cup. It's just when you ask for them, you'd get a single bunch (whatever fits into a pudding cup). If you want to consider jelly beans individually, you gotta take them out of the cup (using @() or %() or other means).
20:19 Zoffix evanm: I'd think it's implementation detail.
20:19 moritz evanm: native arrays are an exception
20:19 Zoffix moritz: thanks. Will try when I gey home
20:20 Zoffix moritz: are they guranteed in Perl 6 to be contiguous in memory?
20:20 pilne joined #perl6
20:20 moritz Zoffix: I don't know
20:22 S007 joined #perl6
20:22 nadim joined #perl6
20:22 raiph joined #perl6
20:22 mr-foobar joined #perl6
20:24 evanm Zoffix: to extend the analogy, with a List you have to provide your own cups?
20:25 evanm re: contiguity, memory layout is an important detail for heavy number-crunching applications
20:27 Zoffix evanm: you could if you wanted to. That's one way to make stuff mutable and how an Array is made outta a List
20:27 raiph evanm: take care to consider a key distinction related to data structures bound to `@` symbols and thus also its elements
20:27 timotimo native shaped arrays are guaranteed to be contiguous storage
20:27 raiph evanm: native arrays vs non-native arrays
20:28 Zoffix and if you don't provide your own cups you just get stuff as is :) ummm in plastic bags. So you can still see your bundles of jelly beans as bundles, but you can't modify the bundles ')
20:28 evanm native array = CArray ?
20:28 setty1 joined #perl6
20:28 moritz I meant more like my int @a
20:29 Zoffix timotimo: in Perl 6 spec? Or just Rakudo's implementation detail?
20:29 Zoffix raiph: what's the distinction?
20:30 mspo left #perl6
20:30 timotimo i think the whole point of native shaped arrays is to have that?
20:31 bpmedley joined #perl6
20:31 moritz the point is efficient access
20:31 Cabanossi joined #perl6
20:31 timotimo hmm
20:32 raiph evanm: aiui, yes
20:32 timotimo no, raiph
20:32 timotimo CArray is different still
20:32 raiph ok
20:32 raiph i wondered
20:32 timotimo native array is "my int @foo"
20:32 timotimo CArray is my @foo := CArray.new(1, 2, 3);
20:32 evanm Zoffix: Ok thanks. I'll play around in the shell and make some diagrams, I'm finding it hard to "see it" with just p6 syntax
20:33 setty1 joined #perl6
20:33 raiph evanm: I agree that both the word "item" and its doc is weak
20:33 raiph evanm: or rather, perhaps you are just wondering but I don't like the way we use the word "itemize" in the opposite sense from the conventional one
20:34 geekosaur unfortunately 'containerize' is already in use for a lower level concept relevant to moarvm
20:34 raiph i propose s/item/individual/
20:34 geekosaur we could piss everyone off and call it 'idem' :p
20:35 raiph i know it's longer, but it preserves something i really, really like which is that it starts with I
20:36 Zoffix maybe something that means "one thing"... like... scalar :)
20:36 raiph because i like the mnemonic that a $ symbolizes an Individual in Scalar (or Item in Single Container)
20:36 geekosaur raiph, I think that has the same problem, it makes me think it means the individual contents instead of the thing itself
20:36 raiph and then an Array individualizes the individuals that it stores
20:37 cdg joined #perl6
20:38 raiph speaking as an individual, i most protest of this talk of me as my individual contents rather than me as myself (thing in my itself, if you must) :)
20:38 futura joined #perl6
20:38 Zoffix evanm: FWIW, I struggled to understand these, until I stopped trying to link the sigils into the equation. The $, @, % and & don't matter much amd are more about the defaults rather than dictating what type of "container" you get. So once you realize that, then an Array in $ sigil or a list in % sigil don't look weird
20:39 cdg joined #perl6
20:40 cdg__ joined #perl6
20:44 timotimo but you don't get to put a list into a % sigil?
20:44 Triplefox left #perl6
20:45 Zoffix You can if you want to
20:47 futura joined #perl6
20:48 Zoffix which I'm totally forgetting how to do
20:48 Zoffix you need to add is Positional or of Positional or something or other. Basically retype it from Associati e
20:49 Zoffix you can't do that on & sigil tho; it says it's NYI
20:50 evanm What does this mean? "use Arrays as non-itemized lists of itemized lists, if appropriate"
20:50 S007 joined #perl6
20:51 evanm https://docs.perl6.org/language/list#Itemization bullet point 4
20:51 Zoffix I remember commenting examples on reddit... maybe I'm misremembering :(
20:52 geekosaur [[a,b,c],[d,e,f]] instead of it turning into [a,b,c,d,e,f]
20:52 geekosaur erm, parens not p[
20:52 geekosaur not []
20:53 geekosaur if you @a = @b, @c then you get @b and @c flattened, if you @a = $@b, $@c then they remain (sub)lists
20:54 * Zoffix cringes at that gather/take flattening approach :(
20:56 Zoffix m: my %list is Array = (1, 2, 3); dd %list
20:56 camelia rakudo-moar 91be8b: OUTPUT: «[1, 2, 3]␤»
20:56 AlexDaniel heh
20:56 Zoffix I guess what I was thinling of was that ^
20:58 Zoffix left #perl6
21:01 evanm geekosaur: so the rule means the Array itself should be itemized, when it appears inside of a list?
21:04 geekosaur evanm, the rule means you can put a list inside another list _as a list_, not as its contents
21:04 geekosaur which is what would normally happen
21:04 skf joined #perl6
21:05 raiph evanm: A courtesy to consider, not a rule, but my, that looks like a lot to consider; and then reading it...
21:07 evanm geekosaur: that sentence still isn't parsing for me. "use Arrays as non-itemized lists of itemized lists".
21:07 evanm My understanding was that arrays are always itemized
21:07 geekosaur but you can use them in contexts that want lists
21:08 geekosaur so they turn into lists. but that means they no longer get automatic itemization
21:09 shlomif joined #perl6
21:10 evanm So if I return an Array where a List is expected, the entries lose their containers?
21:10 geekosaur let's try this again.
21:10 evanm The "courtesies" are talking about return values, so I'm not sure how to map your assignment examples onto what the docs are talking about
21:11 evanm I guess I'd like to see a conforming function and a non-conforming function
21:12 geekosaur the default when you return more than one thing from a function is a list. this will not be automatically itemized
21:12 geekosaur return @a, @b -- these get flattened even though they are Arrays
21:13 geekosaur return [@a, @b] -- this is an Array and the contents retain their Array-ness
21:13 geekosaur in perl 5, your only option is the first one and you would need to use arrayrefs to get the second
21:14 geekosaur return $@a, $@b -- this explicitly itemizes the arrays so they don't get flattened into the result list. but this can be confusing
21:14 geekosaur so the second one is preferred because you are being explicit about what is going on
21:15 geekosaur (arrayrefs are actually more like the third option than the second; the second is not something perl 5 does)
21:15 raiph evanm: note that "itemizes" in P6/geekosaur's usage does not mean what it means at dictionary.com; it means something akin to the opposite of dictionary.com's meaning
21:16 mr-foobar joined #perl6
21:16 raiph itemifies would be perhaps better
21:16 geekosaur maybe idem's not such a bad idea after all
21:17 Voldenet Hmm, how to check if the object is null?
21:18 silug joined #perl6
21:19 evanm geekosaur: Ok, I understand your examples. I am still confused by the sentence. Your second example looks to me like more like "itemized list of itemized lists" rather than "non-itemized list of itemized lists"
21:20 Voldenet m: use nqp; my $null = nqp::null(); say nqp::isnull($null)
21:20 camelia rakudo-moar 91be8b: OUTPUT: «0␤»
21:20 timotimo Voldenet: you need to decont, i believe
21:20 Voldenet Ah, right.
21:20 geekosaur evanm, I think the doc was written for perl 5 users, for whom the outer list is the implicit one containing the result of the function
21:20 geekosaur that is the non-'item'ized list
21:21 Zoffix joined #perl6
21:21 Zoffix moritz: what db is the log data in?
21:21 * Zoffix doesn't wanna start dumping random dbs out :P
21:22 Zoffix ah, got it from config file. nevermind :)
21:22 geekosaur (I get that interpretation from the context of that list of considerations.)
21:23 Zoffix Voldenet: or just bind instead of assign: m: use nqp; my $null := nqp::null(); say nqp::isnull($null)
21:23 Zoffix m: my $null := nqp::null(); say nqp::isnull($null)
21:24 camelia rakudo-moar 91be8b: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Could not find nqp::null, did you forget 'use nqp;' ?␤at <tmp>:1␤------> 3my $null := nqp::null()7⏏5; say nqp::isnull($null)␤»
21:24 Zoffix m: use nqp; my $null := nqp::null(); say nqp::isnull($null)
21:24 camelia rakudo-moar 91be8b: OUTPUT: «1␤»
21:27 nadim Hi, I get this message "our printf-style directives specify 3 arguments, but 5 arguments were supplied" and that's it, no file, no line, nothing
21:27 Zoffix m: printf "%s"
21:27 camelia rakudo-moar 91be8b: OUTPUT: «Your printf-style directives specify 1 argument, but no argument was supplied␤␤»
21:27 Zoffix oops
21:27 Zoffix nadim: would you report it as a bug, please?
21:27 Zoffix huggable: rakudobug
21:27 huggable Zoffix, Report bugs by emailing to <rakudobug@perl.org>
21:28 nadim sure
21:28 Zoffix nadim: add --ll-exception flag and it should give more info
21:28 nadim ok
21:28 Zoffix hm, don't seem to point at it tho :(
21:28 Zoffix even with ll-exception
21:30 nadim is a printf style directive always a printf? at least that will narrow it down
21:32 nadim ah, I just has a single sprintf in the code, lucky me
21:33 Zoffix moritz: how can I restart the webservice to check if a fix worked?
21:37 skf Hi all! Have made my first ever module and uploaded it to github: https://github.com/svekenfur/Swedish-TextDates_sv.git The module takes a date (yyyy-mm-dd) and transforms it to swedish text, for example '2017 july fouth' expept in swedish :-) Does a module like that have a place in the ecosystem?
21:37 skf *fourth
21:39 Zoffix skf: sure, why not
21:40 gdonald joined #perl6
21:42 |oLa| joined #perl6
21:42 leont_ joined #perl6
21:43 raiph evanm et al: I apologize. "itemize" has *both* meanings at dictionary.com
21:43 raiph 1. Treat as a list of items.
21:43 raiph 2. Treat a list of items as an item in its own right.
21:43 raiph When "itemize" is written in P6 doc the second meaning is intended, not the first.
21:44 skf Thanks Zoffix!
21:47 raiph Maybe 1 should be shortened to 1. List (verb)
21:48 AlexDaniel is there anything shorter than CATCH { default { my-code-here } } ?
21:48 mr-foobar joined #perl6
21:50 ugexe try ...; my-code-here if $!;
21:51 ugexe or try { ... } || my-code-here
21:51 Zoffix .tell moritz so I talked to people in #maria and one of the suggestions was to change ilbot/blob/master/lib/Ilbot/Backend/SQL.pm:40 to $_[0]->do( 'set names utf8' ); instead of the mysql-specific thing there. Is that code used to store data from IRC too tho? I popped open the db and done `select * from ilbot_lines where id = 14879831 limit 50;` and there's garbage up in there even if I do set names utf8 in the
21:51 yoleaux Zoffix: I'll pass your message to moritz.
21:51 Zoffix client. So perhaps we need the set names utf8 thing some other place too?
21:52 Zoffix .tell moritz client. So perhaps we need the set names utf8 thing some other place too?
21:52 yoleaux Zoffix: I'll pass your message to moritz.
21:53 Zoffix note that try does `use fatal`
21:53 Zoffix m: $ = +"a"; CATCH { default { say "caught" } }
21:53 camelia rakudo-moar 91be8b: ( no output )
21:53 Zoffix m: try $ = +"a"; say "caught" if $!
21:53 camelia rakudo-moar 91be8b: OUTPUT: «caught␤»
21:55 AlexDaniel thanks!
21:59 AlexDaniel m: sub foo($x) { CATCH { return 42 }; die ‘foo’ }; say foo(60) # this also seems to accomplish something similar, depending on what is actually needed
21:59 camelia rakudo-moar 91be8b: OUTPUT: «42␤»
21:59 Sgeo joined #perl6
21:59 Popov_ joined #perl6
22:01 Cabanossi joined #perl6
22:01 Geth_ ¦ ecosystem: svekenfur++ created pull request #350: Add Swedish-Textdates to ecosystem
22:01 Geth_ ¦ ecosystem: review: https://github.com/perl6/ecosystem/pull/350
22:02 Zoffix m: sub foo($x) { CATCH { return 42 }; die ‘foo’ }; say foo 1, 2, 3, 4, 5, <meeeaaaoooowwwws>
22:02 camelia rakudo-moar 91be8b: OUTPUT: «Too many positionals passed; expected 1 argument but got 6␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
22:02 Zoffix dang it
22:03 Zoffix Right, I was thinking of LEAVE phaser, not CATCH :)
22:03 lizmat joined #perl6
22:07 MasterDuke joined #perl6
22:09 leont_ left #perl6
22:15 nicq20 joined #perl6
22:20 nicq20 m: role A { token m { \N* } }; A.^methods(:all).say
22:20 camelia rakudo-moar 91be8b: OUTPUT: «(token m { \N* })␤»
22:20 nicq20 Why does that happen?
22:21 nicq20 Shouldn't it spit out  just 'm'?
22:23 timotimo no, you're printing out the method
22:24 timotimo if you want just m, you need to A.^methods(:all)>>.name.say
22:24 nicq20 So why does it work that way for methods?
22:25 xerx joined #perl6
22:26 timotimo m: my $themethod = Str.^methods(:all)[0]; say $themethod.gist; say $themethod.perl; say $themethod.Str
22:26 camelia rakudo-moar 91be8b: OUTPUT: «BUILD␤submethod BUILD (Str $: :$value = "", *%_ --> Nil) { #`(Submethod|41669832) ... }␤Submethod object coerced to string (please use .gist or .perl to do that)␤  in block <unit> at <tmp> line 1␤BUILD␤»
22:27 timotimo m: role A { token m { \N* } }; my $thetoken = A.^methods(:all)[0]; say $thetoken.Str; say $thetoken.gist; say $thetoken.perl
22:27 camelia rakudo-moar 91be8b: OUTPUT: «Regex object coerced to string (please use .gist or .perl to do that)␤  in block <unit> at <tmp> line 1␤m␤token m { \N* }␤token m { \N* }␤»
22:27 timotimo seems like tokens, as opposed to other methods, will .gist to their name + contents
22:28 nicq20 Is it supposed to?
22:28 timotimo m: say Str.^methods
22:28 camelia rakudo-moar 91be8b: OUTPUT: «(BUILD Int Num chomp starts-with ends-with substr-eq contains indices index rindex pred succ comb match subst-mutate subst ords lines parse-base parse-names samecase samemark samespace word-by-word trim-leading trim-trailing trim words encode NFC NFD NFK…»
22:29 timotimo well, it's not consistent with other methods
22:29 Zoffix m: m: role A { token m { \N* } }; my $thetoken = A.^methods(:all)[0]; $thetoken.^mro.say
22:29 camelia rakudo-moar 91be8b: OUTPUT: «((Regex) (Method) (Routine) (Block) (Code) (Any) (Mu))␤»
22:29 Zoffix ^ it's a Regex, so it's consistent with regexes
22:29 Zoffix m: /foo .+ bar/.gist.say
22:29 camelia rakudo-moar 91be8b: OUTPUT: «/foo .+ bar/␤»
22:29 Zoffix m: m/foo .+ bar/.gist.say
22:29 camelia rakudo-moar 91be8b: OUTPUT: «Use of uninitialized value of type Any in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤  in block <unit> at <tmp> line 1␤Nil␤»
22:30 Zoffix right
22:30 * Zoffix can't ever remember which of the two is which
22:30 Zoffix m: rx/foo .+ bar/.gist.say
22:30 camelia rakudo-moar 91be8b: OUTPUT: «rx/foo .+ bar/␤»
22:30 Zoffix That
22:30 Zoffix :)
22:31 nicq20 Ah, ok. That makes sense.
22:49 mr-foobar joined #perl6
22:50 skf exit
22:53 cdg joined #perl6
22:56 Geth_ ¦ ecosystem: c42ec75a0d | svekenfur++ (committed by Zoffix Znet) | META.list
22:56 Geth_ ¦ ecosystem: Add Swedish-Textdates to ecosystem (#350)
22:56 Geth_ ¦ ecosystem:
22:56 Geth_ ¦ ecosystem: See https://github.com/svekenfur/Swedish-TextDates_sv.git
22:56 Geth_ ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/c42ec75a0d
22:57 parv joined #perl6
23:01 Cabanossi joined #perl6
23:04 cdg_ joined #perl6
23:05 skids joined #perl6
23:17 mr-foobar joined #perl6
23:26 kurahaupo_ joined #perl6
23:28 lizmat and another Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2017/07/17/2017-29-zoffix-released/
23:29 geekosaur zoffix 2.0? :p
23:29 timotimo ZoffexDaniel
23:34 Zoffix lizmat++ # good weekly
23:34 Zoffix Looks like there's quite some traffic on perl6-users mailing list
23:35 BenGoldberg joined #perl6
23:36 kurahaupo joined #perl6
23:36 Ptolemarch joined #perl6
23:37 kurahaupo joined #perl6
23:39 kurahaupo joined #perl6
23:40 parv could "P" & "6" embedded in "Camelia" logo not look like hand painted?
23:41 kurahaupo_ joined #perl6
23:42 kurahaupo_ joined #perl6
23:42 lizmat .oO( pretty good it looks hand painted while it is an SVG :-)
23:42 kurahaupo__ joined #perl6
23:45 parv "P" & "6" won't look out of place if rest of the geometrical pieces were not so perfect
23:46 geekosaur but someone got whiny when the rest of it wasn't perfect
23:46 geekosaur "it needs to look professional"
23:46 geekosaur or some such
23:47 parv then why not react out & touch <P 6>?/
23:47 Zoffix I guess we're back on track with the language, if people have nothing to complain about but the logo :)
23:49 parv i have given up on the name change, after airing my comments. thus achievingW^making peace.
23:49 mr-foobar joined #perl6
23:49 parv s/W^/^W/ # X-]
23:49 Zoffix parv: because you're dealing with a community of at least a 1000 people, all of whom have their Internet Designer degree, all of which have 1000s of suggests for how the logo should look like.
23:50 parv of course that is to be expected when asked for opinion.
23:50 Zoffix http://bikeshed.com/
23:55 parv as for the language, I am not satisfied: () is a list, (x) is not, and (,) is error;  'xy'.split( '' ) gives unreasonably empty strings at either end in normal case (in <x y>.join("3") i do not expect "3x3y3" back).  (feel free to tell me to shut up)
23:56 timotimo why would you .split('')? .comb() is for you
23:56 TEttinger another good example of odd names
23:56 TEttinger is it like a hair comb?
23:56 timotimo yeah
23:56 TEttinger is it short for combine?
23:56 timotimo no
23:56 timotimo it has nothing to do with Half-Life
23:56 TEttinger combinator
23:57 timotimo parv: your example is wrong, though
23:57 timotimo parv: you don't get <x y> from "3x3y3".split("3"), you get ("", "x", "y", "")
23:57 TEttinger he said join
23:58 timotimo yes, but the complaint is about "foo".split("") giving empty strings at beginning and end
23:58 TEttinger I'm a bit confused
23:58 timotimo the equivalent example with 3 is "3f3o3o3".split("3"), not "f3o3o".split("3")
23:59 kurahaupo joined #perl6
23:59 AlexDaniel parv: well, you can try changing P and 6, I'd love to see how it looks
23:59 ugexe in perl5 you use LIMIT 0 for no empty stringys and LIMIT -1 to include them

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

Perl 6 | Reference Documentation | Rakudo