Friday, June 20, 2008

some tips from a jruby hacker on hacking jruby

Some good advice if you are interested in getting into Jruby dev

(3:06:39 PM)
bgurupra: i am wondering what is the best way to get to start contributing to the code source of jruby,trying to understand it by tracing the code seems a daunting task
(3:07:11 PM) VVSiz: yeah
(3:07:43 PM) VVSiz: bgurupra: the easier approach would be to start running the rubyspecs (or writing new ones) and start fixing bugs exposed by those, one by one
(3:08:32 PM) bgurupra: ok yeah I read that on your blog :-) but do you suggest some theoritical read up of compiler theory?lex , yacc etc?
(3:09:09 PM) VVSiz: bgurupra: in most cases you don't really need to do that :)
(3:09:24 PM) bgurupra: oh ok
(3:09:33 PM) VVSiz: that stuff is mostly done and works OK now (with enebo and headius taking care of it)
(3:09:44 PM) VVSiz: and it *IS* very hard path to start up with JRuby :)
(3:10:13 PM) VVSiz: I'd say that starting looking at the jruby bugs and picking up the easy ones until you comfortable, is better
(3:10:33 PM) VVSiz: and in most cases, the fixes are not in compiler/interpreter, but in core class libraries
(3:10:54 PM) VVSiz: and for those there is a very simple mapping Array (in Ruby) -> RubyArray (in JRuby)
(3:11:00 PM) VVSiz: String -> RubyString, etc.
(3:11:17 PM) VVSiz: so, 99% of your time you might spent in org.jruby package, where all those core classes reside
(3:11:39 PM) bgurupra: ok yeah I'll take that approach
(3:11:50 PM) VVSiz: another good way to help out is to run various benchmarks, identify the places where JRuby is slower than MRI and figure out why
(3:12:01 PM) VVSiz: or even writing small benchmarks that clearly show the problem
(3:12:08 PM) bgurupra: OK..
(3:12:46 PM) VVSiz: but I tell ya, interesting stuff, but not that easy, especially on top of the VM, with different options, different garbage collectors, different platforms :)
(3:13:42 PM) bgurupra: yeah sure there is loads of fun stuff :-)
(3:13:43 PM) VVSiz: one of the biggest issues in that area, it seems, is Rails performance. everybody agree that Jruby should be much faster with Rails, but nobody could come up with the exact places where JRuby wastes its time
(3:13:51 PM) VVSiz: yep, it all over the place
(3:14:18 PM) VVSiz: pick up any bug, and chances are, you'll have fun :)
(3:14:40 PM) bgurupra: yeah I'll get to the Jira right away :-)
(3:15:02 PM) bgurupra: thanks as always VVSiz for your inputs/help :-)
(3:15:36 PM) VVSiz: sure :)

No comments: