»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
timotimo wakelift.de/2018/11/10/rakudo-perl...ss-report/ - lol i blogged a second time! 00:23
[ptc] timotimo++ # blog post :-) 00:36
timotimo :)
i'm thinking i should probably record a screencast or something detailing exactly how to install and run all of this
until the frontend gains some automatic "run this code and profile it and load the profile" button 00:37
MasterDuke timotimo: package it as a docker container/appimage/snap/flatpack? 00:59
timotimo i looked into appimage. it was a little bit No
i'll probably go for docker, that ought to be a bit easier 01:00
though i'm not entirely sure how to easily make the system-wide perl6 installation available to be used from inside the docker container without building some hacky RPC
basically a container-escape exploit, but on purpose 01:01
MasterDuke not include perl6 in the container? 01:09
timotimo it has to be in there for the cro app to run 01:12
MasterDuke then why do you need access to the system perl6? 01:13
timotimo well, the user wants to benchmark their code, right? 01:21
they probably have some libraries they want to use
woolfy timotimo++ I hope you get the attention it deserves. I posted it also on Perl6 facebook: www.facebook.com/groups/perl6/perm...944747019/ 01:23
MasterDuke ah, right 01:26
timotimo thank you, woolfy :)
Xliff \o 01:34
Did I miss a [Coke] blog post about Cro?
Xliff Who can I talk to about CArrays and CUnions?> 01:46
holyghost Xliff: that's in google if I remember 02:17
holyghost Xliff: did you look at Mathx::Stat, I've modified it with proper unit module/class syntax 02:56
Xliff Haven't yet, but I will 02:57
Still working on setting up the server for you, and working on my own code and... personal stuff.
holyghost ok, do a PR or something, give me the login, server name and pass on [email@hidden.address] 02:58
good luck with your code
Xliff You can guess what is taking the time, and no... no further details will be given. I'm more the if-you-don't-worry-you'll-be-happier types.
holyghost ok
Xliff Yeah, I'll do that when it's done.
holyghost thanks 02:59
really appreciate it
Xliff Sent you a reply
holyghost I'll take a look later on 03:00
Xliff Now back to eeevil GTK example.
bbl
holyghost lol I do GTK in C# on a mac
have fun
holyghost I'm not going to work in the weekend, so patience with my modules 03:09
Game::Markov needs much more reading, so is Mathx::Stat (the chaos theory I mentioned) 03:22
the seeking of attractors 03:23
Xliff m: say (pi/2).cos == 0 04:11
camelia False
Xliff What's the best way to get that to be True?
m: say (pi/2).cos =~= 0 04:12
camelia True
Xliff \o./
holyghost m: say unless { (pi/2).cos } 04:15
camelia 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…
SmokeMachine Xliff: does cos expect rad? 04:17
m: cos pi/2 04:18
camelia WARNINGS for <tmp>:
Useless use of "cos pi/2" in expression "cos pi/2" in sink context (line 1)
SmokeMachine m: say cos pi / 2 04:19
camelia 6.123233995736766e-17
zostay so i'm looking at all my travis-ci failures for perl6 and... am i really going to have to update every module to move use v6 up one line in every file? 04:24
Xliff zostay: I'm afraid so, yes. 04:25
SmokeMachine: Yeah. =~= saves the day! ;)
m: say (pi/2).cos =~= 0
camelia True
Xliff m: say (pi/2 + 0.01).cos =~= 0 04:26
camelia False
Xliff m: say (pi/2 + 0.001).cos =~= 0
camelia False
Xliff m: say (pi/2 + 0.0001).cos =~= 0
camelia False
Xliff m: say (pi/2 + 0.00001).cos =~= 0
camelia False
Xliff m: say (pi/2 + 0.000001).cos =~= 0
camelia False
Xliff m: say (pi/2 + 0.0000001).cos =~= 0
camelia False
Xliff Something tells me I need more zeros. :) 04:27
zostay ugh
Xliff zostay: :(
zostay i so look forward to perl6 releases breaking every module i've written at least once a year... it's my fave :-p 04:28
this one should at least be easy to script
Xliff Yes. :) 04:29
SmokeMachine zostay: perl6 -i -pe ‘BEGIN say “use v6;”; next if /^ \s* use \s+ v6\s* ; \s* $/; .say ‘ ? 04:30
Xliff: :tolerance? 04:31
zostay something like that... then i just have to run it on all the .pm6 files in every project in my perl6 dir
buggable New CPAN upload: Email-Address-0.1.tar.gz by HANENKAMP cpan.metacpan.org/authors/id/H/HA/...0.1.tar.gz
zostay one step closer to being able to replace my p5 mail filtering scripts with ones in p6 04:32
Xliff zostay: find perl6dir -name \*.perl6 -exec replace_script {} \; 04:34
SmokeMachine: Yep.
SmokeMachine zostay: or ggOuse v6;<esc>/use v6<enter>dd As a vi macro...
Xliff zostay: You really want that in a script so your ';' characters don't screw up find.
Xliff .seen timotimo 05:15
yoleaux I saw timotimo 01:26Z in #perl6: <timotimo> thank you, woolfy :)
Xliff m: my ($x, $y) = (4, 4); ($x, $y) -= (1, 2); $x.say; $y.say 07:44
camelia 0
(Any)
Xliff m: my ($x, $y) = (4, 4); ($x, $y) >>-=<< (1, 2); $x.say; $y.say
camelia 3
2
Xliff say [-]( |(2, 3) »*« (2, 3) ) 07:59
evalable6 -5
woolfy woolfy 08:09
(sigh)
lizmat . 12:35
timotimo yo xliff i'm still on the move, but you can ask me already if its still relevant 12:49
stmuk_ www.reddit.com/r/perl6/comments/9v...ndar_2019/ 12:53
timotimo uh oh 13:34
it has sleep sort with actual "sleep"
that won't work with too many numbers
timotimo that's ash's website? 13:36
buggable New CPAN upload: Email-Address-0.2.tar.gz by HANENKAMP modules.perl6.org/dist/Email::Addre...:HANENKAMP 15:01
AlexDaniel releasable6: status 15:20
releasable6 AlexDaniel, Next release in ≈7 days and ≈3 hours. 4 blockers. 0 out of 103 commits logged
AlexDaniel, Details: gist.github.com/62de313f9cb9d38d1c...215a72ce03
buggable New CPAN upload: AWS-Session-0.7.tar.gz by HANENKAMP modules.perl6.org/dist/AWS::Session...:HANENKAMP 17:01
sena_kun I cannot generate(as in compiler) Perl 6 code if I don't want to work with a textual code representation and its pains, can I? 17:19
oh, stop, maybe I don't need to. 17:20
moritz .tell Zoffix the TLS cert for perl6.party has expired 17:32
yoleaux moritz: I'll pass your message to Zoffix.
timotimo sena_kun: but you totally can, you can build QAST :) 17:39
sena_kun timotimo, well, I thought I need a compiler, but "Hmm, if everything is interpreted here, why must it be a compiler again?" and I couldn't answer. :) 17:40
tobs I'm in a similar situation. I have an AST of a mini-language inside my Perl 6 program and want to compile it into a Callable. I can but *should* I use QAST in this case? 17:50
tobs I mean is it part of the implementation details of which we are always reminded not to use them, when someone mentions nqp? 17:51
timotimo you don't have to, no :)
you can actually stack a bunch of callables together by way of closures deciding what to call where
tobs ^ that's what I'm doing now 17:52
timotimo good call
tobs and hoping that they are inlined eventually
timotimo hm, it's true though, qast is even a little bit worse than just using nqp ops
tobs might still be fun to try though, with a fallback :-) 17:57
pmurias tobs: what are you building? 18:06
tobs pmurias: a propositional calculus module. Having a very small Callable for a Boolean function would be much better than walking the AST representation when generating a truth table. 18:18
buggable New CPAN upload: Hash-MultiValue-0.7.tar.gz by HANENKAMP modules.perl6.org/dist/Hash::MultiV...:HANENKAMP 19:01
Xliff \o 19:29
Geth doc: 5feaf6e59c | (Tim Smith)++ | doc/Language/operators.pod6
Fix typo in example identifier name
synopsebot Link: doc.perl6.org/language/operators
Xliff timotimo and sena_kun: gist.github.com/Xliff/8e402d623cea...45e820d7fd 19:29
gist.github.com/Xliff/b98f00d93194...c65ad3c737 19:30
Long standing weirdness.
The first link has code that is completely self-contained.
sena_kun Xliff, I am sorry, but I am not sure why I am being casted in this case. 19:47
Xliff sena_kun: Sorry. I thought you knew a little about NativeCall. 19:49
sena_kun ah, no problem then, but no, I think I am not. :)
Xliff :)
jdv79 is there any docs on what IO::Socket::Async does when the far side closes 20:01
jdv79 is that just a "done" on the Supply's taps? 20:01
timotimo jdv79: done in one case, quit in another, i expect 20:04
jdv79 what cases would that be? 20:05
timotimo reset by peer or something? 20:06
timotimo anything erroneous, when you get an RST? 20:06
Xliff: do you ever have to introspect the types involved? what happens if you turn them all into Pointer? 20:07
timotimo for example, if your GValue is somehow not the right size, it could make init_value and friends write into unowned memory 20:08
you could compare "nativesizeof GValue" with what you get from sizeof(GValue) in gdb
Xliff Yes. It's 24 bytes across the board. 20:12
I think I talk about that in the second link.
jnthn jdv79: stackoverflow.com/questions/530545...ocketasync 20:13
yoleaux 5 Nov 2018 20:05Z <Xliff> jnthn: Is this a bug in CArray, or how I am using it? gist.github.com/Xliff/b98f00d93194...c65ad3c737
Xliff Oh. Wow! Great timing!
jnthn: Self contained code is here - gist.github.com/Xliff/8e402d623cea...45e820d7fd 20:14
jnthn I'm probably way to full of cold to think about anything difficult :) 20:15
Xliff Heh! No worries. 20:16
jnthn I wonder if it's relevant that CArray, when allocated from the Perl 6 program, allocates memory up to the size of the last assigned element
timotimo have you valground it yet?
jnthn And that also it caches the Perl 6 values
So if it's some kind of out-dated data problem then there's some native refresh thingy that is sometimes needed. 20:17
I forget the details.
Xliff timotimo: No. No valgrinding, yet.
jnthn And yeah, what timotimo said; valgrind can do wonders in explaining memory problems.
Xliff Excellent! Then that's a place to start. Thanks. 20:18
jdv79 jnthn: thanks 20:29
kensanata Style question, cro related: I have $pw is cookie declared and to decode it. That means I can't use the same variable name. So: my $pw_decoded = uri_decode_component($pw || ''); Now I need to all a function and would love to use :$pw but no, I need to use pw => $pw_decoded. What am I doing wrong? What I really want to do is $pw = uri_decode_component($pw || '') and then use :$pw. 20:42
sena_kun well, I am not sure you can avoid that. If you mean something like "I want to tell Cro to apply this decoder to this cookie, so do it for me", we don't have anything like that. And it is, in fact, more of user side of things, imho. So I'd do it with `pw => $pw-decoded`, as it relates to application logic, not http processing. 20:46
kensanata, ^
if you have, like, 10 such cookies per route and it makes the code look worse, I'd factor this decoding & response setting piece out into a subroutine, but no more. 20:49
kensanata Well, I guess I could frame it as a general case: perl6 offers the shortcut :$foo, but disallows the changing of functino arguments, forcing me to write ugly code for every function that has an argument $foo, has to do something to the value and wants to pass it along to the next one, still calling it $foo.
sena_kun kensanata, can you try with `is rw` applied to cookie parameter? I suspect it might be a bad thing in Cro case, but as in general case, it might help. 20:53
kensanata sena_kun: interesting proposition. I thought that only applied to classes and attributes... 20:54
sena_kun ahh 20:55
nope, I am wrong.
sena_kun m: sub bar(:$foo) { $foo.say }; sub foo(:$foo is rw) { $foo = $foo + 10; bar(:$foo) }; 20:55
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use 'is rw' on optional parameter '$foo'.
at <tmp>:1
sena_kun well, then I don't know. And, probably, don't even consider the code you worry about as _too_ ugly to worry about. 20:56
s/you worry about/you write/ 20:57
kensanata Both! :D
sena_kun well, without `:g`, only first one, or at least I remember it being so. :)
timotimo you probably don't want rw, you'll want copy instead 20:58
m: sub bar(:$foo is copy) { $foo.say }; bar(99)
camelia Too many positionals passed; expected 0 arguments but got 1
in sub bar at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo m: sub bar(:$foo is copy) { $foo.say }; bar(foo => 99)
camelia 99
timotimo "is copy" works with optional parameter
sena_kun m: sub bar(:$foo) { $foo.say }; sub foo(:$foo is copy) { $foo = $foo + 10; bar(:$foo) }; foo(foo => 10);
camelia 20
sena_kun kensanata, ^ 20:59
timotimo++
kensanata Awesome. Will try! 21:00
kensanata That seems to work. Thanks, timotimo! 21:01
timotimo YW :) 21:02
jnthn Probably `is copy` is cleanest, though an alternative is `:pw($pw-undec)` to decouple the named parameter name from the variable it's bound into 21:09
You may also want to file a Cro feature request for a way to ask the router to do a certain decoding of cookies; we might be able to add such a feature at some point. 21:10
sena_kun jnthn, with matching API for e.g. headers? 21:12
jnthn sena_kun: I'm not sure that's so commonly needed 21:31
kensanata I'm not sure what to suggest. I'm using URI::Encode because I'm encoding two or three strings. Is this rare? Common? Do people store complex data? Is base64 what they expect? I have no idea. So perhaps all I would ask is for an example in the documentation? 22:10
buggable New CPAN upload: Oddmuse-0.0.4.tar.gz by SCHROEDER modules.perl6.org/dist/Oddmuse6:cpan:SCHROEDER 22:11
kensanata Next challenge: writing a new, grammar-based, extensible Markdown-to-HTML converter... with automated tests from the CommonMark project. 22:13