up vote 2 down vote favorite
share [g+] share [fb]

This might be my worst question yet, but I am in the process of choosing Ruby vs. Jruby for a project that is in technology-research phase so syntax being the same is a minor concern for flexibility.

Are they two different syntaxes or do both look pretty much the same?

link|improve this question

feedback

3 Answers

up vote 8 down vote accepted

Short answer: They use the same syntax. There are slight differences in the objects and methods available, but the syntax is the same.

Longer answer: Ruby 1.9 uses a slightly different syntax than Ruby 1.8. JRuby originally lagged behind in 1.9 support, but is slowly catching up. If you are talking about Ruby 1.8 vs. JRuby, it's the same. If you're talking Ruby 1.9 vs. JRuby, then it is the same as long as you are using JRuby 1.6.0RC2 or later.

Compiler handles all 1.9 syntax now

link|improve this answer
Thanks! Btw, your long answer is only one line longer than your short answer - must be good design ;) – Genadinik Apr 20 '11 at 18:56
feedback

same syntax. only different with database connectivity ruby use MYSQL2 for database connectivity and jruby use jdbcmsql for database connectivity

required gem for jruby database connectivity is activerecord-jdbcmysql-adapter

link|improve this answer
feedback

ruby is a language. It has multiple implementations, but there is one reference implementation known as either MRI (Matz's ruby interpreter) or C-Ruby (because it's written in C). There is also a ruby specification project in progress, which attempts to document how ruby should behave rather than just "do what MRI does".

There are also multiple versions of ruby, 1.8.7 and 1.9.1 being the most commonly found these days.

With that being said, the goal of all implementations (including JRuby, Ironruby, Rubinius) is to be compliant with the spec, and therefore compatible. So you can write your "pure" ruby code and run it on whatever implementation is best.

Of course, different implementations have their own bugs, and their own level of compliance with the spec. And that is what you need to watch out for.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.