Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-04-15

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 ZoffixLappy stanrifkin_, how do you figure you only got "6.c 2015.12"? How do you get that information?
00:01 sortiz timotimo, MoarVM's default is to use the _included_ dyncall, right?
00:01 stanrifkin_ ZoffixLappy: perl6 -v
00:02 ZoffixLappy stanrifkin_, what does it call? Run    which perl6
00:02 ZoffixLappy I'm thinking maybe you have two perls installed
00:02 stanrifkin_ ZoffixLappy: it runs my perl6 installation in ~/.rakudobrew/bin/
00:04 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
00:04 stanrifkin_ ZoffixLappy: i have to use moar-nom - it's always updates that one
00:05 geekosaur you can tell it to point to a specific version, iirc
00:05 timotimo sortiz: that's the default, yes
00:05 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
00:06 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
00:07 * 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:08 geekosaur 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
00:09 teatime is uniprops no longer a thing?
00:13 timotimo uniprop*s*?
00:13 teatime yes, there are lots of references around to a uniprops hash
00:13 teatime S15 is an example
00:13 AlexDaniel hash? :o
00:14 timotimo oh, huh
00:14 timotimo well, the information is there in our database, but we can't quite query it
00:22 hobbs joined #perl6
00:24 Actualeyes joined #perl6
00:32 stanrifkin_ i asked some time ago. do you prefer .pl6 or simply .p6 filename suffix?
00:33 ZoffixLappy .p6 for me
00:36 stanrifkin_ so there is no general consent yet? i just come across the tutorial
00:36 stanrifkin_ and they use .pl6
00:36 timotimo i like .p6
00:36 timotimo just because i'ven't been a perl programmer before i encountered the six
00:37 stanrifkin_ i like .p6 more too
00:38 * ZoffixLappy is a 10-year P5 veteran
00:39 * Xliff is a P5 veteran, also.
00:40 stanrifkin_ "veteran" like you come home from war :)
00:42 * geekosaur works on a tangled C codebase for pay. some wars never end >.>
00:44 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:49 teatime are modules supposed to be .pm6 ?
00:51 stanrifkin_ teatime: seems to be .pm
00:51 ZoffixLappy That's what I use. I'm unsure if they're "supposed to be"
00:51 ZoffixLappy I'd argue against .pm because that's what P5 uses.
00:52 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.
00:53 teatime .p6 looks strange and futuristic. like P6.
00:53 ZoffixLappy stanrifkin_, where? I see only .pm6 in https://github.com/rakudo/rakudo/tree/nom/lib
00:55 sue joined #perl6
00:56 stanrifkin_ ZoffixLappy: https://github.com/rakudo/rakudo/tree/nom/src/core
00:56 ZoffixLappy stanrifkin_, ah. Well, those are types, not modules :)
00:58 stanrifkin_ ZoffixLappy: ok
01:00 lizmat joined #perl6
01:01 ZoffixLappy BTW, I still didn't get an answer for question I asked this noon: http://irclog.perlgeek.de/perl6/2016-04-14#i_12338595
01:02 ZoffixLappy Is the entire spectest supposed to be passing?
01:06 * sortiz spectesting now...
01:09 diakopter some fail for me
01:12 dalek doc: db663fc | (Zoffix Znet)++ | doc/Language/testing.pod:
01:12 dalek doc: Fix signature for throws-like
01:12 dalek doc: review: https://github.com/perl6/doc/commit/db663fc84b
01:13 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?
01:13 * ZoffixLappy didn't run make install... tries
01:13 diakopter no
01:14 diakopter 'course, I was testing a branch of moarvm; I need to test the master branch
01:19 * sortiz t/spec/S06-advanced/wrap.rakudo.moar .......................... ok
01:30 vendethiel joined #perl6
01:32 sortiz ZoffixLappy, In your gist seems that you are trying the unprocessed *.t, that have a few '#?rakudo todo'
01:34 ZoffixLappy Oh.
01:34 sortiz you should try the post-processed *.rakudo.moar files
01:34 ZoffixLappy Ah
01:35 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:36 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 ZoffixLappy That's on nom from yesterday, before my patch
01:37 sortiz This is Rakudo version 2016.03-118-g4f3f1c8 built on MoarVM version 2016.03-108-gca1a21a
01:38 sortiz i.e. nom latest
01:39 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 ZoffixLappy Oh. Two more failures in t/spec/S32-io/IO-Socket-Async.t :/
01:46 BenGoldberg joined #perl6
01:46 ZoffixLappy Here's the result: https://gist.github.com/zoffixznet/c2cc8df4bd1bf76792ece2f92002d0ee
01:46 * ZoffixLappy will deal with this tomorrow...
01:47 ilbot3 joined #perl6
01:47 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!
01:52 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␤»
01:52 ZoffixLappy I'm not seeing the difference between the above and mine, which fails with an error :S https://gist.github.com/zoffixznet/7ecb36ac26c1b7a371ab7e200f1a94c1
01:53 FireFly joined #perl6
01:54 ZoffixLappy Oh, never mind. I see it now.... too many beers :)
01:54 ZoffixLappy Although, I'm disappointed Perl 6 doesn't read my mind :D
02:18 cdg joined #perl6
02:22 * sortiz I'm disappointed because can't read Perl6's mind.
02:50 ilbot3 joined #perl6
02:50 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!
02:50 jolts joined #perl6
02:54 jolts joined #perl6
02:59 matiaslina joined #perl6
02:59 Herby_ m: 'abc42' ~~ / \d / and say ~$/;
02:59 camelia rakudo-moar 4f3f1c: OUTPUT«4␤»
03:01 Herby_ m: 'c:\tv\show\episodeName' ~~ / episodeName / and say ~$/;
03:01 camelia rakudo-moar 4f3f1c: OUTPUT«episodeName␤»
03:02 Herby_ m: 'c:\tv\show\episodeName' ~~ / .+ \\ \w+ / and say ~$/;
03:02 camelia rakudo-moar 4f3f1c: OUTPUT«c:\tv\show\episodeName␤»
03:02 Herby_ i'm hosing that up
03:02 Herby_ if I have a path like 'c:\tv\show\episodeName', how do I regex the episodeName?
03:03 Herby_ trying to list contents of a folder and grab just the file name
03:06 ZoffixLappy Herby_, perhaps one of the methods in IO::Spec::Win32 ?
03:06 geekosaur m: 'c:\tv\show\episodeName' ~~ / .+ \\ ( \w+ ) / and say ~$0;
03:06 camelia rakudo-moar 4f3f1c: OUTPUT«episodeName␤»
03:06 geekosaur however I'd not trust \w there
03:07 Herby_ ZoffixLappy: I'll take a look, thanks
03:08 Herby_ geekosaur, would it be safer to just grab everything after the last '\'?
03:08 Herby_ m: 'c:\tv\show\episodeName' ~~ / .+ \\ ( .+ ) / and say ~$0;
03:08 camelia rakudo-moar 4f3f1c: OUTPUT«episodeName␤»
03:09 Herby_ m: 'c:\tv\show\season 2\episodeName' ~~ / .+ \\ ( .+ ) / and say ~$0;
03:09 camelia rakudo-moar 4f3f1c: OUTPUT«episodeName␤»
03:10 geekosaur Herby_, yes
03:11 Herby_ one more question: if my path structure was 'c:\tv\show\season n\episodeName'
03:11 geekosaur my paranoia kinda prefers
03:11 geekosaur m: 'c:\tv\show\episodeName' ~~ / .+ \\ ( <-[ \\ ]>+ ) / and say ~$0;
03:11 camelia rakudo-moar 4f3f1c: OUTPUT«episodeName␤»
03:11 Herby_ and I wanted to grab the season and the episode
03:12 Herby_ m: 'c:\tv\show\season 2\episodeName' ~~ / .+ \\ ( .+ ) \\ ( .+ ) / and say ~$0 ~ ~$1;
03:12 camelia rakudo-moar 4f3f1c: OUTPUT«season 2episodeName␤»
03:12 geekosaur m: 'c:\tv\show\episodeName' ~~ / .+ \\ (season \d+) \\ ( <-[ \\ ]>+ ) / and say "$1, $0";
03:12 camelia rakudo-moar 4f3f1c: ( no output )
03:13 geekosaur whoops
03:13 geekosaur m: 'c:\tv\show\season 3\episodeName' ~~ / .+ \\ (season \d+) \\ ( <-[ \\ ]>+ ) / and say "$1, $0";
03:13 camelia rakudo-moar 4f3f1c: ( no output )
03:14 Herby_ m: 'c:\tv\show\season 2\episodeName' ~~ / .+ \\ ( .+ ) \\ ( .+ ) / and say "$0 \t $1";
03:14 camelia rakudo-moar 4f3f1c: OUTPUT«season 2      episodeName␤»
03:15 Herby_ geekosaur:  why do you like the "( <-[ \\ ]>+ )" more?
03:15 Herby_ my regex is weak, and really weak in p6
03:16 geekosaur because it specifies exactly where I want to allow the \\-s
03:17 geekosaur I could hope it does the right thing like you are, but certain changes to that regex could surprise you
03:18 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 >.>
03:20 Herby_ i might try and get real fancy and use grammars
03:20 Herby_ gotta read up on them
03:21 Herby_ well, i guess that would be overkill
03:21 geekosaur for this, likely yes.
03:21 Herby_ since I'm just parsing one path at a time
03:22 geekosaur that and they're not e.g. recursive
03:23 geekosaur or complex conditionals
03:23 yurivish joined #perl6
03:23 noganex joined #perl6
03:24 AlexDani` joined #perl6
03:25 mcsnolte_ joined #perl6
03:27 ruoso_ joined #perl6
03:29 agentzh joined #perl6
03:29 agentzh joined #perl6
03:35 torbjorn joined #perl6
03:36 olinkl joined #perl6
03:38 sortiz joined #perl6
03:41 peteretep joined #perl6
03:48 ssm_ joined #perl6
04:00 cyberviking joined #perl6
04:05 teatime \o
04:09 nige1 joined #perl6
04:18 Cabanossi joined #perl6
04:24 dalek joined #perl6
04:25 tardisx joined #perl6
04:37 tardisx joined #perl6
04:58 _notbenh joined #perl6
05:22 avenj joined #perl6
05:22 avenj joined #perl6
05:41 ilbot3 joined #perl6
05:41 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!
05:42 pierrot joined #perl6
05:43 ssm_ joined #perl6
05:43 diakopter thank you captionbot.ai
05:43 diakopter http://i.imgur.com/8fHikFv.png
05:45 tony-o MadcapJake: a really inefficient/ineffective search is available on modules.zef.pm
05:46 tony-o well, it's kind of effective but it's not great
05:46 MadcapJake I've found https://github.com/krisk/Fuse to be an easy way to get fuzzy search on client-side
05:46 tony-o i'm using perl
05:47 tony-o 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:48 tony-o it's currently looking at author/module name/provides
05:49 MadcapJake it doesn't seem to organize them
05:49 MadcapJake http://modules.zef.pm/search?terms=Test
05:49 diakopter this one's better: http://i.imgur.com/tyNsrWs.png
05:52 MadcapJake tony-o: almost finished with this highlight.js PR but I hit an unfortunate road-block: heredocs are completely unsupported.
06:08 _mg_ joined #perl6
06:08 moritz heredocs are *hard*
06:19 vendethiel joined #perl6
06:21 CIAvash joined #perl6
06:31 firstdayonthejob joined #perl6
06:37 wamba joined #perl6
06:44 ufobat morning :-)
07:20 ilbot3 joined #perl6
07:20 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!
07:23 ufobat what is a perl6 day?
07:25 moritz it's like Friday, only better :-)
07:26 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 masak (we're hiring)
07:30 * tadzik grumbles
07:31 masak :0
07:31 masak :)
07:31 * masak pats tadzik
07:31 masak *pat pat*
07:31 * moritz hugs tardisx
07:31 moritz erm
07:31 * moritz hugs tadzik
07:31 moritz tab completion fail :-)
07:32 tadzik :}
07:32 masak Hug a Stranger Day! :D
07:32 * masak hugs mre_
07:32 * moritz hugs wtw
07:32 vendethiel joined #perl6
07:33 * masak hugs vendethiel
07:33 masak oh wait. I know you. never mind.
07:34 tadzik http://www.thewalkingdead.com/wp-content/uploads/2014/08/hawkward.jpg
07:34 masak http://ct.weirdnutdaily.com/ol/wn/sw/i53/2/12/5/wnd_f975513e15342eb0032bb149b119e658.jpg
07:36 jeek http://www.thewalkingdead.com/readme.html
07:36 jeek Oh, that's dangerous.
07:36 masak jeek: could you provide some context to that comment?
07:37 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
07:37 tadzik oh-oh
07:37 ufobat masak, that sounds great!
07:37 huf wasnt me
07:38 masak ufobat: it's great when it works ;)
07:38 jeek masak: Your site?
07:38 masak jeek: never heard of it
07:38 jeek You've never herad of thewalkingdead.com ? You just linked it...
07:38 jeek *heard
07:38 masak oh, tadzik did
07:38 ufobat yeah.. "but there are bugs all over the place! fix it masak.." is it like that?
07:38 jeek Err, whoops.
07:38 tadzik I linked to it, actually
07:38 jeek tadzik, yes. Sorry, not awake.
07:38 tadzik and only because that's what came up when I google-imaged for "hawkward" :)
07:39 tadzik I avoid series that are less than 10 years old
07:39 * masak .oO( someone is missing Wordpress patches on the Internet )
07:39 ufobat i've got release day today, not perl6 day
07:39 jeek Well, at least no one noticed.
07:39 tadzik until now! Muahahah
07:40 jeek No one that has ever bothered to download and install https://github.com/wpscanteam/wpscan , at leats.
07:40 jeek *least
07:40 jeek Man, I cannot type tonight.
07:40 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)
07:40 avenj joined #perl6
07:40 avenj joined #perl6
07:40 moritz s/autodated/outdated/
07:40 * moritz can't type either
07:41 jeek masak: Enough context for you? :)
07:45 masak yes. thank you.
07:46 zakharyas joined #perl6
07:51 darutoko joined #perl6
07:55 g4 joined #perl6
07:56 dalek joined #perl6
07:56 abraxxa joined #perl6
07:56 jack_rabbit joined #perl6
07:57 RabidGravy joined #perl6
08:00 sjoshi joined #perl6
08:04 Woodi hey! stop that!
08:04 Woodi you not hear panama papers was out thanx to great Wordpress ??
08:05 Woodi now jurnalists have their version of Big Data (<2Tb) ;)
08:07 araujo joined #perl6
08:10 araujo joined #perl6
08:10 masak if you could program Perl 6 in the browser instead of JavaScript, would you?
08:11 masak 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:13 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:15 araujo joined #perl6
08:15 araujo joined #perl6
08:15 masak what I'm especially after is some kind of "one environment" feeling between client and server
08:15 masak it feels so weird and unnecessary to be writing one client application and one server application
08:15 masak especially as some use cases and code paths effectively straddle the two
08:18 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:20 masak not sure I understand what you want to say with "pushes that boundary closer to the client"...
08:21 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:22 masak aha
08:22 masak wouldn't that... push the boundary closer to the server, though?
08:22 CIAvash Yeah, I would like to see Perl 6 -> wasm too
08:23 rurban joined #perl6
08:23 Possum joined #perl6
08:23 * Woodi would like to see clouds pushed to *home* servers...
08:23 Woodi you know, Mrs. H. Clinton way but better :)
08:25 rurban left #perl6
08:26 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:27 masak I see such solutions sometimes. they seem promising but not quite battle-tested yet.
08:27 Woodi VNC, Xserver ? :)
08:28 RabidGravy bits of ASP.net went somewhere toward that
08:28 RabidGravy JSP was awful
08:29 masak I agree. it would be interesting to dissect *why* JSP was awful.
08:29 masak like, in the light of current known best practices on the web.
08:32 Woodi masak: I think it was ecosystem fault - thing was pushed only for enterprises not plain ppls. and performance...
08:33 Woodi so, if Wordpress destroy management trust in PHP technology, what we will use instead ?
08:34 RabidGravy I'd carry on as normal, never used Wordpress
08:35 masak sounds good to me.
08:35 Woodi I just wonder how secure are that mini-httpd-servers from node, Perl, Python, etc...
08:35 masak I have used Wordpress, and MediaWiki, but I probably won't much in the future.
08:37 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:38 RabidGravy 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:39 _mg__ joined #perl6
08:39 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 ?
08:40 Woodi hmm, probably I worry about performance more then security :)
08:40 pmurias joined #perl6
08:41 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
08:41 pmurias Perl 6 -> wasm won't be happening any time soon
08:41 masak pmurias: I'll take your word for it :/
08:41 pmurias for now wasm is just bytecode asm.js
08:44 [particle] joined #perl6
08:44 yurivish joined #perl6
08:45 pmurias if we really wanted to compile to it we would have to use enscripten and run MoarVM on top of wasm
08:46 pmurias masak: re one environment feeling one big obstacle to that is that the user running part is untrusted
08:47 RabidGravy I think what I am thinking of in the first case is somewhat more high level
08:47 FireFly left #perl6
08:50 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:51 Woodi RabidGravy: so all "state" is moved server side ? and client do rendering only; client can choose prefered theme and things like that ? :)
08:52 M-matthew joined #perl6
08:52 M-tadzik joined #perl6
08:53 RabidGravy more that where the line is drawn is normally unimportant to the programmer
08:55 masak pmurias: oh, that's a good insight.
08:55 masak pmurias: right, "don't trust user input".
08:56 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.
08:56 masak this could probably be statically checked somehow.
08:56 masak like, a value that crosses over to the server is automatically "tainted".
08:57 RabidGravy that's always been the same since client/server applications started appearing
09:00 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:05 masak pmurias: Ember's fastboot heads in that direction as well.
09:06 masak 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:07 Woodi render pixels and send them ;)  and VNC additionally resolves sessions problem :)
09:09 * masak .oO( any sufficiently advanced tongue-in-cheek is indistinguishable from noise )
09:14 RabidGravy anyway this is not getting the authentication part of Sofa finished
09:14 RabidGravy just that and making it replace "couchapp" seamlessly and it's good to go ;-)
09:15 ocbtec joined #perl6
09:17 vendethiel joined #perl6
09:18 ely-se joined #perl6
09:23 pmurias jnthn: is auto vivication of attributes just an optimalisation or is it important for semantics?
09:26 lubomir_ joined #perl6
09:28 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
09:28 jnthn pmurias: Oh...you could do that
09:29 jnthn pmurias: It's the REPR's job to make sure it returns a fresh container
09:29 jnthn pmurias: You could do it at creation time
09:29 jnthn That was a very data-driven optimization, fwiw.
09:29 jnthn It's because every routine has a $_, $/, and $!, but 90%+ of routines never used them.
09:30 jnthn So you get to save 3 memory allocations in a lot of cases :)
09:30 jnthn Which made quite a difference :)
09:30 pmurias $_, $/, $! are stored in attributes rather then lexicals?
09:31 jnthn Oh...
09:32 jnthn No, those are lexicals...which also get auto-viv :)
09:32 jnthn Oh...
09:32 jnthn Yeah, there's another semantic detail too
09:32 jnthn Check isattrinitted
09:33 jnthn If you don't put off the init then you'll need another way to implement that.
09:39 Amnez777 joined #perl6
09:41 dalek joined #perl6
09:51 vendethiel joined #perl6
10:00 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:09 avenj joined #perl6
10:11 M-matthew joined #perl6
10:16 cpage_ joined #perl6
10:21 Roamer` joined #perl6
10:28 cibs_ joined #perl6
10:34 cibs joined #perl6
10:34 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␤»
10:34 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«{"type":"placement","own":[5,6],"neutral":[6,10]}␤»
10:34 masak cool.
10:35 masak I've come to really appreciate the `~~ s[] =` syntax
10:37 tony-o oh, that's really nice
10:46 cibs_ joined #perl6
10:51 cibs joined #perl6
10:53 RabidGravy that had me scared for a minute
10:53 RabidGravy then I realised it was *still a string*
10:54 psch \o
10:55 psch jazz theory is ridiculous
10:55 RabidGravy I think I have the "Encyclopedia of Jazz Theory" on the shelf over there ^
10:56 psch i mean, i don't really know a lot
10:56 psch but what i start to understand scares me :P
10:56 cibs joined #perl6
10:56 jast life is a lot less terrifying if you understand *just enough* of everything without getting in more deeply ;)
10:57 RabidGravy it is quite scary :)
10:57 RabidGravy anyhow I'm off out shopping
10:58 moritz well, science says you're much more scared of stuff you don't know
10:58 moritz but there are areas where I suspect the opposite is true
10:58 moritz climate change, nuclear reactor theory, how software is made
10:59 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
10:59 moritz jast: I know, I'm just glossing over the details
11:04 kid51 joined #perl6
11:06 psch which, curiously, was the advice by jast to not get terrified :)
11:06 jast there's a method to my madness!
11:07 * psch boos at past psch
11:07 psch non-deterministic tests *shakes fist*
11:08 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
11:08 go|dfish joined #perl6
11:08 psch oh, wait, there is
11:09 psch well, the pentatonic scale isn't for making chords anyway, so it'll have to go vOv
11:09 wamba joined #perl6
11:10 jast depends on the chords
11:11 psch right, but i won't stand for an augmented fifth as a tonic
11:12 lizmat joined #perl6
11:12 * timotimo doesn't know anything about jazz theory
11:12 kaare__ joined #perl6
11:14 vendethiel joined #perl6
11:15 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"
11:16 jast IMO scales are overrated
11:16 timotimo "as long as people play, people will cheer", OK
11:16 jast I'm more of a "screw theory, just write/play it the way you want it to sound" guy
11:18 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
11:18 jast at some point you become so good at stealing that it's indistinguishable from innovating :}
11:20 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 timotimo and then you create new kinds of music!
11:22 jast you could see the stealing as a way of kickstarting your own creative abilities with something that's known to "work"
11:22 jast 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
11:22 timotimo OK, because if you steal from /dev/urandom, you're not guaranteed to notice if you're doing it well or not
11:23 kid51 joined #perl6
11:23 jast you're not guaranteed either way, but starting from something solid allows for smaller iterations that still "work"
11:23 jast make a small iteration on /dev/urandom and you're still pretty much in random land
11:25 rurban joined #perl6
11:26 psch it also strongly depends on what exactly "making music" means i think
11:27 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
11:28 psch but e.g. digital composition might work better with just picking a song and trying to recreate it in your favorite DAW
11:33 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 jast but you have to start somewhere, so might as well focus on the awesome aspects
11:34 cibs_ joined #perl6
11:42 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:44 grondilu (doing sub ($functionbody) { sub (|args) { EVAL $functionbody } } looks silly)
11:45 arnsholt my $sub = EVAL "sub { $body }" # I suppose
11:45 arnsholt Or something along those lines
11:45 grondilu oh damn I so dumb.  Yeah the EVAL would be evaluated only once, right?
11:46 grondilu so performance should be totally fine.
11:46 grondilu m: my &f = EVAL 'sub ($a, $b) { $a + $b }"; say &f(1, 2);
11:46 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…»
11:46 grondilu m: my &f = EVAL 'sub ($a, $b) { $a + $b }'; say &f(1, 2);
11:46 camelia rakudo-moar 4f3f1c: OUTPUT«3␤»
11:47 TreyHarris joined #perl6
11:47 grondilu it was so simple I feel genuinely embarassed.
11:48 moritz m: my &f = EVAL 'sub ($a, $b) { $a + $b }'; say f(1, 2);
11:48 camelia rakudo-moar 4f3f1c: OUTPUT«3␤»
11:48 moritz you don't even need the & at invocation
11:54 rurban left #perl6
11:55 * jnthn finally wrote last week's Perl 6 hacking up: https://6guts.wordpress.com/2016/04/15/heap-heap-hooray/
11:56 jnthn (Danger, long post...but hopefully educational :))
11:58 * masak me somehow read "Danger" as the comparative form of the adjective "Dang" :P
12:00 * grondilu thought 'has ($.a, $.b) = 1, 2' was valid syntax
12:00 jnthn Nope.
12:00 jast masak: the dangest mistake
12:00 masak I need to read less dangly, clearly.
12:00 jnthn grondilu: has $.a = ...; actually thunks the RHS
12:01 jnthn grondilu: And attaches it to the attribute in question
12:01 jnthn (So it's a per-attribute thunk)
12:01 masak jnthn: but theoretically, that could happen for a statically-known list of comma-separated things in the RHS too, no?
12:01 masak it's just that we don't do that
12:01 masak er, "just"
12:01 kaare_ joined #perl6
12:02 jnthn masak: Yeah, but...it quickly gets "complicated" because list assignment is a tad dynamic :)
12:02 masak *nod*
12:02 jnthn masak: The moment you get a slip showing up, for example...
12:02 masak yeah
12:02 jnthn So yeah, we could disect *that* case
12:02 masak that, and there's the expectation that the assignments happen "simultaneously", like in `($x, $y) = $y, $x;`
12:03 jnthn Yeah
12:03 masak which I guess *could* also be made to happen, but it feels a bit superfluous for attr init
12:03 jnthn And then the whole "we only apply the default if the attr wasn't touched in initialization"
12:03 masak augh, yes
12:03 jnthn So if your BUILD touched $!a but not $!b...
12:03 jnthn :)
12:07 timotimo Danger! High Postage!
12:07 timotimo when we type, when we tell!
12:08 kaare__ joined #perl6
12:24 TreyHarris joined #perl6
12:29 telex joined #perl6
12:31 ilbot3 joined #perl6
12:31 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!
12:31 kid51 joined #perl6
12:31 ocbtec joined #perl6
12:33 cpage__ joined #perl6
12:34 wamba m: say m/./   for 1,2
12:34 camelia rakudo-moar a45224: OUTPUT«「1」␤「2」␤»
12:35 wamba say /./   for 1,2
12:35 wamba m:  say /./   for 1,2
12:35 camelia rakudo-moar a45224: OUTPUT«/./␤/./␤»
12:35 psch m: say /./.WHAT; $_ = 1; say m/./.WHAT
12:35 camelia rakudo-moar a45224: OUTPUT«(Regex)␤(Match)␤»
12:36 jnthn /./ is a regex object. m/./ means "match this regex now against $_"
12:37 wamba ok, ty
12:38 wamba what kind code is before "for"?
12:38 wamba m: $^a  for 1,2
12:38 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␤»
12:39 moritz wamba: just regular, mainline code
12:42 wamba m: *.say  for 1,2
12:42 camelia rakudo-moar a45224: OUTPUT«1␤2␤»
12:42 wamba m:* .say  for 1,2
12:42 wamba m: * .say  for 1,2
12:42 camelia rakudo-moar a45224: OUTPUT«*␤*␤»
12:44 lizmat joined #perl6
12:46 wamba m: *.Int.say  for 1,2
12:46 camelia rakudo-moar a45224: OUTPUT«1␤2␤»
12:47 wamba say *.Int  for 1,2
12:47 wamba m: say *.Int  for 1,2
12:47 camelia rakudo-moar a45224: OUTPUT«{ ... }␤{ ... }␤»
12:50 Philj Which branch should I be on if I want map().race to work? (If any!)
12:52 ZoffixWin nom is the latest and greatest. As far as I know, race is buggy
12:53 Philj Yeah, I am having more luck with start / await;
12:54 awwaiid buggy? my very limited use of .map().race I thought worked. maybe I was doing .race.map
12:55 Philj my sub returns nothing if I use map.eager/hyper/race, but its fine with start / await;
12:57 wamba if i test race map  that it is usually slower than only map :)
12:58 Philj Ditto :)
12:59 Philj But also with no ouput lol
13:04 Emeric joined #perl6
13:05 wamba ok, this is faster with race (^10000).race.map({ $_ if .is-prime })>>.say;
13:07 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]␤»
13:07 awwaiid m: my %h = a => 5, b => 6, c => 7; say %h[0]
13:07 camelia rakudo-moar a45224: OUTPUT«{a => 5, b => 6, c => 7}␤»
13:08 awwaiid How does that work?
13:08 ZoffixWin That's basically (%h)[0]
13:08 awwaiid ah
13:08 psch m: Any[0].say
13:08 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␤»
13:08 psch anyway, yeah, what ZoffixWin said
13:08 Philj oh, so it seems race.map() works, but map().race doesn't
13:08 awwaiid fascinating
13:08 psch m: say Any.^can('AT-POS')(Any)
13:08 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␤␤»
13:09 * psch wonders how useful "Did you forget a 'multi'?" there really is
13:09 psch otoh, i don't think that's a typical use-case...
13:09 sufrostico joined #perl6
13:12 cdg joined #perl6
13:12 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"?
13:15 cdg joined #perl6
13:19 ZoffixWin Just operator.
13:22 ZoffixWin 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␤␤»
13:23 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␤␤»
13:23 ZoffixWin This is what's causing the spectest failure in PR #743
13:24 ZoffixWin Well, ignore the $x
13:25 ZoffixWin This is a bug, right?
13:26 psch m: multi foo { CALLER::CALLER::.WHAT.say }; foo
13:26 camelia rakudo-moar a45224: OUTPUT«(PseudoStash)␤»
13:26 psch m: multi foo { CALLER::CALLER::.^name.say }; foo
13:26 camelia rakudo-moar a45224: OUTPUT«PseudoStash␤»
13:26 psch erg
13:26 ZoffixWin One CALLER:: also works
13:26 psch m: multi foo { CALLER::CALLER::.keys.say }; foo
13:26 camelia rakudo-moar a45224: OUTPUT«()␤»
13:27 ZoffixWin m: multi foo { CALLER::.keys.say }; foo
13:27 camelia rakudo-moar a45224: OUTPUT«($=pod !UNIT_MARKER EXPORT $_ $! ::?PACKAGE GLOBALish $¢ &foo $=finish $/ $?PACKAGE)␤»
13:27 psch yeah, so one CALLER out is UNIT
13:27 psch and beyond UNIT there's nothing
13:27 ZoffixWin m: multi foo { EVAL 'nextsame', context => CALLER:: }; foo
13:27 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␤␤»
13:27 ZoffixWin m: sub foo { EVAL 'nextsame', context => CALLER:: }; foo
13:27 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␤␤»
13:27 psch but nextsame only works inside of a multi
13:28 ZoffixWin Sure. But why is the error different, depending on whether I'm executing my eval in a multi?
13:29 awwaiid ZoffixWin: I ran into this sort of thing in LREP, https://github.com/awwaiid/p6-lrep/blob/master/trystuff-out.txt ... but I don't remember what I all I did to generate that
13:30 awwaiid oh this was around getting line number info
13:31 awwaiid oh here is how I made it, https://github.com/awwaiid/p6-lrep/blob/master/trystuff.p6
13:32 awwaiid sorry, probably not helpful
13:33 vendethiel joined #perl6
13:33 psch m: multi f() { nextwith 1 }; multi f(1) { say "got 1" }; f() # i'm surprised..?
13:33 camelia rakudo-moar a45224: ( no output )
13:33 psch m: say "still here?"
13:33 camelia rakudo-moar a45224: OUTPUT«still here?␤»
13:34 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␤␤»
13:34 psch the "Attempt to return..." one seems out of place
13:35 jnthn psch: nextwith is iterating the *existing* argument list
13:36 skids joined #perl6
13:36 psch "which call the next routine with arbitrary arguments (nextwith)" from http://doc.perl6.org/language/functions
13:36 jnthn uh, candidate list
13:36 psch oh
13:36 Philj Wow. printing/saying is really slow - any workaround?
13:37 psch jnthn: so i'd have to predeclare the other candidate?
13:37 jnthn Same with [call|next][same|with]
13:37 jnthn psch: No, you need to just make a fresh call to re-evaluate the multi-dispatch
13:37 masak Philj: print/say less often?
13:37 ZoffixWin Philj, is it the compile time that's slow or runtime? And do you have an example that reproduces the issue?
13:38 * 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?
13:38 Philj Its not the compile time - hangon - I'll put an example together
13:42 kskv joined #perl6
13:46 Philj After simplifying my example, it seems join is the problem, not print!
13:48 mcsnolte joined #perl6
13:49 jnthn psch: When call a multi, we work out at that point what possible candidates match the incoming arguments
13:49 jnthn psch: And deferral just iterates through that list
13:49 jnthn psch: If you use nextwith/callwith, it does *not* recalculate anything
13:50 psch jnthn: oh, so redispatching with *with only work towards wider candidates that match the same argument list
13:50 jnthn psch: Correct
13:51 jnthn Also
13:51 psch m: multi f(Any $) { say "Any" }; multi f(Int $) { nextsame }; f 1
13:51 camelia rakudo-moar a45224: OUTPUT«Any␤»
13:51 jnthn nextsame and nextwith are equivalent to return callsame and return callwith
13:51 jnthn Which is why the "return outside of routine" thing
13:51 psch ah, yeah, that makes sense
13:52 jnthn Also, the context argument to `EVAL` is...um... :)
13:52 jnthn "unofficial" :)
13:52 jnthn I ugess :)
13:52 jnthn *guess
13:52 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:52 camelia rakudo-moar a45224: OUTPUT«calling g␤no g-calling␤»
13:53 dj_goku joined #perl6
13:53 perlpilot joined #perl6
13:53 jnthn Yeah, *that* much does :)
13:53 jnthn It's referring to lexical symbols that'd bite you really :)
13:54 zhi joined #perl6
13:54 jnthn ('cus the optimizer looks for EVAL ocurring in the code to know what it can get away with)
13:56 nine jnthn: is there any sense at all in putting objects without serialize REPR functions into an SC?
13:59 jnthn nine: No, they're doomed if we pre-comp
14:00 jnthn nine: You thinking of dying on attempting to do so?
14:16 ilbot3 joined #perl6
14:16 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!
14:17 tharkun joined #perl6
14:19 kaare_ joined #perl6
14:19 psch nine: the bootstrap scaffolding for an MVMContext, if the BOOTAttribute/Attribute holds... :)
14:19 psch +analogy
14:20 jnthn Yeah, the type of an MVMContext REPR
14:27 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:28 psch hm, is there a "we ran through the whole loop" phaser?
14:28 psch like, NOTLASTED..?
14:28 psch or am i just misunderstanding LAST
14:29 psch and it always happens at the last iteration and is equivalent to LEAVE in a for or loop
14:31 kaare__ joined #perl6
14:33 jnthn nine: Yeah, it'll only catch direct additions, not ones that come about during the walk
14:37 jolts joined #perl6
14:38 kaare_ joined #perl6
14:42 uruwi joined #perl6
14:46 uruwi_ joined #perl6
14:51 vendethiel joined #perl6
14:53 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:54 jnthn japhb: Well, it static links against the precise CORE.setting and compiler version
14:54 jnthn japhb: Because that's where it finds all the types like Int, Str, Hash, etc.
14:55 jnthn 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.
14:55 jnthn It'd not be a suitable serialization mechanism if things had to survive the network or upgrades. :)
14:55 ptolemarch joined #perl6
14:55 jnthn (It wasn't ever intended to support that. :))
14:56 jnthn 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 japhb nodnod
14:57 jnthn It's a bit hard to bend it into that kind of shape, I think.
14:57 japhb yeah, sounds like
14:59 jnthn And probably better to go with some standardized serialization format, generally
15:00 jnthn 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." https://twitter.com/scrottie/status/720656691436519424
15:00 * ZoffixWin has no idea what that is, but I'm guessing we can't use it? :)
15:00 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*.
15:01 japhb YAML has some functionality for this, IIRC, but I don't recall seeing there's good YAML support available for Perl 6 yet.
15:02 jnthn ZoffixWin: https://en.wikipedia.org/wiki/Real_mode
15:02 jnthn ZoffixWin: I don't know that it's been used for decades... :)
15:03 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
15:03 japhb jnthn: It gets used all the time ... for a fraction of a second at initial boot.  :-)
15:04 nine japhb: 640K!
15:04 jnthn japhb: Ah, because CPUs start in it by default for back-compat?
15:04 geekosaur unless you have uefi boot
15:04 japhb nine: EMM386 and HIMEM.SYS
15:04 geekosaur well, no, even then it's real mode for long enough to init uefi and switch
15:05 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?
15:05 geekosaur they "do" but it's kinda horrid
15:06 geekosaur 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:07 geekosaur 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 ....
15:07 rurban joined #perl6
15:07 japhb geekosaur: Wow, I never knew that bit of trivia.  That's horrendous and cool at the same time.
15:08 hoelzro o/ #perl6
15:08 japhb o/ hoelzro
15:08 hoelzro o/ japhb
15:08 psch o/ hoelzro
15:08 hoelzro o/ psch
15:08 geekosaur (the reboot was needed because you couldn't go back to real mode after entering protected mode)
15:08 japhb #perl6 just became #x86 for a bit there
15:08 nine geekosaur: the A20 gate?
15:08 geekosaur yeh
15:09 nine japhb: I was quite good at squeezing out those Ks, too :)
15:11 psch 60 tests total for Music::Helpers, and travis also is involved now \o/
15:11 vendethiel joined #perl6
15:12 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:13 stmuk moar on MSDOS? :)
15:13 RabidGravy :-O
15:14 damnlie joined #perl6
15:15 geekosaur sorry, not one page, 64K minus 1 paragraph
15:15 avalenn joined #perl6
15:15 geekosaur so HIMEM.SYS did that, relocated some DOS stuff there, and freed up an extra 64K of normal memory
15:16 pyrimidine joined #perl6
15:16 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
15:17 grondilu u sure?  asm.js and stuff can be pretty fast.
15:17 mohae joined #perl6
15:17 grondilu not to mention the upcoming webassembly.
15:18 dustinm` joined #perl6
15:18 maybekoo2 joined #perl6
15:18 jsimonet joined #perl6
15:18 stmuk I saw Quake or Doom  or something running ok
15:19 mohae joined #perl6
15:19 stmuk under emscripten
15:19 MadcapJake joined #perl6
15:19 geekosaur sure. emulators that do their own memory management are where it gets problematic
15:19 mindos joined #perl6
15:19 timotimo joined #perl6
15:19 ruoso joined #perl6
15:20 frederic1 joined #perl6
15:20 profan joined #perl6
15:21 b2gills1 joined #perl6
15:21 nebuchad` joined #perl6
15:21 apejens_ joined #perl6
15:21 ashleyde1 joined #perl6
15:21 yubimusubi joined #perl6
15:21 telex joined #perl6
15:21 ocbtec_ joined #perl6
15:22 TeamBlast joined #perl6
15:23 [particle]1 joined #perl6
15:23 chris2_ joined #perl6
15:23 psch huh, but something somewhere does a modulo 0 apparently..
15:23 psch ...although it's not travis that noticed that :s
15:24 pmurias geekosaur: MoarVM under enscripten will have to do it's own gc
15:25 psch cause travis still chokes on File::Which
15:25 psch well, panda does, actually...
15:25 geekosaur right, my point is a naïve translation via enscripten would probably emulate moar's memory management on a huge array representing memory
15:25 geekosaur not even sure that would *fit* in memory...
15:27 stux|RC-only joined #perl6
15:27 krunen joined #perl6
15:28 Timbus joined #perl6
15:28 pmurias grondilu: you will loose the jit that way
15:28 ptolemarch joined #perl6
15:30 92AAASS2R joined #perl6
15:30 Vlavv_ joined #perl6
15:30 eiro joined #perl6
15:30 gabiruh joined #perl6
15:30 infina joined #perl6
15:30 mre joined #perl6
15:31 infina joined #perl6
15:31 Peter_R joined #perl6
15:31 chee joined #perl6
15:31 Spot__ joined #perl6
15:31 RabidGravy joined #perl6
15:32 chee joined #perl6
15:32 Juerd joined #perl6
15:34 daxim_ joined #perl6
15:34 ChoHag joined #perl6
15:36 PotatoGim joined #perl6
15:38 MadcapJake joined #perl6
15:39 caasih joined #perl6
15:40 mindos joined #perl6
15:41 parisba_ joined #perl6
15:44 Lucas_One__ joined #perl6
15:44 vendethiel joined #perl6
15:44 ugexe joined #perl6
15:44 jnap joined #perl6
15:44 khw joined #perl6
15:46 avenj joined #perl6
15:49 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)␤»
15:49 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)␤»
15:49 hoelzro joined #perl6
15:50 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)␤»
15:50 webmind joined #perl6
15:50 grondilu what am I missing here?
15:50 grondilu m: say (^10).sort: :by({cos(tau*$^a/10) <=> cos(tau*$^b/10)})
15:50 camelia rakudo-moar a45224: OUTPUT«(0 1 2 3 4 5 6 7 8 9)␤»
15:50 timotimo m: say map {cos(tau*$_/100)}, ^10
15:50 camelia rakudo-moar a45224: OUTPUT«(1 0.998026728428272 0.992114701314478 0.982287250728689 0.968583161128631 0.951056516295154 0.929776485888251 0.90482705246602 0.876306680043864 0.844327925502015)␤»
15:50 timotimo m: say map {cos(tau*$_/10)}, ^10
15:50 camelia rakudo-moar a45224: OUTPUT«(1 0.809016994374947 0.309016994374947 -0.309016994374947 -0.809016994374947 -1 -0.809016994374948 -0.309016994374948 0.309016994374947 0.809016994374947)␤»
15:51 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␤␤»
15:51 timotimo m: say (^10).sort: {cos(tau*$_/10)}
15:51 camelia rakudo-moar a45224: OUTPUT«(5 6 4 7 3 8 2 9 1 0)␤»
15:51 timotimo m: say (^10).sort: :by({cos(tau*$_/10)})
15:51 camelia rakudo-moar a45224: OUTPUT«(0 1 2 3 4 5 6 7 8 9)␤»
15:51 timotimo this is what you're missing, i suppose
15:53 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?
15:53 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
15:54 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\
15:54 camelia rakudo-moar a45224: OUTPUT«Duration␤»
15:54 psch curiously, that is exactly what i need
15:54 psch it still hurts a bit :/
15:55 psch 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"?
15:55 psch timotimo: i... am not sure
15:55 grondilu from S32/Containers: @by differs from $by in that each criterion is applied, in order, until a non-zero (tie) result is achieved
15:55 psch if there's a more resilient spot to put it, i'm open to advice
15:57 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␤␤»
15:57 grondilu m: say Ordering
15:57 camelia rakudo-moar a45224: OUTPUT«5===SORRY!5=== Error while compiling /tmp/QHQHC3HAM5␤Undeclared name:␤    Ordering used at line 1␤␤»
15:57 * grondilu is confused now
15:57 arnsholt jnthn++ # blog
15:57 timotimo clearly outdated speculations
15:58 * grondilu greps 'method sort' in the core and find no occurence of neither a :$by nor a :@by parameter.
16:00 psch m: say Order
16:00 camelia rakudo-moar a45224: OUTPUT«(Order)␤»
16:00 psch m: say Order::.keys
16:00 camelia rakudo-moar a45224: OUTPUT«(More Same Less)␤»
16:01 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)})
16:01 camelia rakudo-moar a45224: OUTPUT«(0 1 2 3 4 5 6 7 8 9)␤»
16:01 ZoffixWin Looks like the last example above didn't sort anything
16:03 grondilu well, that's disturbing.
16:04 psch m: "foo".say(:in('spanish'))
16:04 camelia rakudo-moar a45224: OUTPUT«foo␤»
16:05 moritz methods ignore extra named arguments. News at 11.
16:05 ZoffixWin :)
16:06 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␤␤»
16:06 ZoffixWin Why only methods?
16:06 timotimo because methods can be inherited
16:07 * TimToady blames Liskov
16:07 * RabidGravy blames Godot
16:07 TimToady wait!
16:07 moritz I don't, by principle!
16:08 TimToady waiter!
16:08 TimToady waitest!!!
16:09 TimToady waitester!!!!!
16:12 uruwi joined #perl6
16:12 * diakopter blames Godwin
16:13 webmind joined #perl6
16:14 japhb joined #perl6
16:14 vendethiel joined #perl6
16:20 Spot__ joined #perl6
16:20 vendethiel joined #perl6
16:20 caasih joined #perl6
16:22 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␤␤»
16:22 japhb_ joined #perl6
16:22 gregf_ oh in is a filehandle or a stream
16:23 gregf_ 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␤␤»
16:23 gregf_ m: say :in.^name
16:23 camelia rakudo-moar a45224: OUTPUT«Pair␤»
16:23 * grondilu found out he can do sort { &first-criterium($^a, $^b) || &second-criterium($a, $b) }, @stuff
16:24 * grondilu is still a bit confused by the lack of :@by though
16:27 dogbert17 joined #perl6
16:27 molaf joined #perl6
16:28 dogbert17 hello perl6
16:28 dogbert17 working a bit with the documentation in Cool.pod
16:29 dogbert17 the following text is incorrect no 'Coerces the invocant (or in method form, its argument)'
16:29 dogbert17 zoffix mentioned the other day that it should be 'Coerces the invocant (or in sub form, its argument)'
16:30 dogbert17 there are a few methods with the incorrect wording, i'll change them if noone raises any objections
16:31 masak dogbert17: go right ahead. that phrasing will always be Wrong.
16:32 dogbert17 ok, will do. Btw do you know if the undocumented cis function has a normal name?
16:32 psch m: say &cis
16:32 camelia rakudo-moar a45224: OUTPUT«sub cis ($) { #`(Sub|48437624) ... }␤»
16:33 psch m: say cis 1
16:33 camelia rakudo-moar a45224: OUTPUT«0.54030230586814+0.841470984807897i␤»
16:33 arc joined #perl6
16:33 dogbert17 e.g. the normal name for cotanh, or long name is hyperbolic cotangent
16:33 arcetera joined #perl6
16:33 psch https://en.wikipedia.org/wiki/Cis_(mathematics)
16:34 psch so it apparently means cos(x) + i*sin(x)
16:34 sufrostico joined #perl6
16:35 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
16:36 moritz or exp(i * x)
16:36 dogbert17 Eulers formula?
16:37 dogbert17 exp(i * x) = cos(x) + i*sin(x)
16:37 moritz m: for ^10 { say exp(i * $_) - cis($_) }
16:37 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␤»
16:37 moritz m: for 0, 0.1 ... 2 { say exp(i * $_) - cis($_) }
16:37 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␤»
16:38 dogbert17 I'll whip something up and then I believe that all mathematical subs/methods in Cool have at least some documentation :-)
16:39 moritz ++dogbert17
16:39 eiro joined #perl6
16:39 sortiz joined #perl6
16:40 sortiz \o #perl6
16:43 mre joined #perl6
16:45 TimToady oh, now I see where the c...i...s comes from
16:47 vendethiel joined #perl6
16:48 masak and a hyperbolic cis() function ought to be cish() ;)
16:50 jnap joined #perl6
16:54 infina joined #perl6
16:55 dogbert17 in the meantime, does anyone know what the 'unpolar' method is supposed to do?
16:57 diakopter the opposite of unequator
16:57 dogbert17 :-)
16:58 eiro joined #perl6
16:59 moritz dogbert17: presumably create a Complex from polar coordinates
17:00 moritz m: say unpolar(1, pi/2)
17:00 camelia rakudo-moar a45224: OUTPUT«6.12323399573677e-17+1i␤»
17:00 moritz m: say unpolar(5, pi/2)
17:00 camelia rakudo-moar a45224: OUTPUT«3.06161699786838e-16+5i␤»
17:02 dogbert17 so converting from polar coordinate system to a cartesian one
17:02 timotimo sounds about right
17:05 khw joined #perl6
17:06 psch hm, i really need to rethink this whole Chord design
17:06 firstdayonthejob joined #perl6
17:08 keix joined #perl6
17:08 dalek doc: 7ad6d59 | (Jan-Olof Hendig)++ | doc/Type/Cool.pod:
17:08 dalek doc: Added documentation for cis and replaced the word method with sub in a few places
17:08 dalek doc: review: https://github.com/perl6/doc/commit/7ad6d59c04
17:15 psch ...but why do my tests pass but a oneliner dies? /o\
17:16 matt_ joined #perl6
17:53 ilbot3 joined #perl6
17:53 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!
17:56 uruwi joined #perl6
17:56 jolts joined #perl6
17:57 webmind joined #perl6
17:57 jolts joined #perl6
18:00 spider-mario joined #perl6
18:01 jolts joined #perl6
18:01 parisba_ joined #perl6
18:02 jolts joined #perl6
18:05 jolts joined #perl6
18:06 ugexe joined #perl6
18:06 jolts joined #perl6
18:06 firstdayonthejob joined #perl6
18:09 Possum joined #perl6
18:09 jolts joined #perl6
18:10 _mg_ joined #perl6
18:10 jolts joined #perl6
18:12 hoelzro joined #perl6
18:12 FROGGS joined #perl6
18:12 ZoffixWin Hm... awhile back, I asked if traits were "roles" and someone said they were roles composed at compile time. Now I'm reading http://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:13 psch ZoffixWin: a trait_mod is a special kind of Routine, that usually applies a role to its LHS
18:13 dalek doc: e0a47b9 | (Zoffix Znet)++ | doc/Language/functions.pod:
18:13 dalek doc: Fix typo
18:13 dalek doc: review: https://github.com/perl6/doc/commit/e0a47b9aac
18:14 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!) { ... }"
18:14 hoelzro but I may have misspoken
18:14 jolts joined #perl6
18:15 psch well, "usually" is probably a bit inaccurate
18:15 jolts joined #perl6
18:15 psch "conceptually", maybe, but even that's kind of eh..
18:16 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␤»
18:16 psch traits fit with roles insofar that they work similar to what "but" does, but then "but" is a trait_mod itself...
18:17 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
18:17 perlpilot ZoffixWin: maybe start reading at S02:468
18:18 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.
18:19 perlpilot ZoffixWin: yeah.
18:19 perlpilot (sorry, I kinda expected the bot to be around and make a link for me)
18:19 jolts joined #perl6
18:20 jolts joined #perl6
18:21 jolts joined #perl6
18:22 RabidGravy the traits/roles equivalence is a Moose thing, where traits really are just roles applied to meta thingies
18:24 * psch is reminded of https://perl6advent.wordpress.com/2011/12/14/meta-programming-what-why-and-how/
18:25 agentzh joined #perl6
18:25 psch about 60% through, the "very simple aspect oriented programming" bit
18:26 ZoffixWin FWIW, the link was http://design.perl6.org/S02.html#Properties_on_Objects
18:34 vendethiel joined #perl6
18:38 * masak is now trying out the Nex game -- written in Perl 6 -- remotely over the web with a friend
18:41 timotimo masak: i wonder if you'd be interested in "tak": http://cheapass.com/sites/default/files/TakBetaRules3-10-16.pdf  and  https://www.playtak.com/
18:54 masak timotimo: yeah, stacking games can be fun
18:55 masak 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:57 cpage_ joined #perl6
19:04 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 sufrostico joined #perl6
19:05 cpage_ joined #perl6
19:06 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
19:06 vendethiel joined #perl6
19:09 RabidGravy looks like http://www.djmmusic.com/p-3712-km-double-music-stand-light-122-6.aspx but just one bulb
19:09 El_Che thx
19:12 snarkyboojum joined #perl6
19:18 cpage_ joined #perl6
19:18 pyrimidine joined #perl6
19:19 mohae_ joined #perl6
19:20 uruwi_ joined #perl6
19:21 diego_k joined #perl6
19:22 Emeric1 joined #perl6
19:22 mindos_ joined #perl6
19:22 infina joined #perl6
19:23 infina joined #perl6
19:23 sortiz_ joined #perl6
19:25 b2gills joined #perl6
19:26 caasih joined #perl6
19:27 sufrostico joined #perl6
19:29 M-matthew joined #perl6
19:30 PotatoGim joined #perl6
19:33 mindos joined #perl6
19:33 pnu joined #perl6
19:37 thowe joined #perl6
19:41 allessklaar joined #perl6
19:42 itaipu joined #perl6
19:58 rafl joined #perl6
19:59 araujo joined #perl6
19:59 araujo joined #perl6
20:01 emdashcomma joined #perl6
20:04 cpage_ joined #perl6
20:09 cpage_ joined #perl6
20:13 pierrot joined #perl6
20:18 jjido joined #perl6
20:20 sufrostico joined #perl6
20:20 jjido_ joined #perl6
20:21 tharkun joined #perl6
20:24 Possum joined #perl6
20:27 sufrostico joined #perl6
20:28 rafl joined #perl6
20:50 neuron joined #perl6
20:51 neuron Hi
20:51 neuron I'm looking at NativeCall example on Windows
20:52 neuron The function to create dialog looks like sub MessageBoxA(int32, Str, Str, int32)
20:52 neuron But the first parameter is really a pointer
20:52 neuron So I would like to define the function as sub MessageBoxA(HWND, Str, Str, int32)
20:53 kid51 joined #perl6
20:53 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')
20:54 neuron That was other thing I tried
20:54 neuron But then, NativeCall reports error, it does not like to work with such class.
20:55 neuron 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
20:56 neuron ( I should really paste whole code somewhere )
20:56 sufrostico joined #perl6
20:56 neuron Well, on Windows HWND is really a pointer
20:56 rurban joined #perl6
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:57 neuron my native int32 is repr('P6int') is Int is nativesize(32) { }
20:58 MasterDuke joined #perl6
21:00 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 MasterDuke any other browsers known to be good? or other suggestions?
21:02 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
21:05 neuron RabidGravy : sorry, that's out of my league at the moment, can you be more specific please?
21:05 neuron Which sub?
21:06 RabidGravy eh? If you declare "sub MessageBoxA(HWND, Str, Str, int32)" then you don't need the "is Int"
21:08 neuron ah, I have tried that as a first thing, but http://pastebin.com/YNQ4LEGE
21:09 timotimo neuron: https://github.com/jnthn/zavolaj/blob/master/examples/win32-api-call.p6 - this may be interesting to you
21:10 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
21:10 masak we played till the bitter end
21:10 masak (I won)
21:10 neuron Just for the sake of exploring the object model in P6
21:10 timotimo are you actually allowed to introspect a HWND?
21:10 masak I think this is a first -- Perl 6 and rakudo are now stable enough to do this
21:10 RabidGravy neuron, I'm not quite sure what you are trying to do there
21:11 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++
21:11 RabidGravy if you want to pass (HWND *)NULL then just the HWND type object, not a new object
21:11 timotimo that's right, the undefined object stands in as the null pointer
21:11 RabidGravy so "say MessageBoxA(HWND., "We can haz NCI?", "oh lol", MB_YESNO);"
21:11 timotimo which of course doesn't port properly to systems where you can actually dereference the null pointer and store data there
21:12 neuron ah, hmm
21:12 timotimo there's a stray dot in rabidgravy's code
21:12 neuron let me chew on that for a sec :)
21:12 colomon joined #perl6
21:12 colomon o/
21:13 cpage_ joined #perl6
21:13 neuron Ok, I think I see what's going on.
21:13 RabidGravy timotimo, does rakudo run on any of those systems?
21:13 neuron What I wanted to achieve, was to be able to call MessageBoxA(NULL, ....) where the NULL would automagically become HWND class
21:14 neuron Maybe that's silly thing to do though
21:14 japhb joined #perl6
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:16 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?
21:16 colomon any opinions on the current best module to use to read JSON?  I’m running into JSON::Tiny performance issues again.
21:16 RabidGravy or possibly some microcontroller or some such
21:16 * neuron tried to compile P6 on Solaris 12 today but failed miserably
21:17 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
21:17 masak how much do people on this channel feel like they're benefitting from theory?
21:18 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?
21:18 TEttinger joined #perl6
21:18 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?
21:19 Amnez777 joined #perl6
21:20 masak hoelzro: I guess I mean in general.
21:20 RabidGravy neuron , right, so the HWND type object in your code IS NULL
21:20 RabidGravy a (HWND *)0
21:20 masak how much do people feel assisted/propped up by theory?
21:20 masak how important is theory in people's day-to-day activities?
21:20 RabidGravy same as the Int or Str or whatever type object is "undef"
21:21 timotimo i don't remember what that system was and i can't  seem to find anything about it on-line
21:21 timotimo sorry about the noise, then
21:21 sufrostico joined #perl6
21:22 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”.
21:22 RabidGravy neuron, yes
21:22 masak colomon: could you tell me something about the remaining 10%? I'm curious.
21:23 jjido joined #perl6
21:23 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.
21:24 colomon Perfectly possible to learn theory on the job.
21:24 masak I mean, surely something could be both.
21:26 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
21:27 colomon probably some other stuff.
21:27 colomon but I did a bunch of reading my first few years on the job — pattern books, C++ programming books, misc. Knuth....
21:29 Emeric1 joined #perl6
21:30 colomon and seriously tried out a lot of things a later mostly rejected.  ;)
21:33 masak ok, nice to hear
21:33 masak I feel with my current job I rely on theory *heavily*
21:33 masak I feel that's rather unusual
21:33 masak the trick is finding it among all the practice, though
21:33 colomon nice gig if you can get it.  :)
21:34 masak I feel my relationship with Perl 6 is the same, though
21:35 tharkun joined #perl6
21:35 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 masak maybe this is just my way of saying that I'm an irredeemable pattern matcher, so I stumble on theory everywhere. I dunno.
21:39 dalek doc: 8e218cf | (Jan-Olof Hendig)++ | doc/Type/Cool.pod:
21:39 dalek doc: Added tanh, atanh, cotanh and acosech to the coercion table and removed capitalize from the same
21:39 dalek doc: review: https://github.com/perl6/doc/commit/8e218cfb9d
21:40 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.
21:41 masak I have, however, tried my best to make up for it since.
21:41 masak particularly by reading up a bunch on parsers and compilers.
21:41 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?
21:44 masak oh, interesting. so, a slight majority is from theory?
21:44 masak no, wait.
21:44 * masak can't count
21:45 masak a slight majority is from practical experience? :)
21:45 hoelzro yup
21:45 masak that's still a lot less than colomon, for some reason. discuss.
21:45 hoelzro I really appreciate theory, but most of what I use is from experience
21:45 hoelzro things like how caching affects performance, etc
21:45 masak like, you seem to be using four times as much theory as colomon
21:46 colomon Well, I’m doing CAD file I/O stuff.  If there’s direct theory there, no one ever taught me.
21:47 colomon and the broader software organization stuff i mostly rely on guts, not theory.  :)
21:48 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:49 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 masak which is fair enough.
21:49 vendethiel joined #perl6
21:50 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:51 masak when I see the problem, I see http://strangelyconsistent.org/blog/its-just-a-tree-silly
21:58 colomon don’t be silly, it’s a hash.  ;)
21:58 masak ;)
22:01 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:03 RabidGravy if in doubt hack it out
22:04 hoelzro masak: maybe I overestimated, but I think about things like time complexity and data structures a lot
22:04 hoelzro probably more than I need to =P
22:04 * [Coke] waves from the highway.
22:05 RabidGravy don't IRC and drive
22:11 cpage_ joined #perl6
22:18 * masak .oO( don't unicycle and privmsg )
22:18 rurban1 joined #perl6
22:20 Sgeo_ joined #perl6
22:20 masak oh, and I'm all in the "hack it out" school too
22:20 masak 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"
22:22 masak in fact, I'd say TDD has helped me relax into a managed kind of sloppiness in many cases
22:24 psch http://irclog.perlgeek.de/perl6/2016-04-15#i_12345969 expresses a lot of how i currently feel about "theory"
22:25 psch note, that's mostly contextualized by music and its theory, 'cause recently that's most of what i spend my time on
22:25 psch wrt programming/"code", i've never hardly a particularly strong grasp on theory
22:25 psch although i often wished i had, i never felt obviously stumped by that
22:26 psch 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 ;)
22:26 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
22:27 psch masak: entirely possible, but i theory that's gathered by trial-and-error doesn't feel real to me, for some reason
22:27 psch 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
22:28 psch 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
22:28 * psch is just catching up with the clog
22:29 psch i also find myself agreeing with hoelzro there, around http://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"
22:30 RabidGravy but "theory that's gathered by trial-and-error" is a "pattern book", however that book might be stored
22:31 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:32 psch (i am not sure how "storage" plays a role there, though...)
22:32 RabidGravy "book"
22:33 psch oh, so possible options for storage are "intuitive knowledge" and "papers by leading researchers"
22:33 psch plus whatever else
22:33 wamba joined #perl6
22:33 psch yeah, i can see that
22:33 psch s/intuitive knowledge/heuristics/ # probably
22:34 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:35 * psch isn't sure how to scope this back to compilers and VMs
22:35 psch i am definitely lacking in heuristics there :)
22:35 psch ...i am also not sure scope can be verbed like that
22:36 masak sure it can
22:36 psch on the other hand, that's where i think music is so fascinating
22:36 masak we scope things all the time here
22:36 psch like, assuming a standard western tuning, you can play whatever you like
22:36 psch and it can probably be explained theoretically
22:36 masak yes
22:37 masak 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
22:37 psch +s
22:37 psch so it's not surprise that whatever works, actually works
22:37 RabidGravy but then it's bounded sufficiently that it's fairly small
22:37 psch i had had the thought of trying to make music the other way around
22:38 psch 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
22:40 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 colomon joined #perl6
22:41 [Coke] (theory) mostly don't care.
22:41 masak I had a feeling people would fall all over the spectrum on this one. excellent!
22:42 psch in general i'd say "i wish i knew more, but it doesn't seem to matter too much either way"
22:42 psch well, excluding things like maths, obviously :)
22:42 [Coke] And I have ... half of a compsci degree. (BS of computer systems engineering)
22:49 psch RabidGravy: right, but in the technical sense every percussive instrument is a noise generator
22:55 RabidGravy I have these two modules in my rack right now https://www.youtube.com/watch?v=7ZeXbmSkV3U
22:59 Amnez777 joined #perl6
23:00 masak 'night, #perl6
23:04 sufrostico joined #perl6
23:05 RabidGravy right that's me done
23:05 RabidGravy toodles
23:06 skink joined #perl6
23:17 * colomon finally does enough profiles to realize that in his slower cases, JSON::Tiny is not the source of the problem.
23:24 * colomon doesn’t suppose someone has already written a decent 3D spatial tree in p6?
23:32 colomon joined #perl6
23:42 timotimo would that be like a quadtree?
23:45 AlexDaniel joined #perl6
23:45 AlexDaniel heh, somebody mentioned captionbot. Nice: https://files.progarm.org/2016-04-16-024440_751x523_scrot.png
23:47 timotimo huh
23:51 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:52 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
23:53 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:54 Amnez777 joined #perl6
23:54 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:55 japhb (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:56 timotimo what kind of graphics engine stuff have you made? :)
23:58 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
23:58 timotimo i've recently implemented a super simple particle system in pure perl6, but it doesn't perform well ;(
23:59 japhb The craziest was probably one that implemented a graphics engine on top of pTk's 2D primitives.
23:59 timotimo wat :)
23:59 cpage_ joined #perl6
23:59 timotimo that's Tk? as in TCL/TK?

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

Perl 6 | Reference Documentation | Rakudo