5

Ruby 动态类型编程语言

 1 year ago
source link: https://blog.p2hp.com/archives/9771
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Ruby 动态类型编程语言

Ruby 是一种跨平台、面向对象的动态类型编程语言。Ruby 体现了表达的一致性和简单性,它不仅是一门编程语言,更是表达想法的一种简练方式。

08113457_fEiJ.gif

Ruby 的作者于 1993 年 2 月 24 日开始编辑 Ruby,直至 1995 年 12 月才正式公开发布于 fj(新聞群組)。之所以称为 Ruby,是因为 Perl 的发音与 6 月的诞生石 pearl(珍珠)相同,因此 Ruby 以 7 月的诞生石 ruby(红宝石)命名。

Ruby 明显比其他类似的编程語言(如 Perl 或 Python)年轻,又因为 Ruby 是日本人发明的,所以早期的非日文资料和程式都比较貧乏,所以现在在网上仍然可以找到 Ruby 的资料太少之类的批评。约于 2000 年,Ruby 开始进入美国,英文的资料开始发展。

下面是一个在标准输出设备上输出 Hello World 的简单程序,这种程序通常作为开始学习编程语言时的第一个程序:

#!/usr/bin/env ruby
puts "Hello, world!"

或者是在 irb 交互式命令行的模式下:

>>puts "Hello, world!"
Hello, world!
=> nil

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK