Ruby
Ruby is a programming language released for the first time in 1995.
It is dynamically typed and high level, the opposite of C which is the language in which Ruby is written in. That’s right, when you run Ruby code you’re actually running C!
Let’s have an example to showcase how Ruby benefits from C. Imagine you want to remove every letter ‘c’ from a string. To achieve that, you can simply do in Ruby: str.gsub('c', '')
Boom, one-liner! Now let’s check the source code of Ruby, and see its implementation:
In our example, the gsub function is implemented in the string.c file and you can see that it takes up around 120 lines. C is much more complex, but also very much performant as its compiled output is super close to the language of the processor (CPU).
Here is what the Chat has to say about it:
This low-level implementation allows Ruby to interface directly with the underlying system, which can lead to improved performance for certain operations, such as system-level tasks and I/O operations.
Currently, Ruby is mostly used for web development thanks with Ruby On Rails.
Last updated