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 :)

Tuesday, June 10, 2008

no clear in cygwin :-(

Of all the unix commands I use the most clear is probably the number one on the list and cygwin does not have a clear command :-( and I hate cluttered screens

I could get around it by adding this line in the .bashrc file
alias clear="cmd.exe /c cls" though!

Monday, June 9, 2008

ah compact ruby!

I have this problem of messing up my desktop all the time.I keep all sorts of temp stuff(files and folders and short cuts) on the desktop and forget to clean up and before I know its one BIG mess.Since I am trying to pick up on a bit of ruby I tried writing a little script that would clean the desktop for me and put all the stuff i haven't touched in a while into a temp folder somewhere

Not to mention wifey was in a bit of a bad mood and I was better off looking busy :-)

I must say Ruby's code was much compact and more elegant than what I would have been able to do with Java.With some basic error handling and re factoring everything into logical methods it was still just 35 lines of code