Generative programming: methods, tools, and applications
Generative programming: methods, tools, and applications
C++ Templates
Making patterns explicit with metaprogramming
Proceedings of the 2nd international conference on Generative programming and component engineering
Design Patterns in Ruby (Addison-Wesley Professional Ruby Series)
Design Patterns in Ruby (Addison-Wesley Professional Ruby Series)
The ruby programming language
Static and metaprogramming patterns and static frameworks: a catalog. an application
Proceedings of the 2006 conference on Pattern languages of programs
Programming Ruby 1.9: The Pragmatic Programmers' Guide
Programming Ruby 1.9: The Pragmatic Programmers' Guide
Feature-oriented programming with Ruby
FOSD '09 Proceedings of the First International Workshop on Feature-Oriented Software Development
Metaprogramming Ruby
A pattern language for metadata-based frameworks
Proceedings of the 16th Conference on Pattern Languages of Programs
Patterns for consistent software documentation
Proceedings of the 16th Conference on Pattern Languages of Programs
Hi-index | 0.00 |
Modern programming languages provide extensive metaprogramming facilities. We understand metaprogramming as the utilization and modification of available language constructs and abstractions while staying inside the language. Metaprogramming requires a rich semantic model of the program that is represented as language constructs. The careful utilization of the constructs allows changing programs and sometimes even the semantics of other language constructs. There are several use-cases for these kinds of extensions: Runtime adaption, program generation, language customization or the design of Domain-Specific Languages (DSL). However, for using metaprogramming effectively, developers need to understand the mechanisms of metaprogramming and need a language that addresses these mechanisms. These are the prerequisites to communicate about metaprogramming and to actively use it in development. This paper's goal is to explore and highlight the metaprogramming facilities of the Ruby programming language. Ruby is an interpreted and fully object-oriented language. Any class and method -- even those of the built-in entities -- can be modified at runtime. We explain the mechanisms in the form of a pattern catalog that is structured along the object's initialization, declaration, composition, and modification. The core contribution is the sensitive grouping of related patterns that exist in literature and to reduce them to the dominant techniques they use. The pattern catalog can be used to communicate about Ruby's metaprogramming capabilities effectively. We explain the patterns with their context, problem, goals, consequences, known uses, and illustrate them in the context of an example application.