Dynamic programming language
Encyclopedia : D : DY : DYN : Dynamic programming language
- This article attempts to provide a definition for a term which does not have a clear meaning. Please bear with inconsistencies and contribute to the ongoing discussion.
The degree of dynamism varies between languages. Objective-C was based on the GNU/GCC compiler and allowed dynamism of the function calls only (called categorization for unrelated reasons) by re-writing the method dispatch code. TOM is a development of Objective-C in nature, but using a more complex runtime it allows considerably more flexibility at the cost of performance. Most dynamic languages tend toward this end of the spectrum, allowing classes to be re-defined at runtime by collecting code from several modules. The copy-and-modify (prototype based) languages such as Self and NewtonScript tend to be fully dynamic as a matter of course.
Implementation
Generally programming consists of writing together bits of computer code known as functions which operate on data. These functions are physically represented by computer code at some location in memory. In most programming languages function calls in the source code are replaced with instructions to run the code at that physical location (the exact location being defined by the linker). One problem with this approach is that it does not allow for modification of the code once it is compiled. For instance, if a bug is found in the code, the only solution is to correct the original source code and recompile the application.Dynamic languages rely on the addresses for functions being looked up at runtime, instead of being compiled into addresses at compile time. This allows the symbols to be modified to point to new functions, allowing the definitions to change. Many dynamic languages also look up data in the same fashion, allowing "static" objects such as classes to be modified.
This introduces a lookup during runtime however, as each function call requires the symbol to be looked up, and then the function pointer followed. For this reason dynamic languages often run slower than non-dynamic ones, another "kiss of death" during the 1990s. This delay can be dramatically reduced almost to zero in practice however, for instance, the Objective-C programming language used a pre-loaded cache and a small bit of assembler code in order to reduce this overhead to a single operation.
Dynamic languages
Assembly, C, C++, early Java, and FORTRAN do not generally fit into this category, though it is often possible to build layers on top of a language.
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
