欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

Ruby 更像 Perl 还是 Python?

程序员文章站 2022-03-19 15:48:43
...
经常看到ruby和python在一起被比较,也有人说ruby是更像perl和python的结合体,那么ruby更像python还是perl呢?

回复内容:

看 matz 是怎么说的:blade.nagaokaut.ac.jp/c

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, 那么.....
相关标签: python ruby perl