Metaprogramming: notes and reference material
Lecture notes:
Unfortunately most of my lecture notes are still in handwritten form, but here is a
list of topics and piccies of the notes :-)
Metaprogramming: reference material
General references, introductions, and debates
- Wikipedia: metaprogramming
and template metaprogramming
- IBM developerWorks
- F. Rideau: article on metaprogramming theory and challenges
- PEG: parsing expression grammars
Language-focused material
C
- Wikipedia: the C pre-processor
- JHnet: C preprocessor magic
- P.Fultz: C preprocessor tricks
- my quickref to C preprocessing
- A lex tokenizing grammar for C
- A yacc parsing grammar for C
- A tokenizer for the SIMP language
C++
- C++ template metaprogramming
- CodeProject: intro to template metaprogramming in C++
- A. Hitti: Template metaprogramming in C++
- Variadic templates in C++
- C++ template metaprogramming examples (based on the CodeProject notes above):
basic computation,
computation with functions,
loops/recursion,
if/else/switch, and
parameterized bodies for loops/recursion/if/else/switch,
typesafe variadic functions
processing strings at compile time
- Exploration of C++ from CSCI 330
lisp
- Ian Bicking: the challenge of metaprogramming (lisp-focused)
- Lisp meta-programming for C++ devs
- Slideshow: metaprogramming and reflection in common lisp
- My code samples from the 330 lisp pages :
ruby
- Github: ruby metaprogramming resources
- Course material: metaprogramming in ruby
- Tutorials point: ruby tutorial
- Parslet: a ruby parsing tool
-
Banister: extracting the source code for a ruby method
- My Ruby quicknotes
ruby scripts to tokenizer, syntax check, and parse
a new language (IttyBitty)
ruby code for higher order/dynamic coding
- Building storable/passable functions using
lambda
- Dynamically adding user-defined (and callable) methods to modules using
eval
- Allowing customized runs of methods by passing user defined blocks and running with
yields
- A mini interpretter to
record and run ruby code
- Allowing customized runs of methods by passing user defined blocks and running with
Proc.new.call
- Checking if something has been defined at run time
defined? and respond_to?
- Defining class fields and methods on the fly, tracking content with hash functions:
UserCode class
python
- D. Beazley: Python 3 metaprogramming
- Python metaprogramming slideshow
java
- A. Remani: Java metaprogramming slideshow
javascript
- lucasfcosta 4 part series on metaprogramming in javascript
part 1,
part 2,
part 3,
part 4
Article collection
- Lecture material from International Summer School on Metaprogramming
Tools
- StringTemplate: java code generator
- Compiler tools: lex (builds tokenizing programs) and yacc (builds parsing programs)
- Short look at the old NSIS installer-creation system
Q & A posts
- stack overflow: metaprogramming resources
- stack overflow: real world applications
- stack overflow: metaprogramming uses