Ruby, Web Services Scripting Language
Ruby had a local audience before the introduction of the Ruby on rails medium in 2004, which shared its success with the language itself. This is a web application building framework based on this language.

It was created by Yukihiro "Matz" Matsumoto from 1993 to 1995.
The goal was to program intuitively for a person, rather than having them adapt their thinking to the structures of a computer. This is embodied in the application of the principle of least surprise, which means that the syntax of the language is always what the programmer naturally expects. But there are also a number of agreements established to simplify programming and only one way to do each thing (unlike Perl).
Ruby is interpreted (uses baytecode), fully subject-oriented and dynamically typical.
Like Python or PHP, this requires the user to install the interpreter if you want to distribute the program, but in fact it is a whole environment that needs to be installed without being sure that everything works. The difference from Java is the size of the standard API of the latter, while Ruby mainly depends on third-party libraries.
That is why Ruby is mainly used both for corporate projects and on servers. It is also designed for medium services, and, as a rule, for moving to a higher size, tends to migrate to platforms such as Java, Go, Node.js and since 2015 to Elixir.
The Ruby syntax inspired Elixir to run on a Beam virtual machine, and Crystal compiled into LLVM bitcode.
Language simplified by a set of conventions
Thanks to a set of rules, such as the role of capitalization in distinguishing constants, that language has been made simpler and clearer.
Its inspirations are Perl, Smalltalk and Python.
-
Using the
- main object, variables and functions become attributes and methods.
- Simple legacy.
- Operator congestion.
- Closure and continuation.
- Multitasking, exceptions.
- Reflection.
- UTF-8.
Variables and constants:
- Capitalized or capitalized identifiers denote constants.
- Real numbers are recognized as a period followed by a number or zero.
- Global variables start with $. Note that the Go language uses capital letters here.
- Attributes in classes begin with @.
- Local variables are simple identifiers.
Symbols:
# comment begins.
[exp,...] inside the picture.
{1 => a,...} for the dictionary.
Control structures:
The if structure contains the elsive and else variants.
if x < 10 then
print "x moins que 10\n"
else
print "etc...\n"
end
Willow structure: while expr [do]
...
end
Function or method:
The definition starts with the keyword def, then the name and a comma-separated list of arguments, then the statements, and ends with the keyword end.
The return keyword in the definition body returns one or more values.
def funcname( arguments )
...instructions...
return x, y, z
end
Class:
class nom
...
end
Code examples, Hello world:
do puts "Hello, World!" end
Scanning table contents:
mylist = [ "d", "e", "m", "o" ]
for i in mylist do
print i, "\n"
end
Ruby on the rails
Do I need to choose Ruby On Rails to create my online app?
Like the language itself, this server infrastructure was designed to be simple and intuitive. The main reason cited to justify your choice is that you can implement a functional application with ROR in a few hours (when you are already familiar with it).
It has a number of plugins that increase its capabilities, "Gems," a built-in testing tool, and other tools.
However, its implementation is not so easy for a beginner, on the contrary, PHP, you need to know the whole system to start using it, and its template language is quite kabalistic.
ROR also owes its success to its many instruments. But from time to time, PHP in particular has changed significantly. Version 7 is twice as fast, safer. It has a Composer package manager equivalent to RubyGems. The same goes for other platforms: they have endowed themselves with tools equivalent to those of ROR, negating much of its past advantages.
The platform's unconditionists will say that it allows you to make sites with a large audience, but there is a tendency to migrate to Elixir - a language derived from Ruby, but running on the Erlang platform and its Beam virtual machine, designed for fault tolerance at large sites.
In conclusion, ROR is a secure and stable platform with good documentation, but from now on it is no more innovative than alternatives and even lagging behind. By the way, Ruby is little used outside of Rails, so you only need to learn the language to create a site.
See also
Node, Go, Elixir, PHP, which web application platform to choose.
Tools and Documentation
References: Ruby's reference guide.