Perl 6 - the future is here, just unevenly distributed

IRC log for #pdl, 2015-06-21

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

All times shown according to UTC.

Time Nick Message
00:10 jberger ah makes sense
00:11 jberger it might be hard to make it fully async anyway, where would you put the output lines?
00:13 jberger http://nbviewer.ipython.org/gis​t/jberger/b62332a506b364117e37
00:14 jberger sad that gists don't just render like they do in github, but oh well
00:22 sivoais yes, this is true. my next step after I get it working on windows is to work on the interactive widgets system. that will allow for bidirectional communication via JS
00:27 jberger it looks like there are hooks via the IPerl package and display_data
00:40 sivoais ah, yes. I need to document them more and write a tutorial
00:43 jberger I've almost got it
00:47 jberger http://nbviewer.ipython.org/gis​t/jberger/b62332a506b364117e37
00:47 jberger ha!
00:57 jberger sivoais: ^^
01:00 jberger actually, hmmmm, I wonder if that should be marked as execution_result or stdout
01:00 jberger I guess the choice is up to me really
01:04 sivoais I know of a cleaner way. I will fork and post it after I get home and eat dinner :-D
01:06 jberger sounds good
01:10 mohawk sivoais, he's the man
01:10 mohawk if he can't do it, probably someone else can
01:10 jberger hahaha
01:10 jberger but not very many people certainly :-P
01:10 mohawk ha ha, very true
02:17 sivoais ok, let's take a look
02:19 jberger btw, I updated it to use a safer loop invocation
02:19 jberger start the notebook with IO_ASYNC_LOOP=Mojo set
02:24 jberger its really too bad that AnyEvent can't be trusted
02:25 jberger we are back to combinatorical explosion of compatibility wrappers between ioloops
02:28 sivoais hmm
02:28 sivoais and I'm getting: Mojo::Reactor::EV: Read failed: Can't call method "res" on an undefined value at reply input line 4.
02:28 sivoais so... a replacement should be called ManyEvent ;-)
02:30 jberger sivoais: odd
02:30 sivoais updating Mojolicious now
02:31 jberger ah, could be
02:31 jberger you also need IO::Async::Loop::Mojo installed
02:31 sivoais yep, have that
02:32 jberger wait, are you running my example or doing something else?
02:32 jberger what is "reply input line 4"
02:32 jberger that error usually means that either your user agent object or your transaction object went out of scope
02:33 mohawk why not fork AnyEvent with a simple branch that deletes any of schmorp's shitfest changes like process-killing?
02:33 jberger for a client I think it is sufficient to keep the $ua in scope
02:33 sivoais also, I'm running this on Perl v5.16
02:33 mohawk call it ManyEvent
02:33 mohawk as you said
02:33 jberger sivoais: this is just my base code?
02:34 sivoais aaah, I see
02:34 sivoais you're actually using signatures and that isn't in my perl version
02:34 jberger oh
02:34 jberger sorry
02:34 sivoais hehe
02:34 jberger not doing anything special with them
02:34 sivoais I have a Perl 5.20 built on this machine, but nothing installed under the lib
02:34 jberger just a simple conversion (@args) -> my (@args)  = @_ will suffice
02:35 sivoais good, it works
02:35 jberger Building and testing IO-Async-Loop-AnyEvent-0.03 ... Building IO-Async-Loop-AnyEvent t/00use.t ........... 2015-06-20 21:29:04.000000 -0500 fatal AnyEvent: IO::Async::Loop::AnyEvent detected - that module is broken by 2015-06-20 21:29:04.000000 -0500 + design, abuses internals and breaks AnyEvent - will not continue. # Looks like your test exited with 1 before it could output anything. t/00use.t ........... Dubious, test returned
02:36 jberger bah
02:36 jberger humbug
02:36 sivoais did you all schmorp's stableperl? ;-)
02:37 jberger yeah
02:37 jberger that whole thing is really sad
02:37 jberger Coro is broken because it is evil and abuses internals (in the same way that IO::Async does IMHO)
02:38 jberger and then core perl changes and breaks it
02:38 jberger and honestly it should probably have been reverted in perl core, but, thats what you get for using undocumented internals
02:39 jberger now he forks perl rather than fix coro, because he considers it perl's problem not his
02:39 jberger (and he no longer has some internal hook he needed to abuse)
02:39 sivoais ok, so the method that I've written for handling rich MIME display's in IPerl is to create a class for each kind of thing that can be displayed
02:39 jberger k
02:40 sivoais If an object supports the Displayable role <https://github.com/EntropyOrg/p5-Devel-IPerl/blob/​master/lib/Devel/IPerl/Display/Role/Displayable.pm>
02:41 sivoais which is just a method that returns { "text/html" => "<h1>Hello, world!</h1>" }
02:41 jberger meaning if it implements that method
02:41 sivoais yep
02:41 sivoais then calling IPerl->display( $my_displayable ) will send that data to the frontend via the same execute_reply message
02:41 sivoais or something like it
02:42 jberger what if it is a native type, like a string
02:43 sivoais I hadn't added something for non-reference yet, but I should
02:43 sivoais it can go here <https://github.com/EntropyOrg/p5-Devel-IPerl/bl​ob/master/lib/Devel/IPerl/DisplayableHandler.pm>
02:43 sivoais but I do have something for HTML!
02:44 sivoais just doing IPerl->display( IPerl->html( q{ <h1> Hello, world! </h1> } ) ) will work
02:44 jberger oh ok
02:44 * jberger tries
02:45 jberger ok, that works
02:45 jberger but it doesn't show it as output
02:45 jberger (with the out[n]=)
02:46 sivoais hmm, I have to leave, but I can add something to hook into execute_reply too
02:46 jberger I guess that is a matter of taste too
02:46 jberger not an urgent thing by any means
02:47 jberger but it might be nice
02:47 sivoais I'll add an issue for that to remember :-)
02:47 jberger sivoais++
02:48 jberger oh
02:48 jberger wait
02:48 jberger that will still need an async wrapper
02:49 sivoais here we are <https://github.com/EntropyO​rg/p5-Devel-IPerl/issues/46>
02:49 sivoais go to go
02:49 jberger because the dynamic scoping is exited
02:49 jberger o/
16:09 mohawk sivoais, are you able to have a go at making a test for SF390 on a branch? if you start, please email me and chm, else i'll have a go later
17:04 sivoais if you go ahead, it's not a problem. I will see if I have time after some errands
17:28 opkick [pdl] zmughal opened issue #127: Make sure all uses of approx() in the tests have the tolerance argument http://git.io/vLyDI
17:46 sivoais mohawk: I'm writing a test
17:53 mohawk sivoais, superb
17:57 opkick [devops] zmughal pushed 1 new commit to master: http://git.io/vLy5A
17:57 opkick devops/master 3e67e77 Zakariyya Mughal: add tool to setup tests for PDL regressions in a Vagrant VM
17:57 sivoais ^ this is some scripts I had that installed old PDL versions using perlbrew and local::lib
17:58 sivoais all wrapped up in a VM so that there is replicability
17:58 mohawk hell yeah
18:02 mohawk sivoais, i see in the install-pdl same thing as in travis.yml - why are you installing build-essential?
18:03 sivoais iirc, the Ubuntu VM that I use comes with nothing installed
18:03 sivoais so no gcc by default
18:03 sivoais I'm using this with Vagrant
18:04 mohawk fair enough
18:06 mohawk not to distract you, but we should have a think about PDL::Config
18:06 mohawk WITH_* is going to have to change
18:07 sivoais go on... :-) I'm working in another window and catch up
18:07 sivoais *will catch up
18:07 mohawk mostly it'll just get deleted
18:07 mohawk since most of the things will just be external packages
18:08 mohawk although, hang on
18:08 mohawk in p-core the extra packages stuff will go away, for obvious reasons
18:08 * sivoais nods
18:09 mohawk p-monolith might still have it, with MYMETA being used to load those packages
18:09 sivoais seems reasonable
18:10 mohawk i guess that's a price i'm prepared to pay for the monolith-splitting while creating absolutely minimal disruption for the old-skool types who want to load "PDL" and have it work the same
18:11 mohawk i do think we'll have to split then, %PDL::Config as is, but some bits move to %PDL::Core::Config maybe
18:11 mohawk on the other hand, apart from tests being able to drop out early, and the current godawful M.PLs relying on %P::C, what else actually uses it?
18:11 sivoais which %PDL::Config will probably need to merge in, right?
18:11 mohawk i favour it still being %PDL::Config, owned by PDL::Core
18:12 mohawk and the WITH_* just going away
18:12 mohawk anything that breaks we can provide assistance with
18:12 mohawk you know, to the 4 people that rely on it
18:12 mohawk it's not what i'd really accept as calling an "incompatible change"
18:13 sivoais haha, yes. Just checking that the module loads should be enough. That is the standard Perl practice
18:13 sivoais eval { "require ..." }
18:14 mohawk inorite
18:15 mohawk so, keeping it simple, we can just eliminate the relevant WITH_* and possible have a bit of a cleanout of any other obsolete stuff there
18:15 mohawk tragically that will involve change t/config.t
18:16 sivoais lol, that's just a TODO test
18:16 sivoais which doesn't even do much
18:17 sivoais actually, that test should just go away
18:17 sivoais and be replaced with something that actually tests the build configuration
18:19 mohawk it's not TODO, i think
18:20 mohawk it was a valid idea to check all the M.PLs actually set defined values for their relevant thingummies
18:20 mohawk but in the brave new world, it adds nothing
18:23 sivoais right, yeah, that's what I thought. Should have been an xt/ test
18:23 sivoais unless it was meant for CPAN Testers (but it should have had more diagnostics perhaps)
18:27 mohawk thinking about it, you're right - it was an xt test at heart
18:27 mohawk but yeah, zappage is the only thing for it
18:28 mohawk sivoais, how goes the war?
18:28 sivoais don't mention the war!
18:29 sivoais I'm about done, just incorporating chm's other comments from the issue and turning them into tests
18:29 mohawk is it fixed?
18:29 sivoais not yet. I'm going to push the test soon
18:29 mohawk ok, great
18:44 sivoais this is a little tricky because it shows a conflict in the semantics of boolean comparison and BAD values
18:44 sivoais if I'm interpreting this correctly
19:04 mohawk it does seem that way
19:04 mohawk i haven't really used PDL so i don't know :-)
19:04 mohawk i'd suggest emailing chm with what you've got so far
19:04 mohawk or even better, have a wild guess, push the branch
19:04 mohawk that's what code review is for!
19:05 mohawk in this case you'd then email chm with the github branch url including file path
19:05 mohawk i'm just reading PDL::Threading
19:05 mohawk it's a bit mind-bending
19:07 sivoais will do
19:11 mohawk wow, that's really clever
19:11 mohawk life in 3 lines
19:11 mohawk don't talk to me about life
19:23 mohawk and me with this terrible pain in all the diodes down my left side
19:25 sivoais and a brain the size of a planet
19:31 mohawk I mean I've asked for them to be replaced but no one ever listens
19:53 sivoais oh lolol
19:53 sivoais $p = pdl [1, 2, 3]; $p->badflag(1); $p->badvalue(2); $m = stats($p)
19:54 sivoais p $m; # BAD
19:54 sivoais p $p; [1 BAD 3]
20:13 jberger mohawk: one you wrap your head around pdl threading, it really is quite cool
20:14 jberger And afaik it is unique amongst its competitors
20:21 sivoais i think APL might have it, but nobody else but PDL took that lesson
20:21 * sivoais is learning APL
20:38 mohawk oh, it's cool as anything
20:38 mohawk but it's still mind-bending ;-)
20:38 mohawk makes me want to revisit that slow as anything GIMP plugin i asked sivoais for his opinion on last year
20:38 mohawk i bet there's an idiomatic pdl way of doing it
20:39 sivoais the landscape thing, right?
20:39 mohawk that's the badger
20:39 mohawk iland its name is, i think
20:39 mohawk sivoais, so where are we at with the "show-stopper" that chm wants fixing?
20:41 sivoais it's a doozy
20:41 sivoais but test commit incoming
20:41 sivoais I know a fix for the particular problem, but I will need to map out the logic for the general case
20:42 sivoais I think what we have right now in terms of tests doesn't cover all the possible cases nor is there documentation on what the behaviour should be
20:42 sivoais I need a table
20:43 sivoais but fixing the code for Marek should be straightforward
20:43 sivoais which will make everyone happy all 'round :-)
20:43 mohawk let's go with that for now
20:44 mohawk the sooner chm accepts it and releases pdl-monolith 2.013, the sooner i can make pdl-core and chm dev-releases it as pdl::core 2.013_01
20:45 mohawk please could you nudge him to release p-i-g as well
20:45 opkick [pdl] zmughal created sf390 (+1 new commit): http://git.io/vLS44
20:45 opkick pdl/sf390 4ea4d15 Zakariyya Mughal: test comparisons between scalars and 0-dim PDLs with badflag == 1...
20:45 sivoais yes, right after we get Travis-CI working with pdl-core + p-i-g
20:45 mohawk i think pig works fine now
20:46 mohawk it deps on pdl::core
20:46 sivoais oh, ok, so it will install independently
20:46 mohawk yes
20:46 mohawk it just installs the whole of pdl
20:46 mohawk ...for now
20:47 mohawk please make sure that the test and fix are in one commit in final version?
20:47 sivoais but when it requires PDL::Core, that will grab PDL-2.012 and the IO/GD in there will be overwritten
20:48 sivoais i suppose that is fine. It'll get tested either way
20:51 opkick [pdl] zmughal opened pull request #128: test comparisons between scalars and 0-dim PDLs with badflag == 1 (master...sf390) http://git.io/vLSB1
20:54 mohawk yes, it's a tricky one
20:54 mohawk if p-i-g gets released now, then we delete it from pdl-monolith
20:54 mohawk that's why we release the split-out piece first, followed by the new version of the monolith
20:55 mohawk we don't need to release the new monolith immediately, either
20:55 sivoais I have been contemplating having Travis pull directly from a Git branch for one of the tests
20:55 mohawk down that route insanity lies, i fear
20:55 sivoais pull a copy of PDL to install, that is
20:55 mohawk what do you have in mind?
20:56 mohawk hmm, why?
20:57 sivoais well, we are going to test the interaction between the PDL monolith and p-i-g locally, right?
20:58 sivoais before a release is cut
20:58 sivoais why not do the same on Travis-CI
20:59 sivoais I'm thinking of Travis-CI mainly as a sanity check since it smooths over differences in dev environments
20:59 mohawk we could just try doing cpanm github/.../pdl-core/release/...
21:00 sivoais right, that works too
21:00 mohawk i think you're trying to smooth over the intermittent availability of chm doing releases ;-)
21:00 sivoais hahah :-P
21:00 mohawk i think a local test with a couple of versions is good enough
21:00 mohawk or even better, with pdl-core on your local vagrant box
21:04 mohawk i guess i should populate pdl-core soon
21:04 mohawk but not yet
21:04 mohawk it's tricky since the simplest version has >1 subdir (Basic, Pod, Doc)
21:04 sivoais ah, and subtree doesn't do well with that?
21:04 mohawk i'm thinking on my branch i'll git rm the other stuff, then subtree .
21:05 mohawk we'll find out :-)
21:05 mohawk but my first priority is to figure out why latest EUMM breaks on gmake, and to stop it doing that
21:16 opkick [pdl] zmughal comment on issue #124: I have put together some tests on the sf390 branch:... http://git.io/vLSuF
21:31 sivoais *sigh*
21:38 sivoais use PDL; use Test::More; $p = cat( sequence(5), 2*ones(5) ); $p->badflag(1); $p->badvalue(2); ($m) = $p->statsover; is( "$m", "[2 BAD]" );
21:38 sivoais TOO BAD
21:52 sivoais eek
21:52 sivoais if( 0 ) { ... } else { ... }
21:52 sivoais in Basic/Bad/bad.pd
21:53 jberger in my work codebase, I found this gem
21:54 jberger if (0 && 'prefer pdf') { generate_pdf() } else { send_fax() }
21:54 jberger I nearly shot someone
21:55 mohawk jesus h corbett
21:56 jberger also, the code wasn't nice functions but sprawling statement bodies that did (or didn't) do the things
22:02 sivoais ay ay ay
22:03 sivoais also, that code with if( 0 ) { ... } has been there since 2000
22:03 sivoais it should have been a /* TODO */
22:05 sivoais I have a feeling that this one stats() badvalue bug is just the tip of the iceberg when it comes to untested interactions between per-PDL badvalues and various functions
22:05 sivoais )-:
22:06 jberger I know some people use BAD values all the time, but I stayed away from it
22:06 jberger bad juju
22:06 sivoais there needs to be a more formal definition of how they interact with functions
22:07 sivoais probably something that takes from the statistical notion of imputation?
22:08 sivoais it's like smartmatch in a way. Good idea, but requires you to be really smart about how you use it in your code
22:09 * sivoais wonders if APL implementations have missing data tooling
22:09 sivoais I know that numpy implements the same idea using masks
22:10 sivoais for reference <http://docs.scipy.org/doc/num​py/reference/maskedarray.html>
22:12 sivoais of course, R has had support for marking invalid data from the beginning (with the NA type)
22:14 sivoais I ***really*** wish to make PDL3 easier to change in this regard
22:16 sivoais my theory is that making all the PDL PP code tied to the underlying storage representation is an issue
22:17 sivoais while it is the fastest and most straightforward way to implement everything
22:17 sivoais it lacks the abstraction needed to extend to more situations
22:18 sivoais I need more time to think and experiment about this.
22:18 jberger I really wish we could get run4flat back around here
22:18 jberger he had thought a great deal about it
22:19 sivoais has he been busy?
22:19 jberger in fact, that's why he doesn't hang around much anymore, he spent too much time thinking about PDL and Perl and not enough on more import matters
22:19 jberger yeah, he's a visiting professor now
22:20 jberger and he's trying to figure out how to get himself into a tenure track gig
22:20 sivoais ah, yes... I know that feeling. Not the professor one. The other one.
22:20 sivoais ;-)
22:20 jberger we all do
22:20 jberger we've all spent more time on Perl than we should have here or there
22:20 sivoais what's that Feynman quote...
22:21 sivoais about the problem with computers
22:21 sivoais <https://www.goodreads.com/quotes/325051-well-mr-​frankel-who-started-this-program-began-to-suffer>
22:22 sivoais "It's a very serious disease and it interferes completely with the work. The trouble with computers is you *play* with them."
22:22 mohawk ha
22:22 jberger hehe
22:23 jberger "But if you've ever worked with computers, you understand the disease - the *delight* in being able to see how much you can do."
22:23 jberger ^^ this
22:23 mohawk ha ha
22:23 preaction that's the problem with a computer _career_. you have to leash and cage that instinct
22:25 jberger and yet unleash it on command
22:26 preaction and in the evenings and on weekends, let it out for walkies
22:37 mohawk ha ha
22:39 mohawk sivoais, i think this is wrong: https://github.com/PDLPorters/pdl/pull/128/fi​les#diff-a6360c1c0a9fffc74d2d6bf952aa4e26R35
22:40 mohawk boolean false is '', not 0 - "is" does a string-compare, doesn't it?
22:40 mohawk also, that diag should certainly be a "note"?
22:41 jberger can you not use cmp_ok?
22:42 mohawk that was my thought
22:42 mohawk also, the "".0 + ... bit looked a bit precedence-problem-risky?
22:43 jberger but certainly !!0 ne "0"
22:43 sivoais I want to avoid cmp_ok() because that while force stringification
22:43 sivoais *will
22:44 jberger perl -E 'say !!0 eq "0" ? "true" : "false"'
22:44 sivoais err, numifications
22:44 sivoais 0+'BAD' == 0
22:46 sivoais basically, I *want* a string compare, not a numeric compare
22:46 sivoais because one of the possible values is the string 'BAD'
22:47 mohawk cmp_ok i'm almost certain doesn't force stringification
22:47 mohawk while "is" almost certainly does
22:47 mohawk oh, gotcha
22:47 mohawk fine
22:48 sivoais you're right about precedence: + and . are on the same level
22:48 sivoais evaluate left-to-right
22:49 mohawk so does that mean "".0 + (blah) is same as '0' + (blah)?
22:50 sivoais yes
22:50 mohawk https://github.com/PDLPorters/pdl/pull/128/fi​les#diff-a6360c1c0a9fffc74d2d6bf952aa4e26R76
22:50 mohawk that might need a bit of bracket-adding then
22:50 sivoais yeah
22:50 mohawk also line 83
22:50 mohawk and 90
22:51 mohawk it's a damn fine effort so far
22:51 mohawk it's more than i did on this issue so far, more importantly :-)
22:52 sivoais can you see what I mean with how we need a table to identify the different cases when dealing with badvalues
22:52 sivoais especially when dealing with per-PDL badvalues
22:53 sivoais oh that's such a headache ;-)
22:55 sivoais actually, just leaving it as 0+( $bool_expr ) should be good enough, since is() will use eq
22:57 mohawk yes
22:57 mohawk good enough
22:57 mohawk and in due course it does need that table
22:58 sivoais yes, in the future
23:01 mohawk dang right
23:04 opkick [pdl] zmughal force-pushed sf390 from 4ea4d15 to 0b154bd: http://git.io/vLSMn
23:04 opkick pdl/sf390 0b154bd Zakariyya Mughal: test comparisons between scalars and 0-dim PDLs with badflag == 1...
23:06 opkick [pdl] zmughal force-pushed sf390 from 0b154bd to 2cae17e: http://git.io/vLSMn
23:06 opkick pdl/sf390 2cae17e Zakariyya Mughal: test comparisons between scalars and 0-dim PDLs with badflag == 1...
23:06 mohawk nice
23:10 sivoais in more happy news, there's a Travis-CI API :-)
23:10 mohawk aww yeah
23:10 mohawk what can it do?
23:11 sivoais <http://docs.travis-ci.com/api/>
23:11 sivoais it can be used to get information about the builds on branches
23:11 sivoais and cancel jobs
23:12 sivoais also enable Travis-CI on a given repository
23:13 sivoais I'm going to look more into it. I'm writing a tool for myself that might use it
23:13 * sivoais hates having to go look at things in browsers
23:13 mohawk ha ha
23:14 mohawk first world problems:
23:14 mohawk the api doesn't work
23:14 mohawk now i have to look at things in a browser
23:14 mohawk like some kind of animal
23:24 mohawk sivoais, i hope you've emailed chm with your progress? i'd hate to have duplicated effort
23:28 sivoais yep, once to the mailing list and once again to the bug tracker
23:28 mohawk great
23:28 mohawk do you have any ideas on the fix?
23:37 sivoais I need to look at how bad values are set. right now, afaict, there isn't a PP macro for what I want. But no more tuits to look at it today

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