Musings on Programming Languages

It is interesting to read about programming languages. They are very similar to natural languages in many regards. For instance, you tend to prefer the first language that you learn or, failing that, languages that are similar to it. Some times people try to make excuses along the lines of “I know how to do things in that language.”

The languages grow and evolve over time. Idioms arise and fall into disuse as more expressive ones are found. The best languages encourage evolution through function definition at minimum and often through macro definition and expansion.

Macros have always intrigued me. They are code that rewrites code. They help bring the expression of a solution closer to the form that it was originally conceived in the programmer’s mind.

When I first learned about macros, I was convinced that they were a necessary, if perhaps not sufficient, attribute of a language in which an artificial intelligence would be written. I have since come to believe that artificial intelligence will emerge from the substrate of the protocols and distributed computing facilities of the internet. I still suspect macros will be involved in some way.

What is a macro? It is a piece of code that instead of encoding a solution directly, allows a programmer to specify how one expression of a solution can be transformed to another, often more complex, expression of an equivalent solution. They often take the form of templates that are filled in with arguments inserted from the macro invocation, after which the resulting code is evaluated as it would be if a programmer had written it directly.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.