Ruby

Summarized using AI

Standing on the Shoulders of Giants

Ryan Davis • March 05, 2015 • Earth

In the talk titled "Standing on the Shoulders of Giants," Ryan Davis explores the idea that modern programming languages, particularly Ruby, should draw inspiration from the foundational concepts pioneered by earlier languages. Davis emphasizes the historical context of programming language development, referencing figures like Alan Kay from Smalltalk, David Ungar from Self, and Guy Steele from Scheme and Racket. The main focus is on how Ruby can enhance itself by incorporating the rich ideas found in these languages.

Key Points Discussed:
- Historical Influence: The talk highlights the metaphor of standing on the shoulders of giants, illustrating how current developments in programming stem from past innovations. Davis recalls the assertion of both Bernard of Chartres and Isaac Newton regarding the importance of building upon prior knowledge.
- The State of Ruby: Davis reflects on Ruby's evolution since its inception in 1993, noting that while it has excellently borrowed ideas from languages like Smalltalk, Lisp, and Perl, it has also stagnated in adopting new concepts in recent years.
- Smalltalk's Contributions: Davis discusses Smalltalk’s clean syntax and immersive development environment, which introduced many ideas like MVC architecture and object-oriented patterns familiar in modern development.
- Self's Influence: He elaborates on Self, a classless language that emphasizes prototyping, influencing contemporary languages such as JavaScript. Its JIT compilation approach also provides valuable lessons for Ruby.
- Racket and Scheme: Racket's robust documentation and metaprogramming capabilities are discussed as inspirations for enhancing Ruby's adaptability and learning curve, suggesting the potential benefits of incorporating a functional programming perspective.
- Cola and Viewpoints Research Institute: Davis mentions Cola from the VPRI, which aims to develop expressive programming systems, highlighting how Ruby can learn from its mixed object and lambda architectures.

Conclusions/Takeaways:
- Ruby is a powerful language in its own right, but to progress and innovate, it must actively integrate insights and practices from these influential languages.
- By adopting strategies from historical giants, Ruby can improve its tools, include more features, and ultimately elevate developer productivity.
- Davis encourages the Ruby community to not shy away from drawing upon the wealth of knowledge available from past programming languages to build a more advanced Ruby.

Standing on the Shoulders of Giants
Ryan Davis • March 05, 2015 • Earth

By, Ryan Davis
Ruby is a fantastic language, but it could be better. While it has done a terrific job of taking ideas from languages like smalltalk, lisp, and (to an extent) perl, it hasn't done nearly enough of it. Big thinkers have paved the way for us in so many programming languages, like Alan Kay & Dan Ingalls (smalltalk), David Ungar (self), Guy Steele & Gerald Sussman (scheme), and Matthias Felleisen (racket). You might not know their names, but you've certainly used their technology. We should plunder the treasures that they've thought up. I will survey a vast minority of these ideas and how they could help ruby. Ideas including: self-bootstrapping implementations and extensive collection / magnitude hierarchies from smalltalk, instance-based inheritance and JIT compilation from self, TCO and the overarching importance of lambdas from racket/scheme, and finally object level pattern matching and the combined object/lambda architecture from the View Points Research Institute. Ruby is at its best when borrowing great ideas from other languages, but lately it has fallen behind in this. It's time for ruby to step up and do more with these ideas, to keep pushing forward, to stand upon the shoulders of giants.

Help us caption & translate this video!

http://amara.org/v/GTxm/

Ruby on Ales 2015

00:00:29.920 This is Ryan Davis, who goes by Zen Spider on the internet. He founded Seattle.rb, a prominent Ruby user group. Ryan has authored multiple tools, including RSpec, Test-Unit, T-Package, and MaxiTest, which he is particularly fond of. He recently advised me to use structs for everything, and I believe that is sound advice. Anytime I can use a struct, I should. In my applications, I hardly ever create objects anymore; everything is a struct.
00:01:00.000 You can find Zen Spider's actual work online by searching for Zen Spider. Please join me in welcoming Ryan Davis to the stage with a round of applause.
00:01:19.360 Since I am the last speaker, I don't have to start the timer yet, right? You're all captive here, so please start the timer. This is my first time at this conference, and I want to thank everyone for having me. I believe this is a great conference, and I would like to thank Jonan, Kobe, Josh, and everyone else involved. I'm sure I’m forgetting many names, so a round of applause for them would be appreciated.
00:01:36.880 I also want to thank all of you for sticking around for the last talk. I know you are all more than a little bit drunk, having made it through an entire day, and now you have to deal with me. Thank you very much for your attention. As mentioned, I am the founder of Seattle.rb, and we just celebrated our 13-year anniversary last Saturday. We've been meeting weekly for the last nine years or so. Unfortunately, we don’t have an exact date when we started that, but we really love our meetups.
00:02:01.119 Today, I'll be speaking about 'Standing on the Shoulders of Giants'. A humorous moment occurred at RubyConf Australia where I said, 'I'll let you finish, but my talk was the best talk ever.' This was in response to a talk given by Aaron Patterson titled 'Polishing Ruby,' which is also the title of my blog since 2005. Some people took it seriously; however, it was staged.
00:02:21.680 As is customary with my talks, I like to set expectations. This talk will have very little in terms of code as it is more of a historical overview, focusing on ideas and concepts I believe we should adopt. To begin, I want to share a little story about my journey with alcohol. I was a teetotaler for about 20 years, avoiding drinking before it was even legal for me to do so. That changed at Madison Ruby in 2012 when Jeannie Carpenter introduced me to a whiskey and cheese pairing that was simply sublime.
00:02:46.720 Consequently, I decided to give drinking a shot, thinking, if I consume expensive alcohol, I would moderate my intake. So, thanks for ruining my liver! As for my current diet, my liver has a 5x multiplier effect, meaning I easily feel tipsy after minimal drinking. Thanks, Josh, for the scotch! Please bear with me if I start to slur my speech.
00:03:09.000 Now, let's jump into the main topic. About 900 years ago, Bernard of Chartres wrote that we, the moderns, are like dwarfs perched on the shoulders of giants, which allows us to see further than the ancients. He attributed this not to our own acuity or stature but because we are elevated by the giants’ greatness. Fast forward about 500 years, Isaac Newton added, 'If I have seen further, it is by standing on the shoulders of giants.' This concept is not new; Newton was iterating on the straightforward idea that every idea we have builds upon the ideas that came before.
00:03:37.760 However, it begs the question: when we create a programming language, why do we often start from scratch? And what does this have to do with Ruby? Well, everything! Otherwise, this talk would have been rejected. As a prelude for our comparison later on, I want to give a quick overview of Ruby's features. Ruby was created by Yukihiro Matsumoto in 1993 and is an interpreted, file-based scripting language.
00:04:05.760 It is purely object-oriented, class-based, and features incredibly complex syntax and semantics—something that resonates with many of us. Ruby is designed and optimized for developer happiness, which is one of the reasons why we love it. For comparison, I want to present a simple Fibonacci implementation in Ruby as a basic example of the language.
00:04:41.440 Looking back at Ruby’s history, we see that Ruby 1.0 was released almost 20 years ago, and it shipped with almost everything we use today in terms of language features. Since then, not much has been added in terms of language features. Ruby 1.0 introduced private and protected methods, followed by class variables in Ruby 1.6. After that, variations like encodings were introduced in versions 1.9 and later improved in 2.0.
00:05:12.960 As much as I love Ruby and believe it's a fantastic language, it could become even better. It seems to me that Ruby has only done a remarkable job of adopting ideas from languages like Smalltalk, Lisp, and to an extent Perl, but we can do more. Looking forward, I hope to see more influence from Lisp and Smalltalk, as well as new ideas from Self and another system called Cola.
00:05:38.240 Now, let’s discuss some of the giants in programming that I believe we should take inspiration from. First, there's Smalltalk by Alan Kay; then Self by David Ungar; and Scheme and Racket, which were influenced by Guy Steele and Gerald Sussman. Additionally, we have contributions from Matthias Felleisen and others from Viewpoints Research Institute. I do not mean to imply that these individuals worked alone; each of them had collaborative teams contributing to their projects.
00:06:04.640 Let’s start with Smalltalk, one of the first languages I truly loved and where I learned object-oriented programming principles. Smalltalk has a runtime quite similar to Ruby, but it diverges in almost every other aspect. Smalltalk was developed by Alan Kay and Dan Ingalls at Xerox PARC in 1972, and it was publicly released in 1980. It is bytecode compiled but operates on an image-based system rather than a file-based system.
00:06:27.920 Smalltalk is purely object-oriented and class-based, similar to Ruby. It offers an incredibly simple and clean syntax with only six keywords and four precedence levels, making it vastly different from Ruby. This simplicity is contrasted by its fully immersive development environment that served as an incubator for many ideas that we use today, including object-oriented patterns and the MVC architecture—all of which originated in Smalltalk.
00:06:55.760 Here’s a simple Fibonacci implementation in Smalltalk. I have grayed out the pseudo syntax that appears when you export Smalltalk code to files since its standard operations are primarily conducted in memory. The method signature demonstrates how to define the Fibonacci function, and it shows a straightforward, readable structure that Rubyists can easily understand.
00:07:17.280 Next, let’s talk about Self, a language that many of you may be unfamiliar with. Self was developed by David Ungar and Randall Smith at Xerox PARC, and it was finalized at Sun in 1987. This bytecode-compiled language is JIT (Just-In-Time) based, operating on a unique image-based system with no files aside from the image itself. Self is an object-oriented, classless language that emphasizes prototyping.
00:07:43.760 Looking at its syntax, Self is remarkably similar to Smalltalk, yet intriguingly distinct as it only has eight bytecodes in its virtual machine compared to the numerous bytecodes found in Ruby. Self's innovative approach allowed for the development of prototypes, and it has influenced many modern languages, including JavaScript. Self popularized object-oriented prototyping and provided languages like Ruby with concepts to build upon.
00:08:17.280 Following Self, I want to mention Racket, which is a type of Scheme. Scheme, developed by Gerald Sussman and Guy Steele in 1975, is a minimal variant of Lisp that addresses several semantic issues of earlier Lisp versions. Scheme introduced various practical innovations such as tail call optimization and hygienic macros.
00:08:58.240 Racket, which is a maximal variant of Scheme, was developed by Matthias Felleisen and the PLT cohort. It boasts an extensive and varied library that offers a multitude of graphic tools and other functionalities. Racket was designed with a dual focus: it is primarily functional while supporting a multi-language runtime. Its simple syntax, rich set of expressions, and integration of an editor with the runtime make it a pleasure for developers.
00:09:52.160 Finally, I want to introduce Cola, a small yet powerful kernel, contributing to Allen Kay’s legacy of building upon the shoulders of giants. The Viewpoints Research Institute (VPRI), where Kay worked, received a grant from the NSF to explore innovative foundations of new computing systems—most notably, their project, Steps, which is focused on expressive programming systems.
00:10:29.760 Steps aims to create an entire system—from the language to the GUI and applications—understood by an individual coder in roughly 20,000 lines of code rather than the millions typically required by similar systems. Cola is one of the subprojects of VPRI, defined by its mixed object and lambda architecture, which seeks to create the simplest possible language that can be described by itself.
00:10:54.560 Reflecting on the languages we've discussed, they highlight a few key ideas we should explore in Ruby. For instance, Smalltalk's language-supported developer tools enhance productivity significantly. Smalltalk introduces automatic debugging for failed unit tests, advocating for what’s called debugger-driven development, which speeds up the development process.
00:11:20.000 Moreover, Smalltalk’s introspection facilities allow developers to navigate across their code conveniently, which Ruby can learn from. Many in the Ruby community argue that static typing is necessary for effective code analysis; however, Smalltalk proves that with the right tools and approaches, you can achieve a high level of flexibility and clarity.
00:11:50.000 Self, while very different from Ruby, maintains a focus on developer tools and features a straightforward GUI, which is immensely practical for coding. Self’s approach allows you to embed methods directly into objects, making the programming experience seamless.
00:12:09.760 Racket, on the other hand, excels in its polished documentation and responsive development team, which creates an enjoyable coding environment. Its integrated IDE, designed for teaching, is also highly beneficial for experienced developers. With extensive documentation and efficiency in its coding processes, Racket sets a high standard.
00:12:36.000 The language's ability to declare its type at the beginning of source files and support metaprogramming makes it incredibly adaptable. This trait can be hugely beneficial when developing DSLs (domain-specific languages), which further enhances Racket’s usability.
00:12:55.360 As I conclude, I recognize that Ruby is a great language at its core. However, we must remember to stand on the shoulders of giants and draw from the ideas and innovations of other programming languages. The prospect of incorporating new ideas into Ruby excites me, as I believe there's a lot of potential to enhance Ruby's capabilities moving forward.
00:13:36.000 In summary, let’s continue to borrow great ideas from languages that have paved the way for us and kept pushing forward. It's time for Ruby to step-up, embrace innovation, and truly stand upon the shoulders of giants. Thank you!
00:37:26.880 Thank you!
Explore all talks recorded at Ruby on Ales 2015
+9