Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-12-13

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:01 timotimo Zoffix: the node attribute is to install the match object so that other pieces of the compiler chain know where the object came from. at the very least it gives line numbers
00:01 Zoffix timotimo: thanks.
00:01 timotimo YW
00:04 Cabanossi joined #perl6
00:09 tardisx joined #perl6
00:10 Zoffix left #perl6
00:10 sena_kun joined #perl6
00:46 lookatme o/
00:49 Cabanossi joined #perl6
00:49 cdg joined #perl6
00:57 timotimo so, is the perl 6 code in the "all the stars of perl 6" blog post supposed to be ".say for 1...**"? because i don't see a mention of HyperWhatever anywhere in the post
01:07 Geth ¦ doc: 3bef31d57d | (Zoffix Znet)++ | doc/Type/Str.pod6
01:07 Geth ¦ doc: Clarify Str.trans: :d deletes only…
01:07 synopsebot Link: https://doc.perl6.org/type/Str
01:07 Geth ¦ doc:
01:07 Geth ¦ doc: …matches that don't got a replacement char for 'em
01:07 Geth ¦ doc: review: https://github.com/perl6/doc/commit/3bef31d57d
01:09 Geth ¦ doc: 20f3aff032 | (Zoffix Znet)++ | doc/Type/Str.pod6
01:09 Geth ¦ doc: Clarify :d is ignored in Str.trans: :d, :c…
01:09 Geth ¦ doc:
01:09 Geth ¦ doc: If replacement chars are given.
01:09 Geth ¦ doc: Closes https://github.com/rakudo/rakudo/issues/1309
01:09 Geth ¦ doc: review: https://github.com/perl6/doc/commit/20f3aff032
01:10 timotimo DrForr: in your test all the things post you refer to `empty call` as if it were being passed to ok at some point in the example, but that seems to have been edited out or somethin
01:11 manchicken joined #perl6
01:11 manchicken So, I'm thinking of doing a series on NativeCall tutorials. Has anybody ever done that?
01:12 kyan joined #perl6
01:12 manchicken I'm trying to teach myself this, and I figured a neat little documentation project would be the easiest way of doing so.
01:13 perlawhi1l Hi people
01:14 kyan Just a heads up about a problem on the Web site: the body text is written from Camelia's perspective, but in a narrow/zoomed-in display, Camelia is hidden (presumably by CSS media queries).
01:15 perlawhi1l Can I check if a variable is contrained by a subset (without specifying the subset by name)...
01:15 perlawhi1l m: subset Foo of Int where * > 0; my Foo $f = 5; say $f.WHAT;
01:15 camelia rakudo-moar 1c7d15d73: OUTPUT: «(Int)␤»
01:15 perlawhi1l is there anything i can ask `$f` that will tell me it is contrained by subset Foo ?
01:15 timotimo ah yes, it's got the class img-responsile (also, center-block, not sure what that is for, exactly)
01:15 perlawhi1l besides $f ~~ Foo
01:15 timotimo $f.isa(Foo) perhaps, perlawhi1l
01:16 perlawhi1l ok, so unless I know the name of the subset in advance, I can ask.
01:16 perlawhi1l can't
01:16 timotimo that's not true :)
01:17 timotimo m: subset Foo of Str where / "hi" /; my $which-to-check = "Foo"; say "oh hi" ~~ ::($which-to-check)
01:17 camelia rakudo-moar 1c7d15d73: OUTPUT: «True␤»
01:17 timotimo m: subset Foo of Str where / "hi" /; my $which-to-check = "Int"; say "oh hi" ~~ ::($which-to-check)
01:17 camelia rakudo-moar 1c7d15d73: OUTPUT: «False␤»
01:17 TimToady m: subset Foo of Str where / "hi" /; my $which-to-check = "Foo"; say "oh hi" ~~ $which-to-check
01:17 camelia rakudo-moar 1c7d15d73: OUTPUT: «False␤»
01:17 TimToady m: subset Foo of Str where / "hi" /; my $which-to-check = Foo; say "oh hi" ~~ $which-to-check
01:17 camelia rakudo-moar 1c7d15d73: OUTPUT: «True␤»
01:18 timotimo kyan: oh, actually, there's a media query for #welcome-header which has display: none !important, that's what's making it go away
01:18 TimToady still works even if the name is a .WHAT
01:18 timotimo greetings TimToady
01:19 TimToady granted you need ::() if you're only given a string
01:19 perlawhi1l so given `subset Foo of Int; my Foo $f;`... without typing the letters 'Foo', is there anything I can ask $f that returns 'Foo'
01:20 jeromelanteri joined #perl6
01:20 timotimo m: subset Foo of Int where 0 < * < 9; my Foo $var = 4; say $var.VAR.of
01:20 camelia rakudo-moar 1c7d15d73: OUTPUT: «(Foo)␤»
01:20 TimToady m: subset Foo of Int; my Foo $f; say 42 ~~ $f.VAR.of
01:20 camelia rakudo-moar 1c7d15d73: OUTPUT: «True␤»
01:20 timotimo that gives you the type object you can directly typecheck against
01:21 perlawhi1l thanks! TimToady++
01:21 MasterDuke manchicken: i don't know of any
01:21 timotimo or you can .^name and get it as a string, and later get it from your lexical scope (important) with the ::() thing
01:21 TimToady but if $f is visible, why don' tyou know the type :)
01:21 perlawhi1l I do :D I just wanted to know how I can introspect it
01:21 timotimo well, it could have been passed in an "is raw" argument for example
01:22 manchicken MasterDuke, well then, I'll go ahead and do that.
01:22 manchicken I will likely also submit some pull requests.
01:22 manchicken First: how to play with C structs.
01:22 Slayerk joined #perl6
01:22 Slayerk Hi all!
01:22 manchicken (all of this is me learning enough to implement librabbitmq-c)
01:22 timotimo manchicken: i believe perl6-intro.com has a short intro to nativecall, too
01:22 TimToady m: sub foo(::T \sumpthin) { say 42 ~~ T }; foo(42)
01:22 camelia rakudo-moar 1c7d15d73: OUTPUT: «True␤»
01:22 Slayerk Does Perl 6 have something like the delay function in C?
01:23 manchicken I'm going to make a quick GitHub repo that has a bunch of different stuff.
01:23 pilne joined #perl6
01:23 manchicken Slayerk, is that a Windows function?
01:23 manchicken I don't think that's a POSIX routine.
01:23 * TimToady doesn't know what delay() does
01:23 timotimo Slayerk: if you're looking to actually block a thread, you'd use "sleep" (takes its argument in seconds, but allows fractions, of course)
01:24 timotimo otherwise you can "await Promise.in($seconds)" and other tasks can be done on the thread if it's in a thread pool scheduler (and you have version 6.d.PREVIEW turned on)
01:24 Slayerk manchiken: Not sure, sorry :P
01:25 TimToady well, I guess the question is what *you* want to do :)
01:25 Slayerk Well, I'm trying to make terminal animation :P
01:27 timotimo oh, have you considered looking at Terminal::Print, Slayerk?
01:27 TimToady sleep will likely be adequate for that, and it's not difficult to switch to promises if you need to later
01:27 Slayerk TimToady: Thanks, will see how it goes and will report back the results :) timotimo: Thanks for you advice
01:30 Slayerk It works guys!
01:31 timotimo https://perl6advent.wordpress.com/2017/12/13/day13-mining-wikipedia-with-perl-6/ - the newest post is live!
01:32 kyan timotimo: mm, well, anyhow, it makes the "Hi, my name is Camelia." become somewhat disembodied ;P
01:32 timotimo it's true
01:32 Geth ¦ doc: 7351392425 | (Zoffix Znet)++ | doc/Language/operators.pod6
01:32 Geth ¦ doc: Document tr///
01:32 synopsebot Link: https://doc.perl6.org/language/operators
01:32 Geth ¦ doc: review: https://github.com/perl6/doc/commit/7351392425
01:32 timotimo i don't have a good hunch for how to solve it elegantly
01:34 eater joined #perl6
01:34 kyan perhaps put Camelia into the same div as the intro paragraph, and then float right?
01:35 Geth ¦ doc: 023e4a7bc2 | (Zoffix Znet)++ | doc/Language/5to6-perlfunc.pod6
01:35 synopsebot Link: https://doc.perl6.org/language/5to6-perlfunc
01:35 Geth ¦ doc: Clean up tr/// Perl 5 docs
01:35 Geth ¦ doc:
01:35 Geth ¦ doc: - Remove mentions of speculations
01:35 Geth ¦ doc: - Just link to Str.trans for docs
01:35 Geth ¦ doc: - Mention TR///
01:35 Geth ¦ doc: review: https://github.com/perl6/doc/commit/023e4a7bc2
01:41 cdg joined #perl6
01:42 Geth ¦ doc: f45e36ce04 | (Zoffix Znet)++ | doc/Language/operators.pod6
01:42 Geth ¦ doc: Document TR/// pseudo op
01:42 Geth ¦ doc:
01:42 Geth ¦ doc: Rakudo impl: https://github.com/rakudo/rakudo/commit/f695862409
01:42 Geth ¦ doc: Spec:        https://github.com/perl6/roast/commit/27cc9417fc
01:42 Geth ¦ doc: RT#127824:   https://rt.perl.org/Ticket/Display.html?id=127824
01:42 Geth ¦ doc: review: https://github.com/perl6/doc/commit/f45e36ce04
01:42 synopsebot RT#127824 [new]: https://rt.perl.org/Ticket/Display.html?id=127824 [RFC] TR/ / / is not implemented
01:42 Zoffix joined #perl6
01:43 Zoffix kyan: it gets hidden because on mobile real estate is at a premium and there's already a camelia from the header a few lines above: https://i.imgur.com/ktg83b6.png
01:44 Zoffix kyan: if you wanna tweak it, gimme your github username, and I'll give you a commit bit.
01:44 piojo_ joined #perl6
01:44 timotimo Zoffix: that's not on the main page, though
01:44 timotimo or does it appear in tiny if the page is too narrow?
01:45 Zoffix timotimo: ah, I'm actually unsure which site we're talking about. Docs or main? :)
01:46 Zoffix If it's main, yeah, I see on mobile there ain't none camelias
01:46 Zoffix Which sucks 'cause para says "Hi, my name is Camelia" :)
01:46 Zoffix kyan: wanna fix it? :)
01:46 timotimo that's exactly what kyan was complaining about
01:46 timotimo the juxtaposition of "hi i'm camelia" and "no camelia to be seen"
01:46 Zoffix Ah, I misread.
01:46 ZzZombo joined #perl6
01:47 timotimo that would explain the confusion
01:48 timotimo i'll go to bed
01:48 timotimo have a good one!
01:48 Geth ¦ doc: 931506df60 | (Zoffix Znet)++ | doc/Language/operators.pod6
01:48 Geth ¦ doc: Add example of tr/// with adverbs up on it
01:48 Geth ¦ doc: review: https://github.com/perl6/doc/commit/931506df60
01:48 synopsebot Link: https://doc.perl6.org/language/operators
01:48 Zoffix \o
01:51 Actualeyes joined #perl6
01:52 raiph joined #perl6
01:54 TimToady Zoffix: the :node($/) is mostly used for current line number, but the match object is the only way to convey everything in the "current language" to subsequent compiler passes, since dynvars (the old way to do that) go out of scope too soon
01:54 Geth ¦ perl6.org: a55a3d981f | (Zoffix Znet)++ | README.md
01:54 Geth ¦ perl6.org: Add tip about nuking source/archive
01:54 Geth ¦ perl6.org:
01:54 Geth ¦ perl6.org: while building
01:54 Geth ¦ perl6.org: review: https://github.com/perl6/perl6.org/commit/a55a3d981f
01:54 timotimo kyan: if you fix the page for mobile, maybe you can come up with something clever for the tabs above the examples box, too
01:55 haxmeister joined #perl6
01:55 TimToady which is why all the pragmas, braids, etc. now can be found via match objct methods
01:56 Zoffix TimToady: still unsure when it should be used though. Here I saw it passed to the callmethod op and then to the Var qast a few lines down as well: https://github.com/rakudo/rakudo/blob/master/src/Perl6/Actions.nqp#L8131-L8134
01:56 Zoffix Are both needed? vOv
01:59 kyan I'll look at it after finals week :)
02:00 TimToady in general we want every QAST node to know its line number, minimally, cuz we don't know who's gonna throw an error based on what
02:00 TimToady and there's already a node pointer in the QAST, so might as well fill it
02:00 TimToady the redundancy is more perceived than real
02:00 Zoffix OK :)
02:01 TimToady otherwise you start getting error messages that don't know the line number, or pragma decisions that don't know the values of their pragma, etc.
02:03 TimToady and basically you're just gonna keep a heap of pointers into the original match structure, but that match structure itself is not duplicated
02:03 Zoffix Ah
02:03 AndChat|688961 Just out of curiosity, would Perl6 be faster if the procedural Paradigm was removed, if Perl6 was strictly OO?
02:04 TimToady um, OO is essentially procedural underneath anyway, you're just hiding the variables inside objects
02:04 AndChat|688961 Oh, okay.
02:04 timotimo well, and you get method resolution order stuff. depending on whether you put multiple dispatch (or just overloaded methods) in there as well ...
02:04 timotimo in procedural code, you'd probably always know what a given piece of code is calling?
02:05 timotimo in fact, if you use subs or private methods nowadays, we're already selecting the right candidate up front where possible
02:07 TimToady now, with purely functional programming (FP), you try to avoid side effects, so you treat the data as immutable, and that can occasionally have some benefits for the optimizer, and you could call that "removing procedural code", but it's sort of the opposite way of controlling state changes from OO
02:08 comborico Oh.
02:09 TimToady OO tries to hide state changes inside objects, while FP tries to hide state changes in the parameter bindings of the call stack
02:10 manchicken Well poop.
02:10 manchicken NativeCall is giving me `image not found` issues.
02:10 TimToady which one is more efficient really depends on the nature of the problem you're trying to solve
02:10 manchicken The library is there, the symbols exist... but it's not loading.
02:10 timotimo "image"?
02:10 timotimo ah, it could very well be it's missing the "blah.so" file, and doesn't look for "blah.so.1.2.3"
02:11 TimToady I think there's a faq about that
02:11 timotimo you often have to install the corresponding -dev package to get those symlinks
02:11 manchicken The file is there. OSX.
02:11 timotimo oh, dylibs, then
02:11 TimToady I think the faq even mentions OSX
02:11 manchicken What's weird, I'm able to see it elsewhere.
02:12 timotimo manchicken: i hear dtruss can tell you info about what the program is doing underneath
02:12 lookatme Is Perl6 support tail recursive ?
02:13 comborico Thank you for your time. Goodnight.
02:13 lookatme night
02:14 * colomon started using NativeCall for his $work today
02:15 lookatme m: react { whenever supply { emit 123; (< 1 2 3 4 5 6 >.race.map(sub ($x) { emit $x; } ).list) } { .say } }
02:15 camelia rakudo-moar f69586240: OUTPUT: «123␤»
02:16 Zoffix manchicken: that'd be great. I'm unaware of any good tutorials like that. I tried writing it but gave up after first article 'cause I don't know C: https://rakudo.party/post/Perl-6-NativeCall--Look-Ma-Im-A-C-Programmer
02:17 manchicken I think that the `Build.pm` w/`ref build .` is putting the lib in `resources/lib`, but that for some reason when I run `perl6 ./t/data-transfer.t` it can't find the file.
02:17 manchicken I don't really understand how the pathing works.
02:17 manchicken Zoffix, don't worry, I'm going to write something about it.
02:17 Zoffix \o/
02:17 manchicken As soon as I get it working.
02:18 Cabanossi joined #perl6
02:19 Geth ¦ perl6.org: 1db2d49ea9 | (Zoffix Znet)++ | 4 files
02:19 Geth ¦ perl6.org: Move nav items/fix nav on mobilish devices
02:19 Geth ¦ perl6.org:
02:19 Geth ¦ perl6.org: - Move "Compilers" and "Design" items into "Resources"
02:19 Geth ¦ perl6.org:     - Seems a more appropriate place and than front-and-center
02:19 Geth ¦ perl6.org:     - Cleans up valuable space in the nav
02:19 Geth ¦ perl6.org: - Reduce nav item padding a bit to make the nav show up on one line
02:19 Geth ¦ perl6.org:     on iPad-sized devices (fixes unwanted hidage of stuff)
02:19 Geth ¦ perl6.org: - Gabor's book's funderaiser is closed, so I removed the link
02:19 Geth ¦ perl6.org: review: https://github.com/perl6/perl6.org/commit/1db2d49ea9
02:20 manchicken I can't get truss to work.
02:20 MasterDuke manchicken: does strace work on OSX?
02:20 manchicken Naw, dtrace
02:23 MasterDuke lookatme: short answer, not now, longer answer here https://irclog.perlgeek.de/perl6/2017-12-08#i_15551545
02:25 lookatme oh, thanks
02:25 MasterDuke np
02:29 Geth ¦ perl6.org: b026f297da | (Zoffix Znet)++ | 3 files
02:29 Geth ¦ perl6.org: Fix homepage camelia; kyan++ for noticing issues
02:29 Geth ¦ perl6.org: review: https://github.com/perl6/perl6.org/commit/b026f297da
02:30 Zoffix kyan: sorry :) Couldn't help but fix camelia. You can improve the examples tabs or whatever else you think needs improvement
02:30 * Zoffix &
02:30 Zoffix left #perl6
02:43 manchicken joined #perl6
02:57 manchicken OK... so this is cool.
02:57 manchicken Somehow it's magically working after a reboot... I'm thoroughly confused.
02:57 manchicken But whatever.
02:57 manchicken I have a SIGSEGV, though, so that's cool. It's progress.
02:57 manchicken I suspect it's on account of my having not properly allocated a thing.
02:59 ilbot3 joined #perl6
02:59 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
03:04 manchicken Well, this is a POSIX system, so I kinda expect better :)
03:05 manchicken So, trying to figure out how to allocate strings for output params.
03:07 manchicken BOOM!
03:07 manchicken Gotta have a `TWEAK` or something to preset your Str property to `$!foo := Str.new`
03:07 Geth ¦ ecosystem: dmaestro++ created pull request #382: Add SQL::Lexer
03:07 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/pull/382
03:08 TimToady lookatme: medium answer, TCO is not friendly toward parallelization in FP languages as pointed out by Guy Steele and others, see for instance http://xahlee.info/comp/Guy_Steele_parallel_computing.html
03:08 buggable New CPAN upload: SQL-Lexer-0.1.1.tar.gz by DMAESTRO https://cpan.metacpan.org/authors/id/D/DM/DMAESTRO/Perl6/SQL-Lexer-0.1.1.tar.gz
03:10 TimToady iteration vs parallel recursion should be (mostly) an implementation issue, not something the programmer should think about much
03:11 TimToady so p6 is biased toward making you think about lists without privileging the head over the tail
03:13 manchicken joined #perl6
03:26 zakame joined #perl6
03:29 manchicken Should I submit pull requests in small chunks?
03:30 manchicken I have a small blurb I added to the `NativeCall` about managing memory within your CStruct.
03:40 TimToady depends on how closely related the chunks are, such that they can be evaluated together
03:41 TimToady and certainly one can revise a pull request if parts of it are problematic
03:41 AlexDaniel .tell thou in my experience PRs are getting merged faster if they come with a corresponding roast PR with tests :)
03:41 TimToady so there's no need to be overly reductionistic about it
03:41 yoleaux AlexDaniel: I'll pass your message to thou.
03:43 AlexDaniel .tell thou which is something you can help with in this particular case, fwiw
03:43 yoleaux AlexDaniel: I'll pass your message to thou.
03:48 aborazmeh joined #perl6
03:48 aborazmeh joined #perl6
03:49 Cabanossi joined #perl6
03:50 cdg joined #perl6
03:51 manchicken Weeee: https://github.com/manchicken/perl6-nativecall-samples/tree/master/simple-struct
03:52 manchicken Super simple demo of how to pass structs around.
03:52 manchicken I'm going to go to bed, please feel free to email me with feedback if you have it.
03:53 manchicken I also have my diffs for the docs here: https://github.com/perl6/doc/compare/master...manchicken:docfix-manchicken-2017-12-12?expand=1
03:53 manchicken It's not a lot, but it's something.
03:53 manchicken That stupid build issue cost me an hour tonight. :(
03:53 manchicken Night.
04:13 colomon joined #perl6
04:19 Cabanossi joined #perl6
04:24 wamba joined #perl6
04:48 Cabanossi joined #perl6
04:59 Actualeyes joined #perl6
05:01 konsolebox joined #perl6
05:03 Cabanossi joined #perl6
05:12 committable6 joined #perl6
05:35 aborazmeh joined #perl6
05:35 aborazmeh joined #perl6
05:48 Geth ¦ doc: d1c4c641b1 | (Tim Smith)++ | doc/Language/operators.pod6
05:48 Geth ¦ doc: Escape | and + in table cells
05:48 synopsebot Link: https://doc.perl6.org/language/operators
05:48 Geth ¦ doc: review: https://github.com/perl6/doc/commit/d1c4c641b1
05:52 softmoth Thanks, AlexDaniel !
05:53 softmoth BTW, I'm `thou`, switched IRC nick to match github (thou has been an OLD name here on freenode)
05:55 lookatme :)
06:02 TEttinger this is a good soft moth http://farm9.staticflickr.com/8433/7602638824_ceb0969d85_z.jpg
06:04 releasable6 joined #perl6
06:11 konsolebox joined #perl6
06:18 Cabanossi joined #perl6
06:41 char_var[buffer] joined #perl6
06:56 domidumont joined #perl6
06:57 char_var[buffer] joined #perl6
07:03 domidumont joined #perl6
07:05 geospeck joined #perl6
07:05 lowbro joined #perl6
07:05 lowbro joined #perl6
07:06 curan joined #perl6
07:11 shady0wl_ joined #perl6
07:31 sena_kun joined #perl6
07:38 wamba joined #perl6
07:38 darutoko joined #perl6
07:50 cdg joined #perl6
08:04 Grauwolf joined #perl6
08:05 softmoth TEttinger, hey, that is a very nice one!
08:09 vike joined #perl6
08:16 wamba joined #perl6
08:18 benchable6 joined #perl6
08:18 committable6 joined #perl6
08:18 bisectable6 joined #perl6
08:18 unicodable6 joined #perl6
08:18 squashable6 joined #perl6
08:19 squashable6 joined #perl6
08:19 bisectable6 joined #perl6
08:25 syntaxman joined #perl6
08:27 lookatme How can I get parent pid in Perl6 ?
08:28 moritz with nativecall and getppid, if nobody has a better idea
08:30 lookatme :) It's better if there is a $*PPID
08:35 DrForr Also clutters the namespace.
08:37 moritz I think we should have a POSIX module for that
08:38 moritz pull request for https://github.com/cspencer/perl6-posix maybe?
08:41 DrForr More work for me to forget to finish.
08:44 lookatme oh, maybe work :)
08:45 AlexDaniel I think we should have $*PPID
08:46 AlexDaniel lookatme: hehe https://github.com/perl6/whateverable/blob/46337991a954885fe4c535319275bbb6f797b391/lib/Whateverable.pm6#L317-L320
08:46 wamba joined #perl6
08:47 AlexDaniel or, otherwise, why do we have $*PID ?
08:47 lookatme yeah, that's a solution, works fine
08:47 lookatme Cause Perl 5 has a variable named $PID ?
08:47 lookatme But no $PPID
08:47 lookatme :)
08:48 Cabanossi joined #perl6
08:48 AlexDaniel lookatme: mkay, although I dislike this line of reasoning :)
08:49 DrForr %*PROCESS<PARENT> # etc?
08:50 lookatme m:say %*PROCESS<PARENT>; # ?
08:50 evalable6 lookatme, rakudo-moar 116134752: OUTPUT: «(exit code 1) Dynamic variable %*PROCESS not found␤  in block <unit> at /tmp/WuIS5fJp86 line 1␤␤»
08:51 DrForr Just a suggestion.
08:51 lookatme use NativeCall; sub getppid(--> long) is native(Str) {*}; say getppid();
08:51 lookatme m: use NativeCall; sub getppid(--> long) is native(Str) {*}; say getppid();
08:51 camelia rakudo-moar 116134752: OUTPUT: «24129␤»
08:52 eugene_barsky joined #perl6
08:52 eugene_barsky Hi
08:52 lookatme But I think $*PPID is clear :)
08:52 moritz hi eugene_barsky
08:52 lookatme hi
08:54 eugene_barsky Seems that it's Linenoise that slows down my REPL startup. I added linenoise support to my small script and now it loads 5-7 seconds.
08:55 moritz you could try readline instead
08:55 lookatme I recommend Readline
08:55 eugene_barsky The GNU Readline Library?
08:56 lookatme grep: Readline
08:56 greppable6 lookatme, https://gist.github.com/bf3802450f95f67df5c8efa6809caf5f
08:56 moritz eugene_barsky: the Perl 6 library that wraps GNU Readline
08:56 lookatme :) Though I can not access gist, but I can do a search for u :)
08:56 eugene_barsky Thanks!! I'll try it.
08:57 * DrForr keeps an ear to the channel :)
08:59 lookatme eugene_barsky,  a little example https://github.com/araraloren/perl6-app-snippet/blob/master/lib/App/snippet.pm6#L281
09:00 scimon joined #perl6
09:00 eugene_barsky lookatme: Thanks, that's what I was looking for!
09:00 lookatme YW
09:02 eugene_barsky moritz: thanks!
09:02 jast hi guys, I need some help here... I just don't understand why Perl 6 is full of all these awesome things, can anyone explain?
09:02 lookatme What things ?
09:02 DrForr Because we've been packing as much syntax as we can get into a confined space? :)
09:03 lookatme :)
09:03 jast that's a good thing, right? :)
09:03 lookatme Maybe good, for me :)
09:04 teatime lol, jast++
09:07 moritz jast: I could explain, but first you have to read two books, to give you some context... :-)
09:08 moritz <rant>apress/springer still haven't fixed their bloody webshop</rant>
09:09 jast moritz: well, it sure is nice to get some input from someone neutral and unbiased :}
09:09 AlexDaniel u: ♂
09:09 unicodable6 AlexDaniel, U+2642 MALE SIGN [So] (♂)
09:11 thunktone joined #perl6
09:13 zakharyas joined #perl6
09:13 someuser joined #perl6
09:16 zakharyas joined #perl6
09:17 zakharyas joined #perl6
09:18 scimon So. I can't remember who introduced me to http://adventofcode.com yesterday... thanks. I needed another distraction (like the proverbial hole in the head) but it's puzzles. Up to day 12. Many of the (terrible) solutions are now on github (https://github.com/Scimon/advent-of-code) a lot of the early ones were so simple in perl6 I command lined them.
09:18 yoleaux 12 Dec 2017 21:04Z <timotimo> scimon: it might not be worth mutch, but (^9 X ^9).map(-> ($x, $y) { }) is noticably slower than (^9 X ^9).flat.map(-> $x, $y { }): https://gist.github.com/25788b01599b86f109c4e218f7f2a16d
09:18 rindolf joined #perl6
09:20 scimon timotimo: Hmmmm interesting. I may have to try that out. I do use it a bit. (^9 X ^9).map(-> ($x, $y) { }) feels more idomatic though.... speed it nice though....
09:20 zakharyas joined #perl6
09:42 sacomo joined #perl6
09:49 konsolebox joined #perl6
10:08 dakkar joined #perl6
10:29 itaipu joined #perl6
10:44 zakharyas joined #perl6
10:51 domidumont joined #perl6
10:54 AlexDaniel` scimon: if you need more distractions: https://code-golf.io
10:54 scimon I know... Xmas holiday.
10:56 eliasr joined #perl6
11:08 konsolebox joined #perl6
11:09 Geth ¦ doc: 8ae8e7ef8a | (Luca Ferrari)++ | doc/Language/containers.pod6
11:09 synopsebot Link: https://doc.perl6.org/language/containers
11:09 Geth ¦ doc: Add link to 'Scalar' class in containers documentation.
11:09 Geth ¦ doc: review: https://github.com/perl6/doc/commit/8ae8e7ef8a
11:11 AlexDaniel joined #perl6
11:13 quotable6 joined #perl6
11:22 AlexDaniel joined #perl6
11:26 konsolebox joined #perl6
11:40 char_var[buffer] joined #perl6
11:48 Cabanossi joined #perl6
11:51 cdg joined #perl6
11:51 mahafyi joined #perl6
12:17 lowbro joined #perl6
12:17 lowbro joined #perl6
12:18 buggable New CPAN upload: Game-Sudoku-1.1.2.tar.gz by SCIMON https://cpan.metacpan.org/authors/id/S/SC/SCIMON/Perl6/Game-Sudoku-1.1.2.tar.gz
12:18 Voldenet is there any way to supress stderr in qqx-invoked commands?
12:20 Voldenet I could just 2>/dev/null in the command itself, but it doesn't look too great
12:21 moritz you'd have to use run instead of qx
12:33 Voldenet > sub qx(*@cmd){ given Proc::Async.new: @cmd { .stderr.tap({$}); my @o; .stdout.tap({ @o.push($_) }); await .start; @o }};
12:33 Voldenet I'm unsure how to /silence/ stderr in that case too
12:34 teatime just don't call .stderr, according to the docs
12:35 teatime you do have to read both streams tho or you risk a deadlock... presumable Proc::Async is smart enough to know that / do it for you
12:36 Voldenet actually, not doing anything to the .stderr just passes the stderr to the perl's stderr
12:36 Voldenet which isn't what I want :)
12:38 teatime hrm
12:38 teatime that doesn't sound right
12:40 * teatime has the sudden realization that can use Perl6 like an Expect that doesn't suck.
12:43 timotimo you just tap it and do nothing with the result, i believe
12:44 teatime it's super weird to me it outputs it to the programs stderr
12:44 Voldenet I guess it works as requested, I'm just overly pedantic about the readability
12:45 Voldenet teatime: it's okay - most applications don't write to stderr unless there's /an error/ ;)
12:45 teatime well, it's ok to output various free-form debug information into stderr
12:45 teatime that's what it's for
12:46 teatime because you can redirect it away and get just pure "output" when that's what you need
12:46 jast it kind of makes sense that stderr goes to stderr if not accessing it means no redirect is set up
12:46 teatime kindof, yeah.
12:47 teatime is there a null supply consumer / sink, or is {} basically that
12:47 teatime jast: yeah, I suppose so..
12:47 teatime just a LTA in docs I guess
12:47 Voldenet teatime: {} is interpreted as hash by default, needs that little $ somewhere
12:47 teatime oh.  is {$} really the best way to do that?
12:48 Voldenet My question exactly ;)
12:48 piojo_ joined #perl6
12:48 Cabanossi joined #perl6
12:48 cdg joined #perl6
12:56 teatime like, it seems like {$} would trip the useless use of scalar value warning
12:57 teatime you could do -> $ {}, though ?
12:58 Voldenet m: {$}(<nope, it wouldn't trip any warnings>)
12:58 camelia rakudo-moar 116134752: ( no output )
13:06 philomath_ joined #perl6
13:14 teatime moritz: if I were going to buy your Perl 6 book, is there a particular vendor that would be best for you for me to use?
13:16 teatime oh nice, I didn't know about your grammars book either.  sounds good.
13:18 moritz teatime: for me, it doesn't really matter. For you, it's about convenience
13:18 moritz teatime: if you want an ebook, you get a watermarked (but DRM-free) ebook from apress.com
13:19 moritz on amazon, you only get kindle
13:21 scimon moritz: you need to get you some referral links setup ;)
13:21 moritz scimon: apress has a referral program, but it requires a US tax ID
13:22 rindolf joined #perl6
13:22 scimon Awwww....
13:22 teatime hrm.. you may be able to get one?
13:22 moritz scimon: and I get neglible amounts from the amazon referal program, so I tend to send people to smile.amazon.com
13:23 moritz teatime: I may or may not, but so far, I simply don't think it's worth the effort
13:23 rindolf Hi all, sup? Happy Hanukkah
13:31 araraloren joined #perl6
13:31 araraloren |o/
13:33 Cabanossi joined #perl6
13:34 raschipi joined #perl6
13:44 pochi m: try { CATCH { default { say "hello"; } }; my @x = "4,foo".split(",").map: *.Int; }
13:44 camelia rakudo-moar 116134752: ( no output )
13:44 pochi shouldn't this say "hello"?
13:49 timotimo m: say ("foo".Int).WHAT
13:49 camelia rakudo-moar 116134752: OUTPUT: «(Failure)␤»
13:49 timotimo failures are "lazy" exceptions
13:50 pochi ah, so not until I use the result will an exception actually trigger my handler?
13:54 wamba joined #perl6
13:58 zakharyas joined #perl6
13:59 robertle joined #perl6
14:01 cdg joined #perl6
14:01 raschipi pochi: You can force it to blow up, but if you don't touch it won't.
14:03 Cabanossi joined #perl6
14:05 raschipi https://docs.perl6.org/language/pragmas#index-entry-fatal-fatal
14:06 raschipi Well, isn't the try block supposed to turn Failures fatal anyway?
14:09 cdg joined #perl6
14:10 Voldenet m: try { CATCH { default { say "hello"; } }; my @x = "4,foo".split(",").map: *.Int; }
14:10 camelia rakudo-moar 116134752: ( no output )
14:10 pochi I tried fatal, but it didn't trigger it. seems I have to use the result
14:10 Voldenet m: try { CATCH { default { say "hello"; } }; my @x = "4,foo".split(",").map({ .Int }); }
14:10 camelia rakudo-moar 116134752: OUTPUT: «hello␤»
14:11 pochi why would using a block in map change things?
14:12 teatime I really liked the idea of failures, but every time they actually come up they confuse the crap out of me.
14:12 cdg_ joined #perl6
14:12 raschipi It's an undefined value that carries out-of-band information on what went wrong...
14:14 teatime so what's the answer to pochi's latest question?
14:14 Voldenet I'm not sure why using a block in map would change things, but I guess there's a difference between how WhateverCode and Block is treated
14:14 pochi m: my @x; try { CATCH { default { say "hello"; } }; @x = "4,foo".split(",").map: *.Int; }; say @x;
14:14 camelia rakudo-moar 116134752: OUTPUT: «Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo' (indicated by ⏏)␤  in block  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
14:15 pochi now I'm using @x, but it doesn't catch the exception
14:16 cdg joined #perl6
14:19 raschipi m: try { CATCH { default { say "hello"; } }; my @x = "4,foo".split(",").map: *.Int.sink-all; }
14:19 camelia rakudo-moar 116134752: OUTPUT: «hello␤»
14:20 raschipi m: try { CATCH { default { say "hello"; } }; my @x = "4,foo".split(",").map(*.Int).sink-all; }
14:20 camelia rakudo-moar 116134752: OUTPUT: «hello␤»
14:21 Voldenet m: try { CATCH { default { .say; } }; my @x = "4,foo".split(",").map(*.Int).sink-all; }
14:21 camelia rakudo-moar 116134752: OUTPUT: «No such method 'sink-all' for invocant of type 'Seq'␤  in block <unit> at <tmp> line 1␤␤»
14:21 Voldenet *cough*
14:21 pochi so, sink-all makes it non-lazy?
14:22 teatime what's weird to me is map(Whateverable) ends up lazy but map({block}) doesn't?
14:23 teatime I thought about that for the answer to "why does whateverable not raise when block does", but thought nah, can't be that
14:23 cdg joined #perl6
14:24 Voldenet m: try { CATCH { default { .say; } }; my @x = "4,foo".split(",").map: *.Int.sink; }
14:24 camelia rakudo-moar 116134752: OUTPUT: «Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo' (indicated by ⏏)␤  in whatevercode  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
14:24 raschipi m: try { CATCH { default { ; } }; my @x = "4,foo".split(",").map(*.Int).sink-all; say @x[0]  } #Doesn't work
14:24 camelia rakudo-moar 116134752: ( no output )
14:24 Voldenet that'd work too
14:24 raschipi I only know about a .sink method on Proc, that's all the docs talk about
14:26 piojo_ joined #perl6
14:26 Voldenet ah, right
14:27 Voldenet ...why does it work instead of giving `No such method 'sink' for invocant of type 'Int'` ಠ_ಠ
14:29 moritz m: Int.sink
14:29 camelia rakudo-moar 116134752: ( no output )
14:29 moritz m: say so Int.^can('sink')
14:29 camelia rakudo-moar 116134752: OUTPUT: «True␤»
14:29 moritz m: say Int.^can('sink')
14:29 camelia rakudo-moar 116134752: OUTPUT: «(sink)␤»
14:29 comborico1611 joined #perl6
14:29 moritz m: say Int.^can('sink')[0].package
14:29 camelia rakudo-moar 116134752: OUTPUT: «(Mu)␤»
14:29 raschipi m: say Failure.^can('sink')
14:29 camelia rakudo-moar 116134752: OUTPUT: «(sink sink sink)␤»
14:29 moritz it seems *everything* can sink
14:30 pochi is this the proverbial kitchen sink? :-)
14:30 raschipi It's just not documented.
14:30 lizmat well, doesn't that go for any method that lives in Mu?
14:30 Voldenet m: say "baloon".^can('sink')
14:30 camelia rakudo-moar 116134752: OUTPUT: «(sink)␤»
14:30 lizmat if Mu can, than anything else can as well ?
14:31 moritz yes
14:31 Voldenet I bet it just doesn't do what I think it does and that's probably enough
14:33 itaipu joined #perl6
14:33 raschipi m: 4.sink.^name#The problem is that sink throws everything aways
14:33 camelia rakudo-moar 116134752: ( no output )
14:33 raschipi m: say 4.sink.^name
14:33 camelia rakudo-moar 116134752: OUTPUT: «Nil␤»
14:34 Voldenet (the Failure docs say something about sink context causing a failure to throw, so I guessed it would just evaluate the item in sink context)
14:35 raschipi Yeah, that's not what it does, it actually sinks it
14:35 rindolf joined #perl6
14:35 Voldenet m: my @u = ["a"].map(*.Int); @u.iterator.sink-all
14:35 camelia rakudo-moar 116134752: ( no output )
14:36 Voldenet m: my @u = ["a"].map(*.Int); @u.map(*.sink)
14:36 camelia rakudo-moar 116134752: OUTPUT: «Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5a' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤»
14:36 silug joined #perl6
14:37 Voldenet Hmmm, I'm unsure if sink-all works correctly
14:38 AlexDaniel joined #perl6
14:39 Voldenet m: @x = "4,foo".split(",").map(*.say); say "end"; # on the other hand, you don't actually need to sink-all it, because it seems not lazy anyway
14:39 camelia rakudo-moar 116134752: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '@x' is not declared␤at <tmp>:1␤------> 3<BOL>7⏏5@x = "4,foo".split(",").map(*.say); say ␤»
14:39 Voldenet m: my @x = "4,foo".split(",").map(*.say); say "end"; # on the other hand, you don't actually need to sink-all it, because it seems not lazy anyway
14:39 camelia rakudo-moar 116134752: OUTPUT: «4␤foo␤end␤»
14:43 Voldenet I truly wonder how one should properly evaluate the Seq for failures though
14:46 natrys joined #perl6
14:48 Cabanossi joined #perl6
15:10 softmoth joined #perl6
15:23 rindolf joined #perl6
15:33 Cabanossi joined #perl6
15:44 khw joined #perl6
15:49 Rawriful joined #perl6
15:54 troys joined #perl6
16:05 Zoffix joined #perl6
16:07 Zoffix Voldenet: depends on how you want to handle them. If you want to just explode them, use `.self` method. It's just returns the self for all types, and for unhandled Failures it makes them blow up
16:07 Zoffix m: my @u = ["a"].map: *.Int.self
16:07 camelia rakudo-moar 07616effd: OUTPUT: «Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5a' (indicated by ⏏)␤  in whatevercode  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
16:09 Zoffix Though generally that's not needed, since you'd usually be using those values someplace. The few caveats are where you're treating the list as a thing and Failures get lost (e.g. `say @u.elems` would not explode Failures inside @u)
16:10 geospeck joined #perl6
16:12 Zoffix m: sub make-failures { (Failure.new,) }; use fatal; my $x = make-failures; say 42
16:12 camelia rakudo-moar 07616effd: OUTPUT: «42␤»
16:16 Zoffix m: sub make-failures { BEGIN $*LANG.pragma("fatal").say; (+"a",) }; use fatal; my $x = make-failures; say 42
16:16 camelia rakudo-moar 07616effd: OUTPUT: «(Mu)␤42␤»
16:17 Zoffix OK makes sense. the `use fatal`/`try` is lexically scoped and the Failure gets made where it's not in effect. By the time they arrive back into fatalized land, they're already packed inside a list.
16:18 Zoffix Where's it deciding whether to blow it up?
16:22 raschipi What we were most mistified about is the fact that a block will blow it up but whateverblock won't.
16:24 Zoffix look like it sticks a p6fatalize op into places, which desugars to a sink
16:25 Zoffix raschipi: a bug maybe?
16:29 natrys joined #perl6
16:32 * Zoffix tries a hackety hack
16:34 Actualeyes joined #perl6
16:43 khisanth_ joined #perl6
16:48 Zoffix s/makes sense.+//; # wrong, cause the block/whatevercode where failure is made are in lexical scope of fatalization, I think
16:49 teatime raschipi: they do both output a Seq also, forgot to mention checking that
16:49 teatime maybe return value from block is considered "doing something" with the failure value?
16:50 teatime if so, perhaps whateverable needs to do that too?
16:53 Zoffix yeah. on it
16:55 raschipi Right, but returning the failure shouldn't trigger it...
16:56 teatime raschipi: it feels like more than undef+info, it feels like a variable that may live a long life-time before blowing up your program at some unexpected later place.  but I imagine I just don't understand it yet / need to work with it more
16:56 teatime is there a pragma to make failures insta-fatal?
16:56 raschipi Well, if it was just Nil, it would do the same thing, yet it wouldn't tell you what went wrong...
16:57 scimon Looking at https://code-golf.io/ .... There are obviously some tricks I do not know.
16:58 Zoffix teatime: use fatal
17:00 Zoffix teatime: or add a .self call on a value you want to explode if it's a failure
17:00 zakharyas joined #perl6
17:00 teatime is that what .self is for, or is that more of a "hack"?
17:01 Zoffix teatime: .self returns the object itself. It deconts. It also blows up unhandled Failures
17:02 raschipi From the docs: "calling this method is a handy way to explosively filter out Failures"
17:02 Zoffix teatime: it's a "hack" only in a sense that calling most methods on Failures blows them up and here such a method is a no-op for regular objects, so unless it's a Failure, you just get your object as is
17:02 teatime k.
17:02 pochi is my understanding correct that a CATCH handler will only be called if the explosion happens inside a try?
17:03 Zoffix pochi: no. CATCH will be called even without any try. The try enabled fatal pragma
17:03 Zoffix m: CATCH say 'meow'; die
17:03 camelia rakudo-moar 07616effd: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3CATCH7⏏5 say 'meow'; die␤    expecting any of:␤        scoped block␤»
17:03 Zoffix m: CATCH { say 'meow' }; die
17:03 camelia rakudo-moar 07616effd: OUTPUT: «meow␤Died␤  in block <unit> at <tmp> line 1␤␤»
17:03 Zoffix m: CATCH { default { say 'meow' } }; die # without `default` it sends the explosion further up
17:03 camelia rakudo-moar 07616effd: OUTPUT: «meow␤»
17:04 Zoffix well, without `default` or some other `when` thing
17:04 Zoffix s/enabled/enables/;
17:04 pochi ok, but if the CATCH is inside a try, and the explosion happens outside?
17:04 Zoffix pochi: the outside won't have that CATCH applicable to it.
17:05 Zoffix just as here:  { { CATCH { ... } }; die }
17:05 pochi hm, in my case I know where the Failure can be made, but I don't really know when it will blow up
17:06 AlexDaniel joined #perl6
17:06 Zoffix `use fatal` should blow 'em up
17:07 fuzzy joined #perl6
17:07 Zoffix m: "a".map: {.Int}; say "meow";
17:07 camelia rakudo-moar 07616effd: OUTPUT: «meow␤»
17:07 Zoffix m: use fatal; "a".map: {.Int}; say "meow";
17:07 camelia rakudo-moar 07616effd: OUTPUT: «Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5a' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤»
17:07 Zoffix Though I guess not in all cases
17:07 Zoffix m: sub make-failures { (Failure.new,) }; use fatal; my $x = make-failures; say 42
17:07 camelia rakudo-moar 07616effd: OUTPUT: «42␤»
17:08 raschipi Or think of it as a function returning an error value and treat the failure right after getting the results.
17:08 raschipi Letting the failure just be is a possibility but it's not mandatory.
17:09 rindolf left #perl6
17:10 pochi btw, I would like to catch only that one error "base-10 number must begin ...", but I can't figure out the exception type
17:10 Zoffix m: try +"a"; say $!.^name
17:10 camelia rakudo-moar 07616effd: OUTPUT: «X::Str::Numeric␤»
17:11 Zoffix m: try { CATCH { when X::Str::Numeric { say "the num stuff" } }; +"a"; }
17:11 camelia rakudo-moar 07616effd: OUTPUT: «the num stuff␤»
17:11 Zoffix m: try { CATCH { when X::Str::Numeric { say "the num stuff" } }; die "some other stuff" }
17:11 camelia rakudo-moar 07616effd: OUTPUT: «some other stuff␤  in block <unit> at <tmp> line 1␤␤»
17:12 pochi nice
17:16 Zoffix m: (+"a").exception.^name.say # another way to get the name. Failure.exception contains the exception the Failure would explode with
17:16 camelia rakudo-moar 07616effd: OUTPUT: «X::Str::Numeric␤»
17:17 raschipi m: (die "aaa").exception.^name.say
17:17 camelia rakudo-moar 07616effd: OUTPUT: «aaa␤  in block <unit> at <tmp> line 1␤␤»
17:18 Zoffix that ain't a Failure
17:18 raschipi right
17:26 Zoffix w00t. success in hackety hacking \o/
17:33 Cabanossi joined #perl6
17:33 ryn1x .
17:34 Zoffix :
17:35 Zoffix AlexDaniel: BTW t/spec/MISC/bug-coverage-stress.t consistently fails all the time and has been for a while. I guess not many devs notice it cause it's a stresstest...
17:36 AlexDaniel` yea I noticed that, but it felt weird because nobody else was complaining
17:36 AlexDaniel` now that you said it I see why…
17:36 Zoffix :)
17:37 AlexDaniel` ok: https://github.com/rakudo/rakudo/issues/1312
17:39 geekosaur I'd be surprised if there wasn't already a ticket
17:39 geekosaur ...but it'd be an old ticket because that flapper's been around since, uh, sometime before the GLR IIRC
17:39 geekosaur oh, no, wrong stresstest
17:39 geekosaur but yeh I'd bet all stresstests are ignored because they flap so much
17:40 piojo_ joined #perl6
17:42 El_Che the on-off failures are pretty annoying when building on travis
17:43 Zoffix cpan@perlbuild4~/CPANPRC/rakudo (master)$ ./perl6 -e 'use fatal; "a".map: *.Int'
17:43 Zoffix Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏a' (indicated by ⏏)
17:43 Zoffix raschipi: ^ fix shipped
17:44 * Zoffix &
17:44 Zoffix left #perl6
17:44 AlexDaniel joined #perl6
17:45 raschipi m: try { CATCH { default { say "hello"; } }; my @x = "4,foo".split(",").map: *.Int; }
17:45 camelia rakudo-moar 07616effd: ( no output )
17:46 raschipi m: try { CATCH { default { say "hello"; } }; my @x = "4,foo".split(",").map: *.Int.self; }
17:46 camelia rakudo-moar 07616effd: OUTPUT: «hello␤»
17:46 raschipi pochi ↑
17:57 geospeck joined #perl6
18:03 Cabanossi joined #perl6
18:04 zakharyas joined #perl6
18:11 |oLa| joined #perl6
18:20 wamba joined #perl6
18:24 domidumont joined #perl6
18:25 orangebot joined #perl6
18:26 orangebot Hello!
18:26 AlexDaniel hi!
18:28 |oLa| left #perl6
18:31 someuser_ joined #perl6
18:31 tbrowder AlexDaniel: is there any way to hook up jnthn’s debuggers to use on rakudo?
18:32 AlexDaniel tbrowder: I don't think so, but I don't really know
18:32 AlexDaniel tbrowder: I've been doing printf debugging instead
18:33 tbrowder same, but it gets tiresome when the structure of some match objects is so complex.
18:40 AlexDaniel joined #perl6
18:44 TimToady Voldenet: we usually spell an empty block as {;}, which won't create a spurious state variable as {$} does
18:45 mahafyi are there differences between the free and paid versions of thinkperl6 book?
18:45 teatime aha
18:45 pochi raschipi: thanks
18:47 stmuk . o O ( isn't there supposed to be *another* Perl 6 coming? )
18:47 teatime every christmas? :)
18:48 teatime or select christmases, anyway.
18:55 orangebot Is there a way to introspect what can be passed to a class from something like `class Foo { has Int $.a }`?
19:00 geospeck joined #perl6
19:02 timotimo m: class Foo { has Int $.a }; say Foo.^attributes
19:02 camelia rakudo-moar 31db3accf: OUTPUT: «(Int $!a)␤»
19:02 raschipi m: class Foo { has Int $.a }; Foo.new.^attributes
19:02 camelia rakudo-moar 31db3accf: ( no output )
19:03 philomath_ joined #perl6
19:03 Cabanossi joined #perl6
19:10 AlexDaniel raschipi: say
19:11 raschipi I know, but just above timo already did it.
19:11 cdg joined #perl6
19:11 orangebot Thanks!
19:28 quotable6 joined #perl6
19:29 quotable6 joined #perl6
20:06 zakharyas joined #perl6
20:07 quotable6 joined #perl6
20:07 quotable6 joined #perl6
20:08 quotable6 joined #perl6
20:08 bloatable6 joined #perl6
20:08 nativecallable6 joined #perl6
20:08 unicodable6 joined #perl6
20:08 bisectable6 joined #perl6
20:08 greppable6 joined #perl6
20:08 coverable6 joined #perl6
20:08 reportable6 joined #perl6
20:08 benchable6 joined #perl6
20:08 evalable6 joined #perl6
20:08 releasable6 joined #perl6
20:08 committable6 joined #perl6
20:08 squashable6 joined #perl6
20:08 statisfiable6 joined #perl6
20:12 geospeck joined #perl6
20:12 rgrau joined #perl6
20:15 comborico1611 joined #perl6
20:20 dmaestro_ joined #perl6
20:29 wamba joined #perl6
20:38 virtualsue joined #perl6
20:42 dmaestro_ Here's another puzzler - what's happening here? (I really don't know)
20:42 dmaestro_ m: my $v; { given 1 { $v = ++$ }; say ++$  } for ^5; say $v
20:42 camelia rakudo-moar 31db3accf: OUTPUT: «1␤2␤3␤4␤5␤1␤»
20:42 dmaestro_ m: my $v; { { $v = ++$ }; say ++$  } for ^5; say $v
20:42 camelia rakudo-moar 31db3accf: OUTPUT: «1␤2␤3␤4␤5␤1␤»
20:42 dmaestro_ m: my $v; { $v = ++$; say ++$  } for ^5; say $v
20:42 camelia rakudo-moar 31db3accf: OUTPUT: «1␤2␤3␤4␤5␤5␤»
20:43 dmaestro_ The last is what I expect. How does the enclosing block affect the first ++$?
20:43 TeamBlast joined #perl6
20:43 nine_ joined #perl6
20:43 arnsholt joined #perl6
20:43 tyil joined #perl6
20:43 AlexDaniel dmaestro_: maybe this? https://docs.perl6.org/language/traps#Using_a_once_block
20:43 DarthGandalf joined #perl6
20:44 joy joined #perl6
20:44 afresh1 joined #perl6
20:44 [ptc] joined #perl6
20:44 virtualsue I've written my advent calendar post and scheduled it for Friday
20:44 moritz thanks virtualsue!
20:44 virtualsue if there is anyone here who can check it that would be nice
20:45 virtualsue no problem
20:45 cpage_ joined #perl6
20:45 AlexDaniel dmaestro_: tl;dr state variable goes out of scope, bye-bye state variable
20:45 virtualsue I'll be going on holiday tomorrow and i might not have internet access
20:46 moritz will do
20:46 * perlpilot looks at virtualsue's post
20:47 moritz there seems to be something funny with the code example markup
20:47 virtualsue oh - i'll double check it
20:48 moritz it renders everything starting from :RECURSE as a link or anchor or so
20:48 perlpilot and the very first line seems to be indented by one space too
20:48 eater joined #perl6
20:49 moritz :TAG<a>
20:49 dmaestro_ AlexDaniel: Thanks, that explains it. So the scope of $ is _just outside_ the block it is in ...
20:49 moritz probably needs some HTML escaping
20:51 virtualsue I can't figure out how to see that post again. I find WP quite a struggle to get on with.
20:52 moritz fixed it
20:52 moritz virtualsue: https://perl6advent.wordpress.com/wp-admin/post.php?post=6937&amp;action=edit is the edit link
20:52 AlexDaniel dmaestro_: to be honest I never really understood it properly. My hopes to understand it were lost when we had to change the behavior in some cases
20:52 AlexDaniel dmaestro_: for example:
20:52 virtualsue thank you!
20:52 AlexDaniel c: 2015.12,2017.11 for ^5 { ‘hello’ ~~ /{say $++}/ }
20:52 committable6 AlexDaniel, ¦2015.12: «0␤1␤2␤3␤4␤» ¦2017.11: «0␤0␤0␤0␤0␤»
20:53 AlexDaniel dmaestro_: the current behavior is correct, but I see no way to feel it intuitively
20:54 perlpilot virtualsue: is there more expository text or just "I wrote a spider, here it is, conclusion?"  (just making sure I'm not missing something)
20:55 dmaestro_ left #perl6
20:55 teatime AlexDaniel: ugh, I do not understand what that does
20:55 virtualsue you aren't missing anything. i may tweak it a bit more
20:55 dmaestro_ joined #perl6
20:56 perlpilot ok, cool
20:56 teatime not even the state variable weirdness you were demonstrating, just the (list) for (seq) {block}
20:57 AlexDaniel teatime: 2015.12,2017.11 is part of the command syntax for committable
20:57 teatime oh lol
20:57 teatime sorry
20:57 AlexDaniel teatime: basically asks it to run the same code on two revisions
20:57 AlexDaniel yea I know it is confusing at times
20:57 AlexDaniel but it's a shorthand for this
20:57 AlexDaniel committable6: 2015.12,2017.11 for ^5 { ‘hello’ ~~ /{say $++}/ }
20:57 committable6 AlexDaniel, ¦2015.12: «0␤1␤2␤3␤4␤» ¦2017.11: «0␤0␤0␤0␤0␤»
20:58 AlexDaniel so it *has* to read it that way if we want it to understand messages starting with its nickname :)
20:58 AlexDaniel though it gets even more confusing if you decide to use whitespace after the comma…
20:58 AlexDaniel committable6: 2015.12, 2017.11 for ^5 { ‘hello’ ~~ /{say $++}/ }
20:58 committable6 AlexDaniel, ¦2015.12: «0␤1␤2␤3␤4␤» ¦2017.11: «0␤0␤0␤0␤0␤»
20:59 AlexDaniel teatime: and then, /{…}/ is just a code block in a regex
21:00 setty1 joined #perl6
21:01 cdg joined #perl6
21:03 Cabanossi joined #perl6
21:03 cdg_ joined #perl6
21:03 teatime AlexDaniel: I was just trying to read it as perl6 code, is all
21:04 AlexDaniel m: 2015.12,2017.11: for ^5 { ‘hello’ ~~ /{say $++}/ }
21:04 camelia rakudo-moar 664967d09: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 2015.12,2017.11:7⏏5 for ^5 { ‘hello’ ~~ /{say $++}/ }␤    expecting any of:␤        colon pair␤»
21:04 AlexDaniel aww
21:10 cdg joined #perl6
21:13 leah2 joined #perl6
21:13 geospeck joined #perl6
21:33 ChoHag joined #perl6
21:42 Slayerk joined #perl6
21:42 Slayerk Is there any way to specify how slurp works?
21:43 tamva joined #perl6
21:43 teatime can you be more specific?
21:51 colomon_ joined #perl6
21:56 Slayerk teatime: I'm trying to get spaces in the .txt file to mean new items in the array
21:57 AlexDaniel Slayerk: maybe then ‘myfile’.IO.words ?
21:58 teatime yeah why not ^^, or more generally slurp → split
21:59 AlexDaniel you don't have to slurp to use split
21:59 teatime AlexDaniel: can you do something like,  for .words in $blah.lines
21:59 teatime like what's a clean/idiomatic/short way to do that nested loop
22:00 teatime one per line and one per word
22:00 Slyerk joined #perl6
22:00 Slyerk Got disconnected and then while I was disconnected someone connected using my original name...
22:01 AlexDaniel this is probably ok: for $blah.lines».words { … }
22:01 AlexDaniel Slyerk: https://irclog.perlgeek.de/perl6/2017-12-13#i_15573939
22:01 teatime interesting
22:01 teatime does the race-y nature of » do anything weird there
22:01 teatime like trying to access lines out of order
22:02 Slyerk Ah, thanks
22:02 AlexDaniel teatime: it has the right to do the splitting in parallel, but you'll be iterating it sequentially like normal
22:03 Cabanossi joined #perl6
22:03 tamva Hallo
22:05 tamva So, I'm wondering what the right way is to determine whether an "is default" attribute is set to it's default value
22:05 tamva Related to this, how does "is default" work with array containers?
22:07 jnthn m: my $x is default(42); say $x === $x.VAR.default; $x = 100; say $x === $x.VAR.default
22:07 yoleaux 14:28Z <tbrowder> jnthn: inside rakudo/src/Perl6/Pod.nqp, sub make_config, is it possible to dump to QAST, reform the QAST as desired, and inject it back as a final, serialized %config hash?
22:07 camelia rakudo-moar 664967d09: OUTPUT: «True␤False␤»
22:07 yoleaux 14:52Z <tbrowder> jnthn: please disregard last question
22:07 yoleaux 19:18Z <tbrowder> jnthn: is there any way to tie your grammar debuggers into the rakudo compiler?
22:07 jnthn .tell tbrowder No, though there is a --rxtrace option that you can pass to the compiler
22:07 yoleaux jnthn: I'll pass your message to tbrowder.
22:08 jnthn An Array is a collection of Scalar containers (unless you use binding), and all the Scalar containers in an Array share a descriptor, and thus share the default value.
22:11 tamva Ah, OK... I think that clears up my confusion.
22:11 tamva Thank you.
22:16 * Ulti just did a chunk of the 16th post, some nice graphs! https://perl6advent.files.wordpress.com/2017/12/bioinfo_frame_optimisations.png
22:16 Ulti delicious jit frames thanks to the work landing in the summer :D <3
22:17 Ulti I need to advocate a simple text output for --profile too :P
22:18 Ulti I feel slightly norty using pandas and python for the plotting :Z but it was just a bit too much effort to improve SVG Plot enough to do all this nicely
22:57 M-Illandan joined #perl6
22:58 ilmari[m] joined #perl6
23:09 comborico1611 joined #perl6
23:15 Morfent i'm running into trouble with locales for a C library i'm creating binds for
23:16 Morfent specificaly functions that convert utf8 and the like to other formats
23:17 Morfent s/formats/encodings
23:18 Morfent has anyone written code dealing with encodings and nativecall?
23:22 Zoffix joined #perl6
23:23 Zoffix Morfent: I haven't, but the nativecall doc mentions `is encoded` trait for strings. Maybe that is it? https://docs.perl6.org/language/nativecall
23:23 Zoffix bottom of this section: https://docs.perl6.org/language/nativecall#Passing_and_Returning_Values
23:25 Morfent that's not the problem i'm running into
23:25 Morfent gimme a minute
23:30 Zoffix I wouldn't know the answer :) There are a couple of NativeCall modules in ecosystem (NativeHelpers::Blob / NativeHelpers::CBuffer ); maybe they can help: http://modules.perl6.org/search/?q=nativecall
23:30 Zoffix \o
23:30 Zoffix left #perl6
23:36 Morfent possibly
23:36 Morfent i'll take a look at thoes
23:37 SCHAPiE joined #perl6
23:45 geekosaur you might be running into moarvm not actually doing locales currently
23:45 geekosaur like you have to tell it latin-1 instead of e.g. en_US.ISO8859-1
23:45 Morfent that sounds like my issue
23:48 Morfent how come moarvm doesn't support locales?
23:50 Morfent that sounds like a project i could work on so it can have that support
23:52 lizmat Morfent++
23:52 lizmat ++Morfent rather  :-)
23:53 geekosaur nobody's written it and there's probably "fun" involved in getting it to work on both unixlikes and native msvc
23:53 MasterDuke m: say
23:53 camelia rakudo-moar 664967d09: OUTPUT: «5===SORRY!5===␤Argument to "say" seems to be malformed␤at <tmp>:1␤------> 3say7⏏5<EOL>␤Other potential difficulties:␤    Unsupported use of bare "say"; in Perl 6 please use .say if you meant to call it as a method on $_, or use an …»
23:53 tyil say I want to install a p6 app through my package manager portage, which allows me to run code after installation finised, is there a way to generate all the precomp files the application would make on its first run, to speed up the first time the user would actually run the application
23:53 MasterDuke m: say()
23:53 camelia rakudo-moar 664967d09: OUTPUT: «␤»
23:54 tyil m: say;
23:54 camelia rakudo-moar 664967d09: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of bare "say"; in Perl 6 please use .say if you meant to call it as a method on $_, or use an explicit invocant or argument, or use &say to refer to the function as a noun␤at <tmp>:1…»
23:54 tyil hmm
23:54 rgrau joined #perl6
23:55 geekosaur (I wish you luck consistently mapping Unix locales to Windows code pages)
23:56 geekosaur ...and back
23:56 rvhausen joined #perl6
23:57 Morfent this is the code that's driving me nuts https://hastebin.com/onacihomuz.rb
23:58 Morfent * https://hastebin.com/eralujucoj.rb
23:58 Morfent i might need to learn lldm and deguf wtf's causing this

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

Perl 6 | Reference Documentation | Rakudo