December 6, 2024

Idon Rpg

Smart Solutions, Bright Future

At 30 years old, is Ruby in a mid-life crisis or a renaissance?

At 30 years old, is Ruby in a mid-life crisis or a renaissance?

Ruby’s creator, Yukihiro Matsumoto (Matz), released the first public version of the programming language in December 1995, making Ruby just shy of its 30th birthday. It spread across Japanese-language Usenet newsgroups, a popular way of exchanging conversation and media before the World Wide Web, and then reached broader communities throughout the late 1990s.

This was thanks to Ruby’s friendly community and, in no small part, thanks to Matz. (The community has a motto, “Matz is nice, and so we are nice.”) At this year’s annual European Ruby Konferenze — EuRoKu — in Sarajevo, Matz said he created Ruby because he was “lazy and full of hubris.”

That doesn’t sound like a justification for creating and maintaining a programming language for 30 years, but it’s a sign of his derisive humbleness that feeds Ruby and has kept it a generally welcoming community over the decades.

30 years of Ruby history

The programming language emerged when the rapid growth of web-related technologies embraced lightweight, easier-to-learn, and easier-to-run languages such as PHP and Python. While all three languages have myriad other uses, timing and external factors often propelled them into broader popularity. For Ruby, this was the Rails framework in 2004 and two books — Dave Thomas’s Pragmatic Programmer in 1999 and WHY’S (poignant) Guide to Ruby in 2005*.

Webinar: Unicorn DNA: The Blueprint for Scaling Success

What does it take to build a unicorn? On November 19, 3pm CET, top executives of unicorn companies will reveal the mindset, strategies, and innovative thinking that propelled their companies to the top.

While Thomas’s book didn’t cover Ruby in detail, it mentions it, and the author continued to promote the language for many years after publishing it. The book, in general, has been a long-term success, and contributed to increasing interest in Ruby in its early life.

Sometimes, Ruby on Rails feels like a blessing and a curse for Ruby itself. To many developers, they are one and the same thing. Rails events typically have more attendees. Many of the recent features and changes in Ruby came upstream from Rails.

Finally, Rails’ creator and founder of 37Signals, David Heinemeier Hansson (DHH), is a far more recognised name in the wider programming and tech community and is a vocal presence online. One attendee at EuRoKu I spoke to stated that as much as the community doesn’t want to admit it, the two projects are highly connected.

Many Web 2.0 sites that emerged in the early 2000s ran on Rails, and many still do (at least in part), including Airbnb, GitHub, Twitter (now X), Netflix, and Shopify (another major Ruby contributor and sponsor). Rails introduced many features that any older developer (like myself) will remember how groundbreaking they were, and many younger developers will now take it for granted. As a Drupal PHP developer at the time, I remember looking at features such as database table creation, management, and migration with envy.

While interest and search term tracking for Rails shows at a quarter of what it once was, actual usage remains reasonably close to its peak. This shows that many developers using it are at a senior level and largely know what they’re doing.

The 2024 Planet Argon survey confirms this: nearly 70% of respondents had more than seven years experience and have run their applications for about the same length of time. I don’t know how many new projects choose Rails, but there are enough pre-existing ones to maintain a healthy interest for a 20-year-old project.

If you remove the several-year peak of Ruby’s interest after Rails’ release, then Ruby is as popular as it was 30 years ago. According to Tiobe statistics, it’s slightly more popular. The 2023 Stack Overflow survey puts Ruby’s popularity at 16 out of 50 languages, and an IEEE survey from 2024 and PYPL reports about the same.

It’s easy to draw negative or inaccurate statistical comparisons to an unprecedented blip, but abstract them out over time, and you see a different story.

Every language with a few decades under its belt has a degree of technical or community baggage, and I felt this same impression with Ruby in general and at the EuRuKo event. The community was friendly and welcoming but full of references and name drops that meant nothing to me. Granted, all communities do this to a degree, and maybe other events support newcomers, but there were few beginner-level talks.

The next 30 years

But enough of the distant past. What has Ruby recently added, or changed, or planned to keep the current developers interested and maybe attract new ones?

Ruby is an interpreted language, meaning it’s converted from human-readable to machine-runnable code when run, often in a virtual machine that runs on a physical machine. One modern criticism of Ruby, and all interpreted languages, is that they are too slow for the scale of modern applications.

Ruby has a default interpreter, CRuby (formerly “Matz’s Ruby Interpreter”), that translates the code into instructions run by the Ruby virtual machine. But Ruby and the community have added alternative and more performant interpreters, especially in the past few years, including multiple “just in time” (JIT) compiler options, which is a popular technique for bringing compiled code speed to interpreted languages.

Other programming languages, such as C, C++, and Rust, are compiled languages, turning human-readable code into machine-readable code before it’s run. While not primarily designed for running as a compiled language, other options make it possible with Ruby.

However, compiling languages is nothing new, and as I mentioned in my KubeCon EU wrap-up, WebAssembly (WASM) is the present for some and the future for many. Principally, WASM lets you run supported languages in the browser (but also now offers much more, maybe that’s a future post), bringing complex and powerful applications to the browser. Since 2022, Ruby has been able to compile to WASM. If you’ve used Mastodon in the browser, it’s a Ruby on Rails application running as WASM.

When Ruby began life, monoliths were the common application architecture pattern — one large codebase written in one language that handles all functionality and services. In recent years, microservices has become the more popular architectural design, at least in an ideal world.

Instead of one large, multifunctional, monolingual codebase, an application is broken up into a diverse array of code bases and languages that communicate with each other. Ruby was never really designed with this architecture in mind, and you can track its decline along parallel lines with the increase in microservices.

In recent years, Ruby has added features to keep up with changes that may surprise or tempt non-Ruby developers. These include asynchronous and threaded code, allowing applications to communicate simultaneously with other applications and services.

Many modern languages support these features, but Ruby’s syntax is simpler than JavaScript. Developers at EuRuKo were excited by some of the other forthcoming features, all of which continue to add creative options for coding with the language.

While many developers may now dismiss Ruby as an option to start with, it has also inspired many other languages directly and indirectly that may suit the contemporary microservices-fuelled developer.

Elixir, first appearing 12 years ago, drew inspiration from Ruby, and its creator, José Valim, came from the Ruby community. Elixir is more optimised for high concurrency and low latency, making it well-suited for finance and telecommunications industries.

Crystal, created ten years ago, also has members of the Ruby community as maintainers. Its syntax is more inspired by Ruby but adds features that make the language more stable and reliable, including running as compiled instead of interpreted.

Community motivated

Why do long-term Ruby developers still use it despite the plethora of new and shiny options they can choose from? Dave Thomas told me about how he discovered Ruby amongst dozens of other languages he played with on Usenet forums back in the 1990s. “I was blown away. I played with Ruby for a day. I played with it the next day. And I kept playing with it after that, and it became my programming language of choice when I had a choice.”

And why does Thomas continue to use Ruby 30 years later? “Ruby lets you find ways to express yourself without dictating too much. Like when you write prose and are trying to find the right phrasing and structure for your words, Ruby lets you do the same thing with code. You can experiment with nice ways to express things, not just one way.”

I am not likely to switch any of my current projects to Ruby, and I am unsure how many developers established using other languages would either. However, one attitude I heard over and over again when speaking with the Ruby community was “freedom of creative choice.”

Many other programming language communities are full of advice on “the right way” to do things, which is, of course, different, depending on who you speak to. The Ruby community follows a different approach, providing gently opinionated tools to let you find your own way.

The technical world is full of trends that come and go and people who tell you that you’re wrong for your decisions. If the Ruby community is one of the few that doesn’t judge, then no matter its trend or usage percentages, long may it last.

_______

* If you haven’t read WHY’s guide, it’s available for free and is in equal parts programming book, comic, and surreal journey of self-realisation. Because of this strange combination, it’s divisive. Some say it was the only book they ever learned programming from. Others find it an utterly confounding and confusing mess. Still, its unique style and mysterious author also increased interest in the language during its nascent days.

link

Copyright © All rights reserved. | Newsphere by AF themes.