community
directory
books
authors
images
encyclopedia

Email:
Password:
Register

Knowledgerush Search

 

Google
  Web knowledgerush


Search for images of Dynamic language


Message boards   Post comment

Dynamic language

In computer science, a dynamic programming language is a kind of programming language in which programs can change their structure as they run: functions may be introduced or removed, new classes of objects may be created, new modules may appear. As a side effect of this dynamism, most dynamic programming languages are dynamically typed, which static typing advocates consider a drawback (see also static typing). According to advocates of dynamic programming languages, however, the flexibility of dynamic languages offsets these drawbacks, and even provides advantages so considerable as to make this an essential feature.

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 addesses 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 dramtically 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.

The degree of dynamism varies between languages. Objective-C was based on the GNU-C 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.

Smalltalk, Scheme, Lisp, Dylan, Python, Perl and many other languages fit this category. C, C++, Java, and FORTRAN do not, as languages, though it is always possible to build layers on top of a language.

 

Compose Your Message

Your Email Address or Pen Name (optional):
Subject:
Your Message:
 

 

 

 

 

 

This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Dynamic language".

 

Contact UsPrivacy Statement & Terms of Use

 
Copyright © 1999-2003 Knowledgerush.com. All rights reserved.