Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Dynamic programming language
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Implementation== {{Expand section|date=October 2009}} ===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 (computer scientist)|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 function]]s (by passing functions as strings) or [[deserialization]].<ref>{{Citation | citeseerx = 10.1.1.69.5966 | title=Static Typing Where Possible, Dynamic Typing When Needed: The End of the Cold War Between Programming Languages | author=[[Erik Meijer (computer scientist)|Meijer, Erik]] and Peter Drayton | year=2005 | publisher=[[Microsoft]] Corporation|url=https://people.dsv.su.se/~beatrice/DYPL/meijer_drayton.pdf}}</ref> ===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 [[mixin]]s of existing types or objects. This can also refer to changing the [[Inheritance (object-oriented programming)|inheritance]] or type tree, and thus altering the way that existing types behave (especially with respect to the invocation of [[Method (computer science)|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=== [[Reflection (computer science)|Reflection]] is common in many dynamic languages, and typically involves [[Introspection (computer science)|analysis]] of the types and metadata of generic or [[Type polymorphism|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-expression]]s. ===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 [[Macro (computer science)|macros]]. Most programmers today who are aware of the term ''macro'' have encountered them in [[C (programming language)|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 language|Assembly]], [[C (programming language)|C]], [[C++]], early [[Java (programming language)|Java]], and [[Fortran]] do not generally fit into this category.{{clarify|date=September 2016}} 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.<ref>{{cite book| last=Harper| first=Robert | title=Practical Foundations for Programming languages | page=195 | year=2016 |publisher=Cambridge University Press| location=New York| isbn=9-781107-150300}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)