Ruby 更像 Perl 還是 Python?

來源:互聯網
上載者:User
經常看到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, 那麼.....
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.