SlideShare a Scribd company logo
REFLEXIVE METAPROGRAMMING IN RUBY

TUTORIAL PRESENTATION

H. Conrad Cunningham
Department of Computer and Information Science
University of Mississippi
University, MS 38677
(662) 915-5358
cunningham@cs.olemiss.edu

ABSTRACT
Ruby is an interpreted, dynamically typed, object-oriented application programming language [10]. It has
been in existence for more than a decade, but in the past three years interest in the Ruby language and the
programming styles it enables [2] has exploded in the practitioner community [8, 9]. Much of the explosive
growth in interest has been because of the advent of the Ruby on Rails Web application framework [7, 11].

Ruby on Rails is essentially a domain-specific language (DSL) [1, 6] for web applications. It is
implemented as an internal (or embedded) DSL [4, 5] using Ruby’s flexible syntax and extensive reflexive
metaprogramming facilities [3]. Reflexive metaprogramming is the capability of a program to both inspect
and change its own program structures [12]. It has long been a staple of languages such as Smalltalk and
Lisp, but the recent interest in Ruby has renewed interest in metaprogramming and in techniques like
internal DSLs.

This tutorial does not concern itself with Ruby on Rails, but, instead, focuses on the Ruby features that
make Rails possible. It examines Ruby with an emphasis on the language’s distinctive reflexive
metaprogramming facilities and techniques. These include the ability to query a class to determine what its
methods, instance variables, and superclasses are—facilities that exist in mainstream languages like Java.
Ruby also includes more exotic seeming facilities such as the ability to intercept calls to missing methods,
to define new classes and methods dynamically, and to evaluate strings as Ruby code. The tutorial uses
internal DSLs to motivate the utility of these language features.

PRESENTER
H. Conrad Cunningham is Professor and Chair of Computer and Information Science at the University of
Mississippi (Ole Miss).      His professional interests include software architecture, programming
methodology, programming languages, and concurrent and distributed computing. He has a BS degree in
mathematics from Arkansas State University and MS and DSc degrees in computer science from
Washington University in St. Louis. Cunningham has taught courses on software engineering, software
architecture, software components, object-oriented programming, and functional programming. In the Fall
2006 semester, he taught a graduate course that included considerable content on Ruby programming,
including its functional programming and reflexive metaprogramming features, and on domain-specific
languages.

REFERENCES
[1] Bentley, J., Programming pearls: Little languages, Communications of the ACM, 29 (8), 711-721, 1986.
[2] Carlson, L., Richardson, L., Ruby Cookbook, O’Reilly, 2006
[3] Freeze, J., Creating DSLs with Ruby, Artima Developer,
http://www.artima.com/rubycs/articles/ruby_as_dsl.html, March 2006.
[4] Fowler, M., Language workbenches: The killer-app for domain specific languages?
http://www.martinfowler.com/articles/languageWorkbench.html, June 2005.
[5] Fowler, M., Generating code for DSLs, http://www.martinfowler.com/articles/codeGenDsl.html, June
2005.
[6] Mernik, M., Heering, J., Sloane, A. M., When and how to develop domain-specific languages, ACM
Computing Surveys, 37 (4), 316-344, 2005.
[7] Ruby on Rails Project, http://www.rubyonrails.org, accessed December 2, 2006.
[8] Tate, B., Beyond Java, O’Reilly, 2005.
[9] Tate, B., From Java to Ruby: Things Every Manager Should Know, Pragmatic Bookshelf, 2006.
[10] Thomas, D., Fowler, C., Hunt, A., Programming Ruby: The Pragmatic Programmers' Guide, Second
Edition, Pragmatic Bookshelf, 2005.
[11] Thomas, D., Heinemeier Hansson, D., Agile Web Development with Rails, Second Edition, Pragmatic
Bookshelf, 2006.
[12] Wikipedia: The Free Encyclopedia, Metaprogramming,
http://en.wikipedia.org/wiki/Metaprogramming, accessed December 2, 2006.

More Related Content

Similar to RubyMetaprogramming

Towards Language-Oriented Modeling (HDR Defense)
Towards Language-Oriented Modeling (HDR Defense)Towards Language-Oriented Modeling (HDR Defense)
Towards Language-Oriented Modeling (HDR Defense)
Benoit Combemale
 
Unit ii oo design 9
Unit ii oo design 9Unit ii oo design 9
Unit ii oo design 9
kiruthikamurugesan2628
 
A Survey on Various Web Technologies
A Survey on Various Web TechnologiesA Survey on Various Web Technologies
A Survey on Various Web Technologies
ijsrd.com
 
Evolution Of Object Oriented Technology
Evolution Of Object Oriented TechnologyEvolution Of Object Oriented Technology
Evolution Of Object Oriented Technology
Sharon Roberts
 
Programming languages
Programming languagesProgramming languages
Programming languages
priyanka sharma
 
The different kind of programming language
The  different kind of programming languageThe  different kind of programming language
The different kind of programming language
Md Amran
 
Java-centered Translator-based Multi-paradigm Software Development Environment
Java-centered Translator-based Multi-paradigm Software Development EnvironmentJava-centered Translator-based Multi-paradigm Software Development Environment
Java-centered Translator-based Multi-paradigm Software Development Environment
Waqas Tariq
 
8505548.ppt
8505548.ppt8505548.ppt
8505548.ppt
meenabairagi1
 
Programming-Languages.pptx
Programming-Languages.pptxProgramming-Languages.pptx
Programming-Languages.pptx
Vrushabh Tokse
 
Scales02WhatProgrammingLanguagesShouldWeTeachOurUndergraduates
Scales02WhatProgrammingLanguagesShouldWeTeachOurUndergraduatesScales02WhatProgrammingLanguagesShouldWeTeachOurUndergraduates
Scales02WhatProgrammingLanguagesShouldWeTeachOurUndergraduates
Hans Ecke
 
20210417-cppRelevancy-DataStructures.pptx
20210417-cppRelevancy-DataStructures.pptx20210417-cppRelevancy-DataStructures.pptx
20210417-cppRelevancy-DataStructures.pptx
Suman Garai
 
Comparative Analysis of Visual Basic VS Java programming language.docx
Comparative Analysis of Visual Basic VS Java programming language.docxComparative Analysis of Visual Basic VS Java programming language.docx
Comparative Analysis of Visual Basic VS Java programming language.docx
RichwellIanAfrica
 
Programming language
Programming languageProgramming language
Programming language
Lia Safitri
 
Programming Language
Programming LanguageProgramming Language
Programming Language
Fahad Khan
 
English de lenguaje de programacion
English de lenguaje de programacionEnglish de lenguaje de programacion
English de lenguaje de programacion
Villalba Griselda
 
A Survey of Object Oriented Programming LanguagesMaya Hris.docx
A Survey of Object Oriented Programming LanguagesMaya Hris.docxA Survey of Object Oriented Programming LanguagesMaya Hris.docx
A Survey of Object Oriented Programming LanguagesMaya Hris.docx
daniahendric
 
OOP and Its Calculated Measures in Programming Interactivity
OOP and Its Calculated Measures in Programming InteractivityOOP and Its Calculated Measures in Programming Interactivity
OOP and Its Calculated Measures in Programming Interactivity
iosrjce
 
1 preliminaries
1 preliminaries1 preliminaries
1 preliminaries
jigeno
 
Software architecture styles families_research_gssi_nov2013
Software architecture styles families_research_gssi_nov2013Software architecture styles families_research_gssi_nov2013
Software architecture styles families_research_gssi_nov2013
Henry Muccini
 
Impacts of Object Oriented Programming on Web Application Development
Impacts of Object Oriented Programming on Web Application DevelopmentImpacts of Object Oriented Programming on Web Application Development
Impacts of Object Oriented Programming on Web Application Development
Editor IJCATR
 

Similar to RubyMetaprogramming (20)

Towards Language-Oriented Modeling (HDR Defense)
Towards Language-Oriented Modeling (HDR Defense)Towards Language-Oriented Modeling (HDR Defense)
Towards Language-Oriented Modeling (HDR Defense)
 
Unit ii oo design 9
Unit ii oo design 9Unit ii oo design 9
Unit ii oo design 9
 
A Survey on Various Web Technologies
A Survey on Various Web TechnologiesA Survey on Various Web Technologies
A Survey on Various Web Technologies
 
Evolution Of Object Oriented Technology
Evolution Of Object Oriented TechnologyEvolution Of Object Oriented Technology
Evolution Of Object Oriented Technology
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
The different kind of programming language
The  different kind of programming languageThe  different kind of programming language
The different kind of programming language
 
Java-centered Translator-based Multi-paradigm Software Development Environment
Java-centered Translator-based Multi-paradigm Software Development EnvironmentJava-centered Translator-based Multi-paradigm Software Development Environment
Java-centered Translator-based Multi-paradigm Software Development Environment
 
8505548.ppt
8505548.ppt8505548.ppt
8505548.ppt
 
Programming-Languages.pptx
Programming-Languages.pptxProgramming-Languages.pptx
Programming-Languages.pptx
 
Scales02WhatProgrammingLanguagesShouldWeTeachOurUndergraduates
Scales02WhatProgrammingLanguagesShouldWeTeachOurUndergraduatesScales02WhatProgrammingLanguagesShouldWeTeachOurUndergraduates
Scales02WhatProgrammingLanguagesShouldWeTeachOurUndergraduates
 
20210417-cppRelevancy-DataStructures.pptx
20210417-cppRelevancy-DataStructures.pptx20210417-cppRelevancy-DataStructures.pptx
20210417-cppRelevancy-DataStructures.pptx
 
Comparative Analysis of Visual Basic VS Java programming language.docx
Comparative Analysis of Visual Basic VS Java programming language.docxComparative Analysis of Visual Basic VS Java programming language.docx
Comparative Analysis of Visual Basic VS Java programming language.docx
 
Programming language
Programming languageProgramming language
Programming language
 
Programming Language
Programming LanguageProgramming Language
Programming Language
 
English de lenguaje de programacion
English de lenguaje de programacionEnglish de lenguaje de programacion
English de lenguaje de programacion
 
A Survey of Object Oriented Programming LanguagesMaya Hris.docx
A Survey of Object Oriented Programming LanguagesMaya Hris.docxA Survey of Object Oriented Programming LanguagesMaya Hris.docx
A Survey of Object Oriented Programming LanguagesMaya Hris.docx
 
OOP and Its Calculated Measures in Programming Interactivity
OOP and Its Calculated Measures in Programming InteractivityOOP and Its Calculated Measures in Programming Interactivity
OOP and Its Calculated Measures in Programming Interactivity
 
1 preliminaries
1 preliminaries1 preliminaries
1 preliminaries
 
Software architecture styles families_research_gssi_nov2013
Software architecture styles families_research_gssi_nov2013Software architecture styles families_research_gssi_nov2013
Software architecture styles families_research_gssi_nov2013
 
Impacts of Object Oriented Programming on Web Application Development
Impacts of Object Oriented Programming on Web Application DevelopmentImpacts of Object Oriented Programming on Web Application Development
Impacts of Object Oriented Programming on Web Application Development
 

More from tutorialsruby

<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
tutorialsruby
 
TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>
tutorialsruby
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
tutorialsruby
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
tutorialsruby
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
tutorialsruby
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0
tutorialsruby
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
tutorialsruby
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
tutorialsruby
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
tutorialsruby
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
tutorialsruby
 
CSS
CSSCSS
CSS
CSSCSS
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
tutorialsruby
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
tutorialsruby
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
tutorialsruby
 

More from tutorialsruby (20)

<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
CSS
CSSCSS
CSS
 
CSS
CSSCSS
CSS
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 

Recently uploaded

Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 

Recently uploaded (20)

Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 

RubyMetaprogramming

  • 1. REFLEXIVE METAPROGRAMMING IN RUBY TUTORIAL PRESENTATION H. Conrad Cunningham Department of Computer and Information Science University of Mississippi University, MS 38677 (662) 915-5358 cunningham@cs.olemiss.edu ABSTRACT Ruby is an interpreted, dynamically typed, object-oriented application programming language [10]. It has been in existence for more than a decade, but in the past three years interest in the Ruby language and the programming styles it enables [2] has exploded in the practitioner community [8, 9]. Much of the explosive growth in interest has been because of the advent of the Ruby on Rails Web application framework [7, 11]. Ruby on Rails is essentially a domain-specific language (DSL) [1, 6] for web applications. It is implemented as an internal (or embedded) DSL [4, 5] using Ruby’s flexible syntax and extensive reflexive metaprogramming facilities [3]. Reflexive metaprogramming is the capability of a program to both inspect and change its own program structures [12]. It has long been a staple of languages such as Smalltalk and Lisp, but the recent interest in Ruby has renewed interest in metaprogramming and in techniques like internal DSLs. This tutorial does not concern itself with Ruby on Rails, but, instead, focuses on the Ruby features that make Rails possible. It examines Ruby with an emphasis on the language’s distinctive reflexive metaprogramming facilities and techniques. These include the ability to query a class to determine what its methods, instance variables, and superclasses are—facilities that exist in mainstream languages like Java. Ruby also includes more exotic seeming facilities such as the ability to intercept calls to missing methods, to define new classes and methods dynamically, and to evaluate strings as Ruby code. The tutorial uses internal DSLs to motivate the utility of these language features. PRESENTER H. Conrad Cunningham is Professor and Chair of Computer and Information Science at the University of Mississippi (Ole Miss). His professional interests include software architecture, programming methodology, programming languages, and concurrent and distributed computing. He has a BS degree in mathematics from Arkansas State University and MS and DSc degrees in computer science from Washington University in St. Louis. Cunningham has taught courses on software engineering, software architecture, software components, object-oriented programming, and functional programming. In the Fall 2006 semester, he taught a graduate course that included considerable content on Ruby programming, including its functional programming and reflexive metaprogramming features, and on domain-specific languages. REFERENCES [1] Bentley, J., Programming pearls: Little languages, Communications of the ACM, 29 (8), 711-721, 1986. [2] Carlson, L., Richardson, L., Ruby Cookbook, O’Reilly, 2006 [3] Freeze, J., Creating DSLs with Ruby, Artima Developer, http://www.artima.com/rubycs/articles/ruby_as_dsl.html, March 2006. [4] Fowler, M., Language workbenches: The killer-app for domain specific languages? http://www.martinfowler.com/articles/languageWorkbench.html, June 2005. [5] Fowler, M., Generating code for DSLs, http://www.martinfowler.com/articles/codeGenDsl.html, June 2005. [6] Mernik, M., Heering, J., Sloane, A. M., When and how to develop domain-specific languages, ACM Computing Surveys, 37 (4), 316-344, 2005. [7] Ruby on Rails Project, http://www.rubyonrails.org, accessed December 2, 2006.
  • 2. [8] Tate, B., Beyond Java, O’Reilly, 2005. [9] Tate, B., From Java to Ruby: Things Every Manager Should Know, Pragmatic Bookshelf, 2006. [10] Thomas, D., Fowler, C., Hunt, A., Programming Ruby: The Pragmatic Programmers' Guide, Second Edition, Pragmatic Bookshelf, 2005. [11] Thomas, D., Heinemeier Hansson, D., Agile Web Development with Rails, Second Edition, Pragmatic Bookshelf, 2006. [12] Wikipedia: The Free Encyclopedia, Metaprogramming, http://en.wikipedia.org/wiki/Metaprogramming, accessed December 2, 2006.