Perl 6 - the future is here, just unevenly distributed

IRC log for #pdl, 2014-04-19

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

All times shown according to UTC.

Time Nick Message
02:17 sivoais I think I figured out a patch for Leptonica's build. I'm going to push out a release of Alien::Leptonica once I send a patch
02:20 mohawk cool
02:21 mohawk is it on github?
02:21 sivoais not yet
02:22 sivoais running the leptonica build again after a make clean to make sure
02:23 sivoais but I'm going to send a patch upstream and patch from inside Alien::Leptonica for the interim
02:23 mohawk is it worth mentioning the make test/check thing as well?
02:23 mohawk does it succeed on your end?
02:23 sivoais I think that may be just an issue of not having all the build deps
02:24 mohawk oh,that's good news
02:27 sivoais this is the patch <https://gist.github.com/zmughal/11071982>
02:28 sivoais surprisingly simple :-P
02:31 mohawk sounds like me
02:32 mohawk may i ask what's that part of? is the main lib on github?
02:33 sivoais it's a patch for leptonica-1.70.tar.gz from the leptonica site
02:33 mohawk no, i see that
02:33 sivoais or do you mean the Gist site?
02:33 mohawk ah, i didn't notice the "gist" in the url
02:33 sivoais yeah, if you haven't seen that before, it's a nice nopaste site.
02:33 mohawk question answered, thanks
02:34 mohawk i've just been fighting with gimp-perl for the last day or 2
02:34 sivoais my favourite part about it is that each gist is also a git repo
02:34 mohawk yes, i saw that on the blurb
02:34 mohawk what does that mean in practice?
02:35 mohawk (in order to make it delete files on closing, i had to make the server into an extension, which meant learning how to make the perl work with Gtk event loop)
02:35 mohawk (that was a lot of work for a small-seeming gain ;) )
02:35 sivoais rather than pasting many different links for updated versions, you can just edit in place
02:36 sivoais I'll have to install Gimp-perl one day
02:36 mohawk ok
02:37 sivoais for a future project, I want to have images be interoperable between different packages
02:37 mohawk uh... images interoperable?
02:37 sivoais I list a bunch on my issue for <https://github.com/zmughal/p5-Image-Raster-Convert/issues/1>
02:38 mohawk i get you
02:38 mohawk as in, different image-processing packages
02:38 sivoais yep
02:38 mohawk although surely that's up to each package conforming to the relevant image def?
02:38 mohawk oho, i just saw gimp in there
02:38 mohawk i might be able to help there ;)
02:39 sivoais :-)
02:39 sivoais my research is in computer vision and I don't want to be stuck programming in just MATLAB, C/C++, and Python
02:39 sivoais so I need more Perl support for these things
02:41 mohawk i remember my comp vision module from my degree
02:41 mohawk that was a long time ago
02:42 sivoais Perl also needs more stats/machine learning tools :-)
02:42 mohawk ha ha
02:43 mohawk perl needs lots of better tools in order to DOMINATE THE WORLD
02:43 sivoais that's why I'm interested in Alien::*... steal from the best
02:44 mohawk "Good artists copy; great artists steal." - Picasso
02:47 mohawk although it seems he didn't actually say it! http://quoteinvestigator.com/2013/03/06/artists-steal/
02:49 mohawk so how does the gist thing connect with your issue mentioned in your most recent link?
02:49 mohawk it looks like it's not on gist
02:50 sivoais plagiarizing is ok...as long as you call it research! <https://www.youtube.com/watch?v=IL4vWJbwmqM> ;-)
02:50 mohawk ha ha
02:51 sivoais the last issue link is a place where I'm collecting info for *another* package I want to write
02:52 sivoais that will be separate from the *::Leptonica packages
02:54 mohawk got gave you eyes
02:54 mohawk plagiarise
02:54 mohawk got->god
02:55 mohawk last issue link = https://github.com/zmughal/p5-Image-Raster-Convert/issues/1
02:55 mohawk ?
02:55 sivoais yeah
02:55 mohawk ok - what's the connection with gist?
02:56 sivoais no connection beyond how you mentioned Gimp-perl
02:56 mohawk ok
02:56 mohawk i was worried i was missing something there ;)
03:02 mohawk just having a look at https://github.com/zmughal/matlab-central-code-analysis - i see a couple of subdirs there, no sign of a Makefile.PL or Build.PL?
03:03 sivoais mohawk: that's because I'm using Dist::Zilla <http://dzil.org/>. It generates those at release time
03:05 mohawk i will look into that
03:06 mohawk initial look - interesting
03:08 mohawk i want to ask how you manage in the meantime, but i see there's a tutorial there; i'll look at it when i've finished this gp change
03:42 sivoais ok, patch submitted <http://code.google.com/p/leptonica/issues/detail?id=94> and latest version on CPAN <https://metacpan.org/release/ZMUGHAL/Alien-Leptonica-0.004>
03:43 sivoais now to use that typemap info you sent me!
03:56 mohawk i have an idea on how to proceed
03:56 sivoais the MarpaX approach?
03:56 mohawk no
03:57 mohawk i got a bit bogged down trying to effectively make an h2xs replacement
03:58 * sivoais nods
03:58 mohawk i think a better method to do this would be to: grep typedef /usr/local/include/leptonica/*.h
03:58 mohawk massage that into a typemap
03:58 mohawk (there's only 70-something)
03:58 sivoais ah, OK
03:59 mohawk then supply a stripped down allheaders.h, with just the func decl in, to AUTOWRAP in Inline
04:00 mohawk that would fail to get the enums, but that should be doable too
04:00 sivoais OK, I'll see if I can do this in a quick-and-dirty way for a first approach
04:01 sivoais at release time for now (and maybe install time later)
04:01 mohawk sounds sensible
04:01 mohawk making it work at all in a complete-ish way would be a big step forward
04:01 mohawk does it seem like a workable approach to you?
04:09 sivoais yeah, it sounds good
04:10 sivoais it seems like that will lead to something akin to SWIG-generated bindings, but much better integrated with Perl
04:15 mohawk this in itself won't be a large-scale solution
04:15 mohawk however, i then had the idea to use the better c-parser in Inline for this
04:16 mohawk something like a new option AUTOWRAP_FROM
04:16 mohawk and maybe TYPES_FROM as well, to fill in types missing from that
04:17 mohawk effectively turning h2xs inside out
04:18 sivoais interesting
04:18 mohawk i emailed sisyphus with this, nothing heard yet
04:31 mohawk any joy?
04:37 sivoais not yet...
04:40 mohawk how far have you got?
04:40 mohawk i could do with putting aside the thing i'm working on for a bit ;)
04:43 sivoais lol, not far at all...I kinda meandered to something else for a bit :-P
04:46 mohawk ha ha, fair one
04:47 mohawk i've figured what the problem was here - i used open3 and read the output (obviouslY)
04:47 mohawk problem was that if i enabled verbose, the output is huge, so the executable wasn't able to complete as it blocked trying to output
04:47 mohawk a dash of IO::Select later - all is good
04:53 sivoais I like using IPC::Run3 / IPC::Run to wrap up the same APIs
04:53 mohawk pesky non-core modules ;)
04:54 sivoais because I'm likely to forget about all the issues
04:54 mohawk let me look at the api...
04:54 sivoais yeah
04:57 mohawk wow, IPC::Run3 is pretty neat
04:57 mohawk i do like that it's 10+ years old and on v0.048
04:58 mohawk with a release 3 weeks ago ;)
04:59 sivoais heheh
04:59 mohawk i'll remember that one
05:01 mohawk speaking of neat things - do you know of Spiffy?
05:04 sivoais I think I've seen it...
05:05 sivoais that's an OO framework by ingy?
05:05 mohawk is it by ingy? that guy gets around
05:06 sivoais yeah, ingy <https://metacpan.org/pod/Spiffy>
05:06 mohawk yes
05:06 mohawk based on source filtering, which i didn't know existed (having been out of the perl loop for a number of years and not yet caught up)
05:13 sivoais if you haven't seen them, you should also look at Moo, Moose, and Method::Signatures
05:13 mohawk i saw references to those on the PDL3 discussion
05:13 mohawk haven't looked into yet, but will
05:14 sivoais they're *very* nice and make OO in Perl incredibly enjoyable
05:16 sivoais actually, you can get a quick overview if you read the relevant parts of the Modern Perl book <http://www.onyxneon.com/books/modern_perl/index.html>
05:16 sivoais that's how I picked up Moose after reading Learning/Intermediate Perl
05:17 mohawk fascinating
05:17 mohawk i think i'll read the various perl5xdeltas instead
05:18 mohawk i read a C++ book in the early 90s, that was quite good
05:18 mohawk but since then, it's all been by different means
05:19 sivoais yeah, I read those books because I'm a relatively new to Perl. I'm in my early 20s and only got into Perl when I started uni 6 years ago
05:21 mohawk i think you're lucky - perl's really good these days
05:21 mohawk when i was at uni it was still perl4, and it didn't seem any good
05:21 mohawk mid-90s, perl 5 - that was a different story
05:21 mohawk but now it's even better
07:56 mohawk developer release of gimp-perl uploaded to CPAN
07:56 mohawk film at 11
08:39 mohawk joined #pdl
13:59 chm joined #pdl
15:53 mohawk joined #pdl
16:26 mohawk sivoais, i'd be interested to know if you have any comments about the gimp-perl dev release: http://search.cpan.org/CPAN/authors/id/E/ET/ETJ/Gimp-2.3000_01.tar.gz
17:14 sivoais mohawk: ok, first thing I did is install it
17:14 sivoais I'm using perlbrew to manage a local Perl install
17:15 mohawk ok
17:15 * mohawk nods, while looking up what perlbrew is
17:15 sivoais so when it tries to install the Gimp plugin/docs, it can't install them since I'm not root
17:16 sivoais I don't know if Gimp lets you install to something like ~/.gimp/...
17:16 mohawk it's using MakeMaker
17:16 mohawk so i imagine some sort of prefix thing is in order
17:17 sivoais oh, the .pm files are all in the right place...
17:17 sivoais let me show you a log
17:17 mohawk cool
17:17 mohawk (perlbrew looks pretty neat)
17:18 mohawk btw, GIMP uses ~/.gimp-2.8, so that could get a little confusing ;)
17:19 mohawk which GIMP are you using there?
17:19 sivoais GNU Image Manipulation Program version 2.8.10
17:19 mohawk good, that's the latest
17:20 sivoais but I also have ~/.gimp-2.6 from an older install :-P
17:20 mohawk as a hack, you could modify examples/Makefile.PL to use --install-bin, not --install-admin-bin
17:20 mohawk that will install plugins to per-user plugin dir
17:22 sivoais ok, I'll look at that
17:22 mohawk ok
17:22 mohawk i think it'll just work after that
17:22 sivoais here's the log <https://gist.github.com/zmughal/1950d6f4f410a6c6dce6> anyway
17:26 mohawk it is genuinely strange and cool to see this thing building in a dir structure other than mine ;)
17:26 sivoais perfect, s/-admin-bin/-bin/g did the right thing!
17:26 mohawk excellent
17:28 mohawk it would probably even be possible to do perl Makefile.PL ...
17:28 mohawk wait, it's not a make var for now
17:28 mohawk huh
17:38 mohawk i fixed it
17:38 mohawk the next version you can do:
17:38 mohawk make install GTINSTALL='gimptool-2.0 --install-bin'
17:38 mohawk JUST FOR YOU
17:41 sivoais :-D
17:42 mohawk and README is updated as well
17:42 mohawk next dev release will be docs-focused
17:43 mohawk so, the trillion-dollar question: does it work at all?
17:47 sivoais oooh
17:48 sivoais I like the Apply Perl Expression filter
17:50 mohawk ha ha
17:50 mohawk not even looked much at that one
17:51 sivoais I have an error when I run Xach Shadows
17:51 sivoais "Execution error for 'Xach Shadows':
17:52 sivoais function/macro "add_alpha" not found in Gimp::Drawable at /home/zaki/.gimp-2.8/plug-ins/xachshadow line 49."
17:55 mohawk well that's a fucker
17:56 mohawk could you edit the plugin (probably in your build dir, but up to you) and on that line make it say: ->Gimp::Layer::add_alpha?
17:57 sivoais ok, I'll give that a try
17:58 sivoais also, the plugins placed under 'File/Create' don't seem to work for me (yinyang, randomart1, etc.)
17:58 mohawk dang, am i going to have fixed this on my version (not tried it yet) before you on yours? ;)
17:59 sivoais ok, xachshadows seems to work now
18:00 sivoais after making the change
18:01 mohawk yeah, that works
18:15 mohawk yes, that frame_filter is quite nicely made
18:17 mohawk any other thoughts?
18:21 sivoais not at this time (besides the Create plugins not working)
18:22 sivoais oh...is there a way to run these Gimp plugins headless?
18:24 mohawk first: how do you mean, headless?
18:24 mohawk second: can you tell me more about the Create plugins not working? what do you see?
18:26 sivoais as in, running on a system without a GUI display. On an X11 system, I could do that by doing Xvfb, but I'm wondering if there is another way
18:28 mohawk sivoais, it's not greatly doc-ed yet, but try running a plugin on the command line with --help
18:28 sivoais I'm not sure what is wrong with the Create plugins as there aren't any messages
18:29 mohawk any console output? are the filters greyed out?
18:31 mohawk basically, i have no idea what it could be yet and need more info :)
18:31 mohawk (i'm very grateful to you for your effort so far, btw - 2 bugs found and dealt already, awesome!)
18:31 sivoais ok, I ran one of them (yinyang) in the console and it works
18:31 mohawk great
18:32 mohawk now, from the UI?
18:32 sivoais but I think the problem with the GUI is that it may be running, but it doesn't open the file afterwards
18:32 sivoais no change in the GUI state, so it looks like it didn't do anything
18:32 mohawk gotcha
18:33 mohawk could you do me a favour and open a script-fu console
18:33 sivoais ok
18:33 sivoais it's open
18:33 mohawk and do (gimp-image-list)
18:33 mohawk sorry, was looking up proc ;)
18:33 mohawk almost gave you the wrong one
18:34 mohawk you'll probably see images not displayed: do (gimp-display-new IMAGENO) on each?
18:35 mohawk yes, that works
18:35 mohawk i need to update the examples scripts
18:36 mohawk i changed Gimp::Fu to not automatically display returned images
18:36 sivoais yeah, works over here too (had to restart gimp to make sure my steps made sense)
18:43 mohawk updated them
18:48 mohawk let's put aside the fact that yinyang is actually making a large, moled pair of buttocks right now
18:48 sivoais hahahhahha
18:48 sivoais yes, let's ;-)
18:53 mohawk any other feedback right now?
18:56 sivoais nope
18:57 sivoais the gimp-doc script is nice... reading-docs-outside-the-browser++
18:58 mohawk grin
18:58 mohawk i have barely touched that one, all credit to marc / seth
19:01 mohawk holy cow, that's lots of commits - they're all your fault
19:01 mohawk i hope you're proud of yourself
19:01 mohawk (assuming you think 3 is a lot, which you may not)
19:02 mohawk any further thoughts? am going to have to do other stuff in a minute
19:03 sivoais hehe, none presently
19:13 mohawk well, you're awesome for trying this beta-quality software out
19:14 mohawk could you have a super-quick scan of the docs on http://search.cpan.org/~etj/Gimp-2.3000_01/ and tell me your initial impression?
19:14 sivoais not a problem. imo, the more image processing in Perl, the better :-)
19:14 mohawk grin, hopefully this command-line business is helpful
19:14 mohawk HOWEVER
19:15 mohawk be warned that right now the Gimp::PixelRgn (raw PDL access) stuff doesn't work over net mode (including on command line)
19:15 mohawk it'll crash and core-dump, i haven't put in a trap to die then later handle it right yet
19:15 mohawk but that's a priority once the docs are right
19:16 mohawk i would really welcome your thoughts on the docs for now
19:16 mohawk (i've already made a few tweaks post the dev release)
19:18 sivoais ok, if I was a developer looking to get started, I would look for examples first
19:18 sivoais and since I might not be familiar with Gimp and the PDB
19:18 mohawk leading question: is the README any use?
19:19 mohawk if i hadn't said that, how would you have started?
19:20 sivoais ah, I rarely look at READMEs for CPAN modules unless I have installation problems
19:20 sivoais because the main script/module file is my entrance into the docs
19:20 mohawk noted, thanks
19:21 mohawk what is your initial impression of the Gimp.pm doc, then?
19:21 sivoais if I'm evaluating a dist, I skip down to the synopsis and look for an example of the API there
19:21 sivoais I think the SYNOPSIS could use a longer example
19:24 sivoais there are many example scripts which is good
19:25 sivoais some of the PODs for the examples could have more info
19:26 sivoais also, for people browsing online, including an image in the POD would be nice
19:26 sivoais especially in the examples
19:26 mohawk the examples POD is a major target for doc update
19:26 mohawk longer Gimp.pm/SYNOPSIS, ok
19:27 sivoais you can check out how to add images here <http://perlmaven.com/how-to-add-images-to-cpan>
19:27 mohawk image in POD - what would you suggest?
19:27 sivoais like input image -> output image of a plugin
19:28 mohawk noted, good thought
19:29 mohawk by the way, i'm all about the working examples - check out the EXTENSION doc section in Gimp.pm
19:29 mohawk that's all mine
19:31 sivoais ah nice!
19:31 mohawk the examples POD update will also make the "help" button on the plugin UI more useful
19:31 mohawk you like? any thoughts?
19:31 sivoais so could such an extension be used to make Gimp a collaborative image editor?
19:32 mohawk yes, i suppose it could
19:32 mohawk interesting crazy thought
19:32 mohawk that could be GP's killer app
19:34 sivoais :-)
19:34 sivoais this appears to be the closest similar tool for Gimp <http://users.telenet.be/blendix/verse/#gimp_plugin>
19:34 sivoais but it is no longer developed
19:35 sivoais via <http://graphicdesign.stackexchange.com/questions/25077/how-can-i-collaborate-using-gimp2>
19:35 mohawk is it genuinely interactive collaboration, or more git-like?
19:35 mohawk because i'd love to see it be quite interactive
19:35 mohawk something like an "image push" button and my buddy sees it immediately on their version
19:36 mohawk i could use git
19:36 sivoais no idea, but it looks real-time
19:36 sivoais it defines a protocol <https://en.wikipedia.org/wiki/Verse_protocol>
19:37 mohawk i will note that
19:41 mohawk all noted in the TODO doc
19:52 sivoais welp, I guess the Cinepaint fork of Gimp is way too old to see if it can be scripted the same way
19:53 mohawk what ideas does that fork feature? any good enough to steal? ;)
19:55 sivoais not sure... I think the main reason they forked for was to support certain file types that are used in the movie industry
19:56 sivoais forked in 1998, so I would expect a lot of divergence
19:56 mohawk interesting path of investigation
19:56 mohawk i'd expect a modest amount too ;)
19:56 mohawk file formats can be loaded/saved by plugins
19:59 mohawk if someone wants that, they can make it
20:00 mohawk i wonder whether taking that load/save code and putting it in an Inline would be easy...
20:52 mohawk joined #pdl
22:32 mohawk joined #pdl

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