Ruby is a programming language created in 1995 by Yukihiro Matsumoto.
#13on PLDB | 28Years Old | 357.7kUsers |
65Books | 13Papers | 3mRepos |
Try now: Riju · TIO · Replit
Ruby is a dynamic, reflective, object-oriented, general-purpose programming language. It was designed and developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan. According to its creator, Ruby was influenced by Perl, Smalltalk, Eiffel, Ada, and Lisp. Read more on Wikipedia...
# Type your code here, or load an example.
def square(num)
num * num
end
puts "Hello, world!"
#!/usr/bin/env ruby
print "Hello World"
# Hello World in Ruby
puts "Hello World!"
module Foo
end
"Hello, World!".in_blue
=> "<span style=\"color: #00f\">Hello, World!</span>"
_ENCODING_
Feature | Supported | Token | Example |
---|---|---|---|
Conditionals | ✓ | ||
Functions | ✓ | ||
While Loops | ✓ | ||
Case Sensitivity | ✓ | ||
Range Operator | ✓ | (3...6) |
|
Line Comments | ✓ | # | # A comment |
Print() Debugging | ✓ | puts | puts "Hi" |
Operator Overloading | ✓ | ||
Multiline Strings | ✓ | ||
Mixins | ✓ | module A def a1 end def a2 end end module B def b1 end def b2 end end class Sample include A include B def s1 end end samp = Sample.new samp.a1 samp.a2 samp.b1 |
|
Iterators | ✓ | (0...42).each do |n| puts n end |
|
File Imports | ✓ | load 'filename.rb' require 'filename' require 'trig.rb' |
|
Directives | ✓ | coding: UTF-8 |
|
Here Document | ✓ | ||
Generators | ✓ | # Generator from an Enumerator object chars = Enumerator.new(['A', 'B', 'C', 'Z']) 4.times { puts chars.next } # Generator from a block count = Enumerator.new do |yielder| i = 0 loop { yielder.yield i += 1 } end 100.times { puts count.next } |
|
Garbage Collection | ✓ | ||
MultiLine Comments | ✓ | =begin =end | =begin A comment. =end |
Comments | ✓ | # This is a single line comment. |
|
Classes | ✓ | # A tiny Person class in Ruby: class Person attr_accessor :name, :age, : # getter and setter methods def initialize(name, age) @name = name @age = age end end # Create a new Person object: person = Person.new("John", 30) puts person.name puts person.age # Change the age of the person: person.age = 35 puts person.age |
|
Constants | ✓ | # Constants in Ruby being with a capital letter. Will throw a warning or error, depending on runtime settings. Name = "John" # Not a constant name = "John" |
|
Exceptions | ✓ | def hello puts "Hello, World!" # start an exception handler begin raise "This is an exception" rescue => e puts "Exception caught: #{e}" end end hello |
|
Assignment | ✓ | pldb = 80766866 |
|
Booleans | ✓ | true false | |
Integers | ✓ | pldb = 80766866 |
|
Duck Typing | ✓ | ||
Regular Expression Syntax Sugar | ✓ | puts "Hello World".match(/\w/) |
|
Strings | ✓ | " | "hello world" |
Case Insensitive Identifiers | X | ||
Semantic Indentation | X | ||
Async Await | X | ||
Function Overloading | X | ||
Dispose Blocks Pattern | X | ||
Dependent types | X | ||
Enums | X | ||
Variable Substitution Syntax | X |
title | authors | year | citations | influentialCitations |
---|---|---|---|---|
BioRuby: bioinformatics software for the Ruby programming language | Naohisa Goto and P. Prins and M. Nakao and R. Bonnal and J. Aerts and Toshiaki Katayama | 2010 | 186 | 10 |
Programming ruby | Parasuram Anantharam | 2001 | 40 | 5 |
FSelector: a Ruby gem for feature selection | Tiejun Cheng and Yanli Wang and S. Bryant | 2012 | 35 | 5 |
A little language for surveys: constructing an internal DSL in Ruby | H. C. Cunningham | 2008 | 31 | 1 |
Feature-oriented programming with Ruby | S. Günther and Sagar Sunkle | 2009 | 27 | 1 |
The ruby intermediate language | Michael Furr and Jong-hoon An and J. Foster and M. Hicks | 2009 | 25 | 4 |
FlowR: aspect oriented programming for information flow control in ruby | Thomas Pasquier and J. Bacon and B. Shand | 2014 | 17 | 1 |
αRby - An Embedding of Alloy in Ruby | Aleksandar Milicevic and I. Efrati and D. Jackson | 2014 | 16 | 3 |
A machine vision extension for the Ruby programming language | J. Wedekind and B. Amavasai and K. Dutton and M. Boissenin | 2008 | 7 | 0 |
Language design and implementation using ruby and the interpreter pattern | Ariel Ortiz | 2008 | 4 | 0 |
Specializing ropes for ruby | Kevin Menard and Chris Seaton and Benoit Daloze | 2018 | 2 | 0 |
Let’s Get It Started: Installing Ruby | Pete Cooper | 2020 | 1 | 0 |
A machine vision extension to the Ruby programming language using OpenCV and FFI | A. Marburg and M. Hayes and A. Bainbridge-Smith | 2013 | 1 | 0 |