An interesting question arose in a discussion with Michael Stal today, as a side effect of both of us being part of the jury for OOP 2008’s Dynamic Language Shootout (German only): What, exactly, is a dynamic language?
Obviously, this is not really a meaningful question since the term is very much marketing, very little substance. But if anything, I would claim that the key factor for a language to qualify as “dynamic” is the ability to define new code at runtime as part of the core language (e.g. something like eval, define_method or similar).
Update: Wikipedia seems to agree (note to self: check before writing):
Dynamic programming language is a term used broadly in computer science to describe a class of high level programming languages that execute at runtime many common behaviors that other languages might perform during compilation, if at all. These behaviors could include extension of the program, by adding new code, by extending objects and definitions, or by modifying the type system, all during program execution. These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them.
What’s your definition of a “dynamic language”?
I was making slides for a talk about JavaScript when I started thinking about what it really means for a language to be dynamic. I realized that while one knows roughly at an intuitive level, it is not obvious how to define it precisely. Just as you, I followed wikipedia (don’t tell anyone), but then I noticed the paper by Meijer and Drayton (which was probably more authoritative than wikipedia) at the bottom http://pico.vub.ac.be/~wdmeuter/RDL04/papers/Meijer.pdf
I thought it was really interesting what they say in section 2.8.
<< Many people believe that the ability to dynamically eval strings as programs is what sets dynamic languages apart from static languages. This is simply not true; any language that can dynamically load code in some form or another, either via DLLs or shared libraries or dynamic class loading, has the ability to do eval. The real question is whether your really need runtime code generation, and if so, what is the best way to achieve this.
In many cases we think that people use eval as a poor man’s substitute for higher-order functions. Instead of passing around a function and call it, they pass around a string and eval it. Often this is unnecessary, but it is always dangerous especially if parts of the string come from an untrusted source. This is the classical script-code injection threat. >>
It goes on,
<< A final use of eval that we want to mention is for partial evaluation, multi-stage programming, or meta programming. We argue that in that case strings are not really the most optimal structure to represent programs and it is much better to use programs to represent programs, i.e. C++-style templates, quasiquote/unquote as in Lisp, or code literals as in the various multi-stage programming languages [20].>>
I think this is really interesting to think about ;-)
— Karl