From: John Morrice Date: 2010-11-15T22:22:10+09:00 Subject: Re: Ruby Vs PHP > Having large libraries of code (coupled with the fact that Ruby has a > slow interpreter) does make Ruby somewhat slower performance wise, > however a Ruby programer would argue that because Ruby language is > more efficient that PHP by re-using code and by using symbols where > necessary instead of strings that makes up for it's slow rendering > time. Neither PHP or Ruby are high-performance languages. [1] To bring up the obvious example, neither are (usually) compiled. So it seems a little strange to compare the two in this manner. Kinda like racing snails! (Cute little snails...) In the functional programming community, a language design is deemed to be elegant when it has a small 'core', because then you get benefits like not needing lots of syntax, a more organized compiler - indeed, this minimalism is something the functional community strive for! [2] I'm don't know how Ruby is implemented, but it certainly *feels* like a small language, at least to me. Initializing an object - a method call. Defining a class can be done with method calls. All you need are methods and objects, and constants: A = Class.new A.module_eval do def neatsville puts "That's Jazz" end end a = A.new a.neatsville => That's Jazz It's easy to see how the more traditional way of defining a class can be decomposed into these simpler operations - this is definitely subjective, but from a minimalist point of view that is a *good thing*. How would you do this with PHP? Is it even possible? Someone else will have to take this up, for I am a PHP noob. [1] Ruby and PHP are both close to the bottom of the (flawed) benchmarks game, way outpaced by rockets like Javascript and Smalltalk... http://shootout.alioth.debian.org/u32/which-programming-languages-are-fastest.php [2] Simon Peyton Jones - Implementing functional languages: a tutorial. The chapter on the G-Machine is quite accessible. http://research.microsoft.com/en-us/um/people/simonpj/papers/pj-lester-book/ Johnny