solnic changed the topic of #rom-rb to: Ruby Object Mapper | Mailing List: https://groups.google.com/forum/?fromgroups#!forum/rom-rb | Logs: http://irclog.whitequark.org/rom-rb
snusnu has quit [Quit: Leaving.]
snusnu has joined #rom-rb
dkubb|away has joined #rom-rb
dkubb has quit [Read error: Connection reset by peer]
jfredett has joined #rom-rb
_whitelogger has joined #rom-rb
snusnu has quit [Quit: Leaving.]
cored has joined #rom-rb
cored has joined #rom-rb
cored has quit [Ping timeout: 276 seconds]
jfredett has quit [Quit: Leaving.]
johno has joined #rom-rb
<elskwid> solnic: +1 for the MP reference!!
johno has quit [Ping timeout: 250 seconds]
<solnic> elskwid: heh :) yeah I’ve been a huge MP fan since I finished 7 years old :D
mbj has joined #rom-rb
mbj has quit [Ping timeout: 256 seconds]
kleech has joined #rom-rb
mbj has joined #rom-rb
dkubb|away has quit [Quit: Linkinus - http://linkinus.com]
postmodern has quit [Quit: Leaving]
kleech has quit [Remote host closed the connection]
kleech has joined #rom-rb
snusnu has joined #rom-rb
snusnu has quit [Quit: Leaving.]
cored has joined #rom-rb
d-snp has joined #rom-rb
d-snp has left #rom-rb [#rom-rb]
skade has joined #rom-rb
knowtheory has quit [Ping timeout: 256 seconds]
knowtheo1y has joined #rom-rb
breakingthings has joined #rom-rb
kleech has quit [Remote host closed the connection]
kleech has joined #rom-rb
skade has quit [Quit: Computer has gone to sleep.]
jfredett has joined #rom-rb
snusnu has joined #rom-rb
jfredett has quit [Client Quit]
jfredett has joined #rom-rb
kleech has quit [Remote host closed the connection]
kleech has joined #rom-rb
<mbj> snusnu, solnic: Time for beeing critic on a a thought experiment of mine? 5min
<snusnu> mbj: ok, if you promise to never ever write Snusnu again
<snusnu> :p
<mbj> snusnu: sorry
<mbj> snusnu: I realized this to late
<snusnu> mbj: hah no worries, i just hate the look of capital S
<mbj> snusnu: So my thought experiment.
<mbj> snusnu: Given a domain model, implemented in java.
<mbj> snusnu: And a nice set of service objects exposing interfaces for all use cases.
<mbj> snusnu: And most of these use cases take primitives or DTOs, and return primitives or DTOs
<mbj> snusnu: The DTOs a re POJOs
<mbj> snusnu: Setup done :D
<mbj> snusnu: And I'm programming against this service objects from ruby, obviousely I'm under jruby.
<mbj> snusnu: And I hate the jruby round trip and the additional penalty of loading the domain model and service object instances, (spring context).
<mbj> snusnu: So I begun to "mock" the service objects interfaces in a PORO mock, so 95% of my unit tests and most of the integration tests can run against the mock under "fast round-tip MRI"
<mbj> snusnu: So I had to duplicate the java DTOs.
<mbj> snusnu: Also I mapped some of the "java only" constructs to ruby semantics etc.
<mbj> snusnu: Now this mapping code grew a lot. And I'm planning to write a declarative DSL
<mbj> snusnu: Where you can map java DTOs to ruby DTOs and wrap java ServiceObjects to service objects that behave like they where POROs.
<mbj> snusnu: Currently I do this by "hand", and it grew over 2k loc, gross.
<mbj> snusnu: This DSL would also be able to "check" the mapping via java reflection API.
<mbj> snusnu: It would not allow to map a ruby object into a java.lang.String for example.
<mbj> snusnu: Would this DSL/project have a use outside of my domain?
jfredett has quit [Quit: Leaving.]
<mbj> snusnu: Is this a common enough scenario to pulish it as opensource?
<mbj> snusnu: I hope you could follow me.
<snusnu> mbj: i can follow you, but i have no idea if that's common enough
<snusnu> mbj: i just know that *i* wouldn't need it
jfredett has joined #rom-rb
<mbj> snusnu: hehe
<mbj> snusnu: I think I could use ducktrap
<mbj> snusnu: For that DTO mapping
<snusnu> mbj: imo you should ask yourself this: does it really help *you*? or is it an "excuse" for doing what you like more, where eventually your client is the only one who "benefits"
<snusnu> mbj: not everything that can be done, should/must be done … :)
<mbj> snusnu: I'm asking myself the question :D
<mbj> snusnu: That is the reason for a thought experiemnt.
<mbj> snusnu: The benefit, a strong and separated lib to do the mapping will do the job FAR better than my ever growing handcoded mapper.
<snusnu> mbj: i would ask myself at least this: can *i* reuse it at some point? and even more, do i *want* to do that kind of thing again, therefore implying a need for it in the first place
<snusnu> mbj: don't get me wrong, i see the benefits for that particular client project, and i see how you'd like to code such a thing more than continuing hand written stuff … i wonder tho, do you want to do that more than other oss projects of yours?
<snusnu> mbj: and of course, there's the question of will the client pay for it :p
<mbj> snusnu: The client would accept I externalize the mapper
<snusnu> mbj: i dunno dude, it's up to you obviouly, of course it could be done
<mbj> snusnu: And I'm thinking if this could/should be part of ducktrap.
<snusnu> mbj: depends, ducktrap certainly needs *nothing* that particularly makes some specific java/jruby scenario easier
<mbj> snusnu: Whats your opinion? (ducktrap-extension)
<mbj> snusnu: It would be an extension
<snusnu> mbj: of course you're free to do whatever with ducktrap :) … but yeah, normally, in our oss projects, we generalize when we've faced the same situation at least a couple of times
skade has joined #rom-rb
<snusnu> mbj: so yeah, i dunno, i can totally see how you're tempted to generalize this for your app, i've no idea how useful it would be outside of that
skade has quit [Quit: Computer has gone to sleep.]
<mbj> snusnu: Thx. I'm thinking a littebit sharper about this prob now.
kleech has quit [Remote host closed the connection]
skade has joined #rom-rb
skade has quit [Quit: Computer has gone to sleep.]
knowtheo1y is now known as knowtheory
skade has joined #rom-rb
kleech has joined #rom-rb
kleech has quit [Ping timeout: 256 seconds]
jfredett has quit [Quit: Leaving.]
bf4 has quit [Ping timeout: 248 seconds]
jfredett has joined #rom-rb
bf4 has joined #rom-rb
snusnu has quit [Quit: Leaving.]
snusnu has joined #rom-rb
<mbj> snusnu: Any news from rubyrouges recording with solnic?
<snusnu> mbj: haven't heard anything about that
<snusnu> mbj: btw, i'm going to nuke this now, ok? https://github.com/mbj/anima/blob/master/lib/anima.rb#L1
<mbj> snusnu: Click the link NOW and I'm confused.
<mbj> snusnu: But I expect you nuked backports +1
<snusnu> mbj: heh sorry, didn't wait for an answer, it was too obvious that this is a leftover, there wasn't even a dep on backports anymore
<mbj> snusnu: hehe
<mbj> snusnu: But after I clicked the link I was "!!!"
<snusnu> heh
<mbj> :P
<snusnu> and then you read the commit msg ...
<mbj> Than did time calculus
<mbj> And I was like "YEAH" :D
<snusnu> mbj: wdyt about
<snusnu> Deprecate expect { }.not_to raise_error(SpecificErrorClass) or expect { }.not_to raise_error("some specific message"). Using these was prone to hiding failures as they would allow any other error to pass. (Sam Phippen and David Chelimsky)
<snusnu> taken from rspec changelog
<snusnu> i get shitloads of warnings when running mutant on rbnacl (which was the reason i had to remove the require backports from anima)
postmodern has joined #rom-rb
<snusnu> imo rbnacl should have 100% mutation coverage
<mbj> snusnu: its okay to remove not_to raise_error, but keep to raise_error
<mbj> snusnu: As they did.
<snusnu> mbj: so we can't expect correct error messages anymore?
<snusnu> (trying to remember what i do with my own stuff here, heh)
<snusnu> mbj: also btw, how does mutant handle code that depends on ffi anyway?
<mbj> snusnu: We can expect on error messages and expections
<mbj> snusnu: note the "NOT" in the changelog
<mbj> snusnu: they only depreciated the expectation of the inverse :D
<mbj> snusnu: as I read the changelog expect(expression).to raise(Foo, "message") will still work.
<mbj> snusnu: From mutants POV its just ruby code.
kleech has joined #rom-rb
<snusnu> mbj: mutant is running for ages already on rbnacl, and i just saw http://pastie.org/pastes/8317691/text passing by
<snusnu> and it seems to happen a lot
<mbj> snusnu: interesting
<mbj> snusnu: Seems mutant finds bugs :D
<snusnu> lol
<mbj> snusnu: Just released anima-0.1.1 w/o backports
<snusnu> mbj: thx! i was about to ask for that
<mbj> snusnu: You can also release, remember
<snusnu> i know :)
<mbj> you got the perms and the trust :D
<snusnu> heh, while at it, mind updating mutant to depend on the new anima?
<mbj> snusnu: jo
<mbj> snusnu: Now only rubocop requires backports!
<mbj> snusnu: Lets convince them to nuke it.
<snusnu> yeah
<snusnu> :)
<mbj> ?
<snusnu> ?
<snusnu> you tagged and released 0.1.1
<mbj> snusnu: just reload
<mbj> snusnu: I did not pushed my chane
<mbj> *change
<mbj> but released 0.1.1 :D
<snusnu> ah ok :) saw it just now
<mbj> snusnu: The tag was after the push on a rev that wasnt on gh
<snusnu> ok, so it's tagged and released properly i assume
<mbj> jo
<mbj> jo
<mbj> Just changed gem.description pls review
<snusnu> mbj, namelessjon_: mutant results for rbnacl (to be taken with a grain of salt cause of the enumerator.so exceptions): http://pastie.org/8317720
<mbj> snusnu: I expect these numbers are totally invalid because of the crashes :D
<snusnu> probably, yeah
<snusnu> mbj: can i help with any info, so you can fix mutant or report a ruby bug if need be?
<mbj> snusnu: minimal reproduction
<mbj> snusnu: So output the mutated code somehow, change the code and run it.
<snusnu> damnit i knew you would say that
<mbj> snusnu: If it still crashes you have a ruby/ffi bug.
<mbj> snusnu: If not its also a ruby/ffi bug. Because mutant does literally NOTHING that that chould crash ruby in this way.
<snusnu> ok that's too much for now, but i'll not forget about it
<mbj> snusnu: its easy peasy
<mbj> :D
<mbj> I'll show you,
<snusnu> not if you'd see the output it produces
<mbj> mom
<snusnu> i literally don't feel like searching the offending stuff
<mbj> and replace the code with this output
<mbj> and run specs by hand
kleech has quit [Remote host closed the connection]
<snusnu> mbj: is the surviving mutant *below* the stacktrace the offending code?
<snusnu> i assume so
<snusnu> mbj: because the thing is, i actually see no mutation in that code
<snusnu> "looks normal"
<mbj> ?
<mbj> snusnu: pls use gist and line references.
<mbj> snusnu: ahh you are on gist
<mbj> snusnu: so pls use line reference links :D
<snusnu> mbj: nevermind, it's pretty obvious that the unparsed code *above* the ruby stacktrace is the offending code, right?
<mbj> snusnu: okay
<snusnu> mbj: ok, changing rbnacl code to https://gist.github.com/snusnu/4fa3c59772ed6b15e88b#file-rbnacl_mutant-L5 crashes a regular spec run too
<mbj> snusnu: see the nil as first argument
<snusnu> mbj: dude, i reproduced it already?
<mbj> snusnu: jo
<mbj> snusnu: I told you its easy :D
<snusnu> heh, i wasn't referring to that, i kinda wanted to shortcut what i assumed to be upcoming guides on what to do next :D
<mbj> snusnu: Somehow we are desynced :D
<snusnu> lol
<snusnu> ok, so i reproduced it, it crashes ruby, so what does that mean?
<snusnu> heh
<snusnu> it's not mutant's fault, that's obvious
<mbj> Because it crashes ruby it means its rubies or rbnacls fault.
<mbj> I think its rbnacl
<mbj> It should raise an exception but NOT crash like this.
<mbj> It should assert they get a string instance as message.
<mbj> Internally they most likely defererencing a null pointer.
<snusnu> i'm not familiar with ffi, but the crash happens in an ffi call .. what are their options?
<snusnu> just cause i'm curious, i'm definitely not the one to propose a fix
<mbj> With FFI you call C methods.
<mbj> This C method gets passed a char* (my guess)
<mbj> BUT as you are passing nil, you get passed a NULL where you expected to get a pointer to a char.
<mbj> So they should assert its a string
<mbj> raise "message must be a String but was #{message.class}" unless message.kind_of?(String)
<mbj> done
<mbj> raise ArgumentError, ...
<mbj> They must assert types match the C interface.
<snusnu> sounds reasonable, currently they're doing this. https://github.com/cryptosphere/rbnacl/blob/master/lib/rbnacl/nacl.rb#L123
<mbj> Yeah
<mbj> They need explicit wrapper that assert ruby types.
<mbj> "blindly" passing any ruby object to FFI allows such stuff to happen.
<snusnu> i see
<snusnu> ok, so fixing those would be sort of a prerequisite to being able to run mutant against rbnacl
<mbj> I think mutant helped again to find problems :D
<snusnu> definitely
<mbj> Argument insertion is so powerful
<mbj> def(foo, bar=foo, baz=bar)
<mbj> found such code in my current clients project
<mbj> (hate it)
<mbj> But mutant uncovered this "argument fall through" exposed lots of uncovered cases from specs.
<mbj> TBH I give a shit about mutant running so long
<mbj> A better automatic verification tool does not exist.
<mbj> We cannot solve the halting problem, but we can fuzz programms like hell :D
<snusnu> heh
<mbj> snusnu: I need help to find a "nice" way to enumerate the amount of mutation operators mutant has.
<mbj> I think it could surpass *ALL* mutation testers outside.
<snusnu> would that be a fair comparison? doesn't that depend on the language syntax/semantics
<mbj> no
<mbj> It would not be fair :D
<mbj> Absolutely not.
jfredett has quit [Read error: Connection reset by peer]
jfredett has joined #rom-rb
cored has quit [Ping timeout: 260 seconds]
cored has joined #rom-rb
cored has joined #rom-rb
jfredett has quit [Read error: Connection reset by peer]
jfredett has joined #rom-rb
jfredett has quit [Read error: Connection reset by peer]
jfredett has joined #rom-rb
jfredett has quit [Quit: Leaving.]
jfredett has joined #rom-rb
patriciomacadden has joined #rom-rb
cson has joined #rom-rb
snusnu has quit [Quit: Leaving.]
jfredett has quit [Client Quit]
revans has joined #rom-rb
<namelessjon_> mbj: That mutation "can't happen", unless you're calling private and undocumented-except-for-a-warning-not-to-use-them methods.
<mbj> namelessjon_: So calls to that mutated code are santized in an outer layer?
<mbj> namelessjon_: The sanitzer would also be mutated away :D So that ruby crash should "kill" the mutation also.
jfredett has joined #rom-rb
<namelessjon_> mbj: Yeah. That method is ruby private too, and should never be called directly. But yeah, the sanister code could be being removed.
<mbj> namelessjon_: In this case I have to revert my claims. Sorry that code already "looked" internal, I should have researched a bit.
<mbj> namelessjon_: So we found another reason I have to finish blacklisting support for mutant :D
<namelessjon_> mbj: :D
namelessjon_ is now known as namelessjon
skade has quit [Quit: Computer has gone to sleep.]
skade has joined #rom-rb
skade has quit [Client Quit]
patriciomacadden has quit [Quit: Leaving...]
dkubb has joined #rom-rb
kleech has joined #rom-rb
patriciomacadden has joined #rom-rb
patriciomacadden has quit [Client Quit]
dkubb has quit [Quit: Linkinus - http://linkinus.com]
jfredett has quit [Quit: Leaving.]
mbj has quit [Ping timeout: 264 seconds]
mbj has joined #rom-rb
mbj has quit [Read error: Connection reset by peer]
mbj has joined #rom-rb
kleech has quit [Remote host closed the connection]
skade has joined #rom-rb
breakingthings has quit []
bf4 has quit [Ping timeout: 264 seconds]
skade has quit [Ping timeout: 260 seconds]
cored has quit [Ping timeout: 276 seconds]
cored has joined #rom-rb
snusnu1 has joined #rom-rb
snusnu1 has quit [Client Quit]
snusnu1 has joined #rom-rb
snusnu1 has quit [Client Quit]
snusnu1 has joined #rom-rb
snusnu1 has quit [Client Quit]
snusnu1 has joined #rom-rb
snusnu1 has quit [Client Quit]
snusnu has joined #rom-rb
cored has quit [Read error: Operation timed out]
bf4_ has joined #rom-rb