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
cored has quit [Ping timeout: 276 seconds]
djsell has joined #rom-rb
<postmodern> snusnu, doesn't < only work on Classes/Modules, not instances?
<postmodern> snusnu, maybe its(:class) { ... }
<snusnu> postmodern: thx for picking that up! (un)fortunately it was just me being dumb, trying it on an instances although i was completely sure i was trying on a class ;)
<snusnu> postmodern: so yeah, of course it behaves just as you said
<postmodern> also should be_kind_of
<snusnu> yeah, iirc i ended up using that .. it's just that i was *so sure* that i'm dealing with a class, and only later noticed that i was looking at an instance method spec file heh
<snusnu> tricky when objects have equally named instance and class level methods
djsell has quit [Ping timeout: 248 seconds]
snusnu has quit [Quit: Leaving.]
mbj has joined #rom-rb
mbj has quit [Ping timeout: 275 seconds]
mbj has joined #rom-rb
splattael has joined #rom-rb
zekefast has joined #rom-rb
zekefast has quit [Quit: Leaving.]
snusnu has joined #rom-rb
solnic has joined #rom-rb
zekefast has joined #rom-rb
<solnic> snusnu: ping
ptico has joined #rom-rb
postmodern has quit [Quit: Leaving]
<mbj> solnic: hola
<mbj> solnic: Dealing with maven :D
<solnic> mbj: hey :)
<solnic> mbj: maven? why?
mbj has quit [Read error: Connection reset by peer]
mbj has joined #rom-rb
<solnic> mbj: geez we need to standardize gateway
knowtheory has quit [Quit: Computer has gone to sleep]
knowtheory has joined #rom-rb
<solnic> mbj: I'm experimenting with in-memory adapter
<solnic> mbj: not sure if it's a right approach but...the gateway could simply intercept materialize and update data in the adapter's in-memory store...wdyt?
knowtheory has quit [Ping timeout: 264 seconds]
<mbj> solnic: haha, yeah standard gateway would be awesome!
<solnic> mbj: ok I must admit I'm kinda stuck with this memory adapter
<mbj> solnic: I'd love to help, but I'm busy.
<solnic> mbj: no worries
cored has joined #rom-rb
cored has quit [Quit: leaving]
cored has joined #rom-rb
<solnic> mbj: why including equalizer causes inclusion of adamantium?
<solnic> or maybe something weird is going on
<solnic> snusnu: ^^
<solnic> mbj, snusnu: ^^ this makes no sense
<solnic> this is srsly messed up or I'm missing something here
<solnic> weird, when there's include Equalizer.new(:uri) in the adapter class it gets Adamantium included somehow
<solnic> I just replaced it with Concord and Adamantium inclusion is gone
<solnic> SO WEIRD
<mbj> solnic: Adamantium does not even reference equalizer!
<mbj> solnic: Yeah it is weird
<solnic> mbj: here's what happens
<solnic> with equalizer included while loading classes - adapter gets adamantium included
<solnic> when I remove inclusion of equalizer. load console and manually include it
<solnic> adamantium isn't being included
<solnic> WEIRD
<mbj> solnic: Can you reduce this to happen outside rom?
<solnic> mbj: I will try
<solnic> mbj: your axiom adapters have no write support yet rite?
<mbj> solnic: jo
<mbj> solnic: in case of arango I could add them in minutes.
<solnic> mbj: what should Gateway#insert return? another gateway or a relation?
<mbj> solnic: gateway, most likely the same!
<solnic> mbj: ok :)
<mbj> solnic: What was the mocking framework again?
<solnic> mbj: bogus
<mbj> solnic: thx, found
snusnu has quit [Quit: Leaving.]
<solnic> mbj: so if I have a restriction, how does the gateway is supposed to use it to filter in-memory data?
<mbj> solnic: Call #to_a and set new tuples.
<solnic> mbj: damn, this stuff is harder than I thought :P
<mbj> solnic: IMHO the adapter would track the current tuples
<solnic> well, I don't have any data inside that relation
<solnic> so #to_a won't give me anything
<solnic> I'm doing it wrong basically
<mbj> solnic: Why you dont have data in the relation?
<mbj> solnic: Because you did not inserted sth?
dkubb has joined #rom-rb
<mbj> solnic: there you go, dkubb entered the chan :D
<solnic> mbj: no, I have data hash in the adapter
<dkubb> good morning
<mbj> solnic: And the gateway knows the adapter.
<solnic> mbj: and I'm trying to figure out how to make inmemory gateway work with it
<solnic> dkubb: hai, just in time
<solnic> need help with in-memory adapter
<mbj> solnic: And the adapter knows how to return a relation with that data!
<solnic> mbj: lemme push what I have so far
<mbj> solnic: And you wrap that relation inside the restrict node.
<solnic> it's pretty much broken
<mbj> solnic: What about me doing a working version?
<mbj> dkubb: morning!
<mbj> solnic, dkubb: I'm busy. I'll not reply in time!
<solnic> ah shit ok
<solnic> dkubb: got a second to help me with this inmemory gateway/adapter?
<mbj> solnic: you mix adapter with gateway, arent you?
<mbj> solnic: no you dont, sorry
<mbj> solnic: Just stared at the nesting.
<solnic> mbj: that reading part is broken
<solnic> I just pushed what I have so far
<solnic> I guess I just need to wrap it in a new relation
<solnic> but I stare at your arango gateway
<solnic> and I don't get it :D
<mbj> solnic: np
<mbj> solnic: There are multiple ways doing it.
snusnu has joined #rom-rb
<mbj> solnic: So you *pass* the relation to the adapter
<solnic> mbj: yeah I do
<mbj> solnic: And you'd have to filter the relation there
<mbj> solnic: But if your relation was created with the correct data you just could use each on the relation.
<solnic> yes that's the missing part
<dkubb> hmm, I don't know if I've designed the #create, #update and #delete interfaces on the adapter yet
<solnic> dkubb: we'll get to that in a minute ;)
<mbj> solnic, dkubb: I cannot spend my full attention, sorry. Will come back later to this.
<solnic> mbj: ok ok
<mbj> Just waste your and my time with not spending full attention on any task.
<dkubb> solnic: tbh I was probably going to use the same adapter interface as DM1's adapters
<solnic> I think the trick here is to carry the data in gateway instances
<solnic> dkubb: wdyt about that inmemory stuff I pushed today? it's broken
<solnic> but
<solnic> I need help so I pushed
<solnic> to show you the code
<snusnu> solnic: you could keep the data in the adapter, initialize base relations with the tuples stored in the adapter, and then "intercept" #insert #delete on the gateway, guarding it with relations.is_a?(Base::Relation)
<snusnu> dkubb: hey, comments on that very welcome :)
<dkubb> would it help at all if I pushed the gateway from axiom-do-adapter into axiom or into an axiom-abstract-adapter ?
<snusnu> dkubb: yes it would
<solnic> oh yes
<solnic> definitely
<solnic> snusnu: yeah, I started with adapter having data hash
<solnic> snusnu: but now I need to keep track on the relation name (which is used as they key in that data hash)
splattael has quit [Quit: Leaving.]
<snusnu> solnic: the key thing seems to be intercepting at the gateway level, but only for base relations (as everything "trickles down" to them)
<solnic> which gets screwed up once relation becomes sth else, like a restriction or sth
<snusnu> so you could always check if the proxied relation is a base relation, and if so, intercept the insert, inserting the tuples into the base relation exposed by the adapter
<snusnu> and then, make sure to actually call "the real thing" too
<solnic> snusnu: rite, and what about queries? :)
<solnic> let's say you do a restriction
<solnic> so gateway's relation is now a restriction
<solnic> you have access to all the data via adapter
<mbj> dkubb: The shared gateway should have some kind of a state machine, that controls push-down vs wrap
<snusnu> solnic: right, inserts always must apply to base relations tho, eventually
<solnic> and you want to restrict that data using the restricted relation
<mbj> dkubb: You can initialize it with an adapter, and the adapter returns the "state machine" suitable for making sure only valid relation trees can be pushed.
<mbj> dkubb: For example you cannot do restriction(sort(restriction)) in mongo
<mbj> dkubb: Or restriction(sort(offset()))
<mbj> dkubb: So we can start with a "pushes all stuff apart cross repo joins down" gateway, but we need to make sure we can inject that "can push down or cannot push down" logic.
<dkubb> mbj: maybe the gateway should ask the adapter what it can handle?
<mbj> dkubb: the adapter would have to walk the relation tree
<mbj> dkubb: To the root!
<snusnu> solnic: do you know what i am saying?
<snusnu> :p
<solnic> snusnu: yeah I get the insert/update/delete part
<solnic> my problem is with reads right now
<solnic> can't wrap my head around that
<snusnu> solnic: all relations you operate on will be created from an adapter, and get initialized with the tuples, i guess nothing special is needed for read?
<snusnu> solnic: also, all data eventually comes from base relations, which you get from the adapter
<solnic> so, you're saying adapter should return base relations with tuples inside
<solnic> it currently returns just tuples
<snusnu> solnic: well, no, lol .. i see the problem
<solnic> you DO? awesome? :D
<snusnu> well, no, lol .. damnit, i'm confused, this always happens with that topic
<dkubb> mbj: you start off with a base relation wrapped in a gateway. each operation applied on the gateway could decide to push-down or not based on the capabilities of the adapter
<solnic> it is a little bit confusing
<snusnu> my concern now was that we can't always materialze the complete relation of course
<dkubb> maybe it would help if I wrote the first version of the in-memory adapter as a reference :)
<snusnu> dkubb: pretty please! :)
<dkubb> we have all the pieces for that at least
<snusnu> it would be SO awesome to have full in memory support
<snusnu> i would switch our app to ROM immediately
<solnic> yeah it would
<dkubb> yeah, then at least ROM can proceed with something usable
<solnic> yes it's blocking release now
<solnic> if we can have it at least partially done
<solnic> we could push it
<solnic> it'd be a great starting point for others
<dkubb> it'd be nice for integration tests too, since it'll be fast
<snusnu> dkubb: i would actually say it's even more important than sql generation
<solnic> me too
<dkubb> ok
<solnic> we could work on so many other things if in-memory adapter is done
<solnic> like session for example
<solnic> also other people could jump in and start working on their adapters
<dkubb> so the main thing is you need create, update, and delete methods added to the adapter, and a gateway that wraps this?
<solnic> dkubb: yes, I added a dummy #insert
<solnic> but it assumes integer is the key
<solnic> READ would be nice too :D
<solnic> if you could set some foundation for this, I could finish it
<solnic> i'm very confused right now, it's hard to wrap my head around this
<solnic> I mean, I know how it should work, but I have no clue how to make it work haha
<snusnu> solnic: that's exactly how i feel about it too :)
<solnic> looking at other adapters doesn't help since they have a real database under the hood
<dkubb> it's ok, I had assumed I would do it because I've already wrapped my head around how it should all work. once we have a few example adapters it'll get way easier
<snusnu> there's another argument pro in-memory adapter now, while developing an app, you really don't care wether the data actually is persistent, you want to develop the app
<dkubb> some of the questions like pushdown are still open, but that won't be an issue with the in-memory stuff
<solnic> dkubb: <3<3<3
<dkubb> since every operation is already supported
<solnic> with a well defined way of writing an adapter we should see a ton of adapters from other people
<solnic> but this has to become simpler and more obvious
<solnic> otherwise ppl will be as confused as me and Martin are now :D
<dkubb> snusnu: yeah, when I worked on the DO adapter I also worked really hard to make sure the in-memory relations worked the same as the DO adapter; I literally ran 10's of millions of tests to ensure it was the same. that means people should be confident that if they get their app running with an in-memory adapter it can be swapped out later
<dkubb> a few finished examples are needed I think
<solnic> dkubb: that's how I advertise ROM to people btw, good to know about those 10's of millions of tests heh
<dkubb> I can do an in-memory one, and if someone wants to take over the SQL gen I can work on the do adapter after that
<dkubb> solnic: why don't we trade.. I'll do the in-memory adapter and you can do some SQL gen stuff?
<solnic> dkubb: sure
<solnic> dkubb: I was going to suggest that
<dkubb> solnic: we also have some nice fuzzer stuff that mbj wrote
<dkubb> I ran the fuzzer so many times. sometimes for days at a time. it would stop when it found a bug, and I would fix it, and re-run it
<dkubb> I think I repeated that over a few weeks until I could basically let it run for 10m+ iterations with no errors
<solnic> nice
<dkubb> we can do the same thing with this adapter.. although mbj's is more advanced than what I wrote
<dkubb> it's mostly for reads, but I'm guessing we can probably make one that does writes too
<dkubb> er rather extend this for writes
<solnic> yeah this stuff will make us feel much more confident about the adapters
<solnic> it's pretty awesome I must say
<snusnu> dkubb: yeah, that's what i was thinking, the nice thing with axiom backed ROM is that once your app works with the in memory adapter, you can be 100% sure it'll work on sql or whatever else too, which is almost unbelievably awesome .)
<dkubb> when writing an adapter I see this as kind of symbiotic. you write the adapter and get it working the best you can with your tests, then you fuzz it and fix the bugs. then you try to extend the fuzzer to find more problems.. and keep bouncing back and forth between the fuzzer and adapter until you are confident
<dkubb> if we do that for every adapter, after a couple of them we'll have a bullet proof framework
<dkubb> then people writing new adapters have this kind of system that can lead them through the process of finding and fixing bugs. they'll have sample adapters to use as reference
<solnic> snusnu: +1
<solnic> snusnu: I was just writing the very same thing, but deleted it since you were first lol
<snusnu> hah
<solnic> dkubb: yes this sounds great
<solnic> so, let's do this :D
<cored> mornng all
<cored> solnic: did you see the pull request?
<dkubb> combing fuzzing with mutation testing once mbj's new mutant is ready should be sweet too
<solnic> cored: which one?
<solnic> cored: oh and morning
<cored> solnic: the common module
<cored> solnic: :-P I rename it to ConstMissingExtensions
<cored> don't know if it's better or worst
<solnic> cored: awesome, merging
<cored> neat
<cored> checking the issues
<solnic> cored: actually no
<solnic> cored: build is broken :) can you take a look?
<cored> solnic: checking
<dkubb> mbj: btw, github now supports repository renaming with redirects. so you could redirect aequitas to vangaurd
<cored> solnic: fixed
<solnic> cored: merged! thanks
<cored> cool
<cored> which is the next one to tackle ?
<mbj> dkubb: thx, my problem is the vanguard is not related to aequitas in any way. It is 99.95% my code.
<mbj> solnic, snusnu, dkubb Was on phone the last min and still busy. Will catch up later.
<mbj> dkubb: My idea is to have *one* gateway to rule all adapters. So we inject adapter specific push down or push not behavior with some kind of a control object.
<snusnu> mbj: what's the problem with vanguard?
<solnic> cored: https://github.com/solnic/virtus/issues/155 <= this one maybe
<solnic> cored: we recently moved away from global settings though, but old behavior should still work, right elskwid?
<dkubb> mbj: what I was thinking is an adapter would return an object that the gateway uses to construct new copies of itself. by default it would just do this: https://github.com/dkubb/axiom-do-adapter/blob/master/lib/axiom/relation/gateway.rb#L269-L277 .. but it could do other things
<mbj> dkubb: yeah
<dkubb> mbj: I'll probably do this after an in-memory adapter though, since I won't need it for that, but we will need it for other adapters
zekefast has quit [Read error: Operation timed out]
<mbj> dkubb: Maybe we can make this control object to return a new state each call.
<mbj> dkubb: So if you "branch" a relation tree (reuse a root twice) you dont get extra work, or race conditions when sharing between threads.
<mbj> dkubb: state = state.advance(new_relation); and deal with state.relation
<mbj> dkubb: not well thought, but I'd like it.
<cored> solnic: checking
<dkubb> mbj: yeah, I'll think about how to do it. chances are whatever I do will have me telling the object to return a new relation/gateway based on some inputs, rather than asking it which kind of object to create and then doing the work in the gateway
<dkubb> mbj: that way the adapter specific object can do whatever it needs to do, and the gateway is just a dumb container for the adapter and relation
<mbj> dkubb: Yeah, but it should also return a new "decider" object.
<mbj> dkubb: so we have a nice state machine :D
<dkubb> mbj: if it creates a gateway it can always inject a new "decider" object
<dkubb> ok, I've gtg to work, will bbl
dkubb has quit [Quit: Linkinus - http://linkinus.com]
zekefast has joined #rom-rb
<mbj> solnic: Is there something like stup_const in bogus?
<solnic> mbj: yeah I think so
<mbj> solnic: Override seems to be a bad choice for the method name
<snusnu> guys wtf
<snusnu> There was a NameError while loading rom-relation.gemspec:
<snusnu> uninitialized constant ROM::Relation from
<snusnu> /Users/snusnu/.rvm/gems/ruby-1.9.3-p392/bundler/gems/rom-relation-a15ab70be9ef/rom-relation.gemspec:12:in `block in <main>'
<snusnu> this happens when bundling from the pre-mapper-extraction branch
<snusnu> which simply HAS NO rom-relation.gemspec
<snusnu> it all bundles nice when i use local source with pre-mapper-extraction branch checked out
<mbj> snusnu: Today is WTF day.
<elskwid> Howdy y'all
<elskwid> cored: The old global settings API should still be in tact. Please let me know if this is not the case.
<solnic> mbj: where should I put emitters for select/update/delete?
<cored> elskwid: oki
<solnic> mbj: oh you wrote we should start with insert, ok so, where should I put insert emitter?
zekefast has quit [Quit: Leaving.]
<mbj> solnic: SQL::Generator::Emitter::Insert
<snusnu> it seems like we can't bundle rom-relation branch pre-mapper-extraction anymore
<snusnu> either i don't get something really basic, or it's a bundler bug
<snusnu> mbj, solnic: can any of you guys try to bundle: gem "rom", :git => "https://github.com/rom-rb/rom-relation.git", :branch => "pre-mapper-extraction" ?
<snusnu> it consistently fails for me, telling me about uninitialized constant ROM::Relation from rom-relation.gemspec
<snusnu> the fun thing is: there IS NO rom-realtion.gemspec
<snusnu> in this branch
<snusnu> it works absolutely fine if i point the bundle to use a locally checked out version of this branch
<solnic> snusnu: looks like there are two gemspecs
<solnic> snusnu: remove rom.gemspect
<solnic> ugh, rom-relation.gemspec
<snusnu> solnic: no there aren't?
<solnic> snusnu: yes there are
<snusnu> really?
<solnic> snusnu: I'm looking at them
<snusnu> solnic: me too?
<snusnu> wtf
<solnic> snusnu: ^^
<snusnu> solnic: i see them in the repo now
<snusnu> solnic: i don't see them in my local clone lol
<snusnu> solnic: ok, thx for doublechecking! i'm gonna nuke rom-relation.gemspec from that branch
<solnic> snusnu: I must've fucked up merge conflicts resolving
<snusnu> solnic: no worries
<snusnu> solnic: in fact, huge thx, i would've NEVER spotted that
<snusnu> lol
<solnic> snusnu: :)
<snusnu> solnic: works now, of course :)
<solnic> snusnu: osm
djsell has joined #rom-rb
<solnic> mbj: damn I wish I wasn't so clueless with this sql generator :D
<mbj> solnic: it isnt sthat hard
<solnic> mbj: I know
<solnic> but still
<mbj> solnic: s(:insert, target, s(:tuple, value, value, value, value))
<solnic> I don't know how to do it
<solnic> and that target is what?
<mbj> solnic: So first define s(:tuple, foo, bar, baz)
<mbj> solnic: identifier
<snusnu> mbj, solnic: just updated substation-demo to use the new chain dsl, me likes: base chains at https://github.com/snusnu/substation-demo/tree/master/demo/web plus "refinements" in the 2 files in https://github.com/snusnu/substation-demo/tree/master/demo/web/actions
<mbj> def dispatch
<solnic> tuple is what? :D
<mbj> solnic: Insert: def dispatch; write("INSERT INTO"); visit(identifier); visit(tuple); write(";"); end
<mbj> solnic: Tuple; def dispatch; write("(");v visit_delimited(children); write(")"); end
<solnic> mbj: now that's kinda enlightening :)
<mbj> solnic: Tuple is a composition of primitives.
<mbj> solnic: That stuff is SUPER easy.
<solnic> hey I know
<solnic> but you need some level of knowledge
<solnic> to do it
<mbj> solnic: If we'd have money already to distribute, I'd say: Give me 1 working day and I'm through.
<solnic> mbj: working on that :P
<mbj> solnic: yeah, enough sql we need.
<mbj> solnic: This is the 4th time I write emitters
<mbj> It becomes kinda boring :D
<snusnu> guess what, and i ***totally not want to bitch about it*** .. but somehow, just somehow .. money changes oss dynamics :p … i'm *fine* with that change, as the oss we do, is directly beneficial for companies … but yeah, it changes dynamics ...
<mbj> solnic: You can reuse the tuple thing for selects like "SELECT (1 as integer, 2 as float)"
<mbj> solnic: That thing in () is also a tuple...
Gibheer has quit [*.net *.split]
Gibheer has joined #rom-rb
<solnic> snusnu: I know what you mean
<mbj> snusnu: It is differend when you have a child, trust me.
<solnic> mbj: +1
<snusnu> mbj: child or not, it also changes for me, and i have no child :)
<snusnu> mbj: but i DO KNOW what you mean
<snusnu> believe me
<snusnu> and i understand
<mbj> snusnu: Before my child I could spend *hours* workgin on such stuff. But now I have to take care I dont fuck up clients.
<mbj> Before it was possible to backpack russia for month.
<mbj> Before I just said: Hey cool, lets do a 250km bike ride, start in 10min?
<snusnu> mbj: as i said, i'm fully aware, and i'm not bitching at all, it's just an observation, and tbh, one that doesn't surprise me … in fact, show me ONE THING, where money doesn't change the dynamics behind it
<mbj> Sure :D, I know you are not bitching!
<snusnu> :)
<mbj> snusnu: The problem isnt money by itself, it is the regular demand for money.
<snusnu> which boils down to, well, money
<snusnu> lol
<solnic> :)
<mbj> It is more the regular aspect IMHO.
<mbj> I need "value" to exchange, and that each month.
<mbj> No interruption allowed, or I'll run into a backlog.
<mbj> I'd be totally happy if OSS funding is just: "Hey guy, I pay your bills, make the project happy, you have 6 month".
<snusnu> if it weren't for money, you wouldn't need money regularly .. but i guess now i am starting the bitching ;)
<mbj> haha
<mbj> GF is calling, I wanted to be home 20:00
<snusnu> hehe
<mbj> so have to run, cu laters.
<snusnu> have fun
<snusnu> mbj: btw, could you tell me how to run mutant master?
<snusnu> mbj: i tried it for substation, and yeah, it picked up nothing …
<mbj> snusnu: later!
<snusnu> perfectly fine
mbj has quit [Quit: leaving]
snusnu has quit [Quit: Leaving.]
mbj has joined #rom-rb
<solnic> I think I want to put those INSERT INTO and VALUES into constants
<solnic> crap, missing WS before tuple :)
<mbj> solnic: You can also do write(K_INSERT, K_TO, WS)
<solnic> I know
<mbj> solnic: than visit(identifier)
<solnic> didn't know which one is preferred
<solnic> I actually started like that
<mbj> solnic: that one with multiple values in write
<solnic> then recalled there's ws helper
<solnic> thought you prefer that
<solnic> ok ok :)
<solnic> lemme refactor
<mbj> solnic: no the ws helper is old
<mbj> solnic: I just blindly copied it over!
<mbj> solnic: I can fix that stuff if you like!
<mbj> solnic: Having some private time.
<mbj> solnic: you are doing the changes?
<solnic> mbj: just pushed it
<solnic> I removed ws helper since it's not a recommended way
<solnic> this stuff is fun
<solnic> I like how it works
<mbj> solnic: I'm pretty proud about the emitter design!
<solnic> mbj: it's really nice yeah
<solnic> so, lemme know if it's good-to-be-merged
<solnic> I can quickly add update/delete and then select
<mbj> solnic: There is one improvement in this commit I'd like to port from unparser
<mbj> it names childs!
<mbj> solnic: we can merge IMHO.
snusnu has joined #rom-rb
ptico has quit [Remote host closed the connection]
<solnic> mbj: I guess it'd be nice to add WHERE for DELETE
<solnic> I mean, I can start w/o WHERE
<mbj> solnic: I'll add that children naming.
<mbj> solnic: Veto NOW, I'll commit to master :D
<solnic> mbj: please do commit that, it's a neat addition
<solnic> frankly, such thing crossed my mind today
<solnic> so it's osm you've got that already
<solnic> mbj: how should I name WHERE emitter
<solnic> :where?
<mbj> solnic: do we need a special where emitter?
<mbj> solnic: I dont think so.
<solnic> mbj: what is it then?
<mbj> solnic: The WHERE keyword is only valid with a SELECT
<solnic> uhm
<solnic> what about delete?
<solnic> it has where clause too no?
<mbj> solnic: Good!
<mbj> solnic: forgot!
<solnic> :)
<mbj> solnic: so we need it :D
<solnic> YOU NO SQL HIPSTER
<solnic> ;)
<mbj> solnic: Blood shugar near 0
<mbj> did 10h of intense development that day and my brain reduces blood shugar level heavily.
<mbj> Need to eat!
<solnic> mbj: go then :)
<mbj> solnic: lets name it s(where)
<solnic> kk cool
<solnic> mbj: what about foo = '1'?
<mbj> solnic: where statement?
<solnic> I'm so missing vocabulary here
<mbj> So for the where statement DELETE FROM fo WHERE bar = 1 ?
<solnic> I'm just wondering if 'bar = 1' should be handled by a separate emitter
<mbj> solnic: sure!
<solnic> or should it be part of the where emitter
<mbj> solnic: no
<solnic> rite
<mbj> solnic: That statement can be very complex
<solnic> exactly
<mbj> def dispatch; write(K_WHERE, WS); visit(predicate); end
<solnic> including sub-selects and what not
<mbj> so add an eql node
<mbj> s(eql, left, right)
<mbj> you can add it to the binary operator
<mbj> s(eql, s(int 1), s(int 2)) => 1 = 1
<solnic> rite
<solnic> makes sense
<solnic> mbj: virtus fundraiser is featured on the homepage sweet :)
<mbj> solnic: nice!
<mbj> solnic: I'll try a mutant one also!
<mbj> solnic: not now, but later.
<mbj> solnic: pushed my child naming stuff!
<mbj> solnic: Do you think bountysource will work for mutant? Is this the kind of project that could attract people?
<mbj> solnic: I know I asked this before :D
<solnic> mbj: hard to tell
<solnic> mbj: it's definitely gonna be harder than in virtus' case
<solnic> virtus is really popular now
<solnic> used by a lot of people
<solnic> mutant is a very specific tool
<solnic> but who knows
<solnic> you'll never know until you try
<mbj> yeah
<mbj> heh
therabidbanana has joined #rom-rb
<solnic> mbj: not sure if I can put eql into binary ops
<solnic> it creates '("foo") = ("foo")'
<mbj> solnic: does not look pretty, but will work.
<mbj> solnic: We can add context tracking to avoid unneded params!
<solnic> ok
<mbj> solnic: I did this for some cases unnparser already.
<mbj> *in unparser
<mbj> blood shugar...
<mbj> eating sth.
ptico has joined #rom-rb
postmodern has joined #rom-rb
<solnic> mbj: I'm pretty sure mutant task is broken
<solnic> mbj: looking at mutant output in sql
<solnic> it makes no sense, when I perform those mutations manually I see specs failing
<solnic> no idea why it's saying mutations are killed
<mbj> solnic: snusnu also reported this.
<mbj> solnic: I'll take a look, can you assign me an issue?
<solnic> mbj: I think I want to disable mutant until 0.3 is released
<solnic> this task is broken so there's no need to run it
<mbj> solnic: np
<solnic> also we gotta improve yardstick
<solnic> it's killing me srsly
<mbj> solnic: yeah
<mbj> solnic: I think yardstick should load the lib
<mbj> solnic: And than determine if a method is private!
<solnic> yes it should
<solnic> therabidbanana: you know what I'm about to say :)
cored has quit [Ping timeout: 256 seconds]
cored has joined #rom-rb
cored has joined #rom-rb
solnic has quit [Quit: Leaving...]
<therabidbanana> solnic: 70% didn't seem like a big enough number.
<therabidbanana> I was surprised I'd missed the link to that, I'd been looking at virtus just yesterday.
cored has quit [Ping timeout: 256 seconds]
cored has joined #rom-rb
cored has joined #rom-rb
<snusnu> yo mbj, around=
<snusnu> ?
<mbj> snusnu: jo
<snusnu> mbj: got a minute to discuss the failure chains i was talking about?
<mbj> snusnu: mutant?
<snusnu> mbj: nope, substation
<snusnu> mbj: altho that reminds me, tell me how to run mutant master! :)
<snusnu> mbj: on substation
<snusnu> mbj: all of it
<snusnu> mbj: so that it actually does something :)
<mbj> snusnu: hah
<mbj> snusnu: It should *do* something
<snusnu> mbj: ideally, yes :)
* snusnu is bundling mutant from master ...
<snusnu> mbj: here's 2 invocations: http://pastie.org/pastes/8057161/text
<snusnu> mbj: if you could tell me the command line how to properly mutate all of the lib at once, that would be very much appreciated
<mbj> snusnu: Subjects: 0
<mbj> snusnu: The new recursive matcher syntax is ::Substation**
<mbj> snusnu: matcher = that thing that finds subject to mutate
<mbj> snusnu: Matcher: #<Mutant::CLI::Classifier::Namespace::Flat identification="::Substation">
<snusnu> mbj: ::Substation** doesn't work, it's at the end of the pastie, says no matchers
<mbj> snusnu: this is your matcher, a namespace flat
<snusnu> mbj: i got that so far, but i was sure that ::Substation** would be the recursive thing, no?
<mbj> snusnu: should, afaik
<mbj> mom
<snusnu> mbj: it says: Matcher: #<Mutant::CLI::Classifier::Namespace::Recursive identification="::Substation*">
<mbj> snusnu: ::Substation*
<snusnu> mbj: and that would recurse into all namespaces?
<mbj> snusnu: all namespaces within ::Substation and substation itself.
<snusnu> mbj: ah ok! there are "only" 2 of those, i was sure you mentioned * and **
<mbj> snusnu: jo, I mismentioned them.
<snusnu> mbj: ok
<mbj> snusnu: I should implement them as I mentioned them.
<snusnu> mbj: heh
<mbj> snusnu: I'm very open to suggestions!
<snusnu> mbj: dunno, * seems enough if it recurses
<snusnu> mbj: so, wdyt re the failure for ::Substation* ?
<snusnu> (it's in the pastie)
<mbj> snusnu: unhandled node
<mbj> snusnu: Most likely I deleted the rbx specific lvar handler without providing a whitequark/parser one
<mbj> snusnu: solutions:
<mbj> # add lvar inside lib/mutant/mutator/node/noop within the handle macro
<mbj> # or add a mutator <- prefered
<snusnu> lol
<snusnu> i thought so
<snusnu> i mean, the latter being preferred :)
<mbj> snusnu: it should basically emit a random name for that lvar
<mbj> snusnu: mom, I remember I did it
<mbj> snusnu: only fo assignment
<mbj> snusnu: not for access
<mbj> snusnu: I did not do any mutations on lvar accesses under the rbx ast.
<mbj> snusnu: Feel free to noop it
<mbj> snusnu: Or add a simple mutator that replaces the lvar with nil
<mbj> snusnu: accessing a randomized lvar does not really make sense :D
<mbj> snusnu: or replace "puts lvar" with "puts self.lvar"
<snusnu> mbj: huh?
<snusnu> mbj: where would i do that, i have no clue sorry
<mbj> snusnu: in the mutator you should create :D
<snusnu> mbj: you mean an Lvar < Node with something like register :lvar
<snusnu> ?
<snusnu> mbj: i'm sorry, it's probably not the right time for me to commit to mutant :)
<mbj> snusnu: np
<snusnu> mbj: i actually want to do some substation work still :)
<mbj> snusnu: just register :lvar to the noop mutator
<mbj> snusnu: If you find any unhandled node, just add it there.
<snusnu> mbj: ok, lemme do that
<snusnu> mbj: ok, actually, lemme do that after i picked your brain on the substation failure chains :)
<snusnu> mbj: so my plan is to allow to register another chain with any incoming processor, that is invoked in case response.success? #=> false
<snusnu> mbj: so e.g. for a ducktrap: evaluate Some::Ducktrap { wrap Errors::DontMessWithMe }
<mbj> snusnu: dont get the last one, sorry
<snusnu> mbj: so in case of a ducktrap error, it wraps the ducktrap result.output with a specific error class
<snusnu> mbj: and maybe render that later on
<mbj> snusnu: okay
<snusnu> mbj: my goal is to be able to declaratively specify what should happen if an incoming processor returned a failure response
<mbj> snusnu: got it
<snusnu> mbj: so any incoming processor, in case of failure, should have another chain that gets invoked, and produces output the clients can consume
<snusnu> mbj: so i guess my question boils down to this: wdyt about the concept in general? and if you like it, would the above DSL be ok? (the block)
<mbj> snusnu: tbh, I cannot think that well
<mbj> *this evening
<snusnu> mbj: no worries
<snusnu> mbj: ok, adding :lvar to noop made me get further
<snusnu> mbj: :const is next
<mbj> snusnu: add it
<snusnu> mbj: :blockarg
<snusnu> ?
<mbj> snusnu: mhh interesting, mom
<mbj> snusnu: add it
<snusnu> mbj: even more interesting
<snusnu> syntax error, unexpected tAMPER (SyntaxError)
<snusnu> &block.registry
<mbj> snusnu: def foo(&bar)
<mbj> snusnu: show me original code!
<mbj> snusnu: most likely an unparser error!
<snusnu> (srsly, it says L27)
<mbj> snusnu: unparser is NOT able to retain line number!
<mbj> snusnu: it is an unparser, NOT an exact reproducer :D
<mbj> snusnu: new(&block).registry gets unparsed as &block.regisry
<mbj> snusnu: Can you add a test case to unparser?
<mbj> snusnu: containing new(&block).registry ?
<mbj> snusnu: I can fix it *fast*
<snusnu> mbj: where would i put it?
<mbj> snusnu: spec/integration/the_only/file_to_find_here
<snusnu> mbj: right, but in which context?
<snusnu> mbj: def on singleton?
<mbj> snusnu: the context is not needed!
<mbj> snusnu: ruby can parse a method call on the result of a method call passing a block
<snusnu> mbj: i know dude, but where do you think it fits? :)
<snusnu> mbj: i mean which rspec context in the spike_spec.rb?
<mbj> snusnu: send
<snusnu> mbj: ok
<mbj> I have to rename that spec btw :D
<snusnu> mbj: ok, what does it mean if i added the spec and everything's green still?
<snusnu> mbj: i added: assert_source 'new(&block).foo'
<mbj> snusnu: That we found a bug in mutant
<mbj> snusnu: there is a mutation foo(bar) => bar
<mbj> snusnu: so it does foo(&bar) => bar
<mbj> sorry
<mbj> snusnu: foo(&bar) => &bar
<mbj> snusnu: so we have to "remove" that argument promotion in case the promoted argument is a block arg!
<snusnu> mbj: i guess assert_source 'foo(&block)' is enough of a spec for unparser? (it's already present)
<snusnu> mbj: i think i get what you're saying
<snusnu> mbj: but i'm not the guy to do that ;)
<mbj> return unless argument.one? or argument.first.type == :block_arg
<snusnu> mbj: mind fixing it since you already have it open? ;)
<snusnu> mbj: i guess i could do a pull otherwise
<mbj> snusnu: we need to add a spec first
<snusnu> mbj: first, lemme check if it works
<mbj> mom
<snusnu> mbj: send.rb:69:in `emit_argument_propagation': undefined method `type' for nil:NilClass (NoMethodError)
<snusnu> mbj: when adding what you proposed
<mbj> snusnu: jo
<mbj> snusnu: because I always fuck up boolean math with undefined!
<mbj> mom
<mbj> A reason I wrote mutant :D
<mbj> s/undefined/unless/
<snusnu> hehe
<mbj> you see how tired I am :D
<snusnu> but yeah, i find that hard too
<mbj> For that reason I typically write very very easy unless guards.
<mbj> if I have to use a binary op in the conditon I inverse it
<snusnu> mbj: ok, blindly replacing it with && made it go on
<snusnu> mbj: NO IDEA if that's right tho
<snusnu> lol
<mbj> snusnu: stop using master
<snusnu> mbj: why?
<mbj> snusnu: whitequark released parser-2.0.0.beta6, there the handling of empty bodies changed
<mbj> And I did not had the time to adjust mutant.
<snusnu> mbj: ok
<snusnu> mbj: well then
<mbj> It will work but we cannot make the change we do green!
<mbj> Becaus it is already red :D
<mbj> sorry, forgot.
<snusnu> mbj: no worries
<mbj> tools like mutant are HARD!
<mbj> snusnu: going to sleep now. cu
mbj has quit [Quit: leaving]
cored has quit [Ping timeout: 264 seconds]
travis-ci has joined #rom-rb
<travis-ci> [travis-ci] rom-rb/devtools#5 (master - 82dc517 : Dan Kubb): The build has errored.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/rom-rb/devtools/builds/8217775
travis-ci has left #rom-rb [#rom-rb]