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
djsell has quit [Ping timeout: 260 seconds]
djsell has joined #rom-rb
cored has quit [Ping timeout: 240 seconds]
djsell has quit [Quit: Leaving.]
saturnflyer has joined #rom-rb
snusnu has quit [Quit: Leaving.]
saturnflyer has quit [Quit: saturnflyer]
dkubb has joined #rom-rb
knowtheo1y has joined #rom-rb
knowtheory has quit [Ping timeout: 268 seconds]
zekefast has joined #rom-rb
mbj has joined #rom-rb
splattael has joined #rom-rb
zekefast has quit [Quit: Leaving.]
mbj has quit [Ping timeout: 252 seconds]
solnic has joined #rom-rb
zekefast has joined #rom-rb
zekefast1 has joined #rom-rb
zekefast has quit [Read error: Connection reset by peer]
splattael has quit [Ping timeout: 246 seconds]
mbj has joined #rom-rb
splattael has joined #rom-rb
snusnu has joined #rom-rb
<snusnu> mbj: thx for "making me" write up that substation readme section on chains .. i wanted to do it for a while now :)
<solnic> snusnu: morning
<solnic> snusnu: do you already get gateway concept?
<solnic> snusnu: I skimmed through your talk with mbj about it
lorenzo has joined #rom-rb
lorenzo is now known as lorenzo_
<mbj> snusnu: haha
<mbj> snusnu: thx for the release
<mbj> snusnu: now I only need a reek release and a non git source for devtools.
<mbj> snusnu: Than I can fulfill the demands of my current client: No remote interaction for build...
mbj has quit [Remote host closed the connection]
snusnu has quit [Quit: Leaving.]
snusnu has joined #rom-rb
cored has joined #rom-rb
lorenzo_ has quit [Ping timeout: 240 seconds]
lorenzo_ has joined #rom-rb
postmodern has quit [Quit: Leaving]
theCrab has joined #rom-rb
<theCrab> Hey new home
<solnic> snusnu: also lemme know if you want to work on inmemory stuff with me
<solnic> I'm happy to pair or something
<solnic> theCrab: w00t w00t :)
<theCrab> hahaha
<theCrab> solnic: meh! things have moved now
<theCrab> Is it the warmer weather? :))
<theCrab> snusnu: thanks for the heads up
<theCrab> Now where was I? Yes, Composition was used for what again?
<theCrab> in devtools
<solnic> theCrab: it's called Concord now
<theCrab> solnic: looks like i have to get to know the new names again
<solnic> theCrab: it's easy
<theCrab> solnic: whats the main repo for Devtools at?
<theCrab> solnic: Hy was it renamed concord?
<snusnu> solnic: quickly skimmed through the PR and left a comment
<solnic> theCrab: because
<solnic> :D
<solnic> ask mbj
<solnic> but I think it's because 'composition' is a very generic name
<snusnu> solnic: i also want to make sure you're familiar with https://github.com/mbj/mbj-mapper
<solnic> snusnu: rom-mapper will be almost the same
<solnic> it's just that our transformer is called mapper
<snusnu> solnic: i somewhat like the mapper delegating to a transformer that knows dump and load
<solnic> because in mbj's mapper wraps relation
<snusnu> solnic: also, it doesn't assume mutable domain objects
<solnic> we don't do that no more
<solnic> anymore even
<solnic> snusnu: dude, our relation == his mapper, our mapper == his transformer
<solnic> I will add loaders and dumpers later
<solnic> probably today
<solnic> so, our relation uses mapper to load/dump, our mapper delegates loading/dumping to its loader/dumper
<snusnu> solnic: right, i know that difference ;)
<snusnu> solnic: i'm mainly pointing to the support of immutable objects
<solnic> it's the same design except there is no transformer because it is called mapper in rom-mapper
<snusnu> yeah
<solnic> snusnu: I will add different loading strategies
<solnic> I want to support allocating objects w/o calling constructors
<solnic> like in dm1
<snusnu> solnic: right, about that, explain it to me please :)
<solnic> or using "new" that accepts attributes hash
<snusnu> solnic: i'm not familiar with #allocate tbh
<solnic> allocate creates object w/o calling initialize
<solnic> my thinking is that once you created an object and persisted it
<solnic> you don't initialize it later
<solnic> you retrieve its state from the db
<cored> hi
<solnic> so it should appear in the memory again w/o the need to call initialize
<solnic> it kinda makes perfect sense to me
<solnic> I do know that some people disagree :P
<snusnu> solnic: hmm .. so it's kind of "philosophical"?
<solnic> yes it is
<solnic> cored: hi
<cored> solnic: I need some direction with issue 173 for virtus
<snusnu> solnic: in an immutable context, it probably doesn't make much sense?
<snusnu> solnic: i see the reasoning behind it tho
<snusnu> solnic: but i guess it's a matter of how you look at it
lorenzo__ has joined #rom-rb
<snusnu> solnic: if you say, ok, previously, my process didn't know about an object, after fetching from db, it knows, hence, it initializes a new object
<snusnu> solnic: i dunno, to me, #allocate has a somewhat mutable smell to me
<solnic> snusnu: yeah we can have different strategies
lorenzo_ has quit [Ping timeout: 240 seconds]
<solnic> cored: ok?
<solnic> snusnu: if we want to support immutable objects then I do need to add different loading strategies NAU
<solnic> that's ok, I'll be adding loaders so it'll be a good moment to do that
<cored> solnic: oh I thought you were watching the comments on the issue
<theCrab> solnic: just looking at devtools tasks. Rspec 2 changed the top namespace :rspec but devtools defines :spec for :unit and :integration. Am I missing something?
<solnic> cored: haven't seen any notifications
<cored> solnic: dkubb said something but I did not grasp it very well, I was trying to debug but could not find the exact problem
<cored> solnic: wait
<solnic> theCrab: I'm pretty sure rake tasks are defined within :spec
<solnic> namespace
<solnic> cored: this piece of virtus is very nasty right now, I still haven't got a chance to clean it up
<solnic> cored: basically options are being distributed to individual builders
<solnic> so basically too many options are being passed down to writer
<solnic> snusnu: but do you agree with this direction
<solnic> ?
<solnic> basically wrapping header/attribute from axiom?
<cored> hm
<cored> so where do I start
<cored> oki
<cored> checking
<cored> ok let me see if I understands you
<cored> the wrapping of header/attribute from axiom
lorenzo__ has quit [Ping timeout: 252 seconds]
<cored> solnic: but the issue seems in the reading
<cored> because I just set the attribute and it's blows up
<snusnu> solnic: yeah, looks good so far, the direction is definitely right
lorenzo_ has joined #rom-rb
<snusnu> solnic: one thing that comes to my mind, is that i think we should write the mapper in a way that it already expects grouped tuples
<snusnu> solnic: and have that group/ungroup implemented in a dedicated object until axiom supports it
<snusnu> solnic: basically that's code from dm-mapper's Relationship::Iterator::Tuples
<snusnu> solnic: what i actually mean is this: when reading, it should delegate to the object that implements the #group and instantiate a properly nested model instance, and when dumping, it should delegate to the object that implements #dump and "explode" the grouped object to multiple tuples … that must be configurable tho, because not all backends need that expansion
<solnic> cored: check call stack here
<solnic> and debug it
<solnic> it receives type with :writer => :private somehow
<solnic> whereas it should be just { Integer => String }
<solnic> so, something along the way merges those options incorrectly
lorenzo__ has joined #rom-rb
<solnic> snusnu: yes I know, that's the plan
<snusnu> solnic: sweet
<solnic> I'm not going to do the mapping with prefixed names
<solnic> we want to rely on grouping from the start
<snusnu> absolutely
<snusnu> re working on the in memory adapter/gateway .. i'd love to get that done asap, but i guess i won't find time today .. maybe on sunday, but monday might work good
lorenzo_ has quit [Ping timeout: 264 seconds]
<solnic> snusnu: can I start then? you could join me when you have time
<snusnu> solnic: of course dude :)
<cored> solnic: on it
<snusnu> solnic: i'm happy to discuss it with you .. i finally want to understand that bastard
<solnic> snusnu: ok cool
<cored> solnic: in fact I started from there the other night, but I will recheck
<solnic> cored: it happens only with value objects?
<solnic> cored: well ok so look at value_object.rb - it overrides .attribute method forcing writers to be private
<solnic> it probably does it in an incorrect way
<solnic> yeah this code is broken
<solnic> it checks if last arg is a hash assuming it's OPTIONS
<solnic> which can be TYPE
<solnic> add a guard statement checking if args.size > 2 and last arg is option hash
<solnic> cored: do you see this? :)
<solnic> it's fairly simple
<solnic> I need to go, lunch time here, I'll be back in 15 minutes or so
<cored> solnic: yes
<cored> will keep checking
lorenzo__ has quit [Read error: Operation timed out]
<snusnu> theCrab: there's nothing special to using concord and devtools in a project
<snusnu> theCrab: all that devtools does is give a set of rake tasks, a few shared specs targeted towards immutable objects, and a spec_helper that sets things up
<snusnu> theCrab: include Concord.new(:foo, :bar) is equivalent to class C; include Equalizer.new(:foo, :bar); def initialize(foo, bar) @foo, @bar = foo, bar; end attr_reader :foo, :bar; protected :foo, :bar; end
<snusnu> theCrab: the two libs are in no way related
<theCrab> snusnu: am writing an app/lib that will hopefully be independent of an orm/framework. Just the business logic of the organisation.
<theCrab> snusnu: ah cool.
Gibheer has quit [Read error: Connection reset by peer]
Gibheer has joined #rom-rb
mbj has joined #rom-rb
lorenzo_ has joined #rom-rb
<snusnu> mbj: Loader#{call, identity} and Dumper#{call, identity} ftw
<snusnu> mbj: also, wdyt about a substation chain dsl like this: http://pastie.org/8042631
<mbj> snusnu: dont get this one
<snusnu> mbj: the substation dsl?
<mbj> snusnu: Loader#{object,identity} are query methods in my example that dont take any args.
<snusnu> mbj: so?
<mbj> snusnu: Your loader takes an arg, the tuple and returns the object.
<mbj> snusnu: This is to coarse grained IMHO
<mbj> snusnu: The loader can respond to #call and return a "MappingState" object that supports #object and #identity
<snusnu> mbj: oh, i haven't looked at the loader code yet, i just like the name #call better for both #object and #tuple
<mbj> snusnu: Yeah, I'm only talking about the result of the load operation.
<mbj> snusnu: It should feature #identity and #object
<mbj> snusnu: how to construct this object, is "egal"
<mbj> sorry english speakers listening. Did not found an english subsitution for that "egal" in time.
<mbj> snusnu: I dont like that ducktrap DSO
<mbj> snusnu: DSL
<snusnu> substation?
<mbj> snusnu: what does that authenticate method do?
<mbj> snusnu: Why we have differend names?
<snusnu> mbj: i want it so that an app (a client of substation) can register dsl handlers by name, so #authenticate Authenticator would register an authentication handler in the chain
<snusnu> mbj: the actual chain handlers should be configurable by the clients
<snusnu> mbj: substation would never provide those
<snusnu> mbj: but it would allow you to register an authentication handler, and make it available with the #authenticate dsl method
<mbj> snusnu: IMHO this is to much.
<snusnu> mbj: i'd basically add a Chain::Builder object that supports registering different builders under a name, and then define methods with that name on some mutable Chain::Definition
<mbj> snusnu: Becuase they all just add stuff to the chain
<snusnu> mbj: the Chain::Definition then gets instance_eval'ed in the block passed to Chain.build
<mbj> snusnu: authenticate Foo, is just like add Foo, sanitize Foo is add Foo
lorenzo__ has joined #rom-rb
<mbj> snusnu: Why we need to complexify substaiton with a bunch of dsl methods that do the same
lorenzo_ has quit [Ping timeout: 252 seconds]
<snusnu> mbj: i'm tired of all those repetitive calls to new, and i want to reuse authenticator and authorizer as they're the same for the whole app
<snusnu> mbj: also, this could be a place to check wether the actual chain constructed is valid, i.e. it doesn't start with an outgoing handler, or doesn't register an incoming handler after an outgoing handler
<snusnu> mbj: also, i don't see too much complexification for substation, all i need is a builder and a definition instance .. substation never knows about the "content", or the names .. they're up to the user
<mbj> snusnu: I dont get it
<mbj> snusnu: I know substation dos not know the dsl names
<mbj> snusnu: But if I call Builder#authenticate or Builder#validate it just does the same.
<snusnu> mbj: not really, i mean, it provides the same interface, but internally, obviously you do different things .. it's really a matter of taste i guess … i thing validate Validators::NEW_PERSON is more beautiful than Validator.new(Validators::NEW_PERSON)
<snusnu> mbj: and as i said, most but not all of my actions need to authenticate and then authorize, some need no authorization step, and some need none of that … the authenticator and the authorizer are the same for all actions tho
<snusnu> mbj: so i don't want to consistently add them in front of the chain, or even "nest" a chain that does that, i just want to build *on top of it*
<snusnu> mbj: obviously, you would never have to use that dsl anyway
<mbj> snusnu: Ahhh
<mbj> snusnu: So you do validate Person, instead of add Validators::Person ?
<mbj> snusnu: "validate Person" vs "add Validators::Person" ?
<snusnu> mbj: not really, i don't do any namespace convention trickery
<snusnu> mbj: validate Person vs. Validator.new(Person)
<snusnu> mbj: imo naming the steps is more obvious than just appending to an array
<snusnu> mbj: with step "description" being "hidden" in the handler name
<snusnu> mbj: the block for #build gets instance eval'ed on a custom Definition instance that responds to instance methods defined by registering handlers you use in your app
<snusnu> mbj: eventually i want to provide substation-stack which provides handlers for ducktrap, vanguard and maybe mustache
<mbj> snusnu: Okay I got it!
<mbj> snusnu: Do it!
<mbj> snusnu: Sorry, I'm only spending a small fraction of my attention to our discussion.
<snusnu> mbj: heh ok, great
<solnic> snusnu, mbj: I think you need a substation channel (seriously)
jdsiegel has quit [Ping timeout: 256 seconds]
lorenzo__ has quit [Ping timeout: 246 seconds]
<mbj> solnic: Already? I did more mutation related talks here.
<solnic> mbj: oh mutant deserves its own channel even more!
<mbj> solnic: I'm swamped with channels!
lorenzo_ has joined #rom-rb
<solnic> mbj: I'm only in this one and dm :)
<solnic> BORING! ;)
<mbj> solnic: haha
<mbj> solnic, snusnu: BTW eurucamp did not replied about workshops jet :(
<solnic> mbj: that's ok
<solnic> mbj: hey I just pushed Loader#identity pls check it out
<solnic> snusnu: ^^
<mbj> solnic: Loader#identity(object) -> identity ?
<solnic> mbj: shit, no, Loader#identity(tuple) :D
<mbj> solnic: Or Loader.new(tuple, some_other_info).identity => identity
<solnic> actually no
<solnic> wait
<solnic> it's just Loader#identity
<solnic> oh just look at code
<solnic> it gets key values from the tuple
<mbj> solnic: yeah, sorry for causing more brain to irc to brain roundtrips than needed :D
<solnic> dumped should get it from the object
<solnic> or is it the other way around? O_o
<mbj> solnic: yeah
<mbj> this must be true:
<solnic> (gonna go for a walk, bbl but please comment on the pr so I know we're on the same page)
<mbj> loader(tuple).identity == dumper(object).identity
<solnic> ok so that's what I'm doing great!
<solnic> ok ttyl
<mbj> I'll come up with a nice shared spec in rom session
<mbj> That test this invariants
<mbj> (there are more!)
<snusnu> mbj, solnic: fwiw, i don't think a separate substation channel is needed atm
<mbj> snusnu: I agree
<mbj> snusnu: I'd dislike to see a dedicated mutant channel.
<mbj> snusnu: At this point!
<snusnu> mbj: do you think https://github.com/snusnu/substation-demo/blob/master/demo/web/processors.rb#L29 is generic enough to be pushed down to Substation::Chain::Outgoing module?
<snusnu> mbj: yeah, agreed
jdsiegel has joined #rom-rb
<snusnu> mbj: it kinda "enforces" the immutable paradigm, i.e. if handler writers actually call it :)
<mbj> snusnu: yeah
<mbj> snusnu: I'd push it.
<snusnu> mbj: ok good
zaidan has joined #rom-rb
<mbj> zaidan: hola
<mbj> zaidan: I saw your PR but did not had the time to review it.
<cored> I would love to have an object herarchy tree in some way
<mbj> cored: context?
<cored> mbj: for navigation
<cored> mbj: there's this method ValueObject.atrribute which calls super
<cored> I want to know which is the parent
<cored> it's looks like that happens in runtime
<mbj> cored: self.class.superclass does help you?
<cored> checking
<cored> I'm debuggin an issue with pry
<mbj> cored: instance.class.ancestors also helps a lot
<cored> this is quite weird
<cored> solnic: are you around?
<cored> mbj: maybe you have some knowledge on this
<cored> Virtus?
<cored> when I set attribute virtus is trying to extract a type, right?
<cored> so if I set something like attribute :name, String it will expect to use String
<cored> right ?
<mbj> cored: Depends if your input is coercilbe or not!
<mbj> Model.new(:name => Object.new) will not work.
<cored> what I get from this definition Hash[String => Integer]
<cored> is that the type will be a hash and the key value pair will be an string and int
<cored> right /
<cored> ?
splattael has quit [Quit: Leaving.]
<solnic> cored: right
<solnic> cored: as I said, there's a bug in ValueObject.attribute
<solnic> it extends THE TYPE with :writer => :private
<solnic> because of the dummy is_a?(Hash) check
<solnic> this should only kick in when args.size > 2
<solnic> it blindly does args.last if args.last is a hash which can happen when the type is hash
<solnic> it's a trivial fix
<cored> I added the sentinel there
<cored> it did not work
<cored> it's throws another exception in collection
<solnic> cored: say what?
<cored> line 26
<solnic> dooh
<solnic> lemme check
<cored> NotImplementError
<cored> which is weird, I was thinking on this
<cored> if I send the entire type
<cored> which is Hash and key pair String => Intenger
<cored> the type in attribute shouldn't be Hash ?
<cored> I get this there {String => Integer}
<cored> I though it shoul dbe type = hash, options = {string => integer}
<cored> don't know just guessing :-)
zekefast has joined #rom-rb
zekefast1 has quit [Read error: Connection reset by peer]
<solnic> well, I think this method is weird this this args hackery
<cored> it doesn't get inside the debuggins session
<cored> with attributes :metrics, Hash[String => Integer]
<cored> that's why it did not work args just have one item
<dkubb> good morning
<dkubb> ahh yeah, I think I mentioned something about that yesterday
<cored> dkubb: yes :-)
<cored> dkubb: morning
zad0xsis has joined #rom-rb
zad0xsis has left #rom-rb [#rom-rb]
<elskwid> cored is fighting the good fight!
<solnic> cored: sorry, just pushed the fix
<solnic> or maybe I didn't, forgot to pull prior making changes damn :D
<solnic> morning dkubb
<cored> elskwid: :-)
<cored> solnic: ok let me check the fix
<solnic> elskwid: btw there's a nice task to refactor value object so it can work with the equalizer gem instead of the mutable internal one
<elskwid> solnic: Oooh, sounds right up my alley!
<cored> elskwid: do you mind if we pair on that, I want to get a good grab on the entire thing?
<cored> solnic: I'm guessing this will lead to an public api change
<cored> solnic: attribute :metrics, Hash, [String => Integer]
<cored> ?
<elskwid> cored: Fine by me. I can be a half-decent tourguide I think. I still don't know all the bits, but I'm getting a handle on it.
<solnic> cored: huh? no, why? the api stays the same with my fix
<cored> solnic: if I include ValueObject to my class
<cored> isn't the attribute method that you change the first one the call hits?
<solnic> the problem was that this code assumed last arg to be options when it was a hash, and it can be a hash when it's a Hash[Foo => Bar] (<= this gets coerced to a hash after all)
<cored> I'm confunse
<solnic> cored: this is really simple man :)
<solnic> cored: attribute :foo, Hash[Integer => String] <== when you call this, then the arg number 2 becomes a hash instance
<solnic> the prev value object attribute method assumed that if the last arg is a hash instance then it's OPTIONS and it added :writer => :private to it
<cored> oh
<cored> I see
<solnic> which basically means :writer => :private was added to the second parameter representing TYPE
<cored> [] -> is a builder?
<solnic> Hash[] coerces input into a hash instance
<cored> I see
<cored> I did not see that implementation
<solnic> awesome :)
<cored> that's why I was kinda confuse
<cored> I'm trying to write an spec for this either way
<cored> I saw that you merge that with master
<solnic> yeah it was a simple fix so I just pushed it
<cored> I think it's ok to write an expect for the bug, what do you think?
<cored> s/expect/spec
<solnic> I tweaked unit spec so it blows up with prev implementation making sure I actually did fix the problenm
<solnic> elskwid: the coolest thing to do is to integrate with axiom-types, this would simplify a lot of stuff :) but it's A HUGE refactor
<mbj> elskwid: +1 for axiom-types!
<mbj> elskwid: And to patch them into coercible with inverse support
<elskwid> solnic: No refeactor is too big!
<mbj> elskwid: I failed to do this in the short time I had while I tried the last time!
<elskwid> (kidding)
<elskwid> *refactor
<cored> solnic: fair enough
<cored> so I leave it like that
<cored> elskwid: how can we do this?
<cored> do you use vim?
<elskwid> cored: I am actually an emacs user (fairly new) but we can figure something out. Even if we have to use Google Hangouts and just do pilot/co-pilot style is fine.
<elskwid> Especially if all you want to do is discuss what's going on.
<cored> elskwid: sounds good to me
<cored> I found this
<solnic> oh boy emacs and vim user pairing on stuff :D
<cored> you can use any editor
<cored> solnic: which means you are not an user of neither, right?
<elskwid> mbj: I'm keen to understand that idea of the inverse coercions. solnic mentioned them the other day. I haven't been around but I assume you mean if I write a coercer that knows how to make a string a boolean that it also knows how to take that boolean back to a string.
<solnic> no I'm a vimmer
<elskwid> mbj: (Does that sound right?)
<cored> solnic: wuju :-)
<cored> solnic: which are easily tackable bugs https://github.com/solnic/virtus/issues?labels=bug&state=open
<mbj> elskwid: coercion = coercer.from(::String).to(::Integer)
dkubb has quit [Quit: Linkinus - http://linkinus.com]
<mbj> elskwid: coercion.call('10') == 10
<mbj> elskwid: coercion.inverse.call(10) == '10'
<elskwid> mbj: Yep!
_whitelogger_ has joined #rom-rb
<mbj> elskwid: This would be the "perfect" interface for delegating all primitive coercions to ducktrap!
<mbj> elskwid: If we can also make it strict such as: coercion = coercer.from(::String, :only_decimal_notation).to(::Integer), I'd be "ueber happy".
<mbj> elskwid: So it would only accept decimal 123, but not hex input 0x10
<elskwid> mbj: Do you have some time this weekend to talk about ideas on how to implement? I can see I'll need some guidance but I should be able to get started with only a little bit.
<elskwid> I need to get started on "work" this morning.
<elskwid> heh
<elskwid> :(
<mbj> elskwid: Feel free to ping me
<mbj> elskwid: I had noumerous ideas that would *work*, but no not enough time to make them work.
<mbj> elskwid: So I'd love to offload ;)
<elskwid> mbj: And I'd love to help more!
<cored> it's solnic just went away
<cored> elskwid: and you are also leaving, for work, right?
<mbj> elskwid: I apprechiate your help! A lot.
<solnic> I'm here
<solnic> just in another window ;)
<mbj> elskwid: Building a whole ecosystem in this "rom-style" is a lot of efford.
<cored> solnic: oh did you see the list of issues ?
<cored> maybe you can point me on one that should be easy to solve
<elskwid> cored: Just getting started (I work from home)
<solnic> cored: ok lemme see :)
<cored> elskwid: I see, yes I work also from home :-P
<cored> elskwid: I'll be around for the pairing thing, meanwhile will try to work on another issue when solnic check the list
<solnic> cored: #170 should be easy to fix
<solnic> mbj: dude, I just pushed loader/dumper result objects eventually, can you take a look is that what session needs?
<solnic> mbj: it's almost identical to mbj-mapper now
<solnic> naming is a bit different
<cored> solnic: checking
<solnic> mbj: we still need to change rom-session a bit so it operates on rom's relations now instead of some "mappers"
<solnic> it needs to get relation from a registry and build a new instance injecting the specialized mapper
<solnic> mbj: so it seems like we could avoid db roundtrip if axiom had a way of injecting IM indexed with axiom keys
<solnic> so that it can check it before firing a query and return already loaded object
<mbj> solnic: sorry busy
<solnic> np
<mbj> solnic: Will check back later.
<solnic> sure sure
<mbj> solnic: But it "sounds" correct, if I open the code I'll get distracted again.
<solnic> mbj: looks like my recent commit with result objects makes no sense given that session excepts identity/object/tuple to be lazy loaded
<mbj> solnic: It does not expect this
<mbj> solnic: rom-session plays well with both, lazy and non lazy load.
<solnic> yes it does, you used memoize there
<solnic> memoize == lazy
<mbj> solnic: rom-session does not call #object if it finds object in identity_map
<solnic> well yeah and that's the thing
<solnic> it expects stuff to get returned when it asks for it
<mbj> solnic: Where is the problem?
<solnic> current code in rom-mapper doesn't work like that so I need to change it
<mbj> solnic: I cannot check it now. Sorry.
<mbj> I'll get distracted and fuckup my commercial stuff. (rom is interesting, this is a good sign)
<solnic> mbj: no worries, just loud thinking here, I will make it work easily
<solnic> mbj: pro tip: go offline
<mbj> solnic: haha we had this already
<mbj> solnic: I'm free to answer questions, the ones I can answer from cache
<solnic> lol what a nerd-like response :)
<mbj> solnic: With these I have control about my attention.
<solnic> kk
<mbj> But once I follow a cache miss, I get fucked.
zaidan has quit [Ping timeout: 240 seconds]
lorenzo_ has quit [Remote host closed the connection]
<solnic> mbj, snusnu: I merged header/dumper/loader in
<mbj> solnic: nice!
<solnic> I'll tweak rom-session to make it work with rom-mapper
<solnic> then I'll add various loading strategies, ideas how to do it are very much welcom
<solnic> s/welcom/welcome/
<mbj> solnic: Change what you need.
<mbj> solnic: rom-session works pretty well for me, but I expect we'll have to refactor it a lot.
<mbj> solnic: I expect we wrap the core of rom session inside a "statefull" mapper.
djsell has joined #rom-rb
theCrab has quit [Quit: Gone Forever!]
<cored> solnic: are you still there?
<solnic> cored: yes but busy
snusnu has quit [Quit: Leaving.]
<cored> just a quick question, I'm trying to figure out which is the spec that I have to check for this
<cored> it's weird that this just happens with Boolean
<solnic> cored: wait
<solnic> cored: oh actually no, it's not weird
<solnic> Boolean is the only "core" type w/o a corresponding ruby built-in class
<solnic> cored: look for const_missing spec
<solnic> and extract a shared spec from it
<solnic> then use it for both class and module cases
<cored> I have more or less a solution
<cored> don't know if it's correct
<cored> creating a PR
<solnic> cored: sure! send a PR even if it's not ready
<solnic> we can discuss there
<cored> great
<cored> if I add the number of the issue in the title will it reference the issue ?
snusnu has joined #rom-rb
<solnic> cored: I don't think so but who knows
<cored> tried did not work
<cored> there's the PR
<cored> hit me :-D
<solnic> cored: I wonder how and IF we should move it to a shared module between class_methods and module_extensions
<solnic> it's not nice to have 2 identical methods in 2 places :)
<solnic> I'm inclined to troll my own codebase and suggest adding common.rb file
<solnic> j/k
zaidan has joined #rom-rb
<cored> yes
<cored> I just wanted to make the spec pass
<cored> totally agree on that one
<cored> will work on the refactoring
<cored> Virtus::Common
<cored> probably where it should go is on extensions
<zaidan> mbj: ok np, will ask for new work after weekend.
<mbj> zaidan: nice!
<mbj> zaidan: I'll have time soon, in the last steps of porting mutant to whitequarks parser!
<zaidan> mbj: ok great!
zekefast has quit [Quit: Leaving.]
travis-ci has joined #rom-rb
<travis-ci> [travis-ci] mbj/mutant#325 (master - adc3e4a : Markus Schirp): The build was broken.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/mbj/mutant/builds/8096881
travis-ci has left #rom-rb [#rom-rb]
<mbj> solnic: Are you okay with mutant status change emails in this chan?
<solnic> well, I'd prefer to see here only projects with rom- prefix to be honest
<solnic> I mean in general I don't think I like travis notifications in irc
<mbj> solnic: I like them. A lot.
<solnic> it has very little value
<solnic> really?
<solnic> well ok
<solnic> if it helps you somehow
<solnic> let's just keep em
<mbj> also mutant?
<mbj> I'd dislike to force this on you.
<solnic> no worries
<solnic> it doesn't bother me that much
<mbj> okay
<cored> solnic: did the refactoring to remove duplication
<cored> let me know if it's ok I was thinking in adding it on Extensions but it's seems that's just for sharing behavior between instances and classes
<solnic> cored: yeah module names are a bit confusing I need to organize them in a better way
<solnic> it was really tricky to get it to work, once I made it I was too tired to improve the naming
<solnic> cored: oh dude you actually called that module "common" :) I was kidding with this. let's find it a better name
<solnic> mbj: you there?
<mbj> solnic: jo
<solnic> mbj: I want to torture you with session-related questions
<cored> solnic: :-P
<mbj> solnic: not a good moment
<cored> solnic: thinking
<solnic> mbj: damn ok
<mbj> solnic: I'm finishing porting mutant to parser
<mbj> solnic: This is open for month now
<solnic> mbj: ok!
<solnic> shutting up NOW
<mbj> solnic: And significantly delayed mutant
<solnic> :)
travis-ci has joined #rom-rb
<travis-ci> [travis-ci] Build details : http://travis-ci.org/rom-rb/rom-session/builds/8097339
<travis-ci> [travis-ci] rom-rb/rom-session#8 (master - 286cf6a : Piotr Solnica): The build was broken.
travis-ci has left #rom-rb [#rom-rb]
postmodern has joined #rom-rb
<mbj> postmodern: hola!
<mbj> postmodern: You should be happy about latest mutant activity
<mbj> postmodern: I'm very close to a 0.3 release!
<postmodern> mbj, excellent!
<mbj> postmodern: Lots of work ;) Especially the unparser part.
<solnic> mbj: I think we need a mutable session that builds its relations lazily when needed
<mbj> solnic: My session has a mutable core
<mbj> solnic: But I think i mix my and your session here.
<solnic> so once you do for example session[SomeModel] it will try to fetch relation for that model and if it's not there it will create a new one
<solnic> it would be silly to build all relations up-front
<solnic> way too much overhead
<solnic> well I'm talking about registry
<solnic> specifically
<solnic> ok gotta run
<solnic> ttyl
<mbj> solnic: got it.
solnic has quit [Quit: Leaving...]
<postmodern> mbj, how is unparser implemented? pure Ruby?
<postmodern> mbj, i remember we had some issues installing mutant-melbourne on windows
<mbj> postmodern: jo, just like parser.
<mbj> postmodern: parser is a pure ruby parser
<mbj> postmodern: Unparser walks the pure ruby ast to create equivalent source
<mbj> postmodern: Gave me lots of insight into ruby, writing this beast!
<postmodern> mbj, nice
<postmodern> mbj, ha, yeah i hate how it penalizes big constants
<postmodern> mbj, or many constants
<postmodern> mbj, is there a performance gain for freezing data?
<postmodern> mbj, at least on MRI?
<mbj> postmodern: Number of classes is significantly reduced in unparser
<postmodern> mbj, I know Rubinius hates freeze
<dbussink> freeze doesn't help performance wise anywhere afaik
<mbj> postmodern: The high number of classes in to_source is a direct problem from RBX ast is not designed to be used for anything else than rbx bytecode emitting.
<mbj> dbussink: Not to blame anyone!
<mbj> dbussink: BTW would you accept a bytecode emitter based on the whitequark parser ast?
<dbussink> mbj: well, given it would be as fast and as compatible as what we have now, we would likely seriously consider it
<dbussink> but both those criteria have been the main reason the parser works the way it works now
<mbj> I think I can make it compatible. But as fast, dunno.
<mbj> I think the emitter is not the bottleneck, have to benchmak the whitequark parser under rbx before I invest wasted time.
<dbussink> well, i know it's pretty poor atm because of racc
<dbussink> but they accepted a patch from me on racc in mri, so hopefully the gem will be updated soon as well
<mbj> nice
<mbj> What exactly was slow in racc, I never benchmarked it?
<dbussink> it was using RARRAY_PTR
<dbussink> which is really slow in rbx because of the semantics of it
<dbussink> having to rescan the array for objects having to go through the write barrier etc.
<mbj> I thought it was pure ruby! I mixed up the pure ruby output of racc.
<dbussink> well, the racc change made the parser gem tests run 10x faster
<dbussink> on rbx
<dbussink> but i haven't compared it with melbourne performance wise
<mbj> Okay, but the generated parser is "pure ruby"
<mbj> And this is the only thing to benchmark, if the build of rbx would be slower is not really an issue.
<dbussink> how do you mean?
<dbussink> well, the parser / byte code emitter are used for all ruby code compiling
<mbj> dbussink: yeah
<dbussink> so loading gems etc.
<mbj> my point is: the library racc is only needed at compile time
<dbussink> so that being slower would mean longer load times etc. that could be very significant
<mbj> not at run time
<dbussink> compile time of what? of the parser itself?
<mbj> yeah
<dbussink> ah ok
<dbussink> well, to measure is to know basically :)
<mbj> So if you speak about racc (the lib) uses RARRAY_PTR and speeded up the parser tests, it does not speak about the speed of the generated parser.
<mbj> Because the parser tests obviousely build the parser ;)
<mbj> I'll benchmark it in my spare time. Running it through rubinius/**/*.rb
<mbj> via melbourne than via whitequark/parser
<mbj> If there is a significant slowdown I'll not invest time.
<dbussink> right
<dbussink> well, even then it would be interesting to see how the rubinius jit performs on it
<mbj> Yeah!
<mbj> The generated file "looks" as a perfect target for a JIT.
<mbj> But dunno if there is "JIT poison" inside the generated parser.
<mbj> dbussink: From my understanding of the RBX jit the only concern is the size of the tables? https://gist.github.com/mbj/5784976
<dbussink> well, i wonder whether that table can't be just staticly created or is it too big then?
<mbj> tbh dunno
<dbussink> but again, benchmarks would probably show :)
<mbj> dbussink: I have to run, I'll benchmark it later
<dbussink> what exactly is problematic
<dbussink> ok, ttyl!
<dbussink> if you have questions, let me know!
<mbj> would love to build a rbx compatible bytecode emitter
<mbj> If I'm able to write an unparser to ruby code, I should be able to emit "far easier" bytecode ;)
mbj has quit [Quit: leaving]
cored has quit [Ping timeout: 264 seconds]
zaidan has quit [Quit: leaving]
mbj has joined #rom-rb
{aaron} has joined #rom-rb
<{aaron}> hey, is there a new channel for #veritas (axiom) or is this it?
<postmodern> this would be it
<{aaron}> cool. gotta run now but back w/ a question later. looks like axiom made a change that is freezing object hierarchies
<mbj> {aaron}: We have a library that deep freezes objet trees
<mbj> {aaron}: This library is called adamantium, I'd consider it a bug if the "freezing leakes outside the axiom namespace".
<mbj> I'm going to sleep now. Back in 9-10 hours :D
mbj has quit [Quit: leaving]
<postmodern> what's the difference between ice_nine and adamantium?