狗肚子有虫子吃什么药| 九霄云外是什么生肖| 肾结石看什么科| 上司是什么意思| 汗蒸是什么意思| 93年是什么命| 痛风为什么要禁欲| 八七年属什么生肖| 左氧氟沙星是什么药| 人瘦了是什么原因| 做空是什么意思啊| 龋读什么| 腰椎生理曲度存在是什么意思| 胎儿胆囊偏小有什么影响| 梦见弟媳妇是什么预兆| 夏吃姜有什么好处| 鸡蛋加什么吃壮阳持久| 手术后喝什么鱼汤最好| 什么是大麦| 饺子是什么意思| 做手术后吃什么对伤口恢复快| 什么事的英文| 什么快递可以寄活物| 脱氧核苷酸是什么| 肠炎吃什么药效果最好| 指甲发紫是什么原因| 为什么打嗝不停| 结婚唱什么歌送给新人| 湿气重怎么调理吃什么| 中性粒细胞偏低是什么意思| 八方来财是什么意思| 茶叶属于什么类目| 胎盘老化对胎儿有什么影响| 哈戳戳是什么意思| 碧玉是什么玉| 手麻挂什么科| 芭蕉花炖猪心治什么病| 化妆的步骤是什么顺序| 脚趾发紫是什么原因| 五脏六腑指的是什么| 基因检测是什么意思| 养鱼为什么养单不养双| 辣椒含有什么维生素| 氮泵有什么作用| 杰克琼斯属于什么档次| 妈妈的爷爷叫什么| 柳对什么| 性欲是什么| 正切是什么| 什么是根| 药流后需要注意什么| 活泼的反义词是什么| 拔牙第二天可以吃什么| 三个火是什么字念什么| 夏天适合种什么水果| 麾下是什么意思| 手麻吃什么药| 被子植物是什么| 结婚十一年是什么婚| 胃肠彩超能检查出什么| 三星堆遗址在什么地方| 天空像什么的比喻句| 桃花依旧笑春风什么意思| 开髓引流是什么| 做梦梦到吵架是什么意思| 吃榴莲对女人有什么好处| 6月1号什么星座| 儿童鼻炎挂什么科| 炎症用什么药最好| 嘴角流口水是什么原因| 来年是什么意思| 梅核气是什么病| 胖大海配什么喝治咽炎| 64年属什么的| 725是什么意思| 肾炎是什么症状| 者羽念什么| 什么动作可以提高性功能| 女人肾虚吃什么好得快| 促进钙吸收吃什么| 什么样的孕妇容易翻盘| 吃什么增肥| 脸上有红血丝是什么原因| 老公护着婆婆说明什么| 尿道口发炎用什么药| 白带有点黄是什么原因| 梦见被蛇咬是什么意思| 成都五行属什么| 双侧卵巢显示不清是什么意思| 吃什么瘦肚子最快| 声音的高低叫什么| 鲁班姓什么| 心阴虚吃什么中成药| 肺部感染吃什么药| 百合有什么功效| 妇科检查清洁度二度是什么意思| 血压高有什么表现| 高职本科什么意思| 动脉硬化吃什么药| 神经是什么意思| 风热感冒咳嗽吃什么药| 太燃了是什么意思| street是什么意思| 骨质疏松吃什么钙片好| 同一首歌为什么停播了| 豆沫是什么做的| 祛湿是什么意思| 血糖高适合吃什么零食| 额头上长痘是因为什么| 山药炒什么好吃| 女人大腿内侧黑是什么原因引起的| 瀹是什么意思| 弥可保是什么药| 1988年是什么命| 伐木累是什么意思| 痛风可以喝什么饮料| 孩子拉肚子吃什么药| 一什么绳子| 女人细菌感染什么原因引起的| 什么是鸡胸| 最大的淡水湖是什么湖| 青石是什么石头| 射精出血吃什么药最好| 西游记是什么朝代| 九月什么花开| 兑卦代表什么| 官官相护是什么意思| 凶宅是什么意思| 红蜘蛛是什么虫| 中性人是什么意思| 抗原是什么| 痔疮有什么症状表现| 人生得意须尽欢是什么意思| 大黄和芒硝混合外敷有什么作用| 10月1什么星座| 什么店可以买到老鼠药| 一飞冲天是什么生肖| 指甲有白点是什么原因| 梦见很多狗是什么意思| 被舔下面是什么感觉| 坐高铁不能带什么| 口腔脱皮是什么原因引起的| 氮泵是什么| 孕反什么时候结束| 肚脐眼下面疼是什么原因| 一刻是什么意思| 试营业是什么意思| 男人割了皮包什么样子| 绿豆汤为什么是红色的| 土克什么| 离异什么意思| 连云港有什么特产| 翻车鱼为什么叫翻车鱼| 属虎和什么属相最配| 卵巢多囊是什么意思| 什么牌子的燕麦片最好| 膝关节积液吃什么药| 猴子喜欢吃什么食物| 鸡涌是什么意思| 叶酸片什么时候吃最好| 大便每天四五次是什么病| 竖心旁与什么有关| 晚上右眼跳是什么预兆| 生理期不能吃什么水果| 大脚趾发黑是什么原因| 黄瓜为什么叫黄瓜| 口腔溃疡吃什么水果好得快| 高血压吃什么助勃药好| 双喜临门的临是什么意思| 血脂血糖高吃什么食物好| 马头琴是什么族的乐器| 谷氨酸钠是什么| 念珠菌用什么药最好| 左心房增大是什么原因| 什么是神话故事| 男人吃六味地黄丸有什么好处| 闭经和绝经有什么区别| 月经量少吃什么好| 圣人是什么意思| 母带是什么意思| 13颗珠子的手串什么意思| 拔火罐起水泡是什么原因| 湿气重的人不能吃什么| 什么是精神分裂症| 书中自有颜如玉什么意思| 中风是什么原因引起的| 动次打次是什么意思| 龟头责是什么意思| 肛塞是什么东西| 世故是什么意思| 曲马多是什么药| 鳀鱼是什么鱼| 蛤蜊是什么| 蓝色妖姬是什么意思| 青光眼用什么眼药水| 碘伏什么颜色| 凝血是什么意思| 前列腺在什么位置| 衣原体感染有什么症状| 碘吃多了有什么危害| 月和什么有关| 睡眠不好用什么泡脚助于睡眠| 情窦初开是什么意思| 肾结晶是什么意思| 山竹和什么不能一起吃| 跨界歌手是什么意思| 房颤是什么病严重吗| 256排ct能检查什么病| 统招是什么意思| 人绒毛膜促性腺激素是什么| 护佑是什么意思| 艾草泡脚有什么好处| 血用什么能洗掉| 梦见黄狗是什么意思| 腿酸痛是什么原因| 阴虱长什么样子| 睡觉吹气是什么原因| 子宫钙化灶是什么意思| 风湿都有什么症状| 三级手术是什么意思| 炎热的夏天风儿像什么| 2001年属蛇的是什么命| 计数单位是什么意思| 头总是昏昏沉沉的是什么原因| 小祖宗是什么意思| 口干口苦吃什么药好| 三公经费指什么| 迪士尼是什么意思| 内分泌失调吃什么药好| 我好想你是什么歌| 沐五行属性是什么| 湿气重吃什么药好| 12月15号是什么星座| 狗狗生产需要准备什么| 审时度势是什么意思| 直径是什么意思| 孩子为什么要躲百天| 脸麻手麻是什么原因| 脾胃不好吃什么水果好| 老鸨是什么| 做梦梦到和别人吵架是什么意思| 悬壶济世是什么意思| 磷高有什么症状和危害| 白醋泡脚有什么功效| hc2是什么检查| 体重kg是什么意思| 你是我的唯一什么意思| 什么是重生| k金是什么意思| 肉桂属于什么茶类| 公安局属于什么机关| 同房什么意思| 莱字五行属什么| 梦见买床是什么意思| 香松是什么| 名什么什么实| 霉菌阳性是什么意思| 铁棍山药和普通山药有什么区别| 什么是碱| 尼特族是什么意思| 为什么晒太阳能补钙| 甘油三酯高是什么原因| 2月10日什么星座| 美国绿卡有什么好处| 百度Jump to content

三明沙县两车迎面相撞两人被困 消防成功救助

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by Onel5969 (talk | contribs) at 09:42, 29 July 2025 (Disambiguating links to Object-orientation (link changed to Object-oriented programming) using DisamAssist.). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Ruby
ParadigmMulti-paradigm: functional, imperative, object-oriented, reflective
Designed byYukihiro Matsumoto
DeveloperYukihiro Matsumoto, et al.
First appeared1995; 30 years ago (1995)
Stable release
3.4.5 Edit this on Wikidata[1] / 15 July 2025; 21 days ago (15 July 2025)
Typing disciplineDuck, dynamic, strong
ScopeLexical, sometimes dynamic
Implementation languageC
OSCross-platform
LicenseRuby License
Filename extensions.rb, .ru
Websiteruby-lang.org
Major implementations
Ruby MRI, TruffleRuby, YARV, Rubinius, JRuby, RubyMotion, mruby
Influenced by
Ada,[2] Basic,[3] C++,[2] CLU,[4] Dylan,[4]
Eiffel,[2] Lisp,[4] Lua, Perl,[4] Python,[4] Smalltalk[4]
Influenced
Clojure, CoffeeScript, Crystal, D, Elixir, Groovy, Julia,[5] Mirah, Nu,[6] Ring,[7] Rust,[8] Swift[9]
百度 网友贾政经表示:搞笑,这是要穿越吗?女儿出生前5年牺牲刻错时间伤人心无独有偶,被写错的还有同村烈士刘建都的墓,他的牺牲时间也有误。

Ruby is a general-purpose programming language. It was designed with an emphasis on programming productivity and simplicity. In Ruby, everything is an object, including primitive data types. It was developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan.

Ruby is interpreted, high-level, and dynamically typed; its interpreter uses garbage collection and just-in-time compilation. It supports multiple programming paradigms, including procedural, object-oriented, and functional programming. According to the creator, Ruby was influenced by Perl, Smalltalk, Eiffel, Ada, BASIC, and Lisp.[10][3]

History

[edit]

Early concept

[edit]

According to Matsumoto, Ruby was conceived in 1993. In a 1999 post to the Ruby-Talk mailing list, he shared some of his early ideas about the language:[11]

I was talking with my colleague about the possibility of an object-oriented scripting language. I knew Perl (Perl4, not Perl5), but I didn't like it really, because it had the smell of a toy language (it still has). The object-oriented language seemed very promising. I knew Python then. But I didn't like it, because I didn't think it was a true object-oriented language – OO features appeared to be add-on to the language. As a language maniac and OO fan for 15 years, I really wanted a genuine object-oriented, easy-to-use scripting language. I looked for but couldn't find one. So I decided to make it.

Matsumoto described Ruby's design as resembling a simple Lisp language at its core, with an object system like that of Smalltalk, blocks inspired by higher-order functions, and practical utility like that of Perl.[12]

The name "Ruby" originated during an online chat session between Matsumoto and Keiju Ishitsuka on 24 February 1993, before any code had been written.[13] Two names were initially proposed: "Coral" and "Ruby". Matsumoto chose the latter in a subsequent email to Ishitsuka.[14] He also noted that one factor influencing the choice of the name was that a colleague's birthstone was ruby.[15][16]

Early releases

[edit]

The first public release of Ruby 0.95 was announced on Japanese domestic newsgroups on 21 December 1995.[17][18] Subsequently, three more versions of Ruby were released in two days.[13] The release coincided with the launch of the Japanese-language ruby-list mailing list, which was the first mailing list for the new language.

Already present at this stage of development were many of the features familiar in later releases of Ruby, including object-oriented design, classes with inheritance, mixins, iterators, closures, exception handling and garbage collection.[19]

After the release of Ruby 0.95 in 1995, several stable versions of Ruby were released in these years.[13]

In 1997, the first article about Ruby was published on the Web. In the same year, Matsumoto was hired by netlab.jp to work on Ruby as a full-time developer.[13]

In 1998, the Ruby Application Archive was launched by Matsumoto, along with a simple English-language homepage for Ruby.[13]

In 1999, the first English language mailing list ruby-talk began, which signaled a growing interest in the language outside Japan.[20] In this same year, Matsumoto and Keiju Ishitsuka wrote the first book on Ruby, The Object-oriented Scripting Language Ruby (オブジェクト指向スクリプト言語 Ruby), which was published in Japan in October 1999. It would be followed in the early 2000s by around 20 books on Ruby published in Japanese.[13]

By 2000, Ruby was more popular than Python in Japan.[21] In September 2000, the first English language book Programming Ruby was printed, which was later freely released to the public, further widening the adoption of Ruby amongst English speakers. In early 2002, the English-language ruby-talk mailing list was receiving more messages than the Japanese-language ruby-list, demonstrating Ruby's increasing popularity in the non-Japanese speaking world.

Ruby 1.8 and 1.9

[edit]

Ruby 1.8 was initially released August 2003, was stable for a long time, and was retired June 2013.[22] Although deprecated, there is still code based on it. Ruby 1.8 is only partially compatible with Ruby 1.9.[citation needed]

Ruby 1.8 has been the subject of several industry standards. The language specifications for Ruby were developed by the Open Standards Promotion Center of the Information-Technology Promotion Agency (a Japanese government agency) for submission to the Japanese Industrial Standards Committee (JISC) and then to the International Organization for Standardization (ISO). It was accepted as a Japanese Industrial Standard (JIS X 3017) in 2011[23] and an international standard (ISO/IEC 30170) in 2012.[24][25]

Ruby on Rails logo

Around 2005, interest in the Ruby language surged in tandem with Ruby on Rails, a web framework written in Ruby. Rails is frequently credited with increasing awareness of Ruby.[26]

Effective with Ruby 1.9.3, released 31 October 2011,[27] Ruby switched from being dual-licensed under the Ruby License and the GPL to being dual-licensed under the Ruby License and the two-clause BSD license.[28] Adoption of 1.9 was slowed by changes from 1.8 that required many popular third party gems to be rewritten.[citation needed]

Ruby 2

[edit]

Ruby 2.0 was intended to be fully backward compatible with Ruby 1.9.3. As of the official 2.0.0 release on 24 February 2013, there were only five known incompatibilities.[29]

Starting with 2.1.0, Ruby's versioning policy changed to be more similar to semantic versioning, although it differs slightly in that minor version increments may be API incompatible.[30]

Ruby 2.2.0 includes speed-ups, bugfixes, and library updates and removes some deprecated APIs. Most notably, Ruby 2.2.0 introduces changes to memory handling – an incremental garbage collector, support for garbage collection of symbols and the option to compile directly against jemalloc. It also contains experimental support for using vfork(2) with system() and spawn(), and added support for the Unicode 7.0 specification. Since version 2.2.1,[31] Ruby MRI performance on PowerPC64 was improved.[32][33][34] Features that were made obsolete or removed include callcc, the DL library, Digest::HMAC, lib/rational.rb, lib/complex.rb, GServer, Logger::Application as well as various C API functions.[35]

Ruby 2.3.0 includes many performance improvements, updates, and bugfixes including changes to Proc#call, Socket and IO use of exception keywords, Thread#name handling, default passive Net::FTP connections, and Rake being removed from stdlib.[36] Other notable changes include:

  • The ability to mark all string literals as frozen by default with a consequently large performance increase in string operations.[37]
  • Hash comparison to allow direct checking of key/value pairs instead of just keys.
  • A new safe navigation operator &. that can ease nil handling (e.g. instead of if obj && obj.foo && obj.foo.bar, we can use if obj&.foo&.bar).
  • The did_you_mean gem is now bundled by default and required on startup to automatically suggest similar name matches on a NameError or NoMethodError.
  • Hash#dig and Array#dig to easily extract deeply nested values (e.g. given profile = { social: { wikipedia: { name: 'Foo Baz' } } }, the value Foo Baz can now be retrieved by profile.dig(:social, :wikipedia, :name)).
  • .grep_v(regexp) which will match all negative examples of a given regular expression in addition to other new features.

Ruby 2.4.0 includes performance improvements to hash table, Array#max, Array#min, and instance variable access.[38] Other notable changes include:

  • Binding#irb: Start a REPL session similar to binding.pry
  • Unify Fixnum and Bignum into Integer class
  • String supports Unicode case mappings, not just ASCII
  • A new method, Regexp#match?, which is a faster Boolean version of Regexp#match
  • Thread deadlock detection now shows threads with their backtrace and dependency

A few notable changes in Ruby 2.5.0 include rescue and ensure statements automatically use a surrounding do-end block (less need for extra begin-end blocks), method-chaining with yield_self, support for branch coverage and method coverage measurement, and easier Hash transformations with Hash#slice and Hash#transform_keys On top of that come a lot of performance improvements like faster block passing (3 times faster), faster Mutexes, faster ERB templates and improvements on some concatenation methods.

A few notable changes in Ruby 2.6.0 include an experimental just-in-time compiler (JIT), and RubyVM::AbstractSyntaxTree (experimental).

A few notable changes in Ruby 2.7.0 include pattern Matching (experimental), REPL improvements, a compaction GC, and separation of positional and keyword arguments.

Ruby 3

[edit]

Ruby 3.0.0 was released on Christmas Day in 2020.[39] It is known as Ruby 3x3, which signifies that programs would run three times faster in Ruby 3.0 comparing to Ruby 2.0.[40] and some had already implemented in intermediate releases on the road from 2 to 3. To achieve 3x3, Ruby 3 comes with MJIT, and later YJIT, Just-In-Time Compilers, to make programs faster, although they are described as experimental and remain disabled by default (enabled by flags at runtime).

Another goal of Ruby 3.0 is to improve concurrency and two more utilities Fibre Scheduler, and experimental Ractor facilitate the goal.[39] Ractor is light-weight and thread-safe as it is achieved by exchanging messages rather than shared objects.

Ruby 3.0 introduces RBS language to describe the types of Ruby programs for static analysis.[39] It is separated from general Ruby programs.

There are some syntax enhancements and library changes in Ruby 3.0 as well.[39]

Ruby 3.1 was released on 25 December 2021.[41] It includes YJIT, a new, experimental, Just-In-Time Compiler developed by Shopify, to enhance the performance of real world business applications. A new debugger is also included. There are some syntax enhancements and other improvements in this release. Network libraries for FTP, SMTP, IMAP, and POP are moved from default gems to bundled gems.[42]

Ruby 3.2 was released on 25 December 2022.[43] It brings support for being run inside of a WebAssembly environment via a WASI interface. Regular expressions also receives some improvements, including a faster, memoized matching algorithm to protect against certain ReDoS attacks, and configurable timeouts for regular expression matching. Additional debugging and syntax features are also included in this release, which include syntax suggestion, as well as error highlighting. The MJIT compiler has been re-implemented as a standard library module, while the YJIT, a Rust-based JIT compiler now supports more architectures on Linux.

Ruby 3.3 was released on 25 December 2023.[1] Ruby 3.3 introduces significant enhancements and performance improvements to the language. Key features include the introduction of the Prism parser for portable and maintainable parsing, the addition of the pure-Ruby JIT compiler RJIT, and major performance boosts in the YJIT compiler. Additionally, improvements in memory usage, the introduction of an M:N thread scheduler, and updates to the standard library contribute to a more efficient and developer-friendly Ruby ecosystem.

Ruby 3.4 was released on 25 December 2024.[44] Ruby 3.4 adds it block parameter reference, changes Prism as default parser, adds Happy Eyeballs Version 2 support to socket library, improves YJIT, adds modular Garbage Collector and so on.[45]

Semantics and philosophy

[edit]
Yukihiro Matsumoto, the creator of Ruby

Matsumoto has said that Ruby is designed for programmer productivity and fun, following the principles of good user interface design.[46] At a Google Tech Talk in 2008 he said, "I hope to see Ruby help every programmer in the world to be productive, and to enjoy programming, and to be happy. That is the primary purpose of Ruby language."[47] He stresses that systems design needs to emphasize human, rather than computer, needs:[48]

Often people, especially computer engineers, focus on the machines. They think, "By doing this, the machine will run fast. By doing this, the machine will run more effectively. By doing this, the machine will something something something." They are focusing on machines. But in fact we need to focus on humans, on how humans care about doing programming or operating the application of the machines. We are the masters. They are the slaves.

Matsumoto has said his primary design goal was to make a language that he himself enjoyed using, by minimizing programmer work and possible confusion. He has said that he had not applied the principle of least astonishment (POLA) to the design of Ruby;[48] in a May 2005 discussion on the newsgroup comp.lang.ruby, Matsumoto attempted to distance Ruby from POLA, explaining that because any design choice will be surprising to someone, he uses a personal standard in evaluating surprise. If that personal standard remains consistent, there would be few surprises for those familiar with the standard.[49]

Matsumoto defined it this way in an interview:[48]

Everyone has an individual background. Someone may come from Python, someone else may come from Perl, and they may be surprised by different aspects of the language. Then they come up to me and say, 'I was surprised by this feature of the language, so Ruby violates the principle of least surprise.' Wait. Wait. The principle of least surprise is not for you only. The principle of least surprise means principle of least my surprise. And it means the principle of least surprise after you learn Ruby very well. For example, I was a C++ programmer before I started designing Ruby. I programmed in C++ exclusively for two or three years. And after two years of C++ programming, it still surprises me.

Ruby is object-oriented: every value is an object, including classes and instances of types that many other languages designate as primitives (such as integers, Booleans, and "null"). Because everything in Ruby is an object, everything in Ruby has certain built-in abilities called methods. Every function is a method and methods are always called on an object. Methods defined at the top level scope become methods of the Object class. Since this class is an ancestor of every other class, such methods can be called on any object. They are also visible in all scopes, effectively serving as "global" procedures. Ruby supports inheritance with dynamic dispatch, mixins and singleton methods (belonging to, and defined for, a single instance rather than being defined on the class). Though Ruby does not support multiple inheritance, classes can import modules as mixins.

Ruby has been described as a multi-paradigm programming language: it allows procedural programming (defining functions/variables outside classes makes them part of the root, 'self' Object), with object orientation (everything is an object) or functional programming (it has anonymous functions, closures, and continuations; statements all have values, and functions return the last evaluation). It has support for introspection, reflective programming, metaprogramming, and interpreter-based threads. Ruby features dynamic typing, and supports parametric polymorphism.

According to the Ruby FAQ, the syntax is similar to Perl's and the semantics are similar to Smalltalk's, but the design philosophy differs greatly from Python's.[50]

Features

[edit]

Syntax

[edit]

The syntax of Ruby is broadly similar to that of Perl and Python. Class and method definitions are signaled by keywords, whereas code blocks can be defined by either keywords or braces. In contrast to Perl, variables are not obligatorily prefixed with a sigil. When used, the sigil changes the semantics of scope of the variable. For practical purposes there is no distinction between expressions and statements.[58][59] Line breaks are significant and taken as the end of a statement; a semicolon may be equivalently used. Unlike Python, indentation is not significant.

One of the differences from Python and Perl is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc.). Unlike the "getter" and "setter" methods of other languages like C++ or Java, accessor methods in Ruby can be created with a single line of code via metaprogramming; however, accessor methods can also be created in the traditional fashion of C++ and Java. As invocation of these methods does not require the use of parentheses, it is trivial to change an instance variable into a full function, without modifying a single line of calling code or having to do any refactoring achieving similar functionality to C# and VB.NET property members.

Python's property descriptors are similar, but come with a trade-off in the development process. If one begins in Python by using a publicly exposed instance variable, and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby's design forces all instance variables to be private, but also provides a simple way to declare set and get methods. This is in keeping with the idea that in Ruby, one never directly accesses the internal members of a class from outside the class; rather, one passes a message to the class and receives a response.

Implementations

[edit]

Matz's Ruby interpreter

[edit]

The original Ruby interpreter is often referred to as Matz's Ruby Interpreter or MRI. This implementation is written in C and uses its own Ruby-specific virtual machine.

The standardized and retired Ruby 1.8 implementation was written in C, as a single-pass interpreted language.[22]

Starting with Ruby 1.9, and continuing with Ruby 2.x and above, the official Ruby interpreter has been YARV ("Yet Another Ruby VM"), and this implementation has superseded the slower virtual machine used in previous releases of MRI.

Alternative implementations

[edit]

As of 2018, there are a number of alternative implementations of Ruby, including JRuby, Rubinius, and mruby. Each takes a different approach, with JRuby and Rubinius providing just-in-time compilation and mruby also providing ahead-of-time compilation.

Ruby has three major alternative implementations:

  • JRuby, a mixed Java and Ruby implementation that runs on the Java virtual machine. JRuby currently targets Ruby 3.1.x.
  • TruffleRuby, a Java implementation using the Truffle language implementation framework with GraalVM
  • Rubinius, a C++ bytecode virtual machine that uses LLVM to compile to machine code at runtime. The bytecode compiler and most core classes are written in pure Ruby. Rubinius currently[when?] targets Ruby 2.3.1.

Other Ruby implementations include:

Other now defunct Ruby implementations were:

The maturity of Ruby implementations tends to be measured by their ability to run the Ruby on Rails (Rails) framework, because it is complex to implement and uses many Ruby-specific features. The point when a particular implementation achieves this goal is called "the Rails singularity". The reference implementation, JRuby, and Rubinius[61] are all able to run Rails unmodified in a production environment.

Platform support

[edit]

Matsumoto originally developed Ruby on the 4.3BSD-based Sony NEWS-OS 3.x, but later migrated his work to SunOS 4.x, and finally to Linux.[62][63] By 1999, Ruby was known to work across many different operating systems. Modern Ruby versions and implementations are available on all major desktop, mobile and server-based operating systems. Ruby is also supported across a number of cloud hosting platforms like Jelastic, Heroku, Google Cloud Platform and others.

Tools such as RVM and RBEnv, facilitate installation and partitioning of multiple ruby versions, and multiple 'gemsets' on one machine.

Repositories and libraries

[edit]

RubyGems is Ruby's package manager. A Ruby package is called a "gem" and can be installed via the command line. Most gems are libraries, though a few exist that are applications, such as IDEs.[64] There are over 100,000 Ruby gems hosted on RubyGems.org.[65]

Many new and existing Ruby libraries are hosted on GitHub, a service that offers version control repository hosting for Git.

The Ruby Application Archive, which hosted applications, documentation, and libraries for Ruby programming, was maintained until 2013, when its function was transferred to RubyGems.[66]

See also

[edit]

References

[edit]
  1. ^ a b "Ruby 3.3.0 Released". Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  2. ^ a b c Cooper, Peter (2009). Beginning Ruby: From Novice to Professional. Beginning from Novice to Professional (2nd ed.). Berkeley: APress. p. 101. ISBN 978-1-4302-2363-4. To a lesser extent, Python, LISP, Eiffel, Ada, and C++ have also influenced Ruby.
  3. ^ a b "Reasons behind Ruby". Ruby Conference 2008. Confreaks (YouTube). 15 April 2013.
  4. ^ a b c d e f Bini, Ola (2007). Practical JRuby on Rails Web 2.0 Projects: Bringing Ruby on Rails to Java. Berkeley: APress. p. 3. ISBN 978-1-59059-881-8. It draws primarily on features from Perl, Smalltalk, Python, Lisp, Dylan, and CLU.
  5. ^ "Julia 1.0 Documentation: Introduction". Archived from the original on 16 August 2018. Retrieved 6 October 2018.
  6. ^ Burks, Tim. "About Nu?". Programming Nu?. Neon Design Technology, Inc. Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  7. ^ Ring Team (3 December 2017). "Ring and other languages". ring-lang.net. ring-lang. Archived from the original on 25 December 2018. Retrieved 3 December 2017.
  8. ^ "Influences - The Rust Reference". The Rust Reference. Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  9. ^ Lattner, Chris (2025-08-07). "Chris Lattner's Homepage". Chris Lattner. Archived from the original on 2025-08-07. Retrieved 2025-08-07. The Swift language is the product of tireless effort from a team of language experts, documentation gurus, compiler optimization ninjas, and an incredibly important internal dogfooding group who provided feedback to help refine and battle-test ideas. Of course, it also greatly benefited from the experiences hard-won by many other languages in the field, drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list.
  10. ^ "About Ruby". Archived from the original on 9 October 2014. Retrieved 15 February 2020.
  11. ^ Shugo Maeda (17 December 2002). "Official Ruby FAQ".
  12. ^ Matsumoto, Yukihiro (13 February 2006). "Re: Ruby's lisp features". Archived from the original on 2025-08-07. Retrieved 15 February 2020.
  13. ^ a b c d e f "History of Ruby". Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  14. ^ "[FYI: historic] The decisive moment of the language name Ruby. (Re: [ANN] ruby 1.8.1)" (E-mail from Hiroshi Sugihara to ruby-talk). Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  15. ^ "1.3 Why the name 'Ruby'?". Official Ruby FAQ.
  16. ^ Yukihiro Matsumoto (June 11, 1999). "Re: the name of Ruby?". Ruby-Talk (Mailing list). Archived from the original on December 25, 2018. Retrieved April 10, 2012.
  17. ^ "More archeolinguistics: unearthing proto-Ruby". Archived from the original on 6 November 2015. Retrieved 2 May 2015.
  18. ^ "[ruby-talk:00382] Re: history of ruby". Archived from the original on 16 July 2011. Retrieved 2 May 2015.
  19. ^ "[ruby-list:124] TUTORIAL — ruby's features". Archived from the original on 24 May 2003. Retrieved 2 May 2015.
  20. ^ "An Interview with the Creator of Ruby". Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  21. ^ Yukihiro Matsumoto (October 2000). "Programming Ruby: Forward". Archived from the original on 25 December 2018. Retrieved 5 March 2014.
  22. ^ a b "We retire Ruby 1.8.7". Archived from the original on 6 June 2015. Retrieved 2 May 2015.
  23. ^ "IPA 独立行政法人 情報処理推進機構:プレス発表 プログラム言語RubyのJIS規格(JIS X 3017)制定について". Archived from the original on 2 February 2015. Retrieved 2 May 2015.
  24. ^ "IPA 独立行政法人 情報処理推進機構:プレス発表 プログラム言語Ruby、国際規格として承認". Archived from the original on 1 February 2015. Retrieved 2 May 2015.
  25. ^ "ISO/IEC 30170:2012". Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  26. ^ Web Development: Ruby on Rails Archived 2025-08-07 at the Wayback Machine. Devarticles.com (2025-08-07). Retrieved on 2025-08-07.
  27. ^ "Ruby 1.9.3 p0 is released". ruby-lang.org. October 31, 2011. Archived from the original on January 14, 2013. Retrieved February 20, 2013.
  28. ^ "v1_9_3_0/NEWS". Ruby Subversion source repository. ruby-lang.org. September 17, 2011. Archived from the original on November 6, 2015. Retrieved February 20, 2013.
  29. ^ Endoh, Yusuke. (2025-08-07) Ruby 2.0.0-p0 is released Archived 2025-08-07 at the Wayback Machine. Ruby-lang.org. Retrieved on 2025-08-07.
  30. ^ "Semantic Versioning starting with Ruby 2.1.0". December 21, 2013. Archived from the original on February 13, 2014. Retrieved December 27, 2013.
  31. ^ Gustavo Frederico Temple Pedrosa, Vitor de Lima, Leonardo Bianconi (2015). "Ruby 2.2.1 Released". Archived from the original on 16 May 2016. Retrieved 12 July 2016.{{cite web}}: CS1 maint: multiple names: authors list (link)
  32. ^ Gustavo Frederico Temple Pedrosa, Vitor de Lima, Leonardo Bianconi (2015). "v2.2.1 ChangeLog". Archived from the original on 26 February 2017. Retrieved 12 July 2016.{{cite web}}: CS1 maint: multiple names: authors list (link)
  33. ^ Gustavo Frederico Temple Pedrosa, Vitor de Lima, Leonardo Bianconi (2014). "Specifying non volatile registers for increase performance in ppc64". Archived from the original on 17 September 2016. Retrieved 12 July 2016.{{cite web}}: CS1 maint: multiple names: authors list (link)
  34. ^ Gustavo Frederico Temple Pedrosa, Vitor de Lima, Leonardo Bianconi (2014). "Specifying MACRO for increase performance in ppc64". Archived from the original on 17 September 2016. Retrieved 12 July 2016.{{cite web}}: CS1 maint: multiple names: authors list (link)
  35. ^ "ruby/NEWS at v2_2_0 · ruby/ruby". GitHub. Archived from the original on 1 January 2015. Retrieved 2 May 2015.
  36. ^ "Ruby/NEWS at v.2_3_0 - ruby/ruby". GitHub. Archived from the original on 1 March 2017. Retrieved 25 December 2015.
  37. ^ "Ruby 2.3.0 changes and features". Running with Ruby. dev.mensfeld.pl. 14 November 2015. Archived from the original on 5 January 2016. Retrieved 27 December 2015.
  38. ^ "Ruby 2.4.0 Released". www.ruby-lang.org. Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  39. ^ a b c d "Ruby 3.0.0 Released". Ruby Programming Language. 2025-08-07. Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  40. ^ Scheffler, Jonan (10 November 2016). "Ruby 3x3: Matz, Koichi, and Tenderlove on the future of Ruby Performance". Ruby. Archived from the original on 10 May 2019. Retrieved 18 May 2019.
  41. ^ "Ruby 3.1.0 Released". ruby-lang.org. Archived from the original on 25 December 2021. Retrieved 25 Dec 2021.
  42. ^ "Ruby 3.1.0 Released". Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  43. ^ "Ruby 3.2.0 Released". Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  44. ^ "Ruby 3.4.0 Released". 2025-08-07. Retrieved 2025-08-07.
  45. ^ "NEWS - Documentation for Ruby 3.4". Retrieved 2025-08-07.
  46. ^ "The Ruby Programming Language". Archived from the original on 18 January 2020. Retrieved 2 May 2015.
  47. ^ Google Tech Talks – Ruby 1.9 on YouTube
  48. ^ a b c Bill Venners. "The Philosophy of Ruby". Archived from the original on 5 July 2019. Retrieved 2 May 2015.
  49. ^ "Welcome to RUBYWEEKLYNEWS.ORG". 4 July 2017. Archived from the original on 4 July 2017.{{cite web}}: CS1 maint: bot: original URL status unknown (link)
  50. ^ "The Ruby Language FAQ: How Does Ruby Stack Up Against...?". Archived from the original on 8 May 2015. Retrieved 2 May 2015.
  51. ^ Bruce Stewart (29 November 2001). "An Interview with the Creator of Ruby". O'Reilly Media. Archived from the original on 6 May 2015. Retrieved 2 May 2015.
  52. ^ Bill Venners. "Dynamic Productivity with Ruby". Archived from the original on 5 September 2015. Retrieved 2 May 2015.
  53. ^ "Language Workbenches: The Killer-App for Domain Specific Languages?". martinfowler.com. Archived from the original on 2 May 2021. Retrieved 2 May 2015.
  54. ^ "Ruby – Add class methods at runtime". Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  55. ^ Bill Venners. "Blocks and Closures in Ruby". Archived from the original on 18 April 2015. Retrieved 2 May 2015.
  56. ^ "Methods". Official Ruby FAQ. Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  57. ^ "Ruby Standard Library".
  58. ^ "[ruby-talk:01120] Re: The value of while..." Archived from the original on 2025-08-07. Retrieved 2025-08-07. In Ruby's syntax, statement is just a special case of an expression that cannot appear as an argument (e.g. multiple assignment).
  59. ^ "[ruby-talk:02460] Re: Precedence question". Archived from the original on 2025-08-07. Retrieved 2025-08-07. statement [...] can not be part of expression unless grouped within parentheses.
  60. ^ "remove/virtual_module: Born to make your Ruby Code more than 3x faster. Hopefully". GitHub. 21 February 2020. Archived from the original on 1 March 2017. Retrieved 29 August 2016.
  61. ^ Peter Cooper (2025-08-07). "The Why, What, and How of Rubinius 1.0's Release". Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  62. ^ Maya Stodte (February 2000). "IBM developerWorks – Ruby: a new language". Archived from the original on August 18, 2000. Retrieved 3 March 2014.
  63. ^ Yukihiro Matsumoto (August 2002). "lang-ruby-general: Re: question about Ruby initial development". Archived from the original on 3 March 2014. Retrieved 3 March 2014.
  64. ^ "The Ruby Toolbox". Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  65. ^ "Stats RubyGems.org your community gem host". rubygems.org. Archived from the original on 10 December 2021. Retrieved 10 December 2021.
  66. ^ "We retire raa.ruby-lang.org". 2025-08-07. Archived from the original on 2025-08-07. Retrieved 2025-08-07.

Further reading

[edit]
[edit]
立冬和冬至什么区别 虬角为什么要染成绿色 便宜的反义词是什么 球蛋白的功效与作用是什么 孕妇羊水少吃什么补的快
什么的 芍药什么时候开花 送人礼物送什么好 植物神经是什么 秦始皇为什么焚书坑儒
4月23日是什么日子 胸闷气短是什么原因造成的 肝不好的人有什么症状 饭前吃药和饭后吃药有什么区别 蜂蜜可以做什么美食
脚后跟疼为什么 脚心痛什么原因 什么人容易得小脑萎缩 左肺上叶肺大泡是什么意思 对口高考班是什么意思
人体缺钾是什么症状hcv9jop5ns8r.cn 中央办公厅主任什么级别0735v.com 胃反酸烧心吃什么药hcv9jop6ns7r.cn 甘油三酯高有什么症状hcv9jop7ns0r.cn 什么食物含锌最多hcv8jop8ns1r.cn
抬旗是什么意思hcv9jop0ns4r.cn 孩子上吐下泻吃什么药hcv9jop6ns4r.cn 6.30什么星座hcv8jop3ns1r.cn 腰果不能和什么一起吃hcv9jop3ns7r.cn 美国有什么特产chuanglingweilai.com
pe医学上是什么意思hcv8jop0ns5r.cn 小孩疝气是什么症状hcv9jop0ns9r.cn 阳历7月7日是什么日子jiuxinfghf.com 梦到自己快要死了是什么意思hcv7jop4ns7r.cn 尾牙宴是什么意思hcv8jop2ns5r.cn
嗓子不舒服挂什么科hcv9jop2ns4r.cn 妇科炎症吃什么消炎药效果好helloaicloud.com 扶苏姓什么creativexi.com 吃什么补充维生素dhcv9jop7ns1r.cn 虎年是什么年weuuu.com
百度