Talks

Summarized using AI

Ruby Archaeology

Nick Schwaderer • May 17, 2022 • Portland, OR

In the talk titled "Ruby Archaeology" delivered by Nick Schwaderer at RailsConf 2022, the speaker explores historical Ruby programming, inspired by a thought-provoking tweet from a prominent Ruby figure, _why. He emphasizes the importance of running old code and understanding the evolution of Ruby, particularly through the lens of gems that were popular over a decade ago. The speaker posits that examining past coding practices can enhance modern Ruby programming and encourages developers to explore Ruby's rich history. Key points discussed include:

  • Setting Up Old Ruby Environments: Schwaderer details how to simulate a Ruby 1.8 environment on modern machines using tools such as Vagrant. He navigates the challenges of accessing outdated libraries and packages.

  • Exploring Historical Gems: He showcases several Ruby gems, including Markaby (introduced by _why), Instiki (a lightweight wiki created by David Heinemeier Hansson), and Merb (a lightweight framework that later merged with Rails). He discusses their features and relevance.

  • Redefining Coding Practices: Schwaderer reflects on coding idioms from earlier versions of Ruby, discussing methods like method missing and the structure of code from that era, emphasizing creativity in coding practices.

  • Community Evolution: The merger between Merb and Rails is highlighted as a significant moment in the Ruby community, showcasing collaboration over competition, which ultimately evolved into Rails 3.

  • Encouraging Exploration: The speaker motivates the audience to delve into old Ruby codebases, suggesting that many gems and libraries remain unexplored and can provide insights into Ruby's functionality and style.

At the conclusion, Schwaderer provides a Vagrant box with pre-configured environments to facilitate exploration, encouraging programmers to appreciate the artistry of older Ruby code and keep an open mind towards various coding approaches. Overall, Schwaderer’s talk serves as both a nostalgic journey into Ruby's past and a call to action for developers to become Ruby archaeologists, unearthing valuable lessons from the language's history.

Ruby Archaeology
Nick Schwaderer • May 17, 2022 • Portland, OR

In 2009 _why tweeted: "programming is rather thankless. you see your works become replaced by superior works in a year. unable to run at all in a few more."
I take this as a call to action to run old code. In this talk we dig, together, through historical Ruby. We will have fun excavating interesting gems from the past.

Further, I will answer the following questions:

What code greater than 12 years old still runs in Ruby 3.1?
What idioms have changed?
And for the brave: how can you set up an environment to run Ruby 1.8 code from ~2008 on a modern machine?

RailsConf 2022

00:00:00.900 Hello, everyone. Thank you for being here today.
00:00:12.300 Today is a laid-back session about Ruby archaeology. I appreciate your presence.
00:00:19.680 My name is Nick Schwaderer, but you can call me Schwad. I work at Shopify, a company that you might know by its occasional mispronunciation.
00:00:26.340 Normally, I work as a freelance detective in the history of Ruby. You may have come across some of my work. Now, I must clarify that I am not an accredited authority in this field, but that's the charm of being freelance.
00:00:37.800 Recently, however, I received an accolade that is quite heartwarming, although I can't officially accept it for tax reasons.
00:01:05.339 As of Monday, I began working with Shopify’s Ruby on Rails infrastructure team, which is thrilling for me.
00:01:09.720 This is proof that Shopify is committed to supporting my work in Ruby archaeology.
00:01:14.100 You may be wondering what I mean by Ruby archaeology. My interest in Ruby stretches back to earlier versions of the language. For those familiar with Ruby from a decade ago or more, I maintain a newsletter that covers historical aspects of Ruby.
00:01:29.340 This newsletter is a compilation of blog posts, releases, discussions, and more from specific points in Ruby's history. In addition, I created the Portal Gun gem, which allows users to specify a date and get a gem file corresponding to Ruby's state at that time. Although there's been some amazing work done by Mike D'Alessio on a tool called 'Bundler as of,' if you're interested in this sort of thing, I recommend using that instead.
00:01:49.140 While exploring Ruby's history, I've often reflected on the late _why, who symbolizes whimsy in programming to me. That sense of whimsy is what draws many of us to Ruby. I believe it's essential to consider the artistry, joy, and community aspects of being a Rubyist.
00:02:11.160 For this talk, I want to recall a poignant quote from _why, just weeks before his disappearance: 'Programming is rather thankless. You see your works become replaced by superior works in a year and unable to run at all in a few more.' This resonates with me as a call to action for us.
00:02:38.700 Today, I'll discuss how we might set up an environment to run Ruby 1.8 code from around 2008, explore three gems that were popular back then, and suggest some ideas that might still be relevant to our current coding practices.
00:03:06.120 Setting up a coding environment to code in 2009 requires some tricks. First, keep in mind that Ruby versions 1.8 and 1.9 were phased out in 2014. It's been a significant amount of time since those versions were the latest. Yet, understanding our past is crucial for the evolution of our mature and rich ecosystem.
00:03:40.020 To ensure we're not stuck in the present while looking to the past, it's important to keep an eye on the coding styles, techniques, and debates from those early years. It's easy for developers to mirror a single pattern in Ruby, but I encourage everyone to express themselves creatively and explore Ruby’s diversity.
00:04:01.239 In this exploration, I set up a Vagrant box to help simulate that 2008 environment. Should you be unfamiliar with what Vagrant is, it allows you to create and manage virtualized environments with ease. I tailored it to point to an operating system that was relevant during 2008.
00:04:29.760 Once the Vagrant setup is complete, you can SSH into it and face the next challenge: Obtaining the relevant packages from that time. To address this, you would update the sources.list file to refer to old repositories that contain packages pertinent to 2008.
00:04:51.180 Diving into this archaeological endeavor should be embraced fully; you cannot approach it half-heartedly. If you encounter bugs or issues, refrain from thinking that you are doing something incorrectly because running old Ruby is meant to yield historical bugs. Part of the exercise is to figure out these bugs through web searches using timestamps relevant to your targeted period.
00:05:12.480 Keeping a consistent Ruby version in this box is fairly straightforward. I completed it with 'apt-get install ruby-dev 1.8.7,' which installs the right version. However, getting RubyGems installed can pose issues when those libraries try to reach out to the present. I approached this challenge by manually downloading .gem files and using local installs.
00:05:38.370 When installing gems, it's often necessary to follow some iterations to create executables to make the process easier. At some point, I decided to refrain from over-engineering the process. So, I left some parts as is.
00:05:49.560 In all this, remember it parallels how one might operate when transitioning systems, like when you get a new computer. You often have to reinstall a series of applications. I encourage everyone to use their own setup, configure things according to their preferences, and figure out how best they interact with their development process.
00:06:18.480 Now, let’s test out the outcomes. I'll introduce you to the first gem we're examining today: Market B. Can I get a show of hands for those who have used Market B? It’s exciting to see that interest! Market B was created by the late _why, and it made its debut in January 2006.
00:06:40.920 Immediately, there was discussion on its application with Rails as it enabled more Ruby-like syntax. If you have the time, I recommend revisiting the initial announcement that showcases many contributors such as Dave Thomas. The code from back then is quite nostalgic, and some might even find it reminiscent of shapes seen in various frameworks today.
00:07:20.940 This is a recording from my Vagrant environment, which didn't allow me to perform live coding here at RailsConf. I intended to showcase the installation of Market B 0.6.6. When I did so, I found that requiring the RubyGems library is necessary to proceed.
00:07:40.920 Once instantiated, the gem provides a simple interface that accurately reflects your intentions, allowing for a seamless construction of HTML pages without needing to decipher the manual. Once set up, the output looks clean and serves the purpose.
00:08:21.600 Continuing from here, I’ll mark the significant commits and provide insights based on the points in the project's history. One discussion point I came across during my research dealt with nested methods.
00:08:58.260 I reflect on the interesting use case where methods can be hidden within a class by wrapping them in another method. The beauty of Ruby allows us to explore numerous creative possibilities.
00:09:38.700 I noticed the term ‘Builder’ frequently associated with creating domain-specific languages. For those who don’t know, it's worth mentioning that the 'Builder' class was introduced by Jim Wyrick, which many of you might recognize from the Ruby community.
00:10:19.320 As I walked through the existing code using Merb, it led me to another gem named Instiki. Can I get a show of hands for Instiki users? Instiki debuted in March 2004 and operated on a straightforward Wiki system, all written in Ruby.
00:10:44.400 It’s fascinating to think how it quietly SaaS-ed itself into the modern web architecture that we often focus on today. Instiki is still in use today, such as at the University of Texas Physics department, and it's quite the accomplishment for a gem that often goes unnoticed.
00:11:34.020 To use this on a machine, I devised a simple pathway—setting up basics and then connecting to an outside network. By sharing folders with your host machine, you can enhance your workflow in your editor.
00:12:20.820 Once you've done that, the installation process can be quite swift: perform a bundle install and run Ruby Instiki. It's quite straightforward, ideally suited for adapting legacy applications.
00:12:52.620 I proceeded by creating an admin credential, thus launching the Instiki wiki.
00:13:12.120 You can create a landing page, use textile formatting, and create references to other pages even on the first try. So, if it seems that you’re at a dead end, you can still cross-link and manage your pages easily.
00:14:02.520 As I echo my run through the code functionality of Instiki, it's clear that the framework supports basic features, making it a compelling tool that stands the test of time. No wonder this is a project worth mentioning during today’s nostalgia.
00:14:43.680 Classic Ruby patterns that continue to persist include the use of 'try' methods, asserting and redefining contexts over time. Revisiting this behavior with the current use of Ruby brings interesting reflections.
00:15:10.080 Despite differences, leveraging the historical context clarifies many current programming practices in Ruby. And let's not ignore the conventions around block delimiters that have evolved as well, where we've seen a conflict in how we structure methods over the years.
00:15:44.220 We’ve talked about various methods of rewriting, as well as incorporating directives for line breaks, which also play into how we understand our coding styles today. Recognizing the benefits of both end and curly braces in Ruby is paramount.
00:16:07.740 And as we move through these elegant expressions, I can't help but share my love for multi-line blocks, a notorious feature with deep roots in Ruby history.
00:16:37.680 So remember that each syntax choice we face can carry additional semantics. It's worth debating in your team how these choices could be framed as we lean further into Ruby understanding.
00:17:10.680 Moving forward, I'll examine another gem—the elegant Merb, a micro-framework unveiled in October 2006 by the promising Portlandian, Ezra Zygmuntowicz.
00:17:41.520 Merb offered its own interpretation for the cursor of frameworks in the Ruby community and aimed to provide a nimble and fun approach to DSLs, looser than its competitor Rails.
00:18:15.000 This gem played an important role in the major Ruby ecosystem shift, notably merging with Rails, which is often considered a tantalizing historical moment.
00:18:47.520 The merger in December 2008 symbolized a significant unification in our community, as Rails absorbed key Merb contributions, crafting a richer ecosystem with diverse innovations.
00:19:08.400 Yehuda Katz, a key figure in this transition, documented extensive work leading to this conclusion—a transformation that many Ruby on Rails developers are grateful for to this day.
00:19:42.600 As I close, I hope my exploration of dialects—both historical and contemporary—shows the impact on how we interact with Ruby. Each merger is online proof of a community willing to cooperate because they recognize shared goals.
00:20:11.520 This theme resonates beyond coding itself; it highlights how code is just one medium we express our creativity and passion in the tech space.
00:20:36.000 So please, consider becoming Ruby archaeologists in your own right. Test out old gems, discover forgotten aspects of Ruby, and relink with nostalgic development practices.
00:21:08.880 With over two decades of Ruby history available to us, don't hesitate to explore. Every gem has a story to tell, and it's all waiting to be discovered.
00:22:00.040 Thank you once again for your time today. I appreciate every one of you for being a part of this exploration with me, and I invite you to connect with me throughout the conference.
00:22:30.420 Cheers, and here's to many more Ruby archaeological adventures in the future!
Explore all talks recorded at RailsConf 2022
+64