Home Page Icon
Home Page
Table of Contents for
Dedication
Close
Dedication
by Chaur Wu
Pro DLR in .NET 4
Cover Page
Title Page
Copyright
Dedication
Contents at a Glance
Contents
About the Author
About the Technical Reviewer
Acknowledgments
Introduction
Prerequisites
Structure of the Book (or How this Book is Organized…)
Obtaining the Source Code
PART 1: DLR Fundamentals
CHAPTER 1: Introduction to DLR
Setting Up Code Examples
Software Requirements
Installing the DLR, IronPython, and IronRuby
Hello World Examples
Hello World from a Dynamic Language
Creating a “Hello” Language
Implementing REPL for the Hello Language
Practical Uses for the DLR
Application Scripting and DSL
XML Builder
Aspect-Oriented Programming
Runtime
Runtime vs. Run Time
Run Time vs. Compile Time
Dynamic vs. Static
Dynamic Typing
Dynamic Dispatch
Language
Programming Languages in Practice
Putting It Together
Summary
CHAPTER 2: DLR Expression
DLR Expression as a Language
Code as Data
A Common Denominator like CLR
Concrete Syntax and Serialization
Expressions vs. Statements
Expression Type and Kind
Binary Expressions
Flow Control Expressions
If-Then-Else Expressions
Switch Expressions
Scopes and Name Binding
Lexical vs. Dynamic Scope
BlockExpression and Lexical Scoping
Lambda Expressions and Closure
The GotoExpression Class
While Loops
Dynamic Expressions
Index Expressions
Expression Abstraction, Reduction and Extension
Immutability and the Visitor Pattern
Visitor Pattern in General
Visitor Pattern in DLR Expression
Expression Visitor Examples
Summary
CHAPTER 3: Late Binding and Caching
Binding
Call Sites and Early Binding
Call Sites and Late Binding
DLR Binders
Set Up Code Examples
Making a Debug Build of the DLR for .NET 2.0
Developing for Both .NET 2.0 and .NET 4.0
The CallSiteBinder Class
DLR Call Sites
Binding Restrictions and Rules
Checking Binding Rules in Debug Mode
Caching
Three Cache Levels
Late-Binding Context
L0 Cache Example
L1 Cache Example
L2 Cache Example
Creating Canonical Binders
Summary
CHAPTER 4: Late Binding and Interoperability
Language Interoperability
Static and Dynamic Objects
Late-Binding Logic in Two Places
Late Binding Logic in Binders
Late-Binding Logic in Dynamic Objects
Late-Bound Actions
Examples
Common Type System
Class Hierarchy of Binders
Implement a Custom Binder Class
Interoperability Protocol
Summary
CHAPTER 5: Dynamic Objects
What is a Dynamic Object?
IDynamicMetaObjectProvider Interface
Dynamic Meta Objects
DynamicMetaObject and Binding Logic
DynamicMetaObject and Binding Result
Interoperability
DynamicObject Class
XML Builder
Summary
CHAPTER 6: DLR Hosting API
Life Without the DLR Hosting API
Using a Static Language’s Code in Another Static Language
Using a Static Language’s Code in a Dynamic Language
Using a Dynamic Language’s Code in a Static Language
Using a Dynamic Language’s Code in Another Dynamic Language
Overview of the DLR Hosting API
Major Classes in the API
The Tale of Two APIs
The DLR Hosting API in Relation to Binders and Dynamic Objects
Using Script Runtime to Execute Code
Configuring the Languages You Want to Speak
Configuring Script Runtime Declaratively
Configuring Script Runtime Programmatically
Scripting an Object Model
Script Scopes
Value and Reference Variables
Global Scope and Variable Passing
Language Neutral Scope and Variable Passing
Level Two Use of the DLR Hosting API
Compiling Code
Loading Assemblies into Script Runtime
Creating Python Class Instances Using Object Operations
Level Three Use of the DLR Hosting API
Script Host
Object Operations
Remote Script Runtime
.NET Remoting Quick Tour
Running Script Runtime in a Separate Process
Summary
PART 2: Applying the DLR
CHAPTER 7: DLR and Aspect-Oriented Programming
Aspect-Oriented Programming
Cross-Cutting Concerns
Advice, Join Points, and Pointcuts
An Example
A Test Run
AOP for Dynamic Objects
Understanding the Framework
Implementing the Framework
Integration with Spring.NET AOP
Getting the AOP Advisors
Implementing Advice
Applying Advice
Cutting Across Dynamic and Static Objects
Summary
CHAPTER 8: Metaprogramming
Overview of Metaprogramming
Changing Class Definitions
Ruby
Python
DLR
LINQ Query Provider
Understanding the End Goal
Implementing the Query Class
Implementing the QueryProvider Class
Implementing QueryExpressionVisitor
Data Access
Static Data Access
Dynamic Data Access
Generated Data Access
Summary
CHAPTER 9: Stitch — A DSL for Hosting Languages
The Need for Stitch
Syntax of the Stitch Language
Requirements for the Example
Software Requirements
Organization of the Code
Stitch in Use
Being Declarative
Hosting DLR- and Non-DLR-Based Languages
Hosting Stitch Itself
Executing in Parallel
Stitch Language Grammar
Setting Up Eclipse and ANTLR
Defining the Grammar
Test-Driving the Grammar
The Stitch Runtime
Overview of the Runtime
The Script Engine
Function Execution Coordinator
Parallel Extensions for .NET
Script Runner
Running DLR-based Language Code
Language Plug-In
Develop a Stitch Plug-In for PowerShell
Configuring a Plug-In
Summary
CHAPTER 10: Application Scripting
Ball World
Software Requirements
Application Architecture
Application Object Model
Application Scripting
The Physics Engine
User Interface
Summary
CHAPTER 11: DLR in Silverlight
Different Client Side Web Scripting Approaches
Apache HTTP Server Configurations
Using the Hosted Gestalt Components
Hosting the Gestalt Components
Dissecting the Gestalt Components
Scripting HTML
Scripting XAML
DLR Settings
Speak Your Own Language in Silverlight
Software Requirements
Build DLR for Silverlight
The Hello Language
Hello Console in Silverlight
Gestalt-like Hello Console on Silverlight
Summary
CHAPTER 12: Dynamic Languages on JVM
Quick Comparisons
Python and Ruby on JVM
Hosting Python Code in Java Programs
Hosting Ruby Code in Java Programs
Overview of the BoolScript Example
BoolScript Language
Script Engine Factory
Script Engine Discovery Mechanism
Bindings, Scope, and Context
BoolScript Engine
Compile BoolScript Code
Run BoolScript Code as Invocable Function
Summary
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Copyright
Next
Next Chapter
Contents at a Glance
I want to dedicate this book to Sarah, Everett, Cedric, and Chiachi
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset