World Library  
Flag as Inappropriate
Email this Article

Dynamic programming language

Article Id: WHEBN0000234079
Reproduction Date:

Title: Dynamic programming language  
Author: World Heritage Encyclopedia
Language: English
Subject: Julia (programming language), Outline of Perl, ActiveState, Scripting language, Common Lisp
Collection: Evaluation Strategy
Publisher: World Heritage Encyclopedia

Dynamic programming language

This article is about a class of programming languages, for the method for reducing the runtime of algorithms, see Dynamic programming.

Dynamic programming language is a term used in computer science to describe a class of high-level programming languages which, at runtime, execute many common programming behaviors that static programming languages perform during compilation. These behaviors could include extension of the program, by adding new code, by extending objects and definitions, or by modifying the type system. These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them. Many of these features were first implemented as native features in the Lisp programming language.

Most dynamic languages are also dynamically typed, but not all are. Dynamic languages are frequently (but not always) referred to as “scripting languages”, although the term “scripting language” in its narrowest sense refers to languages specific to a given run-time environment.


  • Examples 1
  • Implementation 2
    • Eval 2.1
    • Object runtime alteration 2.2
    • Functional programming 2.3
      • Closures 2.3.1
      • Continuations 2.3.2
    • Reflection 2.4
    • Macros 2.5
  • Languages 3
  • See also 4
  • References 5
  • External links 6
  • Further reading 7


The following are generally considered dynamic languages:



Some dynamic languages offer an eval function. This function takes a string parameter containing code in the language, and executes it. If this code stands for an expression, the resulting value is returned. However, Erik Meijer and Peter Drayton suggest that programmers "use eval as a poor man's substitute for higher-order functions."[3]

Object runtime alteration

A type or object system can typically be modified during runtime in a dynamic language. This can mean generating new objects from a runtime definition or based on mixins of existing types or objects. This can also refer to changing the inheritance or type tree, and thus altering the way that existing types behave (especially with respect to the invocation of methods).

Functional programming

Functional programming concepts are a feature of many dynamic languages, and also derive from Lisp.


One of the most widely used aspects of functional programming in dynamic languages is the closure, which allows creating a new instance of a function which retains access to the context in which it was created. A simple example of this is generating a function for scanning text for a word:

function new_scanner (word)
  temp_function = function (input)
    scan_for_text (input, word)
  end function
  return temp_function
end function

Note that the inner function has no name, and is instead stored in the variable temp_function. Each time new_scanner is executed, it will return a new function which remembers the value of the word parameter that was passed in when it was defined.

Closures[4] are one of the core tools of functional programming, and many languages support at least this degree of functional programming.


Another feature of some dynamic languages is the continuation. Continuations represent execution state that can be re-invoked. For example, a parser might return an intermediate result and a continuation that, when invoked, will continue to parse the input. Continuations interact in very complex ways with scoping, especially with respect to closures. For this reason, many dynamic languages do not provide continuations.


Reflection is common in many dynamic languages, and typically involves analysis of the types and metadata of generic or polymorphic data. It can, however, also include full evaluation and modification of a program's code as data, such as the features that Lisp provides in analyzing S-expressions.


A limited number of dynamic programming languages provide features which combine code introspection and eval in a feature called macros. Most programmers today who are aware of the term macro have encountered them in C or C++, where they are a static feature which are built in a small subset of the language, and are capable only of string substitutions on the text of the program. In dynamic languages, however, they provide access to the inner workings of the compiler, and full access to the interpreter, virtual machine, or runtime, allowing the definition of language-like constructs which can optimize code or modify the syntax or grammar of the language.

Assembly, C, C++, early Java, and FORTRAN do not generally fit into this category.


Popular dynamic programming languages include JavaScript, Python, Ruby, PHP, Lua and Perl.

See also


  1. ^ Chapter 24. Dynamic language support. Retrieved on 2013-07-17.
  2. ^
  3. ^  
  4. ^ See example of use on p.330 of Larry Wall's Programming Perl ISBN 0-596-00027-8

External links

(Many use the term "scripting languages".)

  • Are Scripting Languages Any Good? A Validation of Perl, Python, Rexx, and Tcl against C, C++, and Java (PDF) — 2003 study
  • A Slightly Skeptical View on Scripting Languages by Dr. Nikolai Bezroukov
  • "Programming is Hard - Let's Go Scripting" by Larry Wall - transcript of his State of the Onion speech.
  • Scripting on the Java platform — JavaWorld

Further reading

, Advances in Computers, vol. 77, pages 149-184, July 2009Dynamically Typed LanguagesLaurence Tratt,

This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from World eBook Library are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.