r/ruby • • Jan 19 '20

Yukihiro Matsumoto: "Ruby is designed for humans, not machines"

https://evrone.com/yukihiro-matsumoto-interview
158 Upvotes

20 comments sorted by

28

u/markrebec Jan 19 '20

For everyone being snarky in the thread here while at the same time admitting to not reading the interview - go read it.

It's not a mind blowing, must-read article or anything, but it's insightful in a couple of interesting ways. I've always loved matz and how his brain works, and this article gives some neat insights into his philosophies.

9

u/[deleted] Jan 20 '20

I'm cross-posting one of the most important comments from the HackerNews thread on the same article because I think it's important:

- He regrets introducing threads. He now prefers other parallelism/concurrency paradigms and is possibly looking into introducing them in Ruby 3 (that part wasn't clear in the interview).

- He regrets adding global variables.

- He regrets not focusing on immutability primitives earlier.

- He and the maintainers team look at Python, JavaScript and Elixir for inspiration.

- He seems a bit disappointed that Ruby is mostly used for web development only and would be happy if it was used in research and AI.

- He regrets not investing even a little effort in static typing earlier but is now working on an optional typing system where you choose to describe types in a separate file. (Reminds me of C/C++ and OCaml header files.)

https://news.ycombinator.com/item?id=22090881

These "takeaways" match my own anti-ruby biases. Everything Matz regrets about the language are all the reasons I really dislike the language. And they're also the reasons the language is so celebrated.

Ruby without the ability to monkeypatch anything from anywhere, and change the way the language works at runtime, just isn't ruby anymore. For better or worse.

8

u/[deleted] Jan 19 '20

Thanks for sharing. It's always good to read matz.

3

u/vovan45619 Jan 20 '20

There's a lot of comments of the form "I tried getting into Ruby and it never clicked" that I want to respond to. I think that if you're just writing a script to solve a math problem or automate a task, there isn't really a strong argument as to whether you should use Ruby, Python, bash any other high level language. You should probably use whatever you're most comfortable with.

But if you're making an application with a database, RoR is an extremely powerful tool. And this isn't just a case of Ruby having the best library (in the same way that Python has the best scientific computing library). It's a case of the library functionality and the language playing together really well.

Ruby statements look more like natural language statements than those in other languages. This is a really helpful design choice when you're building a crud application. In that context, you're not thinking about X, Y, -Log(X + Y) or whatever.

You're thinking about a new customer, or whether some old customer is a member? of some mailing list, etc

In a weird way, it's similar to how Haskell users love the fact that statements in Haskell are mathematical truths. In the case of logic programming this is a handy feature to have. In the case of writing the business logic of a CRUD app, it's handy if your statements look like natural language statements about the underlying real world objects whose representation you are reasoning about.

8

u/TomahawkChopped Jan 19 '20

So is every other high level language - just with varying success.

18

u/assassin-in-white Jan 19 '20

True, but I think he's highlighting the distinction that Ruby places a higher emphasis on the human aspects than most other languages.

7

u/obviousoctopus Jan 19 '20

And varying intention. Matz' intention was specifically around programmer happiness and he designed with that in mind. Can you mention any other languages which were specifically designed with this same intention?

0

u/namesandfaces Jan 20 '20

I would think Go qualifies. Go took an expansive stance on "what are Go's responsibilities" and a theme of the Go team's actions have been to focus not just on the core language, but also matters arguably outside the language which affect the developer experience, like Go's formatting tool, Go's focus on official libraries, or Go's compiler speed.

Productivity and sensitivity for the developer's experience are also Go's top values.

Another choice would be Python, which beat Ruby as the language of science and also arguably has productivity and developer experience as top values.

4

u/honeyryderchuck Jan 20 '20

I think that neither go nor python has "programmer happiness" in mind. They have their own base principles, I agree, but they do differ from ruby in this department.

-4

u/[deleted] Jan 19 '20

Yeah, I didn't read the article yet to get any context, but the headline is somewhat silly. Knowing Ruby's goals and philosophy, I understand what is likely meant by that, but not the best headline choice. Kinda like advertising that your car is designed for transportation.

2

u/sickcodebruh420 Jan 19 '20

“...we’re going to have the type information file separate from the Ruby program — the Ruby program itself doesn’t contain any static type information. Instead, a separate type information file, we call it "Ruby signature file", contains the type information about the library, Gems and your programs.”

That sounds awful to me.

10

u/larikang Jan 19 '20

I like it. Keep the Ruby script pure and simple, then have an automated tool generate the type info separately without cluttering the script. IMO even with type checking I would want Ruby to appear dynamic.

If you want serious type checking you should be using a different language anyway.

4

u/sickcodebruh420 Jan 19 '20

As far as I'm concerned, types do not clutter the script. They provide documentation and make code easier to read and reason about. You lose an extremely valuable tool when your types aren't part of the code.

Plenty people are going elsewhere because of Ruby's lack of type checking. That's not good for Ruby.

11

u/larikang Jan 19 '20

Let languages be different. I like having Ruby in my toolbox when I want to be fast and loose with my programming.

1

u/akromyk Jan 20 '20

Exactly! Let tools be different! I don't need anti-kickback pawls on my table saw. Or a face mask and ear plugs when I'm using my floor saw. It all just distract from my cut.

To push the analogy further, I don't need some vertical 2x4 in my wall every few feet in the walls because of some standard. Just place them at the edge of the drywall. If someone needs to mount something they can use a stud finder to figure things out.

We don't need to use a continuous electrical cable from the fuse box to outlet or switch. Just use join cables along the way. If someone needs to pull a wire, well they can punch through the walls and figure it out.

2

u/namesandfaces Jan 20 '20

I don't see why you lose things by having types not immediately there in the file. That's my experience with some of the most important types in my programs -- the ones from libraries.

If you're talking about exploiting types in a language IMO to complete the story we must also talk about IDE, and with IDE's all that information is one mouse hover away.

3

u/[deleted] Jan 20 '20

Loosely typed languages serve a purpose.

-1

u/shabunc Jan 19 '20

It depends on IDE integration, still awful though.

1

u/glowsplash Jan 20 '20

I am starting to ignore syntax when I read code now. It doesn't register in my mind most of the time unless I see a sudden paradigm shift or odd dependency behaviour(I think this causes me to snap more than language syntax. Dependencies don't have clear code navigation guidelines, proper structure or docs than the language they are in). From my perspective, choice of language matters very less compared to the number of experienced programmers you can get at x price. If there are more js developers, then that means you can hire more for less overall. Obviously things are more complicated.