Two Laptop Bag*
The moose likes Other Languages and the fly likes Jruby newbie question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Other Languages
Bookmark "Jruby newbie question" Watch "Jruby newbie question" New topic
Author

Jruby newbie question

bryan lim
Ranch Hand

Joined: Dec 26, 2008
Posts: 140
hi all,

i read that jruby is a Java implementation of the Ruby interpreter.

what is an interpreter? is it like a ide?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24184
    
  34

An interpreter is a program which reads code in some computer language and immediately executes it. Some languages, like Java, are "compiled" into a special format (class files, in Java's case) before being executed, while other languages, like Ruby, are interpreted, with no intermediate format. jruby is a Java program you can just run from the command line to execute your Ruby code.

An IDE for Ruby will generally include an interpreter so you can execute the code you're working on; but an IDE is something different altogether from an interpreter.


[Jess in Action][AskingGoodQuestions]
bryan lim
Ranch Hand

Joined: Dec 26, 2008
Posts: 140
thank you for your reply.

so ruby does not need to be compiled?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24184
    
  34

No, it does not. You can run the Ruby (or JRuby) interpreter interactively, and type in a line of code and see it executed immediately. Of course, you can also save your code in one or more files and run it all at once.
bryan lim
Ranch Hand

Joined: Dec 26, 2008
Posts: 140
i see. learn something new again.

thank you!
 
 
subject: Jruby newbie question