Perl 6 - the future is here, just unevenly distributed

IRC log for #inline, 2014-11-14

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

All times shown according to UTC.

Time Nick Message
03:46 silverdirk joined #inline
09:16 chansen joined #inline
14:54 dolmen joined #inline
18:05 GitHub9 [Inline-Java] mohawk2 pushed 5 new commits to master: http://git.io/sScs8g
18:05 GitHub9 Inline-Java/master c83c7f5 Ed J: Files not checked in by Pat, retrieved from CPAN 0.53
18:05 GitHub9 Inline-Java/master a360cbb Ed J: use "our"
18:05 GitHub9 Inline-Java/master 92a7ecd Ed J: No space before ;
18:05 GitHub15 [Inline-Java] mohawk2 tagged 0.55 at 72cd678: http://git.io/wbg9Aw
18:20 ugexe before i go converting my simple xs module over can someone tell me if passing an multiple arrays (of integers specifically) to a C function?
18:20 ugexe i.e. int src[]
18:22 mohawk you'd need to have a count var
18:23 mohawk and what do you mean by "multiple arrays"?
18:46 ingy moin
18:48 ugexe mohawk: static int distance(unsigned int src[],unsigned int tgt[],unsigned int x,unsigned int y,unsigned int maxDistance)
18:48 ugexe from the perl side im passing @src and @tgt
18:49 ugexe (x and y are my count vars)
18:52 ingy davido__: I'd like to get DZ support done today
19:29 GitHub78 [acme-math-xs-pm] ingydotnet pushed 1 new commit to master: http://git.io/kzevdg
19:29 GitHub78 acme-math-xs-pm/master ef93ef6 Ingy döt Net: Add About
19:56 leont joined #inline
19:56 ingy hi leont
19:56 ingy davido__: leont and I are pairing a bit
19:57 ingy leont: the idea is to automate Inline::C XS modules
19:57 ingy for ::C and ::CPP
19:57 leont That I got
19:58 ingy and for DZ ZD EUMM M:B M:I etc
19:58 leont (seen you talk in Amsterdam ;-))
19:58 ingy Acme::Math::XS is our test
19:58 ingy and Alt-Acme-Math-XS-DistZilla
19:58 ingy will be a DZ version
19:59 ingy ask to drive at any point in the pairup
19:59 ingy else just IRC
19:59 ingy^leont joined #inline
19:59 ingy^leont forgot to join here
20:00 ingy all the stuff is in Inline::Module
20:00 ingy on CPAN
20:01 ingy feel free to ask questions
20:02 leont It starts to make sense
20:02 ingy ::Inline gets swapped out at dist time
20:02 ingy I'll show you
20:09 ingy so next is to make a dzil version
20:09 leont Hmmm
20:10 leont I suspect the whole build process can be simplified somewhat
20:10 ingy maybe
20:10 ingy I'm all for it
20:10 leont But the general approach makes sense
20:10 ingy it already has been simplified a lot :)
20:10 ingy got a few to try the dzil thing?
20:14 leont Essentially you want a filemunger that does the whole translational thingie
20:17 leont Well, it depends on one's dzil workflow too…
20:17 ingy that's all I want
20:18 ingy that is all that should be needed in dzil
20:18 ingy^leont https://gist.github.com/02c57b08e17c49c9161f
20:20 ingy so effectively we need a plugin that makes that Makefile.PL from that dist.ini
20:20 ingy a dzil plugin
20:24 leont There are two kinds workflows in dzil. I'm using a generating one (with lots of munging), others like a mostly 1-on-1 mapping between repo and result
20:25 ingy but certainly the adding 2 lines to a dist.ini is ok?
20:25 leont It's ok, I just don't like how they work on the inside
20:25 ingy well we can fix as we go :)
20:25 ingy I'm not wed to anything
20:26 ingy except getting this project done :)
20:26 leont Fair enough
20:30 ingy^leont https://gist.github.com/2a909f2b78255f114bf7
20:30 ingy^leont :)
20:31 ingy leont: you want to drive?
20:31 ingy actually one sec
20:32 * leont is still thinking mostly :-p
20:33 ingy I just don't know how to write a dzil plugin
20:33 ingy was hoping you could just do that part
20:33 leont I can, I'm still thinking about the best approach
20:34 ingy well, all I want to do in this iteration is add that to the generated Makefile.PL
20:34 leont There are two tasks here, it's probably best to make two plugins (in the same dist) with a pluginbundle, like your synopsis suggests
20:34 ingy what are the tasks?
20:35 ingy I only see one
20:35 leont The Makefile.PL and the munging of the */Inline.pms
20:35 ingy the 2nd part is done
20:35 ingy we can redo it
20:35 ingy but I just want to get step #1 done first
20:36 leont The easiest approach to the first is to subclass MakeMaker::Awesome probably
20:36 ingy then dzil will be supported in the current Inline::Module
20:36 ingy ok please hack it!
20:36 * ingy gets coffee
20:39 ingy leont: we were experimenting with live termcasting. so everyone can watch this in a browser
20:40 * ingy watches leont hack hack :D
20:44 ingy leont: what is this doing?
20:45 leont ::MakeMaker should insert the right Makefile.PL
20:45 ingy yep got that
20:45 ingy that should be all
20:45 ingy yes?
20:46 ingy we could test it now I think
20:46 leont The rest was copying some munging boilerplate for later
20:46 leont Yes, it can be tested
20:46 ingy I'll drive
20:46 leont Ok
20:49 ingy plugin or pluginbundle?
20:50 leont Later concern
20:50 ingy^leont [@InlineModule] invokes a pluginbundle?
20:50 leont Yes
20:50 ingy^leont so looks like we need it
20:50 ingy^leont or change the dist.ini
20:51 leont It's a good idea, but let's first get the individual parts working before tying things together
20:52 ingy but we have a test fail now
20:53 leont Change the dist.ini now, we can change it back later
20:54 ingy I don't know how
20:54 ingy please do it
20:55 leont ok
20:56 ingy oic… @
20:59 ingy you can delete the META and MANIFEST
21:03 ingy can I drive a sec?
21:03 leont Sure
21:07 ingy ok so question
21:07 ingy is `build` like distdir?
21:07 leont dzil build you mean
21:07 ingy dzil build
21:08 ingy :)
21:08 leont Sort of, yes
21:08 ingy that's the dir that gets tarred up
21:08 leont Yes
21:08 ingy ok, now I see where you were going
21:08 leont Commands like test/release/install are fundamentally based on top of the build routine
21:09 ingy yeah
21:09 ingy so ok
21:09 leont They just don't write a tarball, but do something else with the distdir
21:09 ingy right
21:09 ingy so I need the distdir logic added to build
21:10 ingy ok, I didn't realize that
21:10 ingy it's all fine though
21:10 leont Yes
21:11 ingy so only pure_all is needed for this
21:11 ingy for user install side
21:11 leont There may be some trickiness there, since Inline assumes a real file system, and dzil is based on an in memory file system
21:11 leont Possibly, this should be an AfterBuild instead of A FileMunger, now that I think of it
21:11 ingy but not at dzil time
21:12 ingy let me show you what needs to happen
21:12 ingy and then you can figure out how/where
21:15 ingy the 2 generated ::Inline module forms are called proxy and dyna
21:16 ingy proxy is dev/author
21:16 ingy dyna is user install
21:16 ingy we could call this method from dzil
21:16 ingy after build
21:16 ingy with the proper args
21:17 ingy or maybe a subclass that can write to the in memory FS
21:17 leont That would definitely be cleanest
21:18 leont Going through the filesystem is possible bug ugly
21:18 ingy so subclass Inline::Module and override write_module
21:18 ingy wanna try it?
21:18 ingy brb
21:18 ingy you can drive
21:58 willthechill joined #inline
22:26 ether joined #inline
22:26 ingy heya ether
22:26 ingy getting awesomely crowed in here!
22:27 ether o/
22:27 ingy ether: I'd like to know how to get the dist.ini section args from inside a p[lugin
22:27 ingy you can just point me at an example
22:28 ether the args for [Foo] are passed to Dist::Zilla::Plugin::Foo's constructor, so generally they're captured into Moose attributes
22:29 ingy cool. url to github file?
22:29 ingy :)
22:29 ether what sort of plugin are you writing? I can find an example that closely mirrors that
22:30 ether let's see, here's one - https://github.com/karenetheridge/Dist-Zilla-Plugin-OptionalFeature/blob/master/lib/Dist/Zilla/Plugin/OptionalFeature.pm
22:30 ingy great :)
22:31 ether what does [InlineModule] do?
22:31 ingy stuff :)
22:31 ingy a little hard to go over it unless I have 15 mins for you to watch
22:32 ingy I assume you are distracted
22:32 ether ok, 1 sec and I'll clear my deck
22:32 ether alrighty I should have a few
22:33 ingy what resolves that?
22:33 ether I'm twitching here because I'm anticipating all the bugs you're going to get next
22:34 ether you need some dzil roles, but I can't tell you which ones, yet :)
22:34 ingy don't prematurely twitch
22:34 ether what's the /achieve here? :)
22:34 ingy^leont Can't locate object method "register_component" via package "Dist::Zilla::Plugin::InlineModule"
22:34 ingy^leont surely you know where that comes from
22:34 ether 14:34 < ether> you need some dzil roles, but I can't tell you which ones, yet :)
22:35 ingy I want register_component
22:35 ether argh
22:35 ingy sorry
22:35 ether I'm dying here
22:35 ingy if I'm too dumb we can do other things
22:36 ingy I can just show you how it works
22:36 ether can you explain in a few sentences what putting [InlineModule] in a dist.ini will do for the dist?
22:36 leont ether: The InlineModule::Inline can be deleted. It probably shouldn't munge but AfterBuild
22:37 ether "do stuff"?
22:37 leont How I had it in my head: [InlineModule::MakeMaker] is a [MakeMaker::Awesome] subclass. [InlineModule::Inline] should do the Inline rewriting magin. [@InlineModules] should add both (but doesn't exist yet).
22:37 leont (Not that I can see what you two are up to)
22:37 ingy ether: for now I just want to access the value of module from inside the module
22:38 ingy the value of 'module ='
22:38 ingy I think you want to see the end goal
22:38 ether stick me in the editor for the .pm?
22:38 ether argh this is not vim
22:38 * ether falls flat :)
22:40 ether use Moose; with 'Dist::Zilla::Role::SOMETHINGWEDONTKNOWYET';  has module => ( is => 'ro', isa => 'Str' );
22:40 ether for ::Role::FileGatherer, you need sub gather_files {}
22:40 ether and it can be empty
22:40 ether but I don't know if you want a filegatherer
22:40 ether ingy isn't seeing htis
22:40 ether his buffer is scrolled up in the pairup
22:41 ingy^leont sorry
22:41 ingy^leont :)
22:41 ether *whew*
22:41 ether se Moose; with 'Dist::Zilla::Role::SOMETHINGWEDONTKNOWYET';  has module => ( is => 'ro', isa => 'Str' );
22:41 ether FileGatherer is ok as a default if you want to keep the suspense up
22:42 ether it will run now
22:42 ether and do nothing
22:43 ether what do you want BUILDARGS for?
22:43 ether that would be pretty weird.
22:44 ingy I'm trying to get a bearing on what's up
22:45 ether oh, just seeing what's passed to the plugin?
22:45 ingy yes
22:45 ether a plugin's constructor gets passed a plugin_name, the zilla object, and any config args from dist.ini
22:45 ether the first two are handled automatically via plugin roles
22:45 ether so you just declare attributes to grab your configs
22:46 ether plugins run at different phases; which phases those are are indicated by what roles it consumes
22:46 ingy I want a method that gets called after the 'method' attribute is set
22:46 ether and each phase requires one or more subs to be implemented, which are run during the build process at the right phase
22:46 ether it's going to get populated at construction time, and not changed after that
22:47 ingy ether: I can show you Inline::Module if you want
22:47 ether that will probably help! :)
22:47 ingy but if leont is available to finish up what he started, I think that would be best
22:47 ingy ok
22:47 ingy demo
22:49 GitHub106 [acme-math-xs-pm] ingydotnet created dzil (+1 new commit): http://git.io/WzTSxw
22:49 GitHub106 acme-math-xs-pm/dzil 34381e4 Ingy döt Net: Starting work on dzil version of Acme::Math::XS
22:50 ingy so Acme::Math::XS is already on CPAN
22:50 ingy it uses Inline::Module
22:51 * ether looks!
22:51 ingy which is 90% of the grant work
22:51 ingy the other 10% is dzil et al
22:51 ingy ether: well stick with me
22:51 ingy in the pairup
22:54 ingy ether: with me so far?
22:54 ether what is Inline::Module doing when it's run in the makefile?
22:56 ether ah, you're replacing some .pm content?
22:56 ether could you also do that in Makefile.PL?  there's a PL_FILES option for running a script to generate .pms
22:56 ether (iirc, common::sense does this, needlessly, because schmorp)
22:57 ingy ok, I'll make a note of that
22:57 ether so, if I'm understanding this correctly, there's several ways you can achieve this
22:57 ingy acheive what?
22:57 ether the smallest iteration is to have your plugin subclass [MakeMaker::Awesome], capture the module args and add the extra content to Makefile.PL
22:57 ether we can achieve that in about 2 minutes
22:58 ingy already done
22:58 ingy I'll show you
22:58 ether then, you could pull some of the Inline::Module logic into the plugin itself perhaps
22:58 ingy leont did it
22:58 ether a ha
22:58 ether :)
22:58 ingy I'll show you
22:58 ingy but let me finish the demo
22:59 ingy that's one diference
23:00 ether are you swapping out the code on the author side, or on the user side (at install time)?
23:01 ether it looks like at install time, since it's in Make*
23:01 ingy I'm swapping a module at `dzil build` time
23:01 ingy ie `make dist`
23:02 ingy then putting the orginal in inc
23:02 ingy along with other stuff
23:02 ingy see the .so
23:02 ingy ?
23:03 ingy cool?
23:03 ether I've gotten lost. you can't create the .so until install time, on the client
23:03 ingy correct
23:04 ingy it's a bit mind warping to grok
23:04 ingy until you get it
23:04 ingy then it's simple (ish)
23:04 ether :)
23:04 ingy I kinda need both you and leont
23:05 ingy leont could finish up and you could guide
23:05 ingy leont: you got a few?
23:05 * leont is a bit distracted still
23:05 leont I guess I have a few minutes
23:05 ingy ok
23:05 ingy let me add your user
23:06 ingy ok
23:07 ingy leont: you should be good
23:08 ether lotsa beeping :)
23:08 ether am I up?
23:08 ingy up?
23:09 ether in the editor :)
23:09 ingy ether: did you get disconnected?
23:09 ether no
23:09 ingy oh, no leont is driving
23:09 ether oh
23:09 ether I was typing just now
23:09 ingy oh
23:10 ether and then I lost focus
23:10 ingy I see
23:10 leont Hehe, concurrency is hard!
23:10 * ether dunno the key combo to switch panes
23:10 ingy let's let leont drive
23:10 ether is leont here?
23:11 * leont is reading code now, trying to find the path of least resistance, if ether wants to drive she should
23:11 ingy ether: hold on though
23:11 ether argh your esc doesn't work so I keep mistyping
23:11 ether kinda vim but not really :)
23:11 * ether holds.
23:11 ether I should just type into a gist
23:11 ether less painful than using your setup
23:11 ether :)
23:12 ingy esc works
23:12 leont ingy: Am I correct to conclude that, in the pure_all it does the Inline thingie, to create the .so files?
23:13 ingy leont: yes
23:13 ingy it depends on inc/ having right stuff in it
23:13 ingy then it just works
23:13 ingy so I doubt you need to change pure_all
23:14 ingy just need to call the method in Inline::Module (subclass) during `dzil build` time
23:14 ingy that's where we were headed
23:15 leont That will need an actual distdir, instead of a fake virtual file system
23:16 ingy well if we call it post build it should be ok
23:16 leont Something feels wrong, but I can't describe what
23:17 leont I should play with my own checkout, to verbalize it properly
23:17 ingy well don't try to get it all perfect first time
23:23 leont Ah, you're putting Inline itself into inc/, that detail I had missed
23:23 ingy :)
23:26 ingy leont: you can drive
23:26 ingy but try typing \]
23:26 leont \]?
23:27 ingy it maps to :wa|<up><cr>
23:27 ingy so you can run the test without ctl-z
23:27 ingy well up to you :)
23:30 ingy leont: what did you want to do next?
23:30 leont The afterbuild thingie, but I'm really out of focus for today
23:30 ingy I think if we call Inline::Module::handle_distdir at the right time with the right args
23:31 ingy ok maybe I can get ether to help
23:31 ingy what other module does afterbuild?
23:31 ether what's the afterbuild thingy?
23:31 ether is this swapping out the contents of .pm files?  (if so, that's not afterbuild, but munge_files)
23:32 ether if file content is being munged at *build* time, why put anything in inc/?  what does the enduser need in inc?
23:32 ingy ether: I already have code that munges
23:32 ingy I just need to call it after the build
23:32 ingy and I need to know the build dir
23:33 ingy and the dist.ini values
23:33 ingy if we want to rewrite the munging parts, that can happen later on
23:33 ether let me gist you what I wrote in the meantime
23:33 ingy ok
23:34 ether https://gist.github.com/karenetheridge/ad7b73178ed5830662cc
23:34 ether if you want stuff in Makefile.PL, like you showed in #distzilla earlier, you want the first stuff
23:34 ether but if you want to modify the .pm files themselves, you want the lower stuff instead
23:35 ether the actual content modification is left stubbed, as you've already got that
23:37 ingy ether: backing looking
23:38 ingy ether: I'd like a method that gets called at the end of the `dzil build` handling
23:39 ether if you're modifying the contents of files in the dist, then munge_file is the sub you want
23:39 ether it's called once for each file added to the dist
23:39 ingy no, I have a module/method that munges
23:39 ingy I just want to call that
23:39 ether so this would be the hook for it
23:40 ether munge_file calls out to your thing and gets the new content
23:40 ether bb1minute
23:41 ingy ok. I see that dz has a way to do this. but I don't want it. I just want a method called after the build content has been written to disk
23:43 ether why do you want to circumvent the normal path?
23:44 ether because I spent a lot of time fixing plugins that do things wrong, so they play better together :)
23:45 ether after_build is the hook for that, but it shouldn't be mutating distribution content
23:46 leont ether: I'd agree munging would be ideal, but Inline isn't written for that sort approach
23:47 ingy because I need to do this on 6 build systems
23:48 * leont is actually working on an abstraction layer to enable people to write extensions for EUMM (and thus MI) and MB at the same time, but not sure it's ready for prime-time yet
23:48 ingy I'll take patches later to make the dzil way do things the DZIL WAY
23:48 ingy after_build. yay :)
23:48 * ingy tries it
23:50 ether with 'Dist::Zilla::Role::AfterBuild';
23:50 ether sub after_build { ... }
23:50 ether ..is all you need
23:50 ingy ether can you fix that to get 'module' from the attribute?
23:51 ingy and thanks for the after_build info
23:51 ether that's in the top bit of the gist
23:51 ether $self->modules will return a list
23:52 ingy ether: let me drive
23:52 ether everything else below the extends in your file you shouldn't need
23:52 ether yeah, your editor is weird :)
23:52 ingy just vim
23:52 ether not really
23:52 ether ^V doesn't work
23:52 * ether couldn't do a block-select
23:53 ether and esc isn't working either
23:53 ether is pairup grabbing the esc?
23:53 ingy nope
23:53 ingy ctl-v and esc work fine for me
23:53 ingy hold on though
23:53 ether I'm trying to do a visual select, e.g. to insert # at the front of a bunch of lines, and it's not working
23:53 ether it's just not going into that mode
23:54 leont Visual select didn't work for me either, but escape did
23:56 ether wait, are you wanting to munge Makefile.PL *too*?
23:56 * ether thought it was one or the other
23:56 ingy correct
23:56 ingy no both
23:56 ether ok, let me add some stuff then
23:56 ingy hold on a sec
23:57 ingy I just want to get one thing working first
23:57 ingy can you fix that?
23:58 ether sure, what thing?
23:58 ether I see the problem

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