Hi. I am currently at evaluating a few scripting languages for the JVM, and JRuby is of course one of them, and it's its turn now. Before I start messing around, I would like to ask how JRuby works in its most fundamental way. Ruby is an interpreted language (as far as I know, I don't know it) and there is no compilation stage, and as far as I saw in the JRuby sources, this is also the case. I would like to know for sure, though. Most importantly, does it use a custom classloader or sth to pre-compile the ruby code to bytecode during runtime and define classes in the JVM? Does any bytecode get generated? Or does it build an AST and interpret it in some way, and when called again, the whole process starts over (maybe with the AST already built and cached?).
I am asking because there is another 'scripting' language for the JVM that does just that, and it can pose some problems in certain use cases (like usage inside an EJB container, where it is not allowed to create custom classloaders). I wrote 'scripting' (in quotes) because of that precompilation - it has the feel and dynamics of a scripting language, but every snippet is compiled to a class and defined in the JVM. How does JRuby do it? If I posted to a wrong list, I am sorry. I didn't know which mailing list was more appropriate (this or users) and chose this one as I think the probability of getting a definite answer is much closer. If I chose wrong, please forgive me. wujek