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
skade has quit [Read error: Connection reset by peer]
skade has joined #rom-rb
skade has quit [Read error: Connection reset by peer]
mbj has quit [Ping timeout: 240 seconds]
mbj has joined #rom-rb
skade has joined #rom-rb
snusnu has joined #rom-rb
snusnu has quit [Client Quit]
skade has quit [Quit: Computer has gone to sleep.]
rikai has quit [Ping timeout: 240 seconds]
rikai has joined #rom-rb
rikai has joined #rom-rb
rikai has quit [Changing host]
rikai has quit [Read error: Connection reset by peer]
rikai has joined #rom-rb
rikai has quit [Changing host]
rikai has joined #rom-rb
mbj has quit [Ping timeout: 264 seconds]
skade has joined #rom-rb
skade has quit [Quit: Computer has gone to sleep.]
avdi has quit [Ping timeout: 245 seconds]
skade has joined #rom-rb
postmodern has joined #rom-rb
solnic has joined #rom-rb
skade has quit [Quit: Computer has gone to sleep.]
skade has joined #rom-rb
skade has quit [Quit: Computer has gone to sleep.]
skade has joined #rom-rb
avdi has joined #rom-rb
skade has quit [Quit: Computer has gone to sleep.]
skade has joined #rom-rb
skade has quit [Ping timeout: 265 seconds]
skade has joined #rom-rb
skade has quit [Quit: Computer has gone to sleep.]
postmodern has quit [Quit: Leaving]
skade has joined #rom-rb
mbj has joined #rom-rb
<mbj> solnic: seems you have some fun with morpher ;)
<solnic> mbj: yeah, it worked flawlessly
<solnic> mbj: I was only a little confused about domain::param, I build it now explicitly using class interface
<solnic> are you planning to add an emitter for this thing?
<mbj> solnic: yeah
<mbj> solnic: We'll have an AST node compiling to a Transformer::Domain::Param instance
<mbj> solnic: I simply did not have the time yesterday to add this one.
<mbj> s(:domain, Foo, [ :list, :of, :ivars])
<mbj> Thats the first idea.
<mbj> It'll probably clean up once I write it down.
<solnic> mbj: that's what I thought
<solnic> I could try adding it if you don't have time
<mbj> solnic: And yes I the object interface is the only interface you can "currently" use.
<mbj> solnic: I'll add a special node that allows you to place a "precompiled" evaluator into an ast.
<solnic> but first I want to add support for wrap/unwrap via morpher
<mbj> solnic: should be really easy
<mbj> solnic: We probably have to add some nodes that deal with Axiom::Tuples
<solnic> so far it just works
<mbj> cool
<solnic> why do you think we're gonna need something special?
<mbj> I think we can have an optimizer that collapses generic morpher nodes like a pair of axiom tuple to domain objects with null transformations in between into a very easy node.
<mbj> But thats later.
<mbj> solnic: BTW that rspec style you critized allowed me to get full mutaiton coverage for the new loaders / dumpers very fast.
<solnic> I would still vote for simplifying that huge shared examples file
<solnic> it is really complex man, can't argue with that I think
<solnic> but I agree that it does speed up development
<mbj> solnic: haha
<mbj> solnic: I'd never keep the file as is.
<solnic> btw I started adding those domain loaders already yesterday, didn't know you're gonna tackle it
<solnic> so I already had ivar thingie locally done :)
<mbj> solnic: The file is just from spiking.
<mbj> solnic: Sorry I invalidated your local work.
<mbj> solnic: I just had an implementation idea and I wanted to see how it worked out.
<mbj> solnic: Using a special object for param made lots of sense.
<mbj> solnic: And once this worked I just created all the missing loaders.
<mbj> solnic: I'm gonna do an additional pass over the code today to simplify it a bit.
<mbj> solnic: I think the attr writer, ivar loaders can share lots of code.
<mbj> solnic: I really like the idea of the AST as IR.
<mbj> If you get the AST "right" I can change the object layer as much as I want.
<mbj> For such algebra stuff I think the AST is the perfect IR.
<mbj> This is NOT true for all domains.
<mbj> I expect dealing with axiom integration will also be a lot of easier once we have an AST representation.
<solnic> I completely agree
<solnic> building up an ast is so much easier than messing around with a class interface
<solnic> I'm pretty sure adding wrap/unwrap support will be trivial
<solnic> I'm gonna do it probably today
skade has quit [Quit: Computer has gone to sleep.]
<solnic> mbj: how about bloggin about morpher once integration is done? :)
<mbj> solnic: Its your blog ;)
<mbj> solnic: Ping me if you wanna have my input for your post. Just like we did on the mutant one.
<mbj> solnic: But this time we'll test better ;)
<solnic> mbj: yeah examples are always the hardest part
<solnic> I asked because I dunno if it's maybe too early
<mbj> solnic: Also morpher has many times of dimensions you can show
<mbj> input-filter, mapping, transitivity, evaluator with history
<mbj> Maybe it needs a series of posts.
<solnic> this is an exciting project and I like to tell people how we integrated it within rom
<solnic> yeah I'd give an intro to morpher, a generic one
<solnic> not rom-specific
<solnic> and mention that it's used by rom
<solnic> and show how
<mbj> solnic: Morphers primary "building" API is s expressions
<mbj> solnic: I think this will distract people, because they dont get these are used for IR,
<mbj> And the AST needs some explicitness
<mbj> For example wrapping stuff in an s(:block, ...) if you need multiple steps at the same level.
<mbj> So eighter this needs to be carefully explained, or somehow hidden.
<mbj> solnic: You might be interested in rake morpher:list
<mbj> It outputs a nice table that gets reflected from the internal datastructures.
skade has joined #rom-rb
<solnic> mbj: yeah I'll think about it
skade has quit [Quit: Computer has gone to sleep.]
mbj has quit [Ping timeout: 264 seconds]
skade has joined #rom-rb
skade has quit [Quit: Computer has gone to sleep.]
mbj has joined #rom-rb
mbj has quit [Client Quit]
skade has joined #rom-rb
mbj has joined #rom-rb
<solnic> mbj: thanks to you I'm reading about Julia now
<solnic> looks interesting
<mbj> solnic: yeah
<mbj> solnic: After I learned rust is on an LLVM fork, I'm a bit distracted from it.
<mbj> solnic: And julia looks more "flexible".
<mbj> solnic: BTW I think I'm gonna stop evaluating languages by stuff like, abstract, functional, precompiled, jitted, ...
<mbj> solnic: I'll focus on available tooling, or the possiblity to write tooling because good AST is available ;)
<mbj> solnic: I consider my "core tools", are easily portable to another language.
<solnic> mbj: anima uses equalizer by default right>
<solnic> ?
<mbj> solnic: yeah
<mbj> solnic: such as concord
<mbj> solnic: IMHO a good decision.
skade has quit [Quit: Computer has gone to sleep.]
<solnic> mbj: just so you know my talk has anima and morpher in the examples :)
<mbj> solnic: nice
<mbj> solnic: virtus = anima + morpher + DSL
<mbj> solnic: At least I think so ;)
<mbj> solnic: Still need to update my talk.
<mbj> solnic: I expect to do a FAR better talk than my eurucamp one.
<mbj> solnic: I did so much talks in the meantime, local usergroups, customers, workshops etc.
<mbj> So at least from the stress level I should be able to present in a way more conversions are possible.
<mbj> solnic: Lets share slides before to correct each other?
<mbj> solnic: back later, gonna work on my 2nd job now: "Family taxi driver" ....
<solnic> mbj: re virtus: correct!
skade has joined #rom-rb
mbj has quit [Quit: leaving]
gakelev has joined #rom-rb
gakelev has quit [Read error: Connection reset by peer]
mbj has joined #rom-rb
<solnic> mbj: psst :load_attributes_hash => :load_attribute_hash
<solnic> the latter sounds better in english
<mbj> solnic: yeah
<mbj> solnic: you PR or push to master, both is okay
<mbj> ?
<mbj> I can also do it if you are busy.
<solnic> working on my talk right now
<solnic> but I can rename later
<mbj> I'm workon on morpher right now, I'll address it.
<mbj> 0.3 will be released today
lgierth has joined #rom-rb
netguard has joined #rom-rb
lgierth has quit [Remote host closed the connection]
lgierth has joined #rom-rb
onewheelskyward has joined #rom-rb
onewheelskyward has quit [*.net *.split]
netguard has quit [Remote host closed the connection]
skade has quit [Quit: Textual IRC Client: www.textualapp.com]
onewheelskyward has joined #rom-rb
scouts has joined #rom-rb
<mbj> solnic: morpher-0.3.0 got released has ast syntax for domain params.
<mbj> solnic: s(:param, Model, :the, :attributes, :here)
<solnic> mbj: great!
<solnic> mbj: this weekend is full of awesome. amazing progress with morpher, integration in rom, microrb.com goes live, sweeeet
<mbj> solnic: heh, you sound motivated ;)
<solnic> yeah
<solnic> but tired, so, good night :)
<mbj> solnic: ttyl
snusnu has joined #rom-rb
<snusnu> hey guys
mbj has quit [Read error: Connection reset by peer]
<snusnu> mbj, solnic: ping
mbj has joined #rom-rb
<snusnu> mbj: yo
<mbj> snusnu: hi
<mbj> snusnu: my machine just rebooted, forgot the plug ;)
<mbj> snusnu: We did some progress on the morpher front.
<snusnu> mbj, solnic: i have a working implementation of a mapper with morpher :p
<snusnu> gimme a sec, i'll show you what it can do
<lgierth> ohai, while somebody's here: i've been working on non-ruby things for some time, so i'm flying under radar at the moment when it comes to httpkit, devtools, and mutant
<lgierth> i haven't forgotten you :)
<lgierth> let me know if you want to give it a try, i'll hook you up with peering for hyperboria (the development network)
<mbj> lgierth: interesting
<snusnu> mbj, solnic: http://pastie.org/8901897
<snusnu> all this works
<mbj> lgierth: I dont have the time now. But I'll come back later.
<lgierth> sure, cool
<snusnu> i just have it hidden in my subway repo, will update it from morpher 0.1.0 to 0.2.0 in a few minutes, and push it
<snusnu> serious shit ...
<snusnu> :p
<mbj> snusnu: k
<mbj> snusnu: I got some serious advances in morpher internals
<snusnu> i've seen them, very nice
<mbj> snusnu: I really like the new flow.
<snusnu> my stuff works with 0.1.0 already, just need a few minor fixes for 0.2.0
<mbj> Target 0.3 please ;)
<snusnu> i target master
<snusnu> i use this stuff in our app
<snusnu> :p
<mbj> snusnu: Dont target master, I do shifted semver releases.
<mbj> snusnu: master can break any time.
<snusnu> mbj: that's alright
<snusnu> i don't bundle update every day ,)
<mbj> hah
<snusnu> mbj: tell me tho, wdyt of the api?
<mbj> snusnu: Seems you actually like morpher ;)
<mbj> snusnu: Still reading, you know I'm bad in evaluating DSLs. Because I'm a bad DSL user.
<mbj> s/user/author/
<snusnu> no worries dude, there's little dsl anyway, it's mainly about generating models, morphers and mappers (encapsulated by entities) from the simple dsl with infinitely nestable wrap/group
<snusnu> there's also 2 ways to wrap/group .. one, which references another registered entity, and another, which generates an "anonymous" entitly "inline"
<snusnu> i currently use this stuff to do the parameter mapping, thus, for all of my transient entities
<mbj> yeah
<mbj> Using it for parameter mapping is a really good use case.
<mbj> I'm still planning to reject extra keys in a hash.
<snusnu> the nice thing is, it finally puts the model definition where it belongs imo, *outside* of an actual entity
<mbj> But this will be an optional node.
<mbj> !
<snusnu> yeah, rejecting extra keys sounds feasible
<snusnu> mbj: btw, there's no real way to make s(:merge, …) inversible, right?
<mbj> snusnu: I had some ideas. But I'm to undersugared to remember.
<snusnu> mbj: it boils down to comparing merge params with original input
<snusnu> i think
<snusnu> the thing with current irreversible :merge is, that it makes it impossible to define mappers with default values
<mbj> snusnu: You could just remove the merged in params, in case the input is the merged value.
<snusnu> yeah, and if it's different, leave it alone
<mbj> yeah
<snusnu> good, i needed that doublecheck
<snusnu> maybe i'll get around to doing it at some point, altho it'd be cool if you could squeeze in a few minutes, given your latest sprints on morpher ;)
<mbj> haha
<snusnu> i'll keep on polishing my mapper
<snusnu> :p
<snusnu> promise
<mbj> Its goooood to do some demanding OSS
<mbj> I have two clients, one forces me to do monkey work.
<snusnu> :/
<mbj> That one consumes all my coding enthusiasm.
<mbj> So doing some demanding OSS work actually frees my mind up.
<snusnu> the call to .model ???
<snusnu> it broke my codes
<mbj> snusnu: heh
<snusnu> ;)
<mbj> snusnu: s(:attributes_hash, s(:param, Model))
<snusnu> ahh!
<snusnu> thx
<mbj> snusnu: The other loaders require more knowlege
<mbj> snusnu: The other domain specific transformers to be explicity
<mbj> *explicit
<mbj> snusnu: for example the attribute accessor one needs the attributes: s(:attribute_accessors, s(:param, Model, :here, :come, :the, :attribute, :names))
<mbj> snusnu: Its in the changelog BTW ;)
<snusnu> mbj: sweet, fixed! i even saw it, but didn't think of it
<snusnu> mbj: btw, pastie again with output: http://pastie.org/8901939
<mbj> snusnu: nice
<mbj> snusnu: We need to tune the pretty printer a bit.
<mbj> snusnu: Still lots of noise.
<mbj> snusnu: I thought about removing the redundant "Morpher::" prefix
<mbj> snusnu: and/or providing a one line error reference such as input[0]["foo"]["bar"]["10"] guard failure ;)
<snusnu> mbj: yeah, the output can be tuned for sure
<snusnu> it's not only about the printer tho, we need a nice/standard way to consume/transform it
<mbj> yeah
<snusnu> i dunno if you saw what i did with type-checks/coercions and validations in the DSL .. they're completely extensible, built on morpher transformers
<mbj> the problem is there are error cases a one line representation is NOT possible.
<mbj> Because the error might result after a successful transformation
<mbj> *that alters the type structure
<snusnu> so yeah, i fully imagine to be able to coerce and validate an entity, therefore, i need ways to get back at different error formats
<mbj> snusnu: I separete into "input format" specific errors, and "domain errors"
<mbj> snusnu: For domain errors I'll put "named predicates" into the tree allowing us to receive unique identifiers for rule violations.
<mbj> s(:guard, s(:name, :foo, s(:original_predicate_here)))
<mbj> So you just scan for guard violations, and can receive the name of the violation. To use this for generating violation error messages that are domain specific.
<mbj> I'd NOT put that named nodes inside the transformer stages.
<mbj> Because I think we should not do domain validations here.
<snusnu> we'll see, if it's simply about associating coercions and predicates with an entity blueprint, i'm fine with doing it in one stage i guess
<snusnu> we'll see ...
<mbj> snusnu: IMHO it should conceptually be two steps.
<mbj> snusnu: Remember morpher stops on first error.
<mbj> snusnu: Never process business logic before fully parsing your input.
dkubb has joined #rom-rb
<dkubb> good afternoon
<snusnu> mbj: good point
<snusnu> dkubb: hey
<snusnu> mbj: that's the code that powers the pastie
<snusnu> dkubb: fyi, the above link is a rom-mapper spike on morpher, that supports http://pastie.org/8901939
<mbj> dkubb: hello
<snusnu> mbj: here you can see how i use the morpher coercions/predicates to do coercion/validation .. the "_" param represents the injected context (a hash of options passed to #map, #wrap or #group)
<snusnu> mbj: btw, your last point, never process business logic before fully parsing input, is of course true, but i don't see how doing a sanitization/coercion/validation process in "one go" violates that, internally it'd be 3 steps anyway .. and of course it happens before business logic
<mbj> snusnu: k
<mbj> dkubb: BTW you are free to fsck anything in Morpher::Evaluator::**::* namespace.
<dkubb> if you want
<mbj> yeah
<dkubb> this is going to be hard, you know most of my tricks
<dkubb> mbj: I've seen you make "synthetic variables" like https://github.com/mbj/morpher/blob/master/lib/morpher/evaluator/unary.rb#L78 before.. is there any specific reason you do this?
<mbj> dkubb: no, These are refactoring leftovers.
<dkubb> ahh ok
<mbj> dkubb: gonna nuke them.
<mbj> dkubb: Actually that whole self.build is dead code!
<mbj> dkubb: I pushed all the AST handling to the Compiler namespace.
<mbj> mom
<dkubb> mbj: why the distinction between binary and nary operators? why not one or the other, since one can be used to model the other
<mbj> dkubb: I think for predicates I'll end up only using binary evaluators, but for transformers binary evaluators modelling narity would just blow up the evaluation tree.
<dkubb> I guess it depends on how many nodes you join together
<mbj> dkubb: So the only nary node I currently have is s(:block, transform_a, transform_b, ....)
<dkubb> I find binary much easier to optimize
<mbj> dkubb: this, by definition, is modelling a sequence of transformations.
<mbj> Using binary would be possible but make debugging / understanding of evaluation trees infinitely harder.
<snusnu> ok guys, i have to go, cu around, comments on the mapper code are most welcome
<mbj> s(:chain, transform_a, s(:chain, transform_b, s(:chain, transform_c, transform_d)))
<mbj> Is many times more uneasy to understand than s(:block, transform_a, transform_b, transform_c, transform_d)
<mbj> dkubb: You could see the nary nodes an optimiztion of the binary ones. Like an unrolled loop compilers emit.
<mbj> snusnu: I just commented ;)
<dkubb> mbj: in my case, with axiom, I could probably only use an nary operator if the nodes were homogenous
<dkubb> mbj: otherwise everytime I go to evaluate or transform them I'd have to break them up anyway, and it'd get messy
<mbj> dkubb: yeah I see
<mbj> dkubb: It would be easy to change if we need to.
<mbj> dkubb: s(:block, could be captured by the preprocessor and get transformed to a chain of s(:binary_block_equivalent)
cored has joined #rom-rb
cored has joined #rom-rb
<dkubb> mbj: keep in mind I have no idea how morpher works yet, so most of my comments will probably be surface level
<dkubb> I'm not much better than a code metrics tool until I understand how everything fits together :)
<mbj> dkubb: But you are the best code metric tool around.
snusnu has quit [Quit: Leaving.]
<dkubb> thanks :D
<mbj> dkubb: just flag that simplest form of block pass withoout explanation
<dkubb> heh
<dkubb> I'm going to log off for now, but I'll bbl
<mbj> dkubb: I know and agree with them. But I miss them reglulary
<mbj> dkubb: have fun and thx!
dkubb has quit [Quit: Linkinus - http://linkinus.com]
mbj has quit [Ping timeout: 265 seconds]