»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
ZoffixLappy stanrifkin_, how do you figure you only got "6.c 2015.12"? How do you get that information? 00:00
sortiz timotimo, MoarVM's default is to use the _included_ dyncall, right? 00:01
stanrifkin_ ZoffixLappy: perl6 -v
ZoffixLappy stanrifkin_, what does it call? Run which perl6 00:02
I'm thinking maybe you have two perls installed
stanrifkin_ ZoffixLappy: it runs my perl6 installation in ~/.rakudobrew/bin/
stanrifkin_ ZoffixLappy: you're right 00:04
ZoffixLappy *shrug*. nuking ~/.rakudobrew and ~/.perl6 is always an option, though I'm unsure why it's not upgrading you
stanrifkin_ ZoffixLappy: i have to use moar-nom - it's always updates that one
geekosaur you can tell it to point to a specific version, iirc 00:05
timotimo sortiz: that's the default, yes
ZoffixLappy You can try running rakudobrew self-upgrade; and then rakudobrew build moar again. Might be some bug in your older rakudobrew, but I'm really unsure
stanrifkin_ ZoffixLappy: it seems to work now - i didn't realize to use moar-nom 00:06
ZoffixLappy isn't sure what you're talking about
geekosaur is thinking run "rakudobrew current" to check what it currently thinks it's doing and "rakudobrew rehash" to make it repoint things to currently installed 00:07
possibly "rakudobrew switch moar" if it's currently defaulting to something else 00:08
stanrifkin_ yes. i switch to moar-nom and have now the current version
teatime is uniprops no longer a thing? 00:09
timotimo uniprop*s*? 00:13
teatime yes, there are lots of references around to a uniprops hash
S15 is an example
AlexDaniel hash? :o
timotimo oh, huh 00:14
well, the information is there in our database, but we can't quite query it
stanrifkin_ i asked some time ago. do you prefer .pl6 or simply .p6 filename suffix? 00:32
ZoffixLappy .p6 for me 00:33
stanrifkin_ so there is no general consent yet? i just come across the tutorial 00:36
and they use .pl6
timotimo i like .p6
just because i'ven't been a perl programmer before i encountered the six
stanrifkin_ i like .p6 more too 00:37
ZoffixLappy is a 10-year P5 veteran 00:38
Xliff is a P5 veteran, also. 00:39
stanrifkin_ "veteran" like you come home from war :) 00:40
geekosaur works on a tangled C codebase for pay. some wars never end >.> 00:42
ZoffixLappy stanrifkin_, 'veteran' has multiple meanings, one of which is "a person who has had long service or experience in an occupation, office, or the like" 00:44
teatime are modules supposed to be .pm6 ? 00:49
stanrifkin_ teatime: seems to be .pm 00:51
ZoffixLappy That's what I use. I'm unsure if they're "supposed to be"
I'd argue against .pm because that's what P5 uses.
stanrifkin_ teatime: the own perl6 source uses .pm - so i thought 00:52
teatime decides on .pm6 for modules, .p6 or no extension for scripts. for now.
.p6 looks strange and futuristic. like P6. 00:53
ZoffixLappy stanrifkin_, where? I see only .pm6 in github.com/rakudo/rakudo/tree/nom/lib
stanrifkin_ ZoffixLappy: github.com/rakudo/rakudo/tree/nom/src/core 00:56
ZoffixLappy stanrifkin_, ah. Well, those are types, not modules :)
stanrifkin_ ZoffixLappy: ok 00:58
ZoffixLappy BTW, I still didn't get an answer for question I asked this noon: irclog.perlgeek.de/perl6/2016-04-14#i_12338595 01:01
Is the entire spectest supposed to be passing? 01:02
sortiz spectesting now... 01:06
diakopter some fail for me 01:09
dalek c: db663fc | (Zoffix Znet)++ | doc/Language/testing.pod:
Fix signature for throws-like
01:12
sortiz Do you do 'make install' before 'make spectest', last time I check, seems to be an issue about the need to 'make install' first. 01:13
ZoffixLappy diakopter, are they the t/spec/S06-advanced/wrap.t?
ZoffixLappy didn't run make install... tries
diakopter no
'course, I was testing a branch of moarvm; I need to test the master branch 01:14
sortiz t/spec/S06-advanced/wrap.rakudo.moar .......................... ok 01:19
sortiz ZoffixLappy, In your gist seems that you are trying the unprocessed *.t, that have a few '#?rakudo todo' 01:32
ZoffixLappy Oh. 01:34
sortiz you should try the post-processed *.rakudo.moar files
ZoffixLappy Ah
sortiz Btw: All tests successful. Files=1092, Tests=51391, 838 wallclock secs ( 4.56 usr 0.81 sys + 608.21 cusr 41.04 csys = 654.62 CPU) Result: PASS 01:35
ZoffixLappy I'm running `make spectest` (still running), and yet "t/spec/S06-advanced/wrap.rakudo.moar .......................... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/85 subtests " 01:36
That's on nom from yesterday, before my patch
sortiz This is Rakudo version 2016.03-118-g4f3f1c8 built on MoarVM version 2016.03-108-gca1a21a 01:37
i.e. nom latest 01:38
ZoffixLappy (before my unmerged patch)... the advanced/wrap tests fail for me and adding my seemingly unrelated patch adds another failure for some reason :/ 01:39
Oh. Two more failures in t/spec/S32-io/IO-Socket-Async.t :/
ZoffixLappy Here's the result: gist.github.com/zoffixznet/c2cc8df...f92002d0ee 01:43
ZoffixLappy will deal with this tomorrow...
ZoffixLappy m: use Test; throws-like { fail '404' }, Exception, 'delete on non-existent snippet throws', message => /404/; 01:52
camelia rakudo-moar 4f3f1c: OUTPUT« 1..3␤ ok 1 - code dies␤ ok 2 - right exception type (Exception)␤ ok 3 - .message matches /404/␤ok 1 - delete on non-existent snippet throws␤»
ZoffixLappy I'm not seeing the difference between the above and mine, which fails with an error :S gist.github.com/zoffixznet/7ecb36a...200f1a94c1
ZoffixLappy Oh, never mind. I see it now.... too many beers :) 01:54
Although, I'm disappointed Perl 6 doesn't read my mind :D
sortiz I'm disappointed because can't read Perl6's mind. 02:22
ZoffixLappy :D 02:26
Herby_ m: 'abc42' ~~ / \d / and say ~$/; 02:59
camelia rakudo-moar 4f3f1c: OUTPUT«4␤»
Herby_ m: 'c:\tv\show\episodeName' ~~ / episodeName / and say ~$/; 03:01
camelia rakudo-moar 4f3f1c: OUTPUT«episodeName␤»
Herby_ m: 'c:\tv\show\episodeName' ~~ / .+ \\ \w+ / and say ~$/; 03:02
camelia rakudo-moar 4f3f1c: OUTPUT«c:\tv\show\episodeName␤»
Herby_ i'm hosing that up
if I have a path like 'c:\tv\show\episodeName', how do I regex the episodeName?
trying to list contents of a folder and grab just the file name 03:03
ZoffixLappy Herby_, perhaps one of the methods in IO::Spec::Win32 ? 03:06
geekosaur m: 'c:\tv\show\episodeName' ~~ / .+ \\ ( \w+ ) / and say ~$0;
camelia rakudo-moar 4f3f1c: OUTPUT«episodeName␤»
geekosaur however I'd not trust \w there
Herby_ ZoffixLappy: I'll take a look, thanks 03:07
geekosaur, would it be safer to just grab everything after the last '\'? 03:08
m: 'c:\tv\show\episodeName' ~~ / .+ \\ ( .+ ) / and say ~$0;
camelia rakudo-moar 4f3f1c: OUTPUT«episodeName␤»
Herby_ m: 'c:\tv\show\season 2\episodeName' ~~ / .+ \\ ( .+ ) / and say ~$0; 03:09
camelia rakudo-moar 4f3f1c: OUTPUT«episodeName␤»
geekosaur Herby_, yes 03:10
Herby_ one more question: if my path structure was 'c:\tv\show\season n\episodeName' 03:11
geekosaur my paranoia kinda prefers
m: 'c:\tv\show\episodeName' ~~ / .+ \\ ( <-[ \\ ]>+ ) / and say ~$0;
camelia rakudo-moar 4f3f1c: OUTPUT«episodeName␤»
Herby_ and I wanted to grab the season and the episode
m: 'c:\tv\show\season 2\episodeName' ~~ / .+ \\ ( .+ ) \\ ( .+ ) / and say ~$0 ~ ~$1; 03:12
camelia rakudo-moar 4f3f1c: OUTPUT«season 2episodeName␤»
geekosaur m: 'c:\tv\show\episodeName' ~~ / .+ \\ (season \d+) \\ ( <-[ \\ ]>+ ) / and say "$1, $0";
camelia ( no output )
geekosaur whoops 03:13
m: 'c:\tv\show\season 3\episodeName' ~~ / .+ \\ (season \d+) \\ ( <-[ \\ ]>+ ) / and say "$1, $0";
camelia ( no output )
Herby_ m: 'c:\tv\show\season 2\episodeName' ~~ / .+ \\ ( .+ ) \\ ( .+ ) / and say "$0 \t $1"; 03:14
camelia rakudo-moar 4f3f1c: OUTPUT«season 2 episodeName␤»
Herby_ geekosaur: why do you like the "( <-[ \\ ]>+ )" more? 03:15
my regex is weak, and really weak in p6
geekosaur because it specifies exactly where I want to allow the \\-s 03:16
I could hope it does the right thing like you are, but certain changes to that regex could surprise you 03:17
Herby_ hmm ok. I'll play around with it but you've given me a headstart, thanks 03:18
geekosaur and if your luck is anything like mine, that surprise will come in the form of a multihour debugging session when you really need the sleep instead >.>
Herby_ i might try and get real fancy and use grammars 03:20
gotta read up on them
well, i guess that would be overkill 03:21
geekosaur for this, likely yes.
Herby_ since I'm just parsing one path at a time
geekosaur that and they're not e.g. recursive 03:22
or complex conditionals 03:23
teatime \o 04:05
diakopter thank you captionbot.ai 05:43
i.imgur.com/8fHikFv.png
tony-o MadcapJake: a really inefficient/ineffective search is available on modules.zef.pm 05:45
well, it's kind of effective but it's not great 05:46
MadcapJake I've found github.com/krisk/Fuse to be an easy way to get fuzzy search on client-side
tony-o i'm using perl
i did write some of the Levenshtein Damerau XS perl module, that's what i'm currently using - i think i just need to weight the types of matches, i haven't done any tuning to the search yet 05:47
it's currently looking at author/module name/provides 05:48
MadcapJake it doesn't seem to organize them 05:49
modules.zef.pm/search?terms=Test
diakopter this one's better: i.imgur.com/tyNsrWs.png
MadcapJake tony-o: almost finished with this highlight.js PR but I hit an unfortunate road-block: heredocs are completely unsupported. 05:52
moritz heredocs are *hard* 06:08
ufobat morning :-) 06:44
masak morning, #perl6 07:17
Perl 6 day today! \o/ 07:18
ufobat what is a perl6 day? 07:23
moritz it's like Friday, only better :-) 07:25
masak ufobat: I have things set up with my employer that I work 80% and use 20% of my time for Perl 6. 07:26
(we're hiring)
tadzik grumbles 07:30
masak :0 07:31
:)
masak pats tadzik
*pat pat*
moritz hugs tardisx
erm
moritz hugs tadzik
tab completion fail :-)
tadzik :} 07:32
masak Hug a Stranger Day! :D
masak hugs mre_
moritz hugs wtw
masak hugs vendethiel 07:33
oh wait. I know you. never mind.
tadzik www.thewalkingdead.com/wp-content/u...wkward.jpg 07:34
masak ct.weirdnutdaily.com/ol/wn/sw/i53/2...19e658.jpg
jeek www.thewalkingdead.com/readme.html 07:36
Oh, that's dangerous.
masak jeek: could you provide some context to that comment?
jeek Their Wordpress install is from December 11, 2012. They're missing three and a half years of security patches. :) 07:37
ufobat huggs huf
tadzik oh-oh
ufobat masak, that sounds great!
huf wasnt me
masak ufobat: it's great when it works ;) 07:38
jeek masak: Your site?
masak jeek: never heard of it
jeek You've never herad of thewalkingdead.com ? You just linked it...
*heard
masak oh, tadzik did
ufobat yeah.. "but there are bugs all over the place! fix it masak.." is it like that?
jeek Err, whoops.
tadzik I linked to it, actually
jeek tadzik, yes. Sorry, not awake.
tadzik and only because that's what came up when I google-imaged for "hawkward" :)
I avoid series that are less than 10 years old 07:39
masak .oO( someone is missing Wordpress patches on the Internet )
ufobat i've got release day today, not perl6 day
jeek Well, at least no one noticed.
tadzik until now! Muahahah
jeek No one that has ever bothered to download and install github.com/wpscanteam/wpscan , at leats. 07:40
*least
Man, I cannot type tonight.
moritz makes me almost want to automatically search for such autodated versions, and automatically exploit them, and then force-update them to newest (and install an auto-updater)
moritz s/autodated/outdated/ 07:40
moritz can't type either
jeek masak: Enough context for you? :) 07:41
masak yes. thank you. 07:45
Woodi hey! stop that! 08:04
you not hear panama papers was out thanx to great Wordpress ??
Woodi now jurnalists have their version of Big Data (<2Tb) ;) 08:05
masak if you could program Perl 6 in the browser instead of JavaScript, would you? 08:10
let's assume no extra cost for the extra layer of indirection -- slightly unrealistic -- except that you would have to compile down to JS or wasm 08:11
RabidGravy maybe, but I didn't really do Perl 5 in the browser when Activestate made a Perl 5 thing for the scripting host for I.E. back in the day ;-) 08:13
masak what I'm especially after is some kind of "one environment" feeling between client and server 08:15
it feels so weird and unnecessary to be writing one client application and one server application
especially as some use cases and code paths effectively straddle the two
RabidGravy yeah I think the way Perl 6 is pushes that boundary closer to the client, when I was at $large-bank the other year I felt compelled to make a client event middleware in node.js, I'd probably do that in P6 now 08:18
masak not sure I understand what you want to say with "pushes that boundary closer to the client"... 08:20
RabidGravy I started Lumberjack::Application because I wanted to test how little javascript I could get away with, the way that e.g. WebSocket lets you do that naturally helps 08:21
masak aha 08:22
wouldn't that... push the boundary closer to the server, though?
CIAvash Yeah, I would like to see Perl 6 -> wasm too
Woodi would like to see clouds pushed to *home* servers... 08:23
you know, Mrs. H. Clinton way but better :)
RabidGravy yeah, I can foresee something whereby you write server code with some indication that "this is part of the client stuff" and it gets translated to, say, javascript on the way out to the client taking care of all the client/server communication 08:26
masak I see such solutions sometimes. they seem promising but not quite battle-tested yet. 08:27
Woodi VNC, Xserver ? :)
RabidGravy bits of ASP.net went somewhere toward that 08:28
JSP was awful
masak I agree. it would be interesting to dissect *why* JSP was awful. 08:29
like, in the light of current known best practices on the web.
Woodi masak: I think it was ecosystem fault - thing was pushed only for enterprises not plain ppls. and performance... 08:32
so, if Wordpress destroy management trust in PHP technology, what we will use instead ? 08:33
RabidGravy I'd carry on as normal, never used Wordpress 08:34
masak sounds good to me. 08:35
Woodi I just wonder how secure are that mini-httpd-servers from node, Perl, Python, etc...
masak I have used Wordpress, and MediaWiki, but I probably won't much in the future.
RabidGravy well for the most part those things are probably as secure as the most paranoid brain on the development team writing the application can make them :) 08:37
the mini-er the better in general, the fewer default behaviours that the server framework has the less chance of being bitten by some suprise security hole 08:38
RabidGravy of course that plays both ways, if bad programmers implement their own e.g. "serve static content" they can do even worse 08:39
Woodi RabidGravy: but it will be standard-package anyway like: var http = require("http"); in node... and how about performance compared to apache and nginx ?
Woodi hmm, probably I worry about performance more then security :) 08:40
jnthn It seems fairly common to stick nginx or similiar in front of node and friends as a reverse proxy. Seems to perform well enough even with that proxying taking place. :) 08:41
masak Woodi: that sentence is a case where s/then/than/ actually alters meaning
pmurias Perl 6 -> wasm won't be happening any time soon
masak pmurias: I'll take your word for it :/
pmurias for now wasm is just bytecode asm.js
pmurias if we really wanted to compile to it we would have to use enscripten and run MoarVM on top of wasm 08:45
pmurias masak: re one environment feeling one big obstacle to that is that the user running part is untrusted 08:46
RabidGravy I think what I am thinking of in the first case is somewhat more high level 08:47
RabidGravy that is a "thing" whereby you have a template for the UI lke "[% WHENEVER SomeSupply %] ... # draw a table row " and it generates the server part that does all the websocket thing and a client part that connects and does the rendering 08:50
Woodi RabidGravy: so all "state" is moved server side ? and client do rendering only; client can choose prefered theme and things like that ? :) 08:51
RabidGravy more that where the line is drawn is normally unimportant to the programmer 08:53
masak pmurias: oh, that's a good insight. 08:55
pmurias: right, "don't trust user input".
pmurias in the modern web app part it turns into "don't trust the UI" ;) 08:56
masak pmurias: so the tension becomes pretending that the client code is in the same environment while also maintaining input validation from the client.
masak this could probably be statically checked somehow. 08:56
like, a value that crosses over to the server is automatically "tainted".
RabidGravy that's always been the same since client/server applications started appearing 08:57
pmurias masak: AFAIK there are react.js (and I think for other frameworks too) things that blend the client/server distinction, but instead they support moving the client part to the server and prerendering your webapp 09:00
masak pmurias: Ember's fastboot heads in that direction as well. 09:05
basically using the same code paths on the server to send a pre-rendered page to the client, and then reconstituting the app on the client side. 09:06
Woodi render pixels and send them ;) and VNC additionally resolves sessions problem :) 09:07
masak .oO( any sufficiently advanced tongue-in-cheek is indistinguishable from noise ) 09:09
RabidGravy anyway this is not getting the authentication part of Sofa finished 09:14
just that and making it replace "couchapp" seamlessly and it's good to go ;-)
pmurias jnthn: is auto vivication of attributes just an optimalisation or is it important for semantics? 09:23
jnthn pmurias: Semantics. 09:28
pmurias jnthn: could I just clone the containers at object creation or is possible for the cloning to have some serious sideeffects
jnthn pmurias: Oh...you could do that
pmurias: It's the REPR's job to make sure it returns a fresh container 09:29
pmurias: You could do it at creation time
That was a very data-driven optimization, fwiw.
It's because every routine has a $_, $/, and $!, but 90%+ of routines never used them.
So you get to save 3 memory allocations in a lot of cases :) 09:30
Which made quite a difference :)
pmurias $_, $/, $! are stored in attributes rather then lexicals?
jnthn Oh... 09:31
No, those are lexicals...which also get auto-viv :) 09:32
Oh...
Yeah, there's another semantic detail too
Check isattrinitted
If you don't put off the init then you'll need another way to implement that. 09:33
pmurias jnthn: hmm, most attribute lookups have a statically determined class handle so maybe I'll be able to avoid paying the price everywhere 10:00
masak m: my $s = "%7B%22type%22%3A%22placement%22%2C%22own%22%3A%5B5%2C6%5D%2C%22neutral%22%3A%5B6%2C10%5D%7D"; $s ~~ s:g['\''%'\''(..)] = chr(:16(~$0)); say $s 10:34
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/sYM3DkxZZ5␤Missing quantifier on the left argument of %␤at /tmp/sYM3DkxZZ5:1␤------> 3l%22%3A%5B6%2C10%5D%7D"; $s ~~ s:g['\''%7⏏5'\''(..)] = chr(:16(~$0)); say $s␤»
masak m: my $s = "%7B%22type%22%3A%22placement%22%2C%22own%22%3A%5B5%2C6%5D%2C%22neutral%22%3A%5B6%2C10%5D%7D"; $s ~~ s:g['%'(..)] = chr(:16(~$0)); say $s
camelia rakudo-moar 4f3f1c: OUTPUT«{"type":"placement","own":[5,6],"neutral":[6,10]}␤»
masak cool.
I've come to really appreciate the `~~ s[] =` syntax 10:35
tony-o oh, that's really nice 10:37
RabidGravy that had me scared for a minute 10:53
then I realised it was *still a string*
psch \o 10:54
jazz theory is ridiculous 10:55
RabidGravy I think I have the "Encyclopedia of Jazz Theory" on the shelf over there ^ 10:55
psch i mean, i don't really know a lot 10:56
but what i start to understand scares me :P
jast life is a lot less terrifying if you understand *just enough* of everything without getting in more deeply ;) 10:56
RabidGravy it is quite scary :) 10:57
anyhow I'm off out shopping
moritz well, science says you're much more scared of stuff you don't know 10:58
but there are areas where I suspect the opposite is true
climate change, nuclear reactor theory, how software is made
jast science doesn't say anything. humans interpreting scientific findings say things. and that's where science gets scary, too. :} 10:59
awwaiid science is the art of accurately predicting the future
moritz jast: I know, I'm just glossing over the details
psch which, curiously, was the advice by jast to not get terrified :) 11:06
jast there's a method to my madness!
psch boos at past psch 11:07
non-deterministic tests *shakes fist*
jast I find that non-determinism adds a lot of excitement to development, tests, debugging, and cooking 11:08
psch the weird bit is that there shouldn't be a case that doesn't pass
psch oh, wait, there is 11:08
well, the pentatonic scale isn't for making chords anyway, so it'll have to go vOv 11:09
jast depends on the chords 11:10
psch right, but i won't stand for an augmented fifth as a tonic 11:11
timotimo doesn't know anything about jazz theory 11:12
timotimo is it "as long as people play in the same scale, they can play whatever the F they want to and people will still cheer"? :P 11:15
psch timotimo: pretty much, minus "in the same scale"
jast IMO scales are overrated 11:16
timotimo "as long as people play, people will cheer", OK
jast I'm more of a "screw theory, just write/play it the way you want it to sound" guy
timotimo i'm at the "i don't care what i want it to sound like, i couldn't make it so anyway" stage of learning how to music 11:18
jast you start by stealing a lot
at some point you become so good at stealing that it's indistinguishable from innovating :}
timotimo so first you become good at stealing so you can make new stuff that's like existing stuff, then you get bad at that again and create stuff that's unlike existing stuff 11:20
and then you create new kinds of music!
jast you could see the stealing as a way of kickstarting your own creative abilities with something that's known to "work" 11:22
at first you don't diverge too wildly in experimenting with making changes, and as you get more of a sense of how it all works you become more bold
timotimo OK, because if you steal from /dev/urandom, you're not guaranteed to notice if you're doing it well or not
jast you're not guaranteed either way, but starting from something solid allows for smaller iterations that still "work" 11:23
make a small iteration on /dev/urandom and you're still pretty much in random land
psch it also strongly depends on what exactly "making music" means i think 11:26
timotimo hehe. 11:27
psch like, if one was to learn an instrument, playing things that already exist for a few years is pretty much mandatory
but e.g. digital composition might work better with just picking a song and trying to recreate it in your favorite DAW 11:28
jast yeah, and that will be part awesome and part depressing... because recreating all the details takes very good listening skills and a very good understanding of what the details you hear mean and what they're made up of 11:33
but you have to start somewhere, so might as well focus on the awesome aspects
grondilu javascript has something to build functions from a string : var myFunction = new Function("a", "b", "return a * b"); How could I do that in Perl 6 with decent performance? 11:42
(doing sub ($functionbody) { sub (|args) { EVAL $functionbody } } looks silly) 11:44
arnsholt my $sub = EVAL "sub { $body }" # I suppose 11:45
Or something along those lines
grondilu oh damn I so dumb. Yeah the EVAL would be evaluated only once, right?
grondilu so performance should be totally fine. 11:46
m: my &f = EVAL 'sub ($a, $b) { $a + $b }"; say &f(1, 2);
camelia rakudo-moar 4f3f1c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/8C2AYdIj9w␤Unable to parse expression in single quotes; couldn't find final "'" ␤at /tmp/8C2AYdIj9w:1␤------> 3sub ($a, $b) { $a + $b }"; say &f(1, 2);7⏏5<EOL>␤ expecting any of:␤ argu…»
grondilu m: my &f = EVAL 'sub ($a, $b) { $a + $b }'; say &f(1, 2);
camelia rakudo-moar 4f3f1c: OUTPUT«3␤»
grondilu it was so simple I feel genuinely embarassed. 11:47
moritz m: my &f = EVAL 'sub ($a, $b) { $a + $b }'; say f(1, 2); 11:48
camelia rakudo-moar 4f3f1c: OUTPUT«3␤»
moritz you don't even need the & at invocation
jnthn finally wrote last week's Perl 6 hacking up: 6guts.wordpress.com/2016/04/15/hea...ap-hooray/ 11:55
(Danger, long post...but hopefully educational :)) 11:56
masak me somehow read "Danger" as the comparative form of the adjective "Dang" :P 11:58
grondilu thought 'has ($.a, $.b) = 1, 2' was valid syntax 12:00
jnthn Nope.
jast masak: the dangest mistake
masak I need to read less dangly, clearly.
jnthn grondilu: has $.a = ...; actually thunks the RHS
grondilu: And attaches it to the attribute in question 12:01
(So it's a per-attribute thunk)
masak jnthn: but theoretically, that could happen for a statically-known list of comma-separated things in the RHS too, no?
it's just that we don't do that
er, "just"
jnthn masak: Yeah, but...it quickly gets "complicated" because list assignment is a tad dynamic :) 12:02
masak *nod*
jnthn masak: The moment you get a slip showing up, for example...
masak yeah
jnthn So yeah, we could disect *that* case
masak that, and there's the expectation that the assignments happen "simultaneously", like in `($x, $y) = $y, $x;`
jnthn Yeah 12:03
masak which I guess *could* also be made to happen, but it feels a bit superfluous for attr init
jnthn And then the whole "we only apply the default if the attr wasn't touched in initialization"
masak augh, yes
jnthn So if your BUILD touched $!a but not $!b...
:)
timotimo Danger! High Postage! 12:07
when we type, when we tell! 12:08
wamba m: say m/./   for 1,2 12:34
camelia rakudo-moar a45224: OUTPUT«「1」␤「2」␤»
wamba say /./   for 1,2 12:35
m: say /./   for 1,2
camelia rakudo-moar a45224: OUTPUT«/./␤/./␤»
psch m: say /./.WHAT; $_ = 1; say m/./.WHAT
camelia rakudo-moar a45224: OUTPUT«(Regex)␤(Match)␤»
jnthn /./ is a regex object. m/./ means "match this regex now against $_" 12:36
wamba ok, ty 12:37
what kind code is before "for"? 12:38
m: $^a  for 1,2
camelia rakudo-moar a45224: OUTPUT«5===SORRY!5=== Error while compiling /tmp/zOwlwdEkgz␤Cannot use placeholder parameter $^a in the mainline␤at /tmp/zOwlwdEkgz:1␤------> 3$^a7⏏5  for 1,2␤»
moritz wamba: just regular, mainline code 12:39
wamba m: *.say  for 1,2 12:42
camelia rakudo-moar a45224: OUTPUT«1␤2␤»
wamba m:* .say  for 1,2
m: * .say  for 1,2 12:43
camelia rakudo-moar a45224: OUTPUT«*␤*␤»
wamba m: *.Int.say  for 1,2 12:46
camelia rakudo-moar a45224: OUTPUT«1␤2␤»
wamba say *.Int  for 1,2 12:47
m: say *.Int  for 1,2
camelia rakudo-moar a45224: OUTPUT«{ ... }␤{ ... }␤»
Philj Which branch should I be on if I want map().race to work? (If any!) 12:50
ZoffixWin nom is the latest and greatest. As far as I know, race is buggy 12:52
Philj Yeah, I am having more luck with start / await; 12:53
awwaiid buggy? my very limited use of .map().race I thought worked. maybe I was doing .race.map 12:54
Philj my sub returns nothing if I use map.eager/hyper/race, but its fine with start / await; 12:55
wamba if i test race map that it is usually slower than only map :) 12:57
Philj Ditto :) 12:58
But also with no ouput lol 12:59
wamba ok, this is faster with race (^10000).race.map({ $_ if .is-prime })>>.say; 13:05
awwaiid m: %h = a => 5, b => 6, c => 7; say %h[0] 13:07
camelia rakudo-moar a45224: OUTPUT«5===SORRY!5=== Error while compiling /tmp/rJeKBBYZrc␤Variable '%h' is not declared␤at /tmp/rJeKBBYZrc:1␤------> 3<BOL>7⏏5%h = a => 5, b => 6, c => 7; say %h[0]␤»
awwaiid m: my %h = a => 5, b => 6, c => 7; say %h[0]
camelia rakudo-moar a45224: OUTPUT«{a => 5, b => 6, c => 7}␤»
awwaiid How does that work? 13:08
ZoffixWin That's basically (%h)[0]
awwaiid ah
psch m: Any[0].say
camelia rakudo-moar a45224: OUTPUT«5===SORRY!5=== Error while compiling /tmp/YnuX4OCvkL␤Any cannot be parameterized␤at /tmp/YnuX4OCvkL:1␤------> 3Any[0]7⏏5.say␤»
psch anyway, yeah, what ZoffixWin said
Philj oh, so it seems race.map() works, but map().race doesn't
awwaiid fascinating
psch m: say Any.^can('AT-POS')(Any) 13:09
camelia rakudo-moar a45224: OUTPUT«Invocant requires a type object of type List, but an object instance was passed. Did you forget a 'multi'?␤ in block <unit> at /tmp/B32d6NzKIf line 1␤␤»
psch wonders how useful "Did you forget a 'multi'?" there really is
otoh, i don't think that's a typical use-case...
nine jnthn: the Lexotic that serialization stumbles over seems to be one of the outer lexical symbols that compile_in_context unconditionally dumps into the frame. 13:12
awwaiid If the ascii version of operators are the "texas variant", does the fancy version have a name, or is it just "operator"?
ZoffixWin Just operator. 13:19
m: sub foo { EVAL 'nextsame', context => CALLER::CALLER:: }; my $x = 42; foo 13:22
camelia rakudo-moar a45224: OUTPUT«nextsame is not in the dynamic scope of a dispatcher␤ in block <unit> at EVAL_0 line 1␤ in sub foo at /tmp/plIvGvPYs8 line 1␤ in block <unit> at /tmp/plIvGvPYs8 line 1␤␤»
ZoffixWin m: multi foo { EVAL 'nextsame', context => CALLER::CALLER:: }; my $x = 42; foo 13:23
camelia rakudo-moar a45224: OUTPUT«Attempt to return outside of any Routine␤ in block <unit> at EVAL_0 line 1␤ in sub foo at /tmp/0V4GvbkIQA line 1␤ in block <unit> at /tmp/0V4GvbkIQA line 1␤␤»
ZoffixWin This is what's causing the spectest failure in PR #743
Well, ignore the $x 13:24
This is a bug, right? 13:25
psch m: multi foo { CALLER::CALLER::.WHAT.say }; foo 13:26
camelia rakudo-moar a45224: OUTPUT«(PseudoStash)␤»
psch m: multi foo { CALLER::CALLER::.^name.say }; foo
camelia rakudo-moar a45224: OUTPUT«PseudoStash␤»
psch erg
ZoffixWin One CALLER:: also works
psch m: multi foo { CALLER::CALLER::.keys.say }; foo
camelia rakudo-moar a45224: OUTPUT«()␤»
ZoffixWin m: multi foo { CALLER::.keys.say }; foo 13:27
camelia rakudo-moar a45224: OUTPUT«($=pod !UNIT_MARKER EXPORT $_ $! ::?PACKAGE GLOBALish $¢ &foo $=finish $/ $?PACKAGE)␤»
psch yeah, so one CALLER out is UNIT
and beyond UNIT there's nothing
ZoffixWin m: multi foo { EVAL 'nextsame', context => CALLER:: }; foo
camelia rakudo-moar a45224: OUTPUT«Attempt to return outside of any Routine␤ in block <unit> at EVAL_0 line 1␤ in sub foo at /tmp/_v_QHv6shf line 1␤ in block <unit> at /tmp/_v_QHv6shf line 1␤␤»
ZoffixWin m: sub foo { EVAL 'nextsame', context => CALLER:: }; foo
camelia rakudo-moar a45224: OUTPUT«nextsame is not in the dynamic scope of a dispatcher␤ in block <unit> at EVAL_0 line 1␤ in sub foo at /tmp/b4zGkclWTm line 1␤ in block <unit> at /tmp/b4zGkclWTm line 1␤␤»
psch but nextsame only works inside of a multi
ZoffixWin Sure. But why is the error different, depending on whether I'm executing my eval in a multi? 13:28
awwaiid ZoffixWin: I ran into this sort of thing in LREP, github.com/awwaiid/p6-lrep/blob/ma...ff-out.txt ... but I don't remember what I all I did to generate that 13:29
oh this was around getting line number info 13:30
oh here is how I made it, github.com/awwaiid/p6-lrep/blob/ma...rystuff.p6 13:31
sorry, probably not helpful 13:32
psch m: multi f() { nextwith 1 }; multi f(1) { say "got 1" }; f() # i'm surprised..? 13:33
camelia ( no output )
psch m: say "still here?"
camelia rakudo-moar a45224: OUTPUT«still here?␤»
psch m: EVAL 'nextsame', context => CALLER:: 13:34
camelia rakudo-moar a45224: OUTPUT«nextsame is not in the dynamic scope of a dispatcher␤ in block <unit> at EVAL_0 line 1␤ in block <unit> at /tmp/ttZ5II1MtN line 1␤␤»
psch the "Attempt to return..." one seems out of place
jnthn psch: nextwith is iterating the *existing* argument list 13:35
psch "which call the next routine with arbitrary arguments (nextwith)" from doc.perl6.org/language/functions 13:36
jnthn uh, candidate list
psch oh
Philj Wow. printing/saying is really slow - any workaround?
psch jnthn: so i'd have to predeclare the other candidate? 13:37
jnthn Same with [call|next][same|with]
psch: No, you need to just make a fresh call to re-evaluate the multi-dispatch
masak Philj: print/say less often?
ZoffixWin Philj, is it the compile time that's slow or runtime? And do you have an example that reproduces the issue?
ZoffixWin recalls a ticket reporting compilation of multiple `print`s ridiculously slow 13:38
psch jnthn: i don't think i understand. what's a fresh call in this context?
Philj Its not the compile time - hangon - I'll put an example together
Philj After simplifying my example, it seems join is the problem, not print! 13:46
jnthn psch: When call a multi, we work out at that point what possible candidates match the incoming arguments 13:49
psch: And deferral just iterates through that list
psch: If you use nextwith/callwith, it does *not* recalculate anything
psch jnthn: oh, so redispatching with *with only work towards wider candidates that match the same argument list 13:50
jnthn psch: Correct
Also 13:51
psch m: multi f(Any $) { say "Any" }; multi f(Int $) { nextsame }; f 1
camelia rakudo-moar a45224: OUTPUT«Any␤»
jnthn nextsame and nextwith are equivalent to return callsame and return callwith
Which is why the "return outside of routine" thing
psch ah, yeah, that makes sense
jnthn Also, the context argument to `EVAL` is...um... :) 13:52
"unofficial" :)
I ugess :)
*guess
psch m: multi f(Int $) { say "calling g"; g }; multi f(Any $) { say "no g-calling" }; sub g { EVAL 'nextsame', context => CALLER:: }; f(1) # but it works... ;) 13:53
camelia rakudo-moar a45224: OUTPUT«calling g␤no g-calling␤»
jnthn Yeah, *that* much does :) 13:53
It's referring to lexical symbols that'd bite you really :)
jnthn ('cus the optimizer looks for EVAL ocurring in the code to know what it can get away with) 13:54
nine jnthn: is there any sense at all in putting objects without serialize REPR functions into an SC? 13:56
jnthn nine: No, they're doomed if we pre-comp 13:59
nine: You thinking of dying on attempting to do so? 14:00
Well, not you personally like, but... :P 14:01
We could put a sanity check in the op that adds something to an SC that it has ->serialize
nine Well that breaks even NQP's build 14:02
nine Ah (IS_CONCRETE(obj) && !REPR(obj)->serialize) works better 14:03
jnthn Yeah, type objects are always trivially serializable :) 14:04
nine What exactly is a BOOTContext? 14:14
psch nine: the bootstrap scaffolding for an MVMContext, if the BOOTAttribute/Attribute holds... :) 14:19
+analogy 14:20
jnthn Yeah, the type of an MVMContext REPR
nine Just not adding non-serializeable objects to the SC would be too easy. Apparently they can be referenced by P6opaques, too and become added when serializing this P6opaque. 14:27
psch hm, is there a "we ran through the whole loop" phaser? 14:28
like, NOTLASTED..?
or am i just misunderstanding LAST 14:29
and it always happens at the last iteration and is equivalent to LEAVE in a for or loop
jnthn nine: Yeah, it'll only catch direct additions, not ones that come about during the walk 14:33
japhb Is there a way to just make use of the serialization functionality to freeze an object graph to disk, and later load it directly? In other words, is it inextricably entertwined with precompilation, or can I just provide it a graph root, and ask it to serialize object reachable from there that was not previously serialized (i.e., ignoring the setting and loaded modules)? 14:53
jnthn japhb: Well, it static links against the precise CORE.setting and compiler version 14:54
japhb: Because that's where it finds all the types like Int, Str, Hash, etc.
japhb: So you could only use it as cache, as pre-comp is 14:55
japhb Hmmmm, yeah, that's suboptimal for this use case.
jnthn It'd not be a suitable serialization mechanism if things had to survive the network or upgrades. :)
jnthn (It wasn't ever intended to support that. :)) 14:55
It's not that the serialization ops themselves are tied tightly to precomp, so much as the result gives you all the same properties of precomp :) 14:56
japhb Oh sure, I was just wondering if it could be bent into that shape, since it would be mighty convenient for cases where you just want to load or store some complex object graph as a whole, and don't need e.g. an ORM's ability to load an individual object. 14:57
nodnod
jnthn It's a bit hard to bend it into that kind of shape, I think.
japhb yeah, sounds like
jnthn And probably better to go with some standardized serialization format, generally 14:59
Then something other than Perl 6 could decode the thing 15:00
ZoffixWin "A fictitious reader wrote in to add that Perl 6 is also slow because it doesn't use x86 Real Mode." twitter.com/scrottie/status/720656691436519424
ZoffixWin has no idea what that is, but I'm guessing we can't use it? :)
japhb True. But there aren't a lot of standard serialization formats that are good at serializing a general object *graph*, rather than just a *tree*.
YAML has some functionality for this, IIRC, but I don't recall seeing there's good YAML support available for Perl 6 yet. 15:01
jnthn ZoffixWin: en.wikipedia.org/wiki/Real_mode 15:02
ZoffixWin: I don't know that it's been used for decades... :)
japhb ZoffixWin: I believe that's just a tongue-in-cheek joke. It's roughly akin to saying we can't run in DOS and 1MB RAM 15:03
ZoffixWin Ah
japhb jnthn: It gets used all the time ... for a fraction of a second at initial boot. :-)
nine japhb: 640K! 15:04
jnthn japhb: Ah, because CPUs start in it by default for back-compat?
geekosaur unless you have uefi boot
japhb nine: EMM386 and HIMEM.SYS
geekosaur well, no, even then it's real mode for long enough to init uefi and switch
japhb jnthn: Yeah, or at least, they used to. Honestly, I haven't checked whether someone finally gave up on that bit of 80's compatibility in the very latest CPUs, but yeah, it was there for at least a couple decades. 15:05
nine Aren't those using protected mode already?
geekosaur they "do" but it's kinda horrid
programs still ran in real mode. when somehting needed to do a protected mode operation, emm386 switched to protected mode, did the thing, then *rebooted* --- after setting the cpu reset vector to a routine that resumed the original rpogram instead of actually rebootingf 15:06
they used an unused bit in the keyboard controller (!) to retain that information across the special reboot 15:07
japhb nine: Sadly, I got my first job out of college based mostly on my knowledge of how to get every K out of that first MB of RAM. Talk about an otherwise wasted skill ....
japhb geekosaur: Wow, I never knew that bit of trivia. That's horrendous and cool at the same time. 15:07
hoelzro o/ #perl6 15:08
japhb o/ hoelzro
hoelzro o/ japhb
psch o/ hoelzro
hoelzro o/ psch
geekosaur (the reboot was needed because you couldn't go back to real mode after entering protected mode)
japhb #perl6 just became #x86 for a bit there
nine geekosaur: the A20 gate?
geekosaur yeh
nine japhb: I was quite good at squeezing out those Ks, too :) 15:09
psch 60 tests total for Music::Helpers, and travis also is involved now \o/ 15:11
geekosaur oh, and HIMEM.SYS didn't use protected mode, it used a hack that existed even in real mode. if you set a segment register to the highest possible paragraph (0xffff) then it could address one page (minus 16 bytes) of physical memory past the real mode boundary 15:12
stmuk moar on MSDOS? :) 15:13
RabidGravy :-O
geekosaur sorry, not one page, 64K minus 1 paragraph 15:15
geekosaur so HIMEM.SYS did that, relocated some DOS stuff there, and freed up an extra 64K of normal memory 15:15
grondilu btw pmurias is working on a javascript backend, but how possible would it be to compile moarvm to javascript with emscripten or something like that? 15:16
geekosaur that'd be slow as **** if it worked
grondilu u sure? asm.js and stuff can be pretty fast. 15:17
grondilu not to mention the upcoming webassembly. 15:17
stmuk I saw Quake or Doom or something running ok 15:18
stmuk under emscripten 15:19
geekosaur sure. emulators that do their own memory management are where it gets problematic 15:19
psch huh, but something somewhere does a modulo 0 apparently.. 15:23
...although it's not travis that noticed that :s
pmurias geekosaur: MoarVM under enscripten will have to do it's own gc 15:24
psch cause travis still chokes on File::Which 15:25
well, panda does, actually...
geekosaur right, my point is a naïve translation via enscripten would probably emulate moar's memory management on a huge array representing memory
geekosaur not even sure that would *fit* in memory... 15:25
pmurias grondilu: you will loose the jit that way 15:28
grondilu m: say (^10).sort: :by({cos(tau*$_/10)}) 15:49
camelia rakudo-moar a45224: OUTPUT«(0 1 2 3 4 5 6 7 8 9)␤»
grondilu m: say sort {cos(tau*$_/100)}, ^10 15:49
camelia rakudo-moar a45224: OUTPUT«(9 8 7 6 5 4 3 2 1 0)␤»
grondilu m: say (^10).sort: :by({cos(tau*$^b/10) <=> cos(tau*$^b/10)}) 15:50
camelia rakudo-moar a45224: OUTPUT«(0 1 2 3 4 5 6 7 8 9)␤»
grondilu what am I missing here? 15:50
m: say (^10).sort: :by({cos(tau*$^a/10) <=> cos(tau*$^b/10)})
camelia rakudo-moar a45224: OUTPUT«(0 1 2 3 4 5 6 7 8 9)␤»
timotimo m: say map {cos(tau*$_/100)}, ^10
camelia rakudo-moar a45224: OUTPUT«(1 0.998026728428272 0.992114701314478 0.982287250728689 0.968583161128631 0.951056516295154 0.929776485888251 0.90482705246602 0.876306680043864 0.844327925502015)␤»
timotimo m: say map {cos(tau*$_/10)}, ^10
camelia rakudo-moar a45224: OUTPUT«(1 0.809016994374947 0.309016994374947 -0.309016994374947 -0.809016994374947 -1 -0.809016994374948 -0.309016994374948 0.309016994374947 0.809016994374947)␤»
timotimo m: say sort :by{cos(tau*$_/10)}, ^10 15:51
camelia rakudo-moar a45224: OUTPUT«Unexpected named parameter 'by' passed␤ in block <unit> at /tmp/5CgKUFEVON line 1␤␤»
timotimo m: say (^10).sort: {cos(tau*$_/10)}
camelia rakudo-moar a45224: OUTPUT«(5 6 4 7 3 8 2 9 1 0)␤»
timotimo m: say (^10).sort: :by({cos(tau*$_/10)})
camelia rakudo-moar a45224: OUTPUT«(0 1 2 3 4 5 6 7 8 9)␤»
timotimo this is what you're missing, i suppose
grondilu thing is that I wanted to use the :@by version and it did not behave as I expected. So I tried they :$by version and I could not make it work either. 15:53
timotimo :@by?
grondilu yeah this a thing, several sorting criteria with descending priorities. 15:54
timotimo that's just returning a list-like from the by code-block
psch m: role R[::T] { submethod BUILD { self.^add_method(T.^shortname, my method { say T.^name }); self.^compose } }; class C does R[Duration] { }; C.new.Duration # /o\
camelia rakudo-moar a45224: OUTPUT«Duration␤»
psch curiously, that is exactly what i need
it still hurts a bit :/
well, not quite exactly, as the method body has to be a bit different :P 15:55
timotimo hmm, is it a good idea to put that into BUILD, not into something like "compose"?
psch timotimo: i... am not sure
grondilu from S32/Containers: @by differs from $by in that each criterion is applied, in order, until a non-zero (tie) result is achieved
psch if there's a more resilient spot to put it, i'm open to advice
grondilu m: say (^10).sort: :by({cos(tau*$^a/10) <=> cos(tau*$^b/10)} but Ordering) 15:57
camelia rakudo-moar a45224: OUTPUT«5===SORRY!5=== Error while compiling /tmp/5lKHWHt0ok␤Undeclared name:␤ Ordering used at line 1␤␤»
grondilu m: say Ordering
camelia rakudo-moar a45224: OUTPUT«5===SORRY!5=== Error while compiling /tmp/QHQHC3HAM5␤Undeclared name:␤ Ordering used at line 1␤␤»
grondilu is confused now
arnsholt jnthn++ # blog
timotimo clearly outdated speculations
grondilu greps 'method sort' in the core and find no occurence of neither a :$by nor a :@by parameter. 15:58
psch m: say Order 16:00
camelia rakudo-moar a45224: OUTPUT«(Order)␤»
psch m: say Order::.keys
camelia rakudo-moar a45224: OUTPUT«(More Same Less)␤»
psch grondilu: .unique has :&by, there was a discussion recently about the inconsistency there 16:01
ZoffixWin m: say (^10).sort: :do-whatever-you-want-by({cos(tau*$_/10)})
camelia rakudo-moar a45224: OUTPUT«(0 1 2 3 4 5 6 7 8 9)␤»
ZoffixWin Looks like the last example above didn't sort anything
grondilu well, that's disturbing. 16:03
psch m: "foo".say(:in('spanish')) 16:04
camelia rakudo-moar a45224: OUTPUT«foo␤»
moritz methods ignore extra named arguments. News at 11. 16:05
ZoffixWin :)
ZoffixWin m: say "foo", :in('spanish') 16:06
camelia rakudo-moar a45224: OUTPUT«Unexpected named parameter 'in' passed␤ in block <unit> at /tmp/IMWh1KyXot line 1␤␤»
ZoffixWin Why only methods?
timotimo because methods can be inherited
TimToady blames Liskov 16:07
RabidGravy blames Godot
TimToady wait!
moritz I don't, by principle!
TimToady waiter! 16:08
waitest!!!
waitester!!!!! 16:09
diakopter blames Godwin 16:12
gregf_ m: say "hello", :in('spanish') 16:22
camelia rakudo-moar a45224: OUTPUT«Unexpected named parameter 'in' passed␤ in block <unit> at /tmp/9fT4IVUQ7S line 1␤␤»
gregf_ oh in is a filehandle or a stream 16:22
m: say in.^name 16:23
camelia rakudo-moar a45224: OUTPUT«5===SORRY!5=== Error while compiling /tmp/VvgSscfgVh␤Undeclared routine:␤ in used at line 1␤␤»
gregf_ m: say :in.^name
camelia rakudo-moar a45224: OUTPUT«Pair␤»
grondilu found out he can do sort { &first-criterium($^a, $^b) || &second-criterium($a, $b) }, @stuff
grondilu is still a bit confused by the lack of :@by though 16:24
dogbert17 hello perl6 16:28
working a bit with the documentation in Cool.pod
the following text is incorrect no 'Coerces the invocant (or in method form, its argument)' 16:29
zoffix mentioned the other day that it should be 'Coerces the invocant (or in sub form, its argument)'
dogbert17 there are a few methods with the incorrect wording, i'll change them if noone raises any objections 16:30
masak dogbert17: go right ahead. that phrasing will always be Wrong. 16:31
dogbert17 ok, will do. Btw do you know if the undocumented cis function has a normal name? 16:32
psch m: say &cis
camelia rakudo-moar a45224: OUTPUT«sub cis ($) { #`(Sub|48437624) ... }␤»
psch m: say cis 1 16:33
camelia rakudo-moar a45224: OUTPUT«0.54030230586814+0.841470984807897i␤»
dogbert17 e.g. the normal name for cotanh, or long name is hyperbolic cotangent 16:33
psch en.wikipedia.org/wiki/Cis_(mathematics) 16:33
so it apparently means cos(x) + i*sin(x) 16:34
dogbert17 so if I was to document it I would write that it calculates cos(x) + i*sin(x)? 16:35
psch i'd say so, yeah
moritz or exp(i * x) 16:36
dogbert17 Eulers formula?
exp(i * x) = cos(x) + i*sin(x) 16:37
moritz m: for ^10 { say exp(i * $_) - cis($_) }
camelia rakudo-moar a45224: OUTPUT«0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤»
moritz m: for 0, 0.1 ... 2 { say exp(i * $_) - cis($_) }
camelia rakudo-moar a45224: OUTPUT«0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤0+0i␤»
dogbert17 I'll whip something up and then I believe that all mathematical subs/methods in Cool have at least some documentation :-) 16:38
moritz ++dogbert17 16:39
sortiz \o #perl6 16:40
TimToady oh, now I see where the c...i...s comes from 16:45
masak and a hyperbolic cis() function ought to be cish() ;) 16:48
dogbert17 in the meantime, does anyone know what the 'unpolar' method is supposed to do? 16:55
diakopter the opposite of unequator 16:57
dogbert17 :-)
moritz dogbert17: presumably create a Complex from polar coordinates 16:59
m: say unpolar(1, pi/2) 17:00
camelia rakudo-moar a45224: OUTPUT«6.12323399573677e-17+1i␤»
moritz m: say unpolar(5, pi/2)
camelia rakudo-moar a45224: OUTPUT«3.06161699786838e-16+5i␤»
dogbert17 so converting from polar coordinate system to a cartesian one 17:02
timotimo sounds about right
psch hm, i really need to rethink this whole Chord design 17:06
dalek c: 7ad6d59 | (Jan-Olof Hendig)++ | doc/Type/Cool.pod:
Added documentation for cis and replaced the word method with sub in a few places
17:08
psch ...but why do my tests pass but a oneliner dies? /o\ 17:15
[Coke] psch: code? 17:18
psch [Coke]: github.com/peschwa/p6-Music-Helper...02-basic.t is the test file 17:19
the module itself is around 400 loc or so
and the oneliner does exactly what one of the loops does
psch i'm pretty sure github.com/peschwa/p6-Music-Helper...rs.pm#L180 has something to do with it 17:19
psch and i do think it's a terrible idea to do it like that, so i'll just ditch that again and try to do it less... whatever you want to call what i have there 17:20
RabidGravy I've seen worse ;-) 17:21
usually when I've written it 17:22
[Coke] what's the oneliner? 17:23
psch perl6 -Ilib -e'use Music::Helpers; my $C = Note.new(:48midi); my $c = Chord.new(notes => [$C, $C + M3, $C + M3 + m3]); $c.chord-type.say' 17:24
psch does with "Method 'ACCEPTS' not found for invocant of class 'R1'" 17:24
*dies
[Coke] ah. sadly, too complicated for me to dig into before I leave work. :) 17:25
psch no worries
it's in a branch for a reason :)
psch huh, travis couldn't test successfully 17:28
psch so maybe the passing tests are just an artifact of... something? vOv 17:28
RabidGravy some weird unintended dependency 17:30
psch dependency on what though? 17:31
psch like, master tested successfully at least once, and even in the state i branched from iirc 17:33
ZoffixWin Hm... awhile back, I asked if traits were "roles" and someone said they were roles composed at compile time. Now I'm reading docs.perl6.org/language/functions#Traits and it says they're SUBS run at compile time... And they are defined as subs, so why are they roles or was that incorrect? 18:12
psch ZoffixWin: a trait_mod is a special kind of Routine, that usually applies a role to its LHS 18:13
dalek c: e0a47b9 | (Zoffix Znet)++ | doc/Language/functions.pod:
Fix typo
hoelzro ZoffixWin: that was me! I think that the concept of traits as subs (like trait_mod) is a rakudo-based implementation detail 18:14
psch ZoffixWin: as in "has $.x is rw;" fits to "sub trait_mod<is>(Attribute $a, :$rw!) { ... }"
hoelzro but I may have misspoken
psch well, "usually" is probably a bit inaccurate 18:15
psch "conceptually", maybe, but even that's kind of eh.. 18:15
ZoffixWin m: multi sub trait_mod:<is>(Routine $r, :$doubles!) { $r.wrap({ 2 * callsame; }) }; sub square($x) is doubles {$x * $x}; say square 3; 18:16
camelia rakudo-moar a45224: OUTPUT«18␤»
psch traits fit with roles insofar that they work similar to what "but" does, but then "but" is a trait_mod itself...
ZoffixWin Alright. 18:17
Woodi jnthn: when object goes out of scope then it is unmarked so can be mass-freed at gc time... so doing noting is nice optimisation :) but maybe doing .free on fresh-out-of-scope objects can be netto gain ? eg. object is probably in cache
perlpilot ZoffixWin: maybe start reading at S02:468
ZoffixWin What's 468? A line number? 18:18
perlpilot ZoffixWin: Also, I wouldn't say that "trait is a role", but that is a common way they can be attached to things.
ZoffixWin: yeah. 18:19
(sorry, I kinda expected the bot to be around and make a link for me)
RabidGravy the traits/roles equivalence is a Moose thing, where traits really are just roles applied to meta thingies 18:22
psch is reminded of perl6advent.wordpress.com/2011/12/...y-and-how/ 18:24
psch about 60% through, the "very simple aspect oriented programming" bit 18:25
ZoffixWin FWIW, the link was design.perl6.org/S02.html#Properties_on_Objects 18:26
masak is now trying out the Nex game -- written in Perl 6 -- remotely over the web with a friend 18:38
timotimo masak: i wonder if you'd be interested in "tak": cheapass.com/sites/default/files/Ta...-10-16.pdf and www.playtak.com/ 18:41
masak timotimo: yeah, stacking games can be fun 18:54
timotimo: I tend to be drawn to the ridiculously simple ones, though, and this one already looks a little bit too complex for my tastes :) 18:55
El_Che can the piano players here recommend a good piano lamp for a digital piano (standup). I bought this (www.amazon.de/König-Meyer-12297-000-63-Pianoleuchte-silber/dp/B00J5AJPFM) but sent already 2 back. They flicker 19:04
RabidGravy I've got one that sort of clamps on a music stand, takes a small "normal" bulb 19:06
El_Che less likely to flicker than led maybe
RabidGravy looks like www.djmmusic.com/p-3712-km-double-m...122-6.aspx but just one bulb 19:09
El_Che thx
neuron Hi 20:51
neuron I'm looking at NativeCall example on Windows 20:51
The function to create dialog looks like sub MessageBoxA(int32, Str, Str, int32) 20:52
But the first parameter is really a pointer
So I would like to define the function as sub MessageBoxA(HWND, Str, Str, int32)
neuron But trying to create such class fails on me: class HWND is repr('int32') { } 20:53
neuron Lookup by name of unknown REPR: int32 20:53
hoelzro neuron: you probably want a repr('CPointer')
neuron That was other thing I tried 20:54
But then, NativeCall reports error, it does not like to work with such class.
Calling MessageBoxA(Int, Str, Str, EnumMessageBox) will never work with declared signature (HWND, Str, Str, int32 --> int32) 20:55
nine neuron: If a HWND really is an int32, have a look at rakudo's src/core/natives.pm to see how int32 is defined
neuron ( I should really paste whole code somewhere ) 20:56
neuron Well, on Windows HWND is really a pointer 20:56
dogbert17 the docs for Cool mentions a method called capitalize which I can't find doing 'say Cool.^methods'. Has it been removed? 20:56
neuron my native int32 is repr('P6int') is Int is nativesize(32) { } 20:57
MasterDuke I'm trying to look at some profiles I generated (about 2-5Mb) in Linux, but Firefox and Chrome both take very long to read them, and go unresponsive when doing so 21:00
any other browsers known to be good? or other suggestions?
neuron Ah, class HWND is repr('CPointer') is Int { }. Tank you nine ! 21:02
RabidGravy you may not actually need the Int there if you change the sub declaration too
neuron RabidGravy : sorry, that's out of my league at the moment, can you be more specific please? 21:05
Which sub?
RabidGravy eh? If you declare "sub MessageBoxA(HWND, Str, Str, int32)" then you don't need the "is Int" 21:06
neuron ah, I have tried that as a first thing, but pastebin.com/YNQ4LEGE 21:08
timotimo neuron: github.com/jnthn/zavolaj/blob/mast...pi-call.p6 - this may be interesting to you 21:09
neuron timotimo: that's where I started. It is using plain int32, which I'm trying to improve, to create real object HWND 21:10
masak first nex game tonight was a roaring success
we played till the bitter end
(I won)
neuron Just for the sake of exploring the object model in P6
timotimo are you actually allowed to introspect a HWND?
masak I think this is a first -- Perl 6 and rakudo are now stable enough to do this
RabidGravy neuron, I'm not quite sure what you are trying to do there
timotimo also, your new method doesn't create a HWND, it just returns the Int you got passed in in your latest paste 21:11
masak also, but thanks to heroku++ and to pnu++
RabidGravy if you want to pass (HWND *)NULL then just the HWND type object, not a new object
timotimo that's right, the undefined object stands in as the null pointer
RabidGravy so "say MessageBoxA(HWND., "We can haz NCI?", "oh lol", MB_YESNO);"
timotimo which of course doesn't port properly to systems where you can actually dereference the null pointer and store data there
neuron ah, hmm 21:12
timotimo there's a stray dot in rabidgravy's code
neuron let me chew on that for a sec :)
colomon o/ 21:12
neuron Ok, I think I see what's going on. 21:13
RabidGravy timotimo, does rakudo run on any of those systems?
neuron What I wanted to achieve, was to be able to call MessageBoxA(NULL, ....) where the NULL would automagically become HWND class
Maybe that's silly thing to do though 21:14
neuron I thought I would create HWND class, which would have new(int32) constructor, so P6 could eventually figure out what I meant 21:14
RabidGravy no, the API doesn't work like that 21:16
timotimo RabidGravy: i don't even know which systems have that. i think solaris perhaps?
colomon any opinions on the current best module to use to read JSON? I’m running into JSON::Tiny performance issues again.
RabidGravy or possibly some microcontroller or some such
neuron tried to compile P6 on Solaris 12 today but failed miserably
RabidGravy neuron, if you pass NULL as the first argument to the MessageBox function in user32 then it means "there is no owner window", it doesn't get filled in 21:17
masak I have a discussion topic for tonight
how much do people on this channel feel like they're benefitting from theory?
RabidGravy typically you would have got an HWND from a function that created a window 21:18
masak as in, on a scale from "all I do every day I learned on the job" to "theory is everything and without it I'd be nothing", where do people feel they fall?
neuron RabidGravy: yes, but i thought I could make it (HWND*)NULL sort of. So that the MessageBoxA would not accept random numbers, only HWND class or NULL. 21:19
hoelzro masak: you mean in general? or as applies to perl6/this channel?
masak hoelzro: I guess I mean in general. 21:20
RabidGravy neuron , right, so the HWND type object in your code IS NULL
a (HWND *)0
masak how much do people feel assisted/propped up by theory?
how important is theory in people's day-to-day activities?
RabidGravy same as the Int or Str or whatever type object is "undef"
timotimo i don't remember what that system was and i can't seem to find anything about it on-line 21:21
sorry about the noise, then
neuron RabidGravy: You are talking about MessageBoxA(HWND, ....) again, right? 21:22
colomon masak: “90+% of what I do every day I learned on the job”.
RabidGravy neuron, yes
masak colomon: could you tell me something about the remaining 10%? I'm curious.
colomon masak: actually, looking at your comments a bit more there, I think you’re making (or I’m making) an artifical distinction between theory and “on the job”. 21:24
masak fair enough.
colomon Perfectly possible to learn theory on the job.
masak I mean, surely something could be both.
RabidGravy I tend to describe how I work as "having an internal pattern book", I have a feeling for what works well and what doesn't based on practical observation and previous implementations, never recourse to theory knowingly 21:26
colomon In terms of the 10%, I was thinking of things learned in school. I still use a good bit of math, some design ideas picked up in Lisp-based AI classes
probably some other stuff. 21:27
but I did a bunch of reading my first few years on the job — pattern books, C++ programming books, misc. Knuth....
colomon and seriously tried out a lot of things a later mostly rejected. ;) 21:30
masak ok, nice to hear 21:33
I feel with my current job I rely on theory *heavily*
I feel that's rather unusual
the trick is finding it among all the practice, though
colomon nice gig if you can get it. :)
masak I feel my relationship with Perl 6 is the same, though 21:34
masak it's like... sure, there's a lot of practice even in what I do -- but the bits of it that are meaningful and have staying power all have some degree of theory in them 21:35
maybe this is just my way of saying that I'm an irredeemable pattern matcher, so I stumble on theory everywhere. I dunno.
dalek c: 8e218cf | (Jan-Olof Hendig)++ | doc/Type/Cool.pod:
Added tanh, atanh, cotanh and acosech to the coercion table and removed capitalize from the same
21:39
RabidGravy y'see I was never particularly taught computer science theory, I was taught *programming* then thought screw this, and went and did a literature degree :) 21:40
masak I'm in the same boat there. I never formally took CS.
I have, however, tried my best to make up for it since. 21:41
particularly by reading up a bunch on parsers and compilers.
hoelzro masak: I want to say if 0 is "all I do every day I learned on the job", and 100 is "theory is everything", I would say...40?
masak oh, interesting. so, a slight majority is from theory? 21:44
no, wait.
masak can't count
a slight majority is from practical experience? :) 21:45
hoelzro yup
masak that's still a lot less than colomon, for some reason. discuss.
hoelzro I really appreciate theory, but most of what I use is from experience
things like how caching affects performance, etc
masak like, you seem to be using four times as much theory as colomon
colomon Well, I’m doing CAD file I/O stuff. If there’s direct theory there, no one ever taught me. 21:46
and the broader software organization stuff i mostly rely on guts, not theory. :) 21:47
masak someone on the #python channel today asked me about an interview question. it was basically "given an input such as `x ** 3 + 2 * x ** -2` (of arbitrary polynomials over x), find its derivative". I explained to them how to do this with parsing/ASTs/traversal/calculus 21:48
masak someone pointed out that my AST was overpowered for the task, since something like (coefficient, power) would be enough for each term in this case 21:49
which is fair enough.
masak but basically, my ability to solve this problem -- artificial as it is -- is all due to me knowing about parsers and AST traversal (and calculus) 21:50
when I see the problem, I see strangelyconsistent.org/blog/its-ju...tree-silly 21:51
colomon don’t be silly, it’s a hash. ;) 21:58
masak ;)
colomon whereas when reading, say, a STEP file, you could do a formal parser, but that would be overkill 22:01
colomon so you just hack something out 22:02
RabidGravy if in doubt hack it out 22:03
hoelzro masak: maybe I overestimated, but I think about things like time complexity and data structures a lot 22:04
probably more than I need to =P
[Coke] waves from the highway. 22:05
RabidGravy don't IRC and drive
masak .oO( don't unicycle and privmsg ) 22:18
masak oh, and I'm all in the "hack it out" school too 22:20
but it's like when I do that, I do it against a backdrop of "I'm going to come back to this if there's a need" and "this may count as tech debt if X or Y happens"
masak in fact, I'd say TDD has helped me relax into a managed kind of sloppiness in many cases 22:22
psch irclog.perlgeek.de/perl6/2016-04-15#i_12345969 expresses a lot of how i currently feel about "theory" 22:24
note, that's mostly contextualized by music and its theory, 'cause recently that's most of what i spend my time on 22:25
wrt programming/"code", i've never hardly a particularly strong grasp on theory
although i often wished i had, i never felt obviously stumped by that
that can easily be explained away by "you just don't know how a better theoretical base could help you" 22:26
masak or you're using lots of theory, but don't know it ;)
psch on the other hand, just today i've ran into "i wish i could make this pretty" without knowing established patterns that could make it so
masak: entirely possible, but i theory that's gathered by trial-and-error doesn't feel real to me, for some reason 22:27
as in, if i have a hunch that a bunch of nested loops should be expressed differently because i know that nested loops are "slow", it doesn't feel like theoretical knowledge to me
s/but i theory/but theory/ 22:28
masak talking about theory/practice wrt compilers and VMs is highly relevant for something like rakudo or something like MoarVM
psch is just catching up with the clog
i also find myself agreeing with hoelzro there, around irclog.perlgeek.de/perl6/2016-04-15#i_12346006 22:29
masak because (it's quite clear to us) there's a bunch of theory in there, but there's also a bunch of "no-one has done this before, let's try it this way"
RabidGravy but "theory that's gathered by trial-and-error" is a "pattern book", however that book might be stored 22:30
psch RabidGravy: i agree, but i can't help but feel a difference between a pattern crafted by a sufficiently realistic abstraction and a pattern learned by experience 22:31
(i am not sure how "storage" plays a role there, though...) 22:32
RabidGravy "book"
psch oh, so possible options for storage are "intuitive knowledge" and "papers by leading researchers" 22:33
plus whatever else
psch yeah, i can see that 22:33
s/intuitive knowledge/heuristics/ # probably
RabidGravy but hopefully the latter have been tried and found to work (and bad ones thrown out) some of the advocates of "design patterns" ten/fifteen years ago lost sight of that and it become an untested abstraction in itself 22:34
psch isn't sure how to scope this back to compilers and VMs 22:35
i am definitely lacking in heuristics there :)
...i am also not sure scope can be verbed like that
masak sure it can 22:36
psch on the other hand, that's where i think music is so fascinating
masak we scope things all the time here
psch like, assuming a standard western tuning, you can play whatever you like
and it can probably be explained theoretically
masak yes
we talked about well-tempering the other day, actually 22:37
psch but then, taking a standard western tuning as base already severly limit what you *can* play
+s
so it's not surprise that whatever works, actually works
RabidGravy but then it's bounded sufficiently that it's fairly small
psch i had had the thought of trying to make music the other way around
as in, take white noise, throw billions of high-q notch filters at it, see what works 22:38
RabidGravy then you go into Terry Riley's microtonal stuff
RabidGravy psch, I have a large number of "instruments" who's sole purpose is to make various forms of "noise" (in the reasonable technical sense) and another group of devices which either alter the amplitude or harmonic content over time 22:40
[Coke] (theory) mostly don't care. 22:41
masak I had a feeling people would fall all over the spectrum on this one. excellent!
psch in general i'd say "i wish i knew more, but it doesn't seem to matter too much either way" 22:42
well, excluding things like maths, obviously :)
[Coke] And I have ... half of a compsci degree. (BS of computer systems engineering)
psch RabidGravy: right, but in the technical sense every percussive instrument is a noise generator 22:49
RabidGravy I have these two modules in my rack right now www.youtube.com/watch?v=7ZeXbmSkV3U 22:55
masak 'night, #perl6 23:00
RabidGravy right that's me done 23:05
RabidGravy toodles 23:05
colomon finally does enough profiles to realize that in his slower cases, JSON::Tiny is not the source of the problem. 23:17
colomon doesn’t suppose someone has already written a decent 3D spatial tree in p6? 23:24
timotimo would that be like a quadtree? 23:42
AlexDaniel heh, somebody mentioned captionbot. Nice: files.progarm.org/2016-04-16-02444..._scrot.png 23:45
timotimo huh 23:47
japhb timotimo: 3D spatial tree examples are octree, kd-tree, bsp-tree, etc. 23:51
timotimo ah, quadtrees are usually not used for 3d 23:51
japhb timotimo: Only if your 3D happens to be very thin in one dimension (which actually does happen, for e.g. racing games 23:52
timotimo mhm
japhb Colomon: Speaking of theory, which 3D spatial tree you want is a decent theory question that depends a lot on your problem space 23:53
japhb For example, there are structures that are tree-like but don't strictly partition, such as bounding sphere trees, that work for certain problems quite well 23:54
(I found bounding sphere trees to be one of the more efficient structures back in my Perl 5 graphics engine days, because sphere-to-frustum is a really fast test in perl5, and more complex structures which had better theoretical performance fell prey to per-op overhead) 23:55
timotimo what kind of graphics engine stuff have you made? :) 23:56
japhb timotimo: A few little things -- an OpenGL Doom level viewer, a stress test designed to find the boundary of CPU v. GPU bottlenecks for dynamic languages, etc. 23:58
timotimo oooh
i've recently implemented a super simple particle system in pure perl6, but it doesn't perform well ;(
japhb The craziest was probably one that implemented a graphics engine on top of pTk's 2D primitives. 23:59
timotimo wat :)
timotimo that's Tk? as in TCL/TK? 23:59