Posts: 6,566
Threads: 1,107
Joined: Jul 2011
DYNAMIC LANGUAGE
[attachment=16191]
Introduction
is a term used broadly in computer science
execute at runtime
modifying the type system, all during program execution
Static vs. Dynamic Languages
Static Languages
Type safety
Compile-time checking
Runtime performance
Syntactic Sugar
Dynamic Languages
Late bound
Loosely typed
Highly expressive
Features
High Level Features
Built in Data Types
The two universal data types are lists and strings
Most dynamically typed languages also provide support for dictionaries and
sets.
Hosting API
Script Runtime
Starting point for hosting
Represents global script state
Bound scopes
Constructed with Script Runtime Setup,
Script Engine
Represents a DLR language implementation
One engine, per-language, per-runtime which uses configuration settings
Advantages
Provide extensibility (the obvious answer)
Replace complicated XML configuration with meaningful code
Remove clutter from core application logic
Maintain transient logic outside of core application code
Disadvantages
Performance
Debugging
Code completion
Types as documents
Conclusion
Functional programming concepts are used.
The assertion that a language is dynamic is more an assertion about the ease of use of dynamic features than it is a clear statement of the capabilities of the language.
Posts: 4,190
Threads: 817
Joined: Feb 2012
Dynamic language
introduction
Dynamic language is a term used broadly in computer science to describe a class of high-level programming languages that execute at runtime many common behaviours that other languages might perform during compilation, if at all. These behaviours could include extension of the program, by adding new code, by extending objects and definitions, or by modifying the type system, all during program execution. These behaviours can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them.
The Dynamic Language Runtime is built on the idea that it is possible to implement language specificities on top of a generic language-agnostic abstract syntax tree, whose nodes correspond to a specific functionality that is common to many dynamic languages.[13] This architecture is backed by the idea that the number of elementary language constructs that would have to be implemented on the generic stack should be inherently limited.[14] The DLR dynamically generates code corresponding to the functionality expressed by these nodes. The compiler for any dynamic language implemented on top of the DLR has to generate DLR abstract trees, and hand it over to the DLR libraries.
The DLR provides dynamically-updated Dynamic Site objects that cache the task of binding methods to objects. Since the type of an object—as well as the members it contains—in dynamic languages can change during a program lifetime, a method invocation must check the method list to see if the invocation is a valid one. Dynamic Site objects represent and cache the state of the object and its methods; any update to the object is reflected in the Dynamic Site objects as well. DLR routes all method invocations via the Dynamic Site objects, which then performs a fast lookup and binding of the method with the actual implementation.[15]
Posts: 7,939
Threads: 421
Joined: Jun 2012