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
coop-cooper has quit [Ping timeout: 246 seconds]
coop-cooper has joined #rom-rb
postmodern has quit [Quit: Leaving]
postmodern has joined #rom-rb
coop-cooper has quit [Ping timeout: 240 seconds]
coop-cooper has joined #rom-rb
coop-cooper has quit [Quit: leaving]
lfox has joined #rom-rb
lfox has quit [Quit: ZZZzzz…]
lfox has joined #rom-rb
postmodern has quit [Quit: Leaving]
postmodern has joined #rom-rb
lfox has quit [Quit: ZZZzzz…]
moonglum has joined #rom-rb
dkubb has quit [Quit: Linkinus - http://linkinus.com]
judofyr has joined #rom-rb
dkubb has joined #rom-rb
mbj has joined #rom-rb
judofyr has quit [Remote host closed the connection]
mbj has quit [Read error: Operation timed out]
judofyr has joined #rom-rb
mbj has joined #rom-rb
mbj has quit [Ping timeout: 245 seconds]
mbj has joined #rom-rb
dbussink_ has quit [Remote host closed the connection]
dbussink has joined #rom-rb
judofyr has quit [Remote host closed the connection]
judofyr has joined #rom-rb
judofyr has quit [Ping timeout: 272 seconds]
moonglum has quit [Quit: Computer has gone to sleep.]
moonglum has joined #rom-rb
judofyr has joined #rom-rb
judofyr has quit [Remote host closed the connection]
judofyr has joined #rom-rb
breakingthings has joined #rom-rb
postmodern has quit [Quit: Leaving]
solnic has joined #rom-rb
dkubb has quit [Ping timeout: 240 seconds]
dkubb has joined #rom-rb
judofyr has quit [Remote host closed the connection]
judofyr has joined #rom-rb
judofyr has quit [Ping timeout: 245 seconds]
judofyr has joined #rom-rb
mbj_ has joined #rom-rb
CraigBuchek has joined #rom-rb
mbj has quit [Ping timeout: 272 seconds]
judofyr has quit [Remote host closed the connection]
judofyr has joined #rom-rb
sferik has joined #rom-rb
cored has joined #rom-rb
CraigBuchek has quit [Quit: Leaving.]
CraigBuchek has joined #rom-rb
moonglum has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
judofyr has quit [Remote host closed the connection]
cored has quit [Ping timeout: 260 seconds]
cored has joined #rom-rb
<dkubb> good morning
<solnic> morning dkubb
<dkubb> solnic: hey solnic!
mbj_ is now known as mbj
<solnic> dkubb: I saw much progress on sql the other, that's really really cool
<solnic> +day
<solnic> oh btw happy new year :)
<dkubb> solnic: thanks. I'm almost done the first pass on generation
<dkubb> solnic: happy new year!
<solnic> I'm slowly trying to get my hands dirty with some OSS
<solnic> I think I'm gonna play with morpher + virtus soon
<mbj> solnic: nice!
<mbj> solnic: My current focus in OSS is unparser.
<mbj> solnic: I'm gonna unparse the rubygems corpus with it soon.
<mbj> solnic: Than I can be pretty sure its rock solid.
<solnic> rubygems corpus?
<mbj> solnic: But unparsing "foo = bar while foo" is VERY hard.
<solnic> I can see that :/
<mbj> solnic: Just downloading all gems and trying to parse all **/*.rb while comparing it with parsed unparsed ast for equivalency.
<mbj> solnic: Rountripping all OSS ruby :D
<solnic> holy shit :)
<mbj> I got pretty far.
<mbj> foo = bar while foo; cannot be done as while foo; foo = bar; end
<mbj> Because while foo would be an method send this way.
<solnic> it's really interesting to see what kind of "edge cases" you're gonna find
<mbj> I already found a lot of these.
<dkubb> mbj: you got the idea from whitequark/parser right?
<mbj> solnic: return 1, 2 is one of them.
<solnic> mbj: yeah that was a good one
<mbj> dkubb: What idea?
<dkubb> mbj: the idea of parsing the rubygems corpus
<mbj> dkubb: Unparsing rubygems corpus? I had this for my own.
<dkubb> ahh ok
<mbj> dkubb: But than found whitequark did it already.
<dkubb> it's a good idea
<mbj> Yeah
<solnic> mbj: there are quite a lot of ruby examples which seem like syntax error :)
<mbj> solnic: yeah
<solnic> I think I saw a blog post a while ago showing off some of these
<dkubb> it's almost something that should be made available. any tool that parses ruby could use it
<mbj> solnic: ASTs for multiple assignments are also trick for tools.
<dkubb> they should just offer a single tarball of all the gems ;)
<mbj> solnic: a.foo, a[1], b[] = c, *b
<mbj> solnic: This is HARD to unparse :D
<solnic> damn ;)
<mbj> solnic: RE morpher, you can IMHO ask snusnu about how to use it.
<mbj> solnic: We talked a lot about it lately.
<mbj> solnic: I'll be busy with unparser the next days.
dkubb has quit [Read error: Connection reset by peer]
<mbj> And pls dont distract me with interesting quetstions :D
<solnic> he's away
dkubb|away has joined #rom-rb
<solnic> then he's very busy with work
<solnic> then he's leaving on holidays
<mbj> okay
<mbj> so ask me :D
<solnic> I don't wanna distract you too much, I will try to figure things out on my own
<solnic> I'll bother you if I really feel clueless
<solnic> it's fine for me to figure it out anyway since I'd like to contribute too
<mbj> solnic: If you are writing a "top down" emitter and see this "half closed" nodes, its very hard. But solved this for month now.
<solnic> instead of supporting such code you should raise an error "WRITE CODE THAT A HUMAN CAN READ PLS KTHXBYE" ;)
<mbj> solnic: hah, actually it crashes under unparsing :D
<solnic> cool, raise NonCleanCodeError
<solnic> ;)
<mbj> solnic: wrote a little cli tool to save myself work
<mbj> solnic: unparser -e "your shitty code here"
<solnic> I'm obviously just joking
<mbj> I'd love to remove some features from ruby.
<solnic> me too
<mbj> all perlisms
<solnic> word
<dkubb|away> which includes many of those globals
dkubb|away is now known as dkubb
<mbj> !
<mbj> yeah
<solnic> esp those
<mbj> and I'd like to inverse 2.1 literal freeze behavior.
<dkubb> frozen by default?
<mbj> Instead of having them frozen optionally, they should be frozen per default
<mbj> Yeah
<dkubb> that makes sense to me for most literals
<mbj> BTW I was reading through the crystal source code:
<mbj> Ruby like ahead of time compiled language: https://github.com/manastech/crystal
<mbj> Dunno how strong it is under meta programing. But I think it will NOT support runtime metaprogramming.
<solnic> awesome name
<mbj> And this is a feature I wanna remove from ruby also.
<mbj> After your lib/app was booted, I'd like to all a Kernel.remove_metaprogramming!
<mbj> *all => call
<solnic> gotta go focus on work, ttyl
onewheelskyward_ is now known as onewheelskyward
<mbj> solnic: np, same here.
lfox has joined #rom-rb
cored has quit [Ping timeout: 272 seconds]
cored has joined #rom-rb
cored has joined #rom-rb
<mbj> solnic: I think it got it. Ruby allows you to define a whole universe inside a while condition. Parts of that universe are now getting scanned for lvar reads till an lvar boundary.
lfox has quit [Quit: ZZZzzz…]
<mbj> solnic: If the lvar was NOT defined in the parens of the nodes of the while, and first defined in the body, the body gets emitted before the while => while guard style.
<mbj> solnic: And I think it got it correct. Also the tracing wich lvars exist at a given point in the AST.
<mbj> solnic: No I'll have to wire it togetter and fuzz with /**/*.rb :D
<dkubb> it's good for unparser to handle the rubygems corpus. people could literally run a gem's specs to get a baseline, then compare it against the specs of parsed/unparsed ruby code
<dkubb> round trip testing will help parser and unparser improve
<mbj> dkubb: If the specs pass with the original code, and the AST parsed from tune generated code matches the AST from the original code we could skip this.
<mbj> dkubb: s/tune/the/
<mbj> dkubb: parse(original) == parse(generate(parse(original))) && spec(original)
<mbj> enough to prove spec(generate(parse(original)))
<mbj> only if we have trust in parse(source)
<mbj> We *might* find a bug in parser with acutally running the specs on unparsed source.
<mbj> But not in unparser, if the above is true.
<dkubb> ahh right
<mbj> dkubb: Any idea what causes this one: https://circleci.com/gh/mbj/mutant/390
<mbj> dkubb: Also we are rubocop warning free under 1.9.3, 2.0.0 on my machine and travis.
<dkubb> mbj: the rubocop stuff?
<mbj> dkubb: the rubocop behaviing differently and the timeout.
<dkubb> it's because circleci is putting the gems under vendor
<dkubb> and rubocop isn't excluding that
<mbj> yeah
<mbj> thats the case!
<dkubb> you also want to make sure your spec coverage excludes it
<mbj> thx
<mbj> #lazydkubb
<mbj> :D
<mbj> Just like #lazytwitter but asking dkubb instead.
<mbj> dkubb: Lets add this exclude to devtools.
<dkubb> you can't unfortunately.. rubocop basically ignores the includes/excludes directives unless they were read from a .rubocop.yml in the root
<mbj> mhh
<dkubb> I suppose it could be fixed in rubocop, but I didn't want to get side tracked
<mbj> so lets add a ticket to rubocop
<mbj> IMHO its under active developent, we'll get it in.
<mbj> dkubb: BTW I learned lot about ruby internals when writing that lvar tracker.
<mbj> dkubb: Its actually not easy :D
<dkubb> I just wish "no" was said more often during language design ;)
<mbj> yeah
<mbj> c = readbyte while c
<mbj> actually
<dkubb> I wonder if there's a correlation between "hard to parse for computers" and "hard to parse for humans"
<mbj> def some_io_routing
<mbj> c = readbyte while c
<mbj> end
<dkubb> does that initialize "c" automatcally after the first while loop?
<dkubb> like it would run readbyte first, set c, and then test "while c"
<mbj> I think is this: There is a correlation between "hard to parse correctly with compusers by human written software, and "hard to parse for humans".
<mbj> dkubb: no
<mbj> acutally its:
<mbj> def some_io_routing
<mbj> c = readbyte while c != 0xff
<mbj> end
<dkubb> oh I see
<mbj> because c is an lvar, it gets assigned to nil
<dkubb> so c starts off as nil, which satisfied the conditional, then it does the readbye, then the while test again
<mbj> yeah
<dkubb> I think I may have written something like that before
<dkubb> but can it not just be written as: c = nil; while c != 0xff; c = readbyte; end
<mbj> Detecting the need for this is very hard.
<dkubb> I would be more likely to want to try using until there and state the conditional in the positive
<mbj> I need to now: c is read from condition && c got FIRST assigned by body
<mbj> s/now/know/
<mbj> and that FIRST is a big problem. I need to scan the parent tree with lexical rules for assignments of c
<mbj> that can be from block args, def args or traditional assinments.
<dkubb> oh interesting
<mbj> All from the emitter of while
<mbj> And I'll emit as postcondition
<dkubb> it could be a global var, class var or ivar
<mbj> To make sure parse(source) == parse(generate(parse(source))) can acutally work
<mbj> no it cant.
<dkubb> no?
<mbj> global vars and ivars are explicit prefixed with @ and %
<mbj> s/%/$/
<mbj> there is no ambiguity here.
<dkubb> well, I know in this specific exmaple
<mbj> Its all about the "first use of lvar introduces an lvar, and changes the behavior from private method send to lvar read"
<dkubb> but I was talking about $c = readbyte while $c != 0xff
<mbj> This will not a problem for unparsing.
<mbj> Can safely be emitted as; while $c != 0xff; $c = readbyte; end
<mbj> The only reason to emit body before condition is to make sure parser will turn the method call "c" into an lvar read.
<mbj> If there would be a "force to read as lvar even if its undefined so return nil" expression in ruby we could also emit this as: while force_read_as_lvar_with_default_nil(c); c = readbyte; end
<mbj> As we have a "force to read as ivar or gvar" via the $ / @ prefixes it is not a problem.
<mbj> There is a force to read as lvar, eighter emitting body before while, or doing that c = nil beforehand.
lfox has joined #rom-rb
<mbj> If you look at the rbx bytecode you'll see that assign to nil.
<mbj> But my job is to produce source that will get turned into a specific ast, hence I must correctly detect that situration.
<mbj> BTW I have a dkubb.fsck request once I push the code :D
lfox has quit [Ping timeout: 240 seconds]
<dkubb> mbj: would a stopgap be to do c ||= nil before the expression?
<mbj> dkubb: I'd have to emit it before ALL expressions that can be written as postconditions.
<mbj> dkubb: while is just the start, need to support this for ALL controll flow that is possible as "guard claus" style.
<mbj> dkubb: I'm very close to wire the lvar scope scanner. Once this works all of the control flow emitters will get a #postcodintion? (private) to decide between emit_normal and emit_postcondition
<mbj> s/postcondition/guard/
<mbj> dkubb: And yes, it would work.
<mbj> but it would make most of mutants output close to unreadable.
<mbj> dkubb: And +1 good idea ;)
<dkubb> I was more thinking about getting something working and then optimizing it. I agree it's not the ideal case at all. I would like for the unparsed code to be as close to the original semantics as possible
<mbj> dkubb: It would break mutant.
<mbj> dkubb: Actually it wount.
<mbj> dkubb: I'd love to discover this thing more early :D
<mbj> dkubb: But for now I'm very close to commit the optimized version.
cbuxton_ has quit [Ping timeout: 260 seconds]
cbuxton_ has joined #rom-rb
avdi has quit [Ping timeout: 246 seconds]
kapowaz__ has quit [Ping timeout: 260 seconds]
lgierth has joined #rom-rb
cbuxton_ has quit [Ping timeout: 264 seconds]
cbuxton_ has joined #rom-rb
postmodern has joined #rom-rb
lgierth has quit [Quit: Ex-Chat]
breakingthings has quit []