From: Benoit Cerrina Date: 2001-11-14T05:51:49+09:00 Subject: [ruby-talk:25074] Re: Why is ruby slow (compared to perl) > Ok, I should mention sth about ruby. The original was about perl > being so much faster than ruby on win32. Besides the Cygwin vs > Visual C++ issue, is it true that Ruby is an interpreted language and > Perl is a compiled/interpreted hybrid? If so, Perl's performance > advantage over Ruby should become bigger when a similar task takes > longer. > > Russell > This is good because it brings the thread back to the original interesting point of the thread. Ruby is like perl in many ways except its better, cleaner, easier to read and write and slower... So the comparison is very valid (maybe more so than with python, since I can see many former perl user going to ruby but not so much from python). As far as your specific question, perl compiles to bytecode each time a script is sourced (the bytecode is not normally saved although with a specific module you can). The bytecode is then converted in an AST (abstract syntax tree) which is interpreted. Ruby parses the script into an AST and interpret that. I believe there are reasons why the bytecode is a faster way of doing things although I don't know enough yet to see why, what is sure is that almost all interpreted language end up compiling to an intermediate bytecode format at one time or an other. Benoit