經常看到ruby和python在一起被比較,也有人說ruby是更像perl和python的結合體,那麼ruby更像python還是perl呢?
回複內容:
看 matz 是怎麼說的:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/179642
Ruby is a language designed in the following steps:
* take a simple lisp language (like one prior to CL).
* remove macros, s-expression.
* add simple object system (much simpler than CLOS).
* add blocks, inspired by higher order functions.
* add methods found in Smalltalk.
* add functionality found in Perl (in OO way).
So, Ruby was a Lisp originally, in theory.
Let's call it MatzLisp from now on. ;-)
所以你看,它都沒有提到 python。Ruby 主要是受 lisp, Smalltalk 和 perl 影響。
之所以稱為Ruby是取法自Perl,因為Perl的發音與6月的誕生石pearl(珍珠)相同,Ruby選擇以7月的誕生石ruby(紅寶石)命名
Perl 6的開發人員的唐鳳(Autrijus / Audrey)說:“Ruby就是‘沒有到處打廣告的Perl 6’”。
Ruby之父松本行弘在接受歐萊禮(O'Reilly)訪問時,提到“Ruby借用了很多Perl的東西……,Python遠比Perl要少……”、“我認為Ruby這個名字作為Perl之後的一門語言的名字真是再恰當不過了。
Perl之父拉裡·沃爾(Larry Wall)說:“很多方面上我還是很喜歡Ruby的,這是因為那些部分是從Perl借過去的。:-)”、“我還喜歡Ruby的C<*>一元星號操作符,所以我把它加到Perl 6裡面。
from: Ruby
更像Perl更像Perl,用用就知道這個問題就好比,“ 你更像你父母中的哪一位”
你就是你, Ruby就是Ruby。ruby只是借用了別人好的地方。沒有發現特別像哪個語言。當然是perl了, 如果像python, 那麼.....