Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Ruby 3 will separate keyword arguments from positional arguments, which causes the biggest backwards compatibility issues in Ruby since Ruby 1.9. This presentation will discuss the history of keyword arguments, how keyword arguments are handled internally, how keyword arguments were separated from positional arguments internally, and possible future improvements in the handling of keyword arguments.
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
The video titled "Keyword Arguments: Past, Present, and Future" presented by Jeremy Evans at RubyKaigi Takeout 2020 focuses on the evolution of keyword arguments in Ruby, particularly with the upcoming changes in Ruby 3. The presentation covers the historical context, the internal handling of keyword arguments, the separation of keyword from positional arguments, and potential future enhancements. Key Points Discussed: - **History of Keyword Arguments**: - Ruby did not originally support keyword arguments until Ruby 2.0 (released in 2013), although they were planned for Ruby 1.8. - Prior to that, hashes were used as a workaround to simulate keyword arguments, which was clunky and could lead to performance issues. - **Current Implementation**: - In Ruby 2.7, improvements included the ability for non-symbol keys in keyword hashes, addressing various backward compatibility concerns. Evans details the functionality changes and the rationale behind them. - Examples demonstrate how optional hashes could lead to unexpected behavior when treated as keyword arguments, drawing attention to specific class methods that contributed to these confusions. - **Separation of Keyword Arguments in Ruby 3**: - Discussed the significant changes coming with Ruby 3, particularly the need for full keyword argument separation, which intended to eliminate ambiguities when passing arguments. - The new rules make keyword arguments distinct from positional arguments, breaking compatibility for some existing patterns but ultimately providing clearer behavior for method callers. - **Future Improvements**: - Evans proposes optimizations to reduce hash allocations during method calls involving keyword arguments, including strategies for managing mutable flags during operations. - He concludes on positive notes about performance improvements already implemented and the expected enhanced clarity in function usage moving forward in Ruby 3. In conclusion, the presentation outlines the significant transformation of keyword arguments within the Ruby language, emphasizing a history marked by gradual improvements, ongoing challenges with backward compatibility, and a promising future with better performance and clarity in method definitions involving keyword arguments.
Suggest modifications
Cancel