Skip to content
Main menu
  • Main page
  • Discover
  • Unexpected connections
  • Topics
  • Random article
  • Search
Your library
  • Saved articles
  • Recent discoveries
  • Rabbit-hole trails
Topic areas
  • Computer Science
  • Mathematics
  • Physics
  • Engineering
  • Biology
  • Economics
  • Curiosities
WikiholeDeeper into Wikipedia
EnglishEN
  • Saved
  • History

  • Article text and media come live from Wikipedia via the official MediaWiki API and are available under the Creative Commons Attribution-ShareAlike 4.0 License; additional terms may apply. Each article links to its source and revision.
  • WikiHole is an independent project and is not affiliated with the Wikimedia Foundation.
  • How ranking works
  • All topics
  • Reading history
  • Random article
  • MediaWiki API

Dynamic programming language

  • Article
  • Rabbit hole
  • Read
  • View history
Tools
Actions
  • Read
  • View history
General
  • Recent changes
  • Related articles
  • Random discovery
This article
Reading time
6 min
Topic
Computer Science
Quality
Start-class
Views
582 in 14 days
Last edited
11 Jun 2026
Print/export
  • Printable version
In other projects
  • Wikidata item
From Wikipedia, the free encyclopedia
Rabbit hole:
  1. Dynamic programming language

A dynamic programming language is a type of programming language that allows various operations to be determined and executed at runtime. This is different from the compilation phase. Key decisions about variables, method calls, or data types are made when the program is running, unlike in static languages, where the structure and types are fixed during compilation. Dynamic languages provide flexibility. This allows developers to write more adaptable and concise code.

For instance, in a dynamic language, a variable can start as an integer. It can later be reassigned to hold a string without explicit type declarations. This feature of dynamic typing enables more fluid and less restrictive coding. Developers can focus on the logic and functionality rather than the constraints of the language.

Loading the rest of the article…

Recent changes

Rabbit hole

Where Dynamic programming language leads. Every connection below has a source: a link in this article, a shared Wikipedia category, or CirrusSearch text similarity. Articles already on your trail are left out.

Contents
  • (Top)
  • Implementation
  • Example code
  • Examples
  • See also
  • References
  • Further reading
  • External links
  • Recent changes
  • Rabbit hole
Contents
Contents9 sections
  • (Top)
  • Implementation
  • Eval
  • Object runtime alteration
  • Type inference
  • Variable memory allocation
  • Reflection
  • Macros
  • Example code
  • Computation of code at runtime and late binding
  • Object runtime alteration
  • Assembling of code at runtime based on the class of instances
  • Examples
  • See also
  • References
  • Further reading
  • External links
  • Recent changes
  • Rabbit hole
Study aids for Dynamic programming language

Terminology

person
In the next example, the class person gets a new superclass.
print
The print method gets redefined such that it assembles several methods into the effective method.

Terms the article defines in bold, quoted in context.

Categories:
  • Evaluation strategy
  • Dynamic programming languages

741 words · 4 references · revision 1358844202 · CC BY-SA 4.0

General
  • Recent changes
  • Related articles
  • Random discovery
This article
Reading time
6 min
Topic
Computer Science
Quality
Start-class
Views
582 in 14 days
Last edited
11 Jun 2026

Key concepts

  • Static program analysis1
  • Lisp (programming language)2
  • C (programming language)2
  • C++2
  • Java (programming language)2
  • Eval1
  • Abstract syntax tree1
  • Erik Meijer (computer scientist)1
  • Runtime code generation1
  • Dynamic loading1

The articles this one links to most, weighted towards the introduction.

Print/export
  • Printable version
In other projects
  • Wikidata item

Implementation

Eval

Some dynamic languages offer an eval function. This function takes a string or abstract syntax tree containing code in the language and executes it. If this code stands for an expression, the resulting value is returned. Erik Meijer and Peter Drayton distinguish the runtime code generation offered by eval from the dynamic loading offered by shared libraries and warn that in many cases eval is used merely to implement higher-order functions (by passing functions as strings) or deserialization.1

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).

Type inference

As a lot of dynamic languages come with a dynamic type system, runtime inference of types based on values for internal interpretation marks a common task. As value types may change throughout interpretation, it is regularly used upon performing atomic operations.

Variable memory allocation

Static programming languages (possibly indirectly) require developers to define the size of utilized memory before compilation (unless working around with pointer logic). Consistent with object runtime alteration, dynamic languages implicitly need to (re-)allocate memory based on program individual operations.

Reflection

Reflective programming (reflection) is common in many dynamic languages, and typically involves analysis of the types and metadata of generic or polymorphic data. However, it can also include full evaluation and modification of a program's code as data, as in the features that Lisp provides in analyzing S-expressions.

Macros

A limited number of dynamic programming languages provide features which combine code introspection (the ability to examine classes, functions, and keywords to know what they are, what they do and what they know) 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 is 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.

The earliest dynamic programming language is considered to be Lisp (McCarthy, 1965) which continued to influence the design of programming languages to the present day.2

Example code

The following examples show dynamic features using the language Common Lisp and its Common Lisp Object System (CLOS).

Computation of code at runtime and late binding

The example shows how a function can be modified at runtime from computed source code

; the source code is stored as data in a variable
CL-USER > (defparameter *best-guess-formula* '(lambda (x) (* x x 2.5)))
*BEST-GUESS-FORMULA*

; a function is created from the code and compiled at runtime, the function is available under the name best-guess
CL-USER >  (compile 'best-guess *best-guess-formula*)
#<Function 15 40600152F4>

; the function can be called
CL-USER > (best-guess 10.3)
265.225

; the source code might be improved at runtime
CL-USER > (setf *best-guess-formula* `(lambda (x) ,(list 'sqrt (third *best-guess-formula*))))
(LAMBDA (X) (SQRT (* X X 2.5)))

; a new version of the function is being compiled
CL-USER > (compile 'best-guess *best-guess-formula*)
#<Function 16 406000085C>

; the next call will call the new function, a feature of late binding
CL-USER > (best-guess 10.3)
16.28573

Object runtime alteration

This example shows how an existing instance can be changed to include a new slot when its class changes and that an existing method can be replaced with a new version.

; a person class. The person has a name.
CL-USER > (defclass person () ((name :initarg :name)))
#<STANDARD-CLASS PERSON 4020081FB3>

; a custom printing method for the objects of class person
CL-USER > (defmethod print-object ((p person) stream)
            (print-unreadable-object (p stream :type t)
              (format stream "~a" (slot-value p 'name))))
#<STANDARD-METHOD PRINT-OBJECT NIL (PERSON T) 4020066E5B>

; one example person instance
CL-USER > (setf *person-1* (make-instance 'person :name "Eva Luator"))
#<PERSON Eva Luator>

; the class person gets a second slot. It then has the slots name and age.
CL-USER > (defclass person () ((name :initarg :name) (age :initarg :age :initform :unknown)))
#<STANDARD-CLASS PERSON 4220333E23>

; updating the method to print the object
CL-USER > (defmethod print-object ((p person) stream)
            (print-unreadable-object (p stream :type t)
              (format stream "~a age: ~" (slot-value p 'name) (slot-value p 'age))))
#<STANDARD-METHOD PRINT-OBJECT NIL (PERSON T) 402022ADE3>

; the existing object has now changed, it has an additional slot and a new print method
CL-USER > *person-1*
#<PERSON Eva Luator age: UNKNOWN>

; we can set the new age slot of instance
CL-USER > (setf (slot-value *person-1* 'age) 25)
25

; the object has been updated
CL-USER > *person-1*
#<PERSON Eva Luator age: 25>

Examples

Popular dynamic programming languages include JavaScript, Python, Ruby, PHP, Lua, and Perl. The following are generally considered dynamic languages:

  • ActionScript
  • BeanShell3
  • C# (using reflection)
  • Clojure
  • CobolScript
  • ColdFusion Markup Language
  • Common Lisp and most other Lisps
  • Dylan
  • E
  • Elixir
  • Erlang
  • Forth

See also

  • Comparison of programming languages
  • Name binding
  • Von Neumann architecture

References

  1. 1Meijer, Erik and Peter Drayton (2005), Static Typing Where Possible, Dynamic Typing When Needed: The End of the Cold War Between Programming Languages (PDF), Microsoft Corporation, CiteSeerX 10.1.1.69.5966 {{citation}}: Cite uses deprecated parameter |citeseerx= (help)
  2. 2Harper, Robert (2016). Practical Foundations for Programming languages. New York: Cambridge University Press. p. 195. ISBN 9-781107-150300.
  3. 3Chapter 24. Dynamic language support. Static.springsource.org. Retrieved on 2013-07-17.
  4. 4"Groovy - Home". Archived from the original on 2014-03-02. Retrieved 2014-03-02.

Further reading

  • Tratt, Laurence (2009). Dynamically Typed Languages. Advances in Computers. Vol. 77. pp. 149–184. doi:10.1016/s0065-2458(09)01205-4. ISBN 9780123748126.

External links

(Many use the term "scripting languages".)

  • Prechelt, Lutz (August 18, 2002). "Are Scripting Languages Any Good? A Validation of Perl, Python, Rexx, and Tcl against C, C++, and Java" (PDF). Advances in Computers. 57: 205–270. doi:10.1016/S0065-2458(03)57005-X. ISBN 9780120121571. ISSN 0065-2458. Retrieved 2020-07-27.{{cite journal}}: CS1 maint: periodical has ISBN (link)
  • Bezroukov, Nikolai (2013). "A Slightly Skeptical View on Scripting Languages". Softpanorama (2.1 ed.). Retrieved 2020-07-27.
  • Wall, Larry (December 6, 2007). Programming is Hard, Let's Go Scripting... (Speech). State of the Onion 11. Perl.com. Retrieved 2020-07-27.
  • Roth, Gregor (November 20, 2007). "Scripting on the Java platform". JavaWorld. Retrieved 2020-07-27.
  • (March 1998). (PDF). . Vol. 31, no. 3. pp. 23–30. :. . Archived from (PDF) on 2020-07-27. Retrieved 2020-07-27.

Assembling of code at runtime based on the class of instances

In the next example, the class person gets a new superclass. The print method gets redefined such that it assembles several methods into the effective method. The effective method gets assembled based on the class of the argument and the at runtime available and applicable methods.

; the class person
CL-USER > (defclass person () ((name :initarg :name)))
#<STANDARD-CLASS PERSON 4220333E23>

; a person just prints its name
CL-USER > (defmethod print-object ((p person) stream)
            (print-unreadable-object (p stream :type t)
              (format stream "~a" (slot-value p 'name))))
#<STANDARD-METHOD PRINT-OBJECT NIL (PERSON T) 40200605AB>

; a person instance
CL-USER > (defparameter *person-1* (make-instance 'person :name "Eva Luator"))
*PERSON-1*

; displaying a person instance
CL-USER > *person-1*
#<PERSON Eva Luator>

; now redefining the print method to be extensible
; the around method creates the context for the print method and it calls the next method
CL-USER > (defmethod print-object :around ((p person) stream)
            (print-unreadable-object (p stream :type t)
              (call-next-method)))
#<STANDARD-METHOD PRINT-OBJECT (:AROUND) (PERSON T) 4020263743>

; the primary method prints the name
CL-USER > (defmethod print-object ((p person) stream)
            (format stream "~a" (slot-value p 'name)))
#<STANDARD-METHOD PRINT-OBJECT NIL (PERSON T) 40202646BB>

; a new class id-mixin provides an id
CL-USER > (defclass id-mixin () ((id :initarg :id)))
#<STANDARD-CLASS ID-MIXIN 422034A7AB>

; the print method just prints the value of the id slot
CL-USER > (defmethod print-object :after ((object id-mixin) stream)
          (format stream " ID: ~a" (slot-value object 'id)))
#<STANDARD-METHOD PRINT-OBJECT (:AFTER) (ID-MIXIN T) 4020278E33>

; now we redefine the class person to include the mixin id-mixin
CL-USER > (defclass person (id-mixin) ((name :initarg :name)))
#<STANDARD-CLASS PERSON 4220333E23>

; the existing instance *person-1* now has a new slot and we set it to 42
CL-USER > (setf (slot-value *person-1* 'id) 42)
42

; displaying the object again. The print-object function now has an effective method, which calls three methods: an around method, the primary method and the after method.
CL-USER > *person-1*
#<PERSON Eva Luator ID: 42>
Gambas
  • GDScript
  • Groovy4
  • Java (using Reflection)
  • JavaScript
  • Julia
  • Lua
  • MATLAB – Octave
  • Objective-C
  • Object REXX (ooRexx)
  • Perl
  • PHP
  • PowerShell
  • Prolog
  • Python
  • R
  • Raku
  • Rebol
  • Ruby
  • Smalltalk
  • SuperCollider
  • Tcl
  • VBScript
  • Wolfram Language
  • Ousterhout, John K.
    "Scripting: Higher-Level Programming for the 21st Century"
    Computer
    doi
    10.1109/2.660187
    ISSN
    0018-9162
    the original
  • "ActiveState Announces Focus on Dynamic Languages". ActiveState. July 26, 2004. Retrieved 2020-07-27.
    • Ascher, David (July 27, 2004). "Dynamic Languages — ready for the next challenges, by design" (PDF). Whitepapers. ActiveState. Archived from the original (PDF) on 2008-11-18.
    • Ascher, David (July 27, 2004). "Dynamic Languages – ready for the next challenges, by design". Whitepapers. ActiveState. Archived from the original on 2008-12-08.
  • Created
    26 May 2003
    History
    470 edits
    321 contributors
    No edits in the last 30 days
    Last edited
    11 Jun 2026

    470 revisions in total · 321 contributors

    1. 11 Jun 2026, 09:51 UTCFierysea13§ Implementation removed outdated tag−38diff
    2. 6 Jun 2026, 10:29 UTCRageking890mNo edit summary−2diff
    3. 11 Mar 2026, 08:10 UTCJerryobjectm§ Reflection Small WP:COPYEDITs WP:EoS clarify. WP:LINKs: update-standardizes, needless-WP:PIPE > WP:NOPIPE, add.+23diff
    4. 11 Mar 2026, 07:53 UTCJerryobject§ External links Adds: MOS:COMMENT, WP:CATEGORY.+102diff
    5. 11 Mar 2026, 07:45 UTCJerryobjectm§ Examples WP:LINKs: update-standardizes, needless-WP:PIPEs > WP:NOPIPEs. Avoidable spaced WP:SLASH > WP:NDASH. MOS:FIRSTABBReviation define-clarify before parenthetic WP:ABBR.−47diff
    6. 28 Jan 2026, 10:10 UTCSmartserm deleted article Wikipedia:Sockpuppet_investigations/Mahmoud_Fayed−39diff
    7. 22 Jan 2026, 08:18 UTCClueBot NGmReverting possible vandalism by ~2026-46715-6 to version by SophisticatedeveningALT. Report False Positive? Thanks, ClueBot NG. (4472777) (Bot)+11,058diff
    8. 22 Jan 2026, 08:18 UTCTemporary accountrevertedNo edit summary−11,058diff

    View full revision history

    Created
    26 May 2003
    History
    470 edits
    321 contributors
    No edits in the last 30 days
    Last edited
    11 Jun 2026

    Go deeper: linked from this article

    • Listed under See also

      Von Neumann architecture

      Computer architecture where code and data share a common bus

      The von Neumann architecture—also known as the von Neumann model or Princeton architecture—is a computer architecture based on the First Draft of a Report on the EDVAC, written by John von Neumann in 1945, describing designs by John Mauchly and J.

      13 min readGo deeper
    • Linked from the introduction

      Static program analysis

      Analysis of computer programs without executing them

      In computer science, static program analysis (also known as static analysis or static simulation) is the analysis of computer programs performed without executing them, in contrast with dynamic…

      8 min readGo deeper
    • Listed under See also

      Name binding

      Association of data/code with an identifier in software

      In computer programming, name binding is the association of a data or code entity with an identifier. An identifier bound to an entity is said to reference that entity.

      1 min readGo deeper

    Adjacent: shared categories and similar text

    • Shares category “Dynamic programming languages”

      Common Lisp

      Programming language standard

      Common Lisp (CL) is a dialect of the Lisp programming language, published in American National Standards Institute (ANSI) standard document ANSI INCITS 226-1994 (S2018) (formerly X3.226-1994 (R1999)).

      36 min readGo deeper
    • Shares category “Dynamic programming languages”

      Ruby (programming language)

      General-purpose programming language

      Ruby is a general-purpose programming language designed with an emphasis on programming productivity and simplicity. In Ruby, everything is an object, including primitive data types.

      22 min readGo deeper
    • Shares category “Dynamic programming languages”

      Lua

      Lightweight programming language

      Lua is a lightweight, high-level, multi-paradigm programming language designed mainly for embedded use in applications.

      19 min readGo deeper
    • Linked in “Implementation”

      Higher-order function

      Function that takes one or more functions as an input or that outputs a function

      In mathematics and computer science, a higher-order function (HOF) is a function that does at least one of the following: takes one or more functions as arguments (i.e. a procedural parameter, which…

      9 min readGo deeper
    • Linked in “Examples”

      Python (programming language)

      General-purpose programming language

      Python is a high-level, general-purpose programming language that emphasizes code readability, simplicity, and ease-of-writing with the use of significant indentation, an extensive ("batteries-included") standard library, and garbage collection.

      53 min readGo deeper
    • Shares category “Dynamic programming languages”

      Perl

      Interpreted programming language first released in 1987

      Perl is a high-level, general-purpose, interpreted, dynamic programming language.

      44 min readGo deeper
    • Shares category “Dynamic programming languages”

      PHP

      Scripting language created in 1994

      PHP is a general-purpose scripting language geared toward web development. It was created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995.

      54 min readGo deeper
    • Shares category “Dynamic programming languages”

      Clojure

      Dialect of the Lisp programming language on the Java platform

      Clojure (like closure) is a dynamic and functional dialect of the programming language Lisp on the Java platform.

      17 min readGo deeper
    • Linked in “Examples”

      C Sharp (programming language)

      General-purpose programming language

      C# (see SHARP) is a general-purpose high-level programming language supporting multiple paradigms.

      38 min readGo deeper
    • Linked in “Implementation”

      C (programming language)

      General-purpose programming language

      C is a general-purpose programming language created in 1972 by Dennis Ritchie.

      38 min readGo deeper
    • Linked in “Implementation”

      C++

      General-purpose programming language

      C++ is a high-level, general-purpose programming language created by Danish computer scientist Bjarne Stroustrup.

      24 min readGo deeper