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
tumdedum has quit [Ping timeout: 264 seconds]
skade has joined #rom-rb
tumdedum has joined #rom-rb
skade has quit [Quit: Computer has gone to sleep.]
CraigBuchek has quit [Quit: Leaving.]
lgierth has quit [Quit: Ex-Chat]
cored has quit [Ping timeout: 264 seconds]
cored has joined #rom-rb
cored has quit [Ping timeout: 240 seconds]
cobbr2 has quit [Ping timeout: 264 seconds]
rikai_ has quit [Ping timeout: 240 seconds]
rikai has joined #rom-rb
rikai has joined #rom-rb
rikai has quit [Changing host]
tchegodaev has quit [Remote host closed the connection]
rikai has quit [Ping timeout: 244 seconds]
rikai has joined #rom-rb
rikai has joined #rom-rb
rikai has quit [Changing host]
solnic has quit [Read error: Connection reset by peer]
solnic has joined #rom-rb
skade has joined #rom-rb
kalleth_ has joined #rom-rb
onewheelskyward has quit [*.net *.split]
kalleth has quit [*.net *.split]
postmodern has quit [Quit: Leaving]
skade has quit [Quit: Computer has gone to sleep.]
cored has joined #rom-rb
cored has joined #rom-rb
mcls has joined #rom-rb
mcls has quit [Client Quit]
skade has joined #rom-rb
skade has quit [Quit: Computer has gone to sleep.]
cored has quit [Ping timeout: 240 seconds]
skade has joined #rom-rb
lgierth 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
lgierth has quit [Quit: Ex-Chat]
tumdedum has joined #rom-rb
tumdedum has quit [Changing host]
skade has quit [Quit: Computer has gone to sleep.]
shashko has joined #rom-rb
skade has joined #rom-rb
mbj has joined #rom-rb
<mbj> solnic: hola
shashko has quit [Remote host closed the connection]
<solnic> mbj: hola
<mbj> solnic: I have some time for OSS now.
<mbj> solnic: Gonna address your "keep as string" stuff soon.
<mbj> solnic: Actually you can do this NOW without any changes, but it would not be as nice.
<solnic> mbj: that's awesome
<solnic> mbj: I already figured it out, like you said - key_fetch followed by key_dump
<solnic> can be simplified for sure
<mbj> solnic: Since the idea of the AST as IR allows us to have "hignlevel" nodes that decouple internas from the IR.
<solnic> IR?
<mbj> IR = Intermediate Representation, compiler speetch
<solnic> I keep forgetting that abbreviation
<solnic> thanks
<mbj> You'll see me mentioning this abbrev multiple times soon.
<mbj> I have some code that compiles axiom relations to LLVM IR, allowing to generate some *potential very fast* in memory operations.
<mbj> But this requires to represent the tuple via some more generic structure than ruby objects.
<mbj> I had something working once, need to polish it a lot. Was a demo for a data-cruching-job.
<mbj> Where customer wanted to have "highlevel language" but "low level speed".
<mbj> The work itself is commercial, dunno if its actually in use.
<mbj> But I'll redo an OSS version if I have the time ;)
<mbj> solnic: Thats an interesting question anyhow, if I solve a solution under commercial license, but my brain keeps the implementation details in mind. And I just write it down a better time => Is this a contract / NDA violation?
<solnic> mbj: depends on your contract
<mbj> solnic: heh
<mbj> solnic: I think that nobody "owns" my thoughts.
<mbj> solnic: Only the "serialized version" :D
lgierth has joined #rom-rb
<mbj> solnic: And yeah unparser has a pretty "narrow" interface: Unparser.unparse(ast) => String ;)
<solnic> yeah it does just one thing
<mbj> solnic: I just pushed a nice cleanup that fixes the Nullary vs Parameterized stuff.
<solnic> mbj: btw I'm not sure why we're doing this but "class Foo < self" is not cool
<solnic> makes it harder to read stuff
<solnic> something I never thought about before I started reading morpher which was a completely new code base for me
<mbj> solnic: Its far easier for refactoring.
<solnic> ??
<mbj> solnic: I tend not to think about contribs when writing code. You know. I want to have an accessible code base for myself.
<solnic> you mean, your mass-replace will be a bit faster? :D
<mbj> solnic: no
<mbj> class Foo
<mbj> class Bar < self
<mbj> end
<mbj> end
<mbj> If I need to push Bar deeper maybe inside Baz
<mbj> I dont need to track the superclass change in brain.
<solnic> ugh ;)
<solnic> well, ok
<mbj> So that self can be deferenced with looking one line up
<mbj> I tend to write code in "minimal terminal duplication" style
<mbj> class Foo
<mbj> class Bar < Foo
<mbj> end
<mbj> end
<mbj> Is "terminal" duplication ;) # for me
<solnic> that's weird but ok
<mbj> solnic: I'm gonna add a mutation to transform class Foo < Bar; end into class Foo < self; end
<solnic> why?
<mbj> solnic: Because s(:self) is a far simpler ast than s(:const nil, :Bar)
<mbj> but this will be added in around 30 years when mutant can mutate "Boot time code".
<solnic> Foo < Bar is far simpler for human brain though :P
<mbj> we do not have to discuss this *now* because mutant cannot mutate boot time code ;)
<mbj> solnic: Do you see what I mean with "boot time code" ?
<solnic> yeah I think so - code that gets loaded prior being run
<solnic> like, reading class body etc
<solnic> I mean, it is being run when it is being read in ruby :)
<solnic> but yeah, I know what you mean with "booting"
<mbj> Lets describe it as: Code that gets executed before mutant finds subjects to mutate.
<solnic> right
<mbj> So I cannot change certain structures inside the VM once they got created.
<solnic> meta question - don't you think that your future-self will appreciate code that's just easier to read?
<mbj> solnic: Code without terminal duplication is easier to read.
<mbj> *for my self
<mbj> Less noise.
<solnic> no, not in this case "Foo < self" requires you to go and look to see what self is
<mbj> Its by definition alwasys the namespace.
<mbj> Where Foo is in.
<solnic> and it's not always "right up there above"
<mbj> For my code it is.
<solnic> no it's not :D
<mbj> show me
<solnic> see SymbolizeKey
<solnic> I had to scroll up and up to see the superclass
<solnic> oh btw, why it's key_fetch and then symbolize_key?
<mbj> because there are multiple child classes in the same file
<mbj> But all the < self in this calss point to the same superclass
<mbj> Its quite easy to track for me.
<solnic> sure, you wrote it, just recently
<mbj> solnic: And the whole preprocessor is just "unfinished"
<solnic> blah, ok nevermind
<mbj> solnic: Only the Morpher::Evaluator** namepsace is actually "how it should be"
<solnic> so, why not key_symbolize and key_fetch or fetch_key and symbolize_key?
<mbj> because I never thought about that improvement
<mbj> good point
<solnic> oh I see
<mbj> lets do it
<solnic> yeah I tried fetch_key after seeing symbolize_key and was surprised it didn't work :)
<solnic> small glitches
<solnic> I can rename it if you want
<mbj> yeah pls PR
<solnic> ok will do later today
<solnic> need food now, bbiab
<mbj> solnic: You can also have push access of you want. But dont push to master apart from obvious stuff such as spelling errors crashes because of a bad commit etc.
<mbj> solnic: But dont rework stuff you think I might disagree, I think you know what I mean ;)
<mbj> solnic: BTW I'm about to write a script that prints a table of all nodes and their roles ;)
<solnic> sure
<solnic> that would speed up things
<solnic> I wouldn't push anything without discussing it with you btw
<mbj> solnic: push to your feature branches as much as you like.
piatcha has joined #rom-rb
<solnic> mbj: thanks
<mbj> solnic: Just did the rename
<mbj> solnic: And some more cleanups
<solnic> mbj: that DRYup you just did, I'm not sure if it's a good idea, you added additional complexity and probably slowed things down due to public_send
<solnic> also, no need to use public_send given that both methods *are* public
<mbj> solnic: "* Uses a style some people might not agree with" I was very close to write @solnic would not agree with ;)
<mbj> solnic: This is NOT final. but its better than before.
<mbj> solnic: Because I just moved the duplication and uglyness into one file.
<solnic> yeah haha
<mbj> solnic: Its easier to spot now.
<mbj> solnic: I give a fuck about speed at this point.
<solnic> yeah I get that
<solnic> there's a nice thread about DRY on RR parley
<mbj> solnic: There are lots of better options, I'm just thinking them up.
<solnic> ok cool
<mbj> solnic: But in the meantime it was better to push each small improvement.
<solnic> I just hope you didn't do it because of flay ;)
<mbj> nah
<mbj> flay just helped me to spot a cross file uglyness
<solnic> mbj: if you remove that overridden node constructor I'll be able to test it against rom
<solnic> (I have it changed locally for the time being)
<mbj> solnic: moment
<mbj> solnic: done
<solnic> awesome
<solnic> mbj: ok specs are passing
<mbj> solnic: you now have the s(:key, operation_on_value_here) AST node.
<mbj> (in case you use master)
<mbj> I'll path through they key unaffected.
piatcha has quit [Remote host closed the connection]
skade has quit [Ping timeout: 240 seconds]
<solnic> mbj: lol I didn't open the PR on purpose but let's keep it
<mbj> solnic: oha, sorry
<mbj> solnic: I just thought you forgot.
skade has joined #rom-rb
solnic has quit [Read error: Connection reset by peer]
solnic has joined #rom-rb
<solnic> mbj: no, this branch is a very early wip
<mbj> solnic: So lets remove PR
<mbj> solnic: To reduce noise.
<solnic> I should have some more close to complete once we have those alternative ways of loading objects in morpher
<solnic> I'll work on that too
<mbj> solnic: I have some ideas
<solnic> ok?
<mbj> solnic: The relationship between "load method" and "dump method" must be explicit.
<mbj> because you might have an object that gets loaded via attribute hash, but dumped via ivars
<mbj> or vice versa
<mbj> So for the first version we'll make it symetric.
<solnic> well we need to establish very specific contracts here
<mbj> So if you initialize via attribute hash (keys as symbol) you expect #to_h for dumping.
<solnic> exactly :)
<solnic> this is how anima works now
<mbj> Or if you initialize via allocate + instance_variable_set, you expect to dump via instance_variable_get
<solnic> and virtus objects
<solnic> yep
<mbj> This is enough for 99% of the cases we need "now"
<solnic> and with writers you need to use readers
<mbj> yeah
<solnic> yep sounds like a plan!
<mbj> So we need to find "names" for them.
<solnic> the hard part
<mbj> load_attributes_hash, dump_attributes_hash
<mbj> load_instance_variables, dump_instance_variables
<mbj> load_writers, dump_writers
<mbj> all are nullary nodes
<mbj> but take params
<mbj> And we have to agree on what data format must be on the stack
<mbj> I think the morpher internal representation prior to loading is #fetch(attribute_name)
<mbj> And after dumping we expect { :attribute_name => value }
<solnic> yeah I actually like that
<solnic> those are very explicit names
<solnic> what about class names?
<mbj> fuck class names, they are internal
<mbj> Just soue A, B, C to start ;)
<solnic> well, still need to have some names
<mbj> I'd just camelize them
<solnic> I'll start with whatever then
<solnic> exaclty
<solnic> hehe
<mbj> for now, and once I see them in code I'd have an idea
kzenit has joined #rom-rb
skade has quit [Read error: Connection reset by peer]
kzenit has quit [Remote host closed the connection]
skade has joined #rom-rb
dereny has joined #rom-rb
<solnic> mbj: s(:instance_variables_set, :list, :of, :ivar, :names) <== does this make sense?
<mbj> solnic: I thought we could just use the key value pairs from the value on the stack
<mbj> solnic: And I'd prefix all "loaders" with load
<mbj> solnic: And all dumpers with dump
<solnic> ugh, right, I suffixed them
<solnic> instance_variable_load / dump
<solnic> because there's anima_load
<solnic> so it's suffixed
<solnic> I followed that convetion
<solnic> so, you prefer a prefix?
<solnic> prefix sounds more natural
<solnic> dump_stuff / load_stuff
<solnic> looks good
<mbj> yeah
<mbj> lest prefix
<mbj> *lets prefix
<mbj> solnic: Remember morpher is "very new"
<mbj> You can question everything in it ;)
<mbj> Just preparing a very nice refactoring that moves all AST logic (apart from node naming) out of the Morpher::Evaluator
<mbj> *namespace
<solnic> nice :)
<mbj> solnic: Basically I removed all extend ClassMethods from my code.
<mbj> solnic: These are a smell, if you singleton needs to be patched dynamically you are doing sth wrong.
<solnic> yeah I'm avoiding class methods in general these days :)
<solnic> anyhow, I gotta call it a day a chill out a bit
<solnic> I'll work on those new loaders/dumpers tomorrow, I think I'm on the right track
<solnic> good night!
<mbj> solnic: I may pushe these tonight.
<mbj> solnic: Just preparing some nice infrastucuture.
<mbj> solnic: My latest push reduced the public interface of Morpher::Evaluator**::*
<mbj> solnic: so its easier to add more classes (dumpers/loaders)
solnic has quit [Quit: Leaving...]
dereny has quit [Ping timeout: 244 seconds]
skade has quit [Ping timeout: 244 seconds]
skade has joined #rom-rb
lgierth has quit [Quit: Ex-Chat]
skade has quit [Ping timeout: 264 seconds]
skade has joined #rom-rb