Perl 6 - the future is here, just unevenly distributed

IRC log for #pdl, 2013-11-14

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

All times shown according to UTC.

Time Nick Message
00:08 sivoais jberger_: yep, I've been basing all my stuff on Mojolicious for exactly that reason. :-)
00:15 jberger_ sivoais, oh interesting, do you have anything in a public repo
00:17 gtodd jberger :-)
00:20 sivoais jberger_: yeah, this <https://github.com/zmughal/p5-Devel-REPL-Web>. It wraps around Devel::REPL using the Term::ReadLine interface
00:20 sivoais I've got some bugs/features that I need to sit down and tackle
00:21 sivoais I think I shared it with run4flat a while back when he was working on something...
00:21 gtodd jberger .. you would have a decision to make:   Mojolicious::Plugin::Plot::D3  or ...  PDL::Graphics::Plot::Mojolicious
00:22 gtodd sivoais: I noticed there's some kind of a little buglet with Term::Readline stuff in PDL ...
00:22 gtodd or no wait it's Term::ReadLine::Perl ... it's as if the completion and history is "off by one" or something
00:22 gtodd but not always
00:23 * jberger_ looks
00:23 sivoais ah, this is the context <http://mailman.jach.hawaii.edu/pipermai​l//pdl-porters/2013-August/005794.html>, <http://irclog.perlgeek.de/pdl/2013-08-08#i_7426449>
00:24 jberger_ oh and that email reminds me that I don't think run4flat ever pulled my patch!
00:29 jberger_ hmmmm, I'm going to have to think about this some more
00:29 jberger_ I don't know enough about Devel::REPL
00:30 jberger_ oh I see, run_once prints and then you capture it
00:31 sivoais The main reason I figured out the internals was because I needed to write some mock objects earlier for testing Devel::REPL plugins. :-P
00:32 jberger_ always best to learn by doing
00:35 gtodd sivoais: ahh sorry it's something to do with Prima .. the pod explains it ... not sure when I said "off by one" I really knew what I was talking about:
00:35 gtodd perldoc -T PDL::Graphics::Prima::Simple | grep -C5  "NOTE: Term::ReadLine::Perl "
00:37 gtodd jberger: I know you do javascript  from time to time ... :-)
00:39 gtodd do you think a mojo or perlhaps pdl plugin could/should be coerced to output the required d3.js to a page or socket to allow fancy js/html5/svg plotting?
00:40 gtodd ie for a subset of popular plots that people useful ... or should it just draw svg directly (or both)
00:40 jberger_ I think that could be done very easily
00:41 jberger_ and I think that sivoais is on track for it basically
00:41 jberger_ I also did something once let me see if I can find it
00:42 jberger_ actually the best thing I have is this: http://perltuts.com/tutorials/
00:43 jberger_ I wrote the skeleton of a tutorial for perltuts and then never got back to it
00:43 jberger_ :-/
00:45 gtodd heh thanks ...  anyway good to know it's doable (it's doable now but not in a cpan easy peasy way) .... d3.js could be sort of cutting edge and a out bit "out there" as far as data visualization goes ... and the PDL community might be a bit more scientific, but it seems like ti would be easy to "plug in" ...
00:48 gtodd and just having a something as easy as: "install perl and cpanm with perlbrew , now cpanm PDL,  cpanm Mojolicious ;  cpanm Mojolicious::Plugin::Plot::D3"  ... and with in 5 minutes you can plot your dog's growth curve ... that could grab a whole new bunch of users for Mojolicious and PDL ...
00:50 jberger_ and it looks like the site is missing the library :-/
00:50 jberger_ if you run the following in the console it will fix things
00:50 jberger_ $.getScript('//cdnjs.cloudflare.com/aja​x/libs/flot/0.8.1/jquery.flot.min.js')
00:50 gtodd ok
00:54 jberger_ OH
00:54 jberger_ and that was why I added unpdl() to the PDL core
00:54 jberger_ which is my only real code contribution to PDL
00:55 jberger_ I fixed up some doc rendering too, but that was mostly cruft removal
00:56 gtodd wow nice plots!  ...
00:56 gtodd they look good ... in a ggplot2 kinda way :)
00:58 jberger_ if you look at the pod, you can see what I did to get there, its wasn't too much
00:58 jberger_ I'm remembering things now
00:58 jberger_ I think the holdup was that vti (the site's owner) wouldn't share the underlying internals with us
00:58 jberger_ (I can understand, its evaling on his system)
00:58 gtodd I guess the bar for looking good is pretty low what with Excel plots still looking like they did in 1992 ;)
00:58 jberger_ but it made it hard for us to develop for the site
00:58 gtodd ah ok
00:59 gtodd well the console trick worked ... I need to remember that one :)
00:59 jberger_ we had to keep asking him to open up parts of the architecture to allow for different things
01:00 jberger_ anyway, unpdl() takes a pdl and returns an array(ref?) of arrayrefs preserving the dimensionality of the input piddle
01:00 gtodd wow so .. you can just make a piddle (hmm that sounds wrong) and plot from it?
01:01 jberger_ well, you would presumably then JSON encode it and send it to the browser via a websocket
01:01 jberger_ (or Mojo's websocket handling has a builtin for this
01:02 jberger_ $c->send({ json => $AoA })
01:02 gtodd oh right there's one more step of course
01:02 jberger_ so you could just simply do: $c->send({ json => unpdl($pdl) })
01:03 jberger_ and yes unpdl returns an arrayref directly so the above would work
01:03 jberger_ then you would have to hookup the websocket handler on the client side to whatever plotting library
01:03 jberger_ flot or d3 or whatever
01:03 jberger_ but it really isn't too hard
01:05 gtodd the backend/frontend bit seems like your could mix and match lots of ways of doing it ... I sort of had a d3.js breakthrough last week  where I finally understood why writing javascript that writed svgs (instead og just outputting svgs directly)  might be useful.
01:06 jberger_ there's nothing that can't be fixed with another layer of abstractions
01:07 gtodd :)
01:08 gtodd I think woody allen said that about his therapist
01:08 jberger_ I have probably watched/read enough woody allen that it is totally possible that I might accidentally quote him
01:09 jberger_ meanwhile I have rewritten my mojolicious presentation software, for which it might be fun to do something like this
01:10 gtodd nice
01:10 jberger_ it uses mojolicious templates as slides
01:10 jberger_ and Mojo::Template is a thin layer over Perl as it is, so it wouldn't be hard to do really
01:12 gtodd cool ... you will have a complete "mojo office" .. you've nearly got excel and powerpoint next up: a vim/word/notepad replacement ;-)
01:13 jberger_ have you seen farabi?
01:14 jberger_ anyway, if you promise not to share it with the attendees of the conference, I can share the preview link to my talk
01:14 jberger_ its not quite complete, but if I had to present it right now it wouldn't be the end of the worl
01:14 jberger_ world
01:15 gtodd heard of it never used it ...
01:15 gtodd ah cool
01:17 gtodd too bad you couldn't fix slide 6 before tomorrow to have "Created with Mojo::PDL:Plot 0.01"  instead of "Created with Wolfram Mathematica 7.0" ;-)
01:17 jberger_ no, part of the talk is why Mathematica is bad
01:18 jberger_ the Mathematica scripts are the "before" part of the examples
01:18 jberger_ :-)
01:18 jberger_ all of the Perl code I will run live in front of the audience
01:19 jberger_ part of my presentation framework is that it shows Perl code examples from the files directly
01:19 jberger_ so whatever I'm about to run, they see
01:19 jberger_ even if I change something at the last minute in the example
01:25 gtodd :-D
01:25 gtodd nice
01:35 sivoais hehe <https://www.youtube.com/watch?v=NfhSLTQTLhI>
01:35 sivoais for anyone familiar with Daft Punk ;-)
01:44 jberger_ sivoais, nice
01:45 jberger_ I was very lucky not to need to stay up all night in my PhD program
01:45 jberger_ then again, I was there 8 years :-)
01:46 jberger_ then again, I did stay up late often writing code :-)
01:48 sivoais staying late to finish something can be fun every now and then as long as you plan it out :-)
03:27 _vicash_ how is Mojolicious compared to Dancer ? The syntax looks pretty much the same...
10:54 jberger_ joined #pdl
11:54 pdurbin they both seem nice
12:22 jberger_ _vicash_, on the surface the syntax is the same, but they are very different internally
12:23 jberger_ most important is that mojo is designed for non-blocking IO
12:24 jberger_ which means that writing async apps and doing real-time interaction (like websockets) is very easy
12:24 jberger_ also, since mojo has its own stack of tools, they work together in a very internally consistent way
12:25 jberger_ I have written some blog posts about non-blocking in mojo recently
12:26 jberger_ http://blogs.perl.org/users/joel_berg​er/2013/10/writing-non-blocking-appli​cations-with-mojolicious-part-1.html
12:26 jberger_ http://blogs.perl.org/users/joel_berg​er/2013/11/writing-non-blocking-appli​cations-with-mojolicious-part-2.html
16:32 gtodd a quick way to show numbers that are "divisible by" some other number: in perl re.pl:  say for grep $_%3==0, 1..10     does one do the same thing in PDL or ....?
16:32 gtodd p grep $_%3==0, 1..10    .... doesn't feel right :)
17:16 sivoais gtodd: like: which(sequence(10) % 3 == 0) ?
17:18 gtodd better :)  ... the other approach doesn't feel like I'm using PDL in a PDL-ish way somehow  ...
17:20 gtodd but I don't know what I am talking about since I compare with my ancient way of doing R  .... :-\
17:21 gtodd thanks
18:06 gtodd I think the pdl() function is going to help me bridge  my puny perl<->R mental models  yay
18:06 gtodd eg:
18:06 gtodd numbers <- 1:100 ; numbers[numbers %% 3==0] #the R
18:06 gtodd $numbers=pdl(1..100) ;  $numbers->where($numbers % 3 == 0) # the PDL
18:08 gtodd I suppose that way I can go on speaking perl/pdl like someone who misuses R and R like a person who misuses perl/pdl for a while longer yet
18:40 drrho joined #pdl
20:02 jberger_ joined #pdl

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