Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Programs which manipulate other programs are extremely fun and incredibly powerful. To write them, we need a way to represent code as a data structure which we can analyse, manipulate and eventually execute. In this talk we’ll learn how to store executable code as data in Ruby, and explore how to write different kinds of programs that process it.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In his talk "Programming with Something" at RubyConf 2021, Tom Stuart explores the concept of manipulating programs as data structures using Ruby. His presentation builds on a previous talk from 2011 titled "Programming with Nothing," where he demonstrated the power of using procs to represent data structures and perform operations in Ruby. The key topics he discusses include: - **Representation of Value**: Stuart explains how Ruby’s procs can encode numbers and data structures. He illustrates how to encode and decode numbers, demonstrating that even complex structures like lists and pairs can be processed similarly. - **Implementation of Custom Objects**: The talk encourages implementing personal data structures instead of relying solely on Ruby's built-in procs. By creating custom implementations, programmers gain a deeper understanding and control of the functionality behind their code. - **Evaluation Logic**: Stuart emphasizes the need to evaluate the structures created and outlines an approach for interpreting them, drawing on concepts from computational theories, particularly referencing Alonzo Church’s work on expression reduction. - **Decoding Process**: He discusses decoding the results back into useful information, introducing constants within the abstract syntax tree to facilitate the conversion back to recognizable Ruby values. - **Performance Optimization**: Towards the end, Stuart compares the efficiency of his implementations with Ruby’s performance, discussing methods to enhance speed, including using the secd machine, first proposed by Peter Landin, which separates the evaluation from rewriting expressions, resulting in significant performance improvements. Stuart concludes that understanding the underlying mechanisms of programming languages not only enhances one's skill set but also opens up pathways for creating more efficient programming languages in the future. His demonstration of encoding operations like the fizzbuzz illustrates not just the theoretical underpinnings but practical applications of these concepts. He encourages viewers to explore the provided code examples on GitHub, reinforcing the idea that underlying simplicity can lead to powerful expressions within programming language design.
Suggest modifications
Cancel