An Introduction to Metaprogramming

Hi, today's entry is going to talk about an article called “An Introduction to Metaprogramming” written by our professor Ariel Ortiz in 2007. First of all, I just want to mention that I’m really impressed because I didn’t know that our professor had many published articles and papers (we saw the others in my other blog for Compilers Design course). Basically, as its name says, it talks about metaprogramming, which is defined during the article as a program that generates other programs or just program parts. It is used to eliminate or just reduce a “tedious” programming task. It is like instead of writing complex machine code programs, we use any high-level language and use the compiler of that language to do the translation into the programs equivalent in machine code (low-level language). I have to admit that before reading this paper, I hadn’t fully understood the metaprogramming meaning and importance. We used and applied that term in a past course called Programming Languages. On that course, we built a metacircular program using Clojure.

I want to mention two concepts I found important, the eval function and Quines. The first one is a function that not all the languages have, but it is used to translate and execute any piece of code in a string but at the runtime phase. This could really facilitate the development of a metacircular program because, in that way, we don`t have to generate a new file and then run it. The second one refers to a kind of source code generator, very useful also for building any metacircular program.

I found this paper really interesting an effectively achieving its main goal, that it is giving an introduction to metacircular programming. It gave us some techniques to facilitate our metaprogramming both understating and developing. I hope more papers as this one are coming.

Comments

Popular posts from this blog

Hidden Figures

Microservices