DEV Community

Cover image for Is Ruby based on Python?
SAM
SAM

Posted on

Is Ruby based on Python?

The question that everyone seems to be asking is, “Is Ruby based on Python?”

Although Ruby and Python both fall under the umbrella of general-purpose programming languages, many people ask whether one is based on the other. The short answer to this question is no!

Both languages were developed in the 1990s by developers working at research institutions.

Python was developed by Guido van Rossum at CWI in the Netherlands, which was a research institute for mathematics in Holland. He named the language after Monty Python.

Ruby was developed by Yukihiro Matsumoto (“Matz”) while he was working as a developer in Japan. He wanted a language that was more powerful than Perl but still usable as an every-day scripting language, and also had a syntax similar to languages like Smalltalk and Eiffel.

Although Python influenced Ruby, it’s more accurate to say that Ruby is based on Perl, Smalltalk, Eiffel, and Lisp.

Thank you for reading

Discussion (11)

Collapse
darkwiiplayer profile image
DarkWiiPlayer • Edited on

ruby is what happens when some kid learns java then looks at perl and thinks ‘I can fix this!’.


Also, I don't see what Ruby got from lisp. Certainly none of the good parts.

Collapse
saaaa_ profile image
SAM Author • Edited on

As I said Ruby was designed by Yukihiro, who first learned about Lisp in college and later used some of the language's features in his new programming language, which he called Ruby.
while it doesn't really have a lot of the characteristics that make Lisp what it is, it does share some of the same ancestry!

Collapse
darkwiiplayer profile image
DarkWiiPlayer

Yes, but what I'm saying is that I just don't see any of lisp in Ruby. What are the actual language features that carried over?

Thread Thread
saaaa_ profile image
SAM Author

One can see the influence of Lisp in Ruby's use of parentheses for calling functions and the way it uses lambda syntax and object-oriented programming to create more powerful versions of the functional programming style!!

Thread Thread
jeremyf profile image
Jeremy Friesen

There's also the ability to pass methods (as lambdas) to other method calls:

def thing(func)
  func.call
end

thing("hello".method(:to_s))
Enter fullscreen mode Exit fullscreen mode

I've used that one few occasions to assist in dependency injection or testing.

Thread Thread
darkwiiplayer profile image
DarkWiiPlayer

Maybe I'm just not seeing it because I don't know enough about lisp, but 1. using parentheses for calling functions is not a lisp feature; if anything, function calls in lisp tend to look quite different. 2. Lambdas in Ruby are a joke, and not even a good one 3. Object-Oriented and Functional are two completely different programming styles that disagree in fundamental things like state management and mutability. You can mix them, but all you'll get is a mix, not a more powerful version of either of them.

Collapse
joelbonetr profile image
JoelBonetR

About Ruby.
Its creator, Yukihiro “Matz” Matsumoto, blended parts of his favorite languages (Perl, Smalltalk, Eiffel, Ada, and Lisp) to form a new language that balanced functional programming with imperative programming.

There's no single mention to Python. Probably because Python was released in 1991 and it was not widely accepted in the industry since a couple of years ago, whereas Ruby was released in mid 90's.

Collapse
saaaa_ profile image
SAM Author

I couldn't agree more!

Collapse
moopet profile image
Ben Sinclair

I've never heard anyone ask that!

Collapse
saaaa_ profile image
SAM Author

Feel free to check Quora though!

Collapse
moopet profile image
Ben Sinclair

Quora is hilarious.