Perl 6 - the future is here, just unevenly distributed

IRC log for #pdl, 2014-05-01

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

All times shown according to UTC.

Time Nick Message
12:53 gtodd joined #pdl
15:45 mohawk joined #pdl
17:20 mohawk new dev release of gimp-perl: http://search.cpan.org/CPAN/author​s/id/E/ET/ETJ/Gimp-2.30_02.tar.gz
17:21 mohawk mainly the "podregister" addition, and doc updates
17:43 mohawk sivoais, i would be very interested in your opinion / take on this new release
21:02 sivoais mohawk: installed and looked it over. Nice job on the docs! I see lots more got added and expanded
21:02 sivoais and that bug from last time is fixed (the window opening one)
21:29 mohawk sivoais, thanks!
21:29 mohawk you can now browse it here: http://search.cpan.org/~etj/Gimp-2.30_02/
21:30 mohawk this was a doc-focused release, which is how the podregister thing came about
21:30 mohawk i'm working on updating the gimp.org gimp-perl tutorial now
21:32 sivoais I see that it hasn't been updated since Gimp 1.2 <http://www.gimp.org/tutorials/Basic_Perl/>
21:32 mohawk correct
21:32 mohawk dov made a version for 2.0
21:32 mohawk i'm working through that one
21:32 mohawk let me push how far i've got to my github fork of the stuff he put up:
21:36 mohawk https://github.com/mohawk2/gimp-stuff
21:36 mohawk is there a way to view the index.html in there as an actual web page?
21:39 mohawk http://htmlpreview.github.io/?https://github.​com/mohawk2/gimp-stuff/blob/master/index.html
21:45 sivoais looks good
21:45 sivoais is it possible to have syntax highlighting on the code snippets?
21:45 mohawk bearing in mind i'm not substantively changing much, do you think it acts as a good intro?
21:45 mohawk (ie it's meaningful to read all of it even if some is not yet updated)
21:46 mohawk it might be possible but i think that's a bridge too far ;)
21:47 sivoais "as it is the major language for writing CGI scripts" is true, but makes the doc feel dated
21:47 sivoais small quibble
21:49 mohawk yes, i wondered about that myself
21:49 mohawk i want to big-up perl a bit, any ideas?
21:55 sivoais mohawk: yeah, I think the tutorial is worth reading. Probably easier to get started than by just reading the CPAN POD
21:56 sivoais it's worth mentioning all the examples that are in the dist for learning
21:56 mohawk good call
21:57 mohawk and for the initial bit, just ditch the "CGI" bit, or can you think of a replacement?
21:58 mohawk i'm just going to mention CPAN, and the examples, at the start
21:58 mohawk job done
22:00 sivoais I think that saying Perl is an extensible, data-processing languages found on most Unix systems would be good
22:00 sivoais s,languages,language,
22:01 sivoais and portable!
22:02 mohawk nice
22:02 sivoais speaking of which... is making more of <http://www.cpantesters.org/distro/G/Gimp.html> green on the roadmap? :-)
22:02 mohawk although it's undermined by gimp-perl only working on linux for now
22:03 mohawk sivoais, this is an Alien:: type issue
22:03 mohawk if there's no GIMP on the testing machine, how can GP be tested?
22:03 sivoais ah
22:08 mohawk that's a genuine question, by the way
22:14 mohawk did you notice yinyang now works?
22:14 mohawk when i put the enums in instead of just the numbers, i spotted what was wrong
22:16 sivoais I did. I ran that one first. :-P
22:17 sivoais I have no idea how to better test if Gimp isn't there. Alien doesn't seem like a good option for an entire application
22:18 mohawk i agree with that
22:18 mohawk although it's very much in the same class
22:18 mohawk in fact, i think it might be identical
22:21 mohawk what do perl mods do that depend on external libs?
22:21 mohawk (ie that can't gracefully skip over them)
22:26 sivoais I think they just bail out and tell the user what needs to be installed
22:26 mohawk i believe that's what gp does too
22:27 mohawk although the idea a user is going to try gp without gimp is a bit fanciful
22:27 sivoais haha
22:28 mohawk i think we may have to go without testing gimp-perl on vax, mobile phones, etc
22:31 sivoais lol, but how will I run gimp-perl on my Nintendo DS!
22:32 * mohawk frowns, then sighs
22:33 mohawk i think the next things i'll do in gp will be making a Gimp::Extension module
22:33 mohawk just to wrap the stuff i did already
22:33 mohawk and then a gtk+ perl-console
22:34 mohawk dammit, i made some effort making gp's params UI look the same as script-fu; it's burning me up python and scheme have consoles and not perl!
22:35 sivoais do they provide built-in PDB documentation look-up?
22:36 mohawk define "built-in" - there's the PDB browser
22:36 sivoais btw, I was able to get the Leptonica library binding working with Inline::MakeMaker
22:36 mohawk it's all the same PDB
22:36 mohawk damn, well done!
22:36 mohawk is it on cpan?
22:36 sivoais as in a tab-completion + dropdown showing all the parameters
22:37 sivoais like an IDE
22:37 mohawk i get you - pretty sure not
22:37 mohawk although script-fu's "browse" option lets you double-click the proc, and it appears in the console with params ready to fill
22:37 mohawk so pretty close
22:37 sivoais The binding is not on CPAN yet because I need to incorporate the C documentation
22:38 sivoais and look at how some of the C types needed to be converted between Perl
22:39 mohawk why not put up a 0.01 without?
22:39 sivoais especially things like char** ... is that newly allocated memory... or just an array of strings?
22:39 mohawk release early, release often
22:39 sivoais Alright, I'll give it a shot
22:39 mohawk that's the spirit
22:39 mohawk apart from anything, another working example of Inline::MakeMaker can't possibly be a bad thing
22:40 mohawk (i've got approval from rob to make the AUTOWRAP_FROM, btw)
22:40 mohawk h2xs, your days are numbered
22:41 sivoais heh, this is my code to prune down the header file and generate the typemaps
22:41 sivoais <https://github.com/zmughal/p5-Image-Le​ptonica/blob/master/tool/build-inline>
22:41 sivoais not the best, but it works
22:42 mohawk is that somewhat similar in idea to what we talked about last time?
22:42 sivoais yeah, it is
22:43 sivoais but no real parsing of C
22:43 mohawk shweet
22:43 mohawk well, quite
22:43 mohawk nice use of Path::Class
22:43 mohawk this will provide a good basis for my Inline work
22:44 mohawk sub main?? oh oh ;)
22:45 mohawk dumb question: what's DDP?
22:46 sivoais Data::Printer... like Data::Dumper but with colours
22:46 mohawk cute
22:50 mohawk that is some beautiful code, dude
22:51 mohawk i'd have given in 11/10 if you hadn't done the "sub main" thing
22:51 mohawk now i can only give you 10
22:51 sivoais hah, should it have been more descriptive?
22:52 mohawk good code doesn't really need comments
22:52 mohawk this is great code
22:52 mohawk i assume that's what you mean by "descriptive"?
22:53 mohawk by the way, do you feel at all like modifying Alien::L* to make it work "with" Inline?
22:53 sivoais I meant should sub main have been something like sub generate_inline_bindings
22:53 mohawk my doc update is now in released version: http://search.cpan.org/~sisyphus/Inlin​e/Inline.pod#Playing_%27with%27_Others
22:54 mohawk my "objection" (overstatement) is that perl doesn't need a main() function
22:54 mohawk the script is the thing
22:54 mohawk so having just a list of statements would be fine
22:54 mohawk do_all() functions are a sign of bad engineering, i think
22:55 mohawk as for descriptiveness, i think the script name tells you what the "main" stuff is - it's building inline, done
22:55 mohawk so the "solution" - delete "sub main {" and matching brace, de-indent, perfect
22:56 sivoais ah, I see. The only real reason I used main was to get folding in my editor. So not a technical reason, hahah
22:57 mohawk ha ha
22:57 mohawk but folding? was it needed? ;)
22:57 mohawk which editor?
22:59 sivoais Vim. It wasn't needed, but I didn't know how many functions I was going to end up with
22:59 sivoais OK, so all the 'with' feature does is give all the config options
22:59 mohawk i'm a big vim fan myself
22:59 mohawk sivoais, yes it does
23:00 mohawk i'm arguing for Alien::L* to have an ::Inline function that returns that stuff
23:00 mohawk (if it doesn't already)
23:00 sivoais so that a programmer can basically write code in C that uses Leptonica directly
23:00 sivoais Probably not in Alien::Leptonica, but in Image::Leptonica
23:00 sivoais which I just released <https://metacpan.org/release/​ZMUGHAL/Image-Leptonica-0.01>
23:01 sivoais Image::Leptonica contains the typemap
23:02 mohawk i'm proposing that Alien::L* should support it
23:02 mohawk not saying Image::L* shouldn't
23:02 mohawk although it's redundant if I::L* does - why write XS when you have the perl interface already?
23:04 sivoais I can see it if you already have the C code or if you want to be careful with memory allocation
23:05 sivoais or even the most likely case where you have another C library that you want to use Leptonica functions with, but don't want to go through Perl to access them
23:12 mohawk fair enough
23:12 mohawk would you agree both should support Inline, then?
23:14 sivoais I'd have to move the typemaps to Alien::Leptonica, but that's not a big deal.
23:14 mohawk if I::L depends on A::L, that seems like the right thing
23:14 mohawk A is the foundation, I is on top?
23:14 sivoais yes
23:14 mohawk ok
23:15 mohawk so conceptually A provides the XS foundation, I perlifies it
23:15 mohawk so A owns typemaps etc
23:16 sivoais no, A just provides the C library headers + objects. That's what most Alien:: modules do
23:16 mohawk gotcha
23:16 mohawk you're right
23:17 mohawk however, let's make A get as close to being "with"-able as possible
23:17 mohawk in terms of the same method names for accessing cflags etc?
23:17 sivoais you don't need typemaps for 'with' right? Because I can see something like
23:18 sivoais sub Alien::Leptonica::Inline { +{ LIBS => $self->libs, INC => $self->flags } }
23:19 sivoais and
23:19 mohawk remember Inline is a brilliantly-engineered wrapper around XS - so if there are C types XS doesn't know about, it's going to fail without a typemap
23:20 sivoais sub Image::Leptonica::Inline { { %{ Alien::Leptonica::Inline() }, TYPEMAPS => $self->typemap_path } }
23:20 mohawk yes! that's my vision too
23:20 sivoais in that case... we can make a change to Alien::Base
23:20 mohawk that's my vision
23:21 mohawk i'm waiting to check whether this stuff actually works, with [IA]::L* as a testbed
23:21 sivoais I see!
23:21 mohawk if it does, i will make a patch
23:21 mohawk i thought i spelled that out before, maybe i was unclear
23:21 sivoais OK, in that case... all I need to do is make Inline a recommended dep of A::L
23:22 mohawk i have a browser open with Alien::Base, as part of my project activity for this
23:22 mohawk wait, i don't understand?
23:23 sivoais that way it makes it known that the module does *something* with Inline, but you don't *need* it to get the base functionality
23:23 mohawk putting it in the docs, you mean?
23:23 mohawk my vision is that all Alien mods will move this way
23:23 sivoais both in the docs and in the Makefile.PL
23:24 mohawk i wouldn't put in M.PL, because it doesn't depend on Inline at all
23:24 mohawk it's just an extra facility if you use Inline
23:24 mohawk so A::* will "support" Inline, not depend on it - does that make sense?
23:25 sivoais sorry, not in Makefile.PL, in META.yml
23:25 sivoais like here: <https://metacpan.org/source/ZMUGHAL​/Unicode-Number-0.007/META.yml#L17>
23:25 mohawk i get you
23:26 mohawk i would say the relationship is the other way - no recommendation required?
23:26 mohawk of course, it's actually your module we're talking about ;)
23:29 mohawk mcdonalds drivethroughs "support" me driving up to them
23:29 mohawk they don't need to "recommend" i be present?
23:31 sivoais you're right, there's a better option
23:31 sivoais <http://search.cpan.org/~dagolden/CPAN-Meta-2​.141170/lib/CPAN/Meta/Spec.pm#Relationships>
23:31 sivoais 'suggests'
23:31 mohawk see, i don't feel like that's it either?
23:31 mohawk i feel like "supports" is the way
23:32 mohawk and if that's not available, only put in the docs?
23:32 sivoais "suggests: These dependencies are optional, but are suggested for enhanced operation of the described distribution."
23:32 mohawk i think A::* would work fine without Inline?
23:34 sivoais let's see how suggest has been used on CPAN before
23:34 mohawk if there isn't a "supports" relationship there ought to be
23:41 sivoais I think that the folks on #toolchain can help make that happen
23:43 sivoais the inspiration came from Debian's packaging <https://www.debian.org/doc/debian-poli​cy/ch-relationships.html#s-binarydeps>
23:43 sivoais which has "Depends, Recommends, Suggests, Enhances, Pre-Depends"
23:43 mohawk those are all types of "depends" (i read through the CPAN one too)
23:44 mohawk i believe this vision thing i'm pursuing, of lots of mods supporting Inline, would really exercise this new "supports" relationship
23:44 mohawk what do the toolchain guys think?
23:44 mohawk let's find out ;)
23:46 mohawk i have another idea
23:47 mohawk if there were Inline::Base with pure-virtual methods
23:47 mohawk your A::L mod could "depend" on that
23:48 sivoais so at runtime it can check if it is available and add to @ISA?
23:48 mohawk not really
23:48 mohawk since the I::B would only "implement" one thing, which would be the ::Inline method
23:49 mohawk but it would be a way of finding what "supports" Inline - see what "depends" on I::B?
23:51 sivoais OK, so only a (large) subset of Alien::Base modules support Inline
23:51 sivoais all the C libraries... but maybe not the Fortran or Java libraries
23:51 sivoais like that?
23:52 mohawk only the ones that expressly implemented the "::Inline" method
23:52 mohawk any of them *could* support it
23:53 mohawk clearly, presently almost none do
23:54 mohawk i think Inline::Interface would solve this problem nicely
23:54 mohawk for Makefile.PL purposes
23:55 mohawk what do you think?
23:55 mohawk jberger, since this stuff relates to Alien::Base, i am obviously very keen for your thoughts
23:55 sivoais where would that live and how would that work for Alien::Base's children?

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