Index

images A

abstract syntax, DLR Expression and, 29

abstract syntax trees (ASTs), 14

Accept method

Element class, 57, 59

Expression class, 32

Add method (Expression class), 34

advice, AOP and, 166171, 174183

algorithms, Visitor pattern and, 56

ANTLR, 214, 218225, 281

AOP (aspect-oriented programming), 11, 165183

AOP framework, integrating with Spring.NET AOP, 174183

dynamic objects and, 171174

AopMetaObject class, 171, 172, 173

Apache web server, Silverlight and, 252

App.config file, 8, 140, 243

AppDomain class, 157

application scripting, 10, 239250

DLR Hosting API and, 242, 245

enabling, 244

arithmetic binary expressions, 34

ASP.NET platforms, 251

aspect-oriented programming. See AOP

aspects, AOP and, 167, 169

Assembly class, 152

assignment expressions, 31

ASTs (abstract syntax trees), 14

B

Ball World (sample) application, 239250

architecture of, 241

ball collisions, Farseer Physics engine for detecting, 246248

object model of, 241

user interface of, 248

base objects, Meta-Object Protocol and, 119

binary expressions, 33

BinaryExpression class, 32, 34

BinaryOperation late-bound operation/action, 97

BinaryOperationBinder class, 99

Bind method

CallSiteBinder class, 71

DynamicMetaObject class, 103, 114

DynamicObject class, 119

binders, 50, 67, 68

caching and, 65, 79

canonical, 86

classes for, 99102

DLR Hosting API and, 139

interoperability protocol and, 102106

late-binding logic in, 91, 92

late-bound operations/actions and, 94100

sharing across call sites, 8486

BindGetMember method (DynamicMetaObject class), 112

binding, 20, 6568

early, 66, 80

late. See late binding

restrictions and, 74, 80

rules for, 7386

block expressions, 31, 41

BoolScript engine (sample), 280295

compiling code and, 291294

executing code and, 294

BoolScript language, 280, 281

C

C#

vs. DLR, 22

IL instructions and, 28

C# (cont.)

language interoperability and, 87102

metaprogramming and, 191196

caching, 24, 65, 7886

cache misses and, 78, 82, 85

levels of, 7886

Call method (Expression class), 27, 54

call site binders, 50

call sites, 24, 50

early binding and, 66

late binding and, 67, 72

restrictions and, 74

sharing binders and, 8486

CallSiteBinder class, 68, 71, 105

CallSiteBinderExamples, 69

canonical binders, 86

CanReduce property (Expression class), 32, 54

Chrome web browser, Silverlight and, 252

class definitions, changing, 186196

ClassMetaObject class, 191196

generated data access and, 207210

implementation of, 193

CLOS (Common Lisp Object System), 119

closures, 44

CLR (Common Language Runtime), 13, 28

CLR2 conditional compilation symbol, 71, 76

"code as data," DLR Expression and, 28, 196

code scattering/tangling, as cross-cutting concerned resolved via AOP, 165

code editors, 23

code samples in this book, 4, 913

CodePlex, 5, 10

Common Language Runtime (CLR), 13, 28

Common Lisp Object System (CLOS), 119

Common Type System (CTS), 96

compilation flags, 71

compile time, 1416

metaprogramming and, 185

vs. run time, 14

compile-time binding, 66

CompiledCode class, 137, 150, 157

compilers, 14, 23

dynamic languages vs. static languages and, 16

metaprogramming and, 186

CompileSourceCode method, 7

concrete syntax, DLR Expression and, 29

conditional compilation symbol CLR2, 71, 76

conditional expressions, 31

conditions, 74, 80, 113

console property, of DLR object, 264

ConsoleHost class, 9

Constant method (Expression class), 34

context-free grammars, 221

Convert late-bound operation/action, 98

ConvertBinder class, 99

CPython, 6

CreateDomain method (AppDomain class), 157

CreateFromConfiguration method (ScriptRuntime class), 140

CreateInstance late-bound operation/action, 98

CreateInstanceBinder class, 99

CreateScriptSourceFromFile method (ScriptEngine class), 150

cross-cutting concerns, resolving via AOP, 165

CTS (Common Type System), 96

curly braces ({ }), 40

custom classes, 53, 5963

binder classes and, 100

Expression class and, 54

D

data access, 201210

"data as code," DLR Expression and, 28, 201

data structures, Visitor pattern and, 56

debuggers, 23

debugging

debug build for, 69

viewing binding rules and, 7578

Debugging API, 25

DefaultBinder utility class, 106

DeleteIndex late-bound operation/action, 98

DeleteIndexBinder class, 99

DeleteMember late-bound operation/action, 97

DeleteMemberBinder class, 99

Divide method (Expression class), 34

DLR (Dynamic Language Runtime), 325

application scripting and, 239250

vs. C#, 22

Common Type System of, 96

components of, 24

downloading/installing, 5

Hello language illustrating, 68, 265274

Silverlight and, 251274

DLR Expression, 2763

custom classes and, 53, 5963

LINQ query providers and, 196201

Visitor pattern of, 57

DLR Hosting API, 25, 133161

Ball World sample application and, 242, 245

classes of, 137

Hello console and, 268

Hello language and, 266

vs. JSR 223 API (table), 275

metaprogramming and, 185

Stitch domain-specific language and, 211

ways of using (levels), 137, 139, 143, 150, 154

DLR object, 264, 273

dlr.js file, 254, 264

dlr.xap file, 253256, 272

DlrScript class, 233

dlr-spec-hosting.doc file, 137

domain-specific languages (DSLs), 10, 211

. See also Stitch domain-specific language

downloads

ANTLR, 214, 219

Apache web server, 252

code samples in this book, 4

DLR, 5

Farseer Physics library, 240

Gestalt components, for Silverlight applications, 254

PowerShell, 214

software components used in this book, 4

Spring.NET AOP, 167

tools, 4

dpier project, 210

DSLs (domain-specific languages), 10, 211

. See also Stitch domain-specific language

dynamic data access, 204

dynamic dispatch. See late binding

dynamic expressions, 49

dynamic keyword (C#), 18

Dynamic Language Runtime. See DLR

dynamic languages, 1620

application scripting and, 239250

DLR Hosting API and, 134

Java and, 275296

support for, .NET vs. Java (table), 275

Dynamic method (Expression class), 51

dynamic objects, 25, 109131

AOP and, 171174, 177, 180183

DLR Hosting API and, 139

interoperability protocol and, 102106

late-binding logic in, 91, 94, 109114, 119

late-bound operations/actions and, 94100

Meta-Object Protocol and, 119

static objects and, 91, 109

dynamic scoping, 41

DynamicExpression class, 50

DynamicMetaObject class, 91, 103, 111116

dynamic object late-binding behaviors and, 113

late-binding logic/late-binding result and, 112

properties of, 115

DynamicMetaObjectBinder class, 103

DynamicObject class, 119122, 125

DynamicObjectExamples, 110

E

early binding, 66

call sites and, 66

late-binding context and, 80

Eclipse, 218

Element class hierarchy (Visitor pattern), 56

embedding languages, 8

engine scopes, 145, 151

context in script engine and, 287

variable passing and, 149

Execute method (ScriptSource), 8

ExpandoClass class, 191196

generated data access and, 207210

implementation of, 193, 195

expression abstraction, 53

Expression class, 27, 31

custom classes and, 54

factory methods and, 34

late binding and, 71

expression extension, 53, 58

Expression property (DynamicMetaObject class), 115

expression reduction, 53

expression trees, 29, 32, 5563

expressions, 13, 21, 24, 2763

binary, 33

compiling/interpreting, 16

custom classes and, 53, 5963

dynamic, 49

flow control, 3639

index, 52

lambda, 44

metaprogramming and, 185

ExpressionVisitor class, 5862, 200

FallbackGetMember method, 104

F

Farseer Physics Engine, 10, 246248

Farseer Physics library, 240, 246

flow control expressions, 3639

fluent APIs, 10

FxCop, 23

G

generated data access, 207210

Gestalt components, for Silverlight applications, 253257

downloading, 254

Hello console sample application and, 271

Gestalt project, 253

gestaltmedia.js file, 254

GetIndex late-bound operation/action, 97

GetIndexBinder class, 99

GetMember late-bound operation/action, 97, 100, 124

GetMemberBinder class, 99, 103

GetMetaObject method, 111

global scopes, 143

script engines and, 287291

variable passing and, 147

Goto method (Expression class), 48

goto statements (C#), 46

GotoExpression class, 46

Groovy language, 11, 191

guest language

DLR Hosting API and, 133

scripting an object model and, 143

H

Hello console (sample) application, 268274

Hello language, 68, 265274

Hello World examples, 69, 2731

host language, 8, 133

hosting programming languages. See DLR Hosting API;

Stitch domain-specific language

HostingExamples, 138

HTML scripting, 257260

I

IDE (Integrated Development Environment), 23

IDynamicMetaObjectProvider interface, 111, 121, 140, 171

if statements, 21

if-then-else expressions, 37

IfThenElse factory method (Expression class), 37

IL instructions, 28

IMethodInterceptor interface, 168, 172

immutability, 5563

index expressions, 52

IndexExpression class, 52

InteropBinderExamples, 87

interoperability protocol, 102106

interoperability. See language interoperability

intrinsic objects, "just text" approach to Web scripting and, 257

Invoke late-bound operation/action, 97, 124

InvokeBinder class, 99

InvokeMember late-bound operation/action, 97, 124

InvokeMemberBinder class, 99

ipy.exe console application (IronPython), 6, 264

IQueryable interface, 197

IQueryProvider interface, 198

ir.exe command console (IronRuby), 264

IronPython

compilers and, 15

downloading/installing, 5

Hello World sample and, 6

Jython and, 277

language interoperability and, 8794

IronPython.slvx file, 254, 272

IronRuby

downloading/installing, 5

JRuby and, 276

language interoperability and, 87

IronRuby.slvx file, 254, 272

J

Java, dynamic languages and, 275296

compiling code and, 291294

vs. .NET (table), 275

JavaHostingExamples, 276

joint points, AOP and, 166

JRuby, 276

JSR 223 API, 275293

"just text" approach to Web scripting, 251, 256264

Gestalt components for, 253257

Hello console sample application and, 271274

JVM, Python/Ruby on, 276280

Jython, 6, 276

L

L0 (first-level) cache, 79, 82

L1 (second-level) cache, 79, 83

L2 (third -level) cache, 79, 84

Label method (Expression class), 47

lambda calculus (mathematics theory), 44

lambda expressions, 44

Lambda method (Expression class), 44

language consoles, 264

language consumers, 133, 137, 138

language context, Hello language and, 7

language developers, 138

language interoperability, 25, 8791

Common Type System and, 96

DLR Hosting API and, 133136, 139

dynamic objects and, 115118

interoperability protocol for, 102107

Java and, 275, 276

language-neutral scopes, 143, 145, 148

language plug-ins, for non-DLR-based languages, 234237

language producers, 133, 137

language-specific scopes, 143

late binding, 20, 25, 50, 6586

caching and, 7886

call sites and, 67, 72

CallSiteBinder class for, 71

canonical binders and, 86

late-binding context and, 80

late-bound operations/actions and, 94100

late-binding logic, 9194

FallbackGetMember method and, 104

in binders, 91, 92

in dynamic objects, 91, 94, 109114

lexer/parser generators, 218

lexical scoping, 4044, 66

LINQ expressions, 21

LINQ queries, 196

LINQ query providers, 196201

Query class implementation and, 196

ways of using, 201210

Load method (Assembly class), 152

logging, 11, 165171

LoopExpression class, 48

M

MarshalByRefObject class, 157

member method invocation, 94

member property get-access operation, 94

Meta-Object Protocol (MOP), 119

meta-objects, 91, 103105

late-binding logic of, 111114

Meta-Object Protocol and, 119

MetaExamples, 187

metaprogramming, 185210

methods, adding to/removing from a class, 186196

Microsoft.Scripting.Ast namespace, 76

Microsoft.Scripting.Hosting namespace, 137

Model-View-ViewModel (MVVM), 241

MOP (Meta-Object Protocol), 119

mscorlib.dll assembly, 67

MVVM pattern, 241

N

name binding, 3944, 66

nested scopes, 41

.NET 2.0, 69

.NET 3.5, 69

.NET 4.0, 69

.NET 4.0 SDK, 4

.NET CLR, 154

.NET libraries, 23

.NET Remoting, 157, 158

NodeType property

BinaryExpression class, 32

Expression class, 32, 54

O

ObjectOperations class, 150

documentation string of Python functions obtained via, 156

Python class instances created via, 153

objects meta. See meta-objects

Meta-Object Protocol and, 119

passing by value/by reference, 146150

P

Parallel Extensions for .NET, 217, 230

ParameterExpression class, 73

parser generators, 218

path property, of DLR object, 264, 273

PlatformAdaptationLayer class, 154

pointcuts, AOP and, 166171, 174183

polymorphic inline caching, 25, 65

PostIncrementAssign method (Expression class), 48

PowerShell, 214, 234237

PresentationCore.dll assembly, 152

PresentationFramework.dll assembly, 152

Print helper method, 36, 43, 53

PrintExpression (custom) class, 53, 5963

production rules, Stitch grammar and, 222

programming languages, 21, 22

DLR Expression and, 2763

hosting. See DLR Hosting API

language interoperability. See language interoperability

properties, adding to/removing from a class, 186196

Python

application scripting and, 244

class instances created via ObjectOperations class, 153

functions of, documentation string for obtained via ObjectOperations class, 156

Java and, 276

Jython and, 6, 276

metaprogramming and, 185, 189

Stitch language and, 212

Q

Queryable class, 198

R

Read-Eval-Print-Loop. See REPL console

Reduce method (Expression class), 32, 54

REPL console, 6, 23

for Hello language, 9

for IronPython, 6

resources for further reading

DLR Hosting API, consumer side of, 137

"just text" approach to Web scripting, 252

restrictions on binding, 74, 80, 113

Restrictions property (DynamicMetaObject class), 115

Return method (Expression class), 72

RIAs (Rich Internet Applications), 251

Ruby

Java and, 276, 279

language interoperability and, 8795

metaprogramming and, 185, 187

Stitch language and, 212

Ruby on Rails, 196, 202

rules for binding, 7386, 113

checking in debug mode, 7578

parts of, 74

run time, 1416

vs. compile time, 14

vs. runtime, 14

run-time binding. See late binding

runtime weaving, 170

runtimes, 1316

CLR runtime and, 13, 23

metaprogramming and, 185

S

samples, 4, 913

AOP framework, 167171

Ball World application, 239250

BoolScript engine, 280295

CallSiteBinderExamples, 69

DynamicObjectExamples, 110

environment setup for, 6971

Hello console application, 268274

Hello language, 68, 265274

Hello World, 69

HostingExamples, 138

InteropBinderExamples, 87

late-bound operations/actions, 94

MetaExamples, 187

Stitch domain-specific language, 214218

XML builder API, 122130

SAOs (server-activated objects), 159

scoping, 3944, 66

script code, Hello language and, 7

script engines, 280295

script context for, 286

script engine discovery mechanism for, 284

script runners, 226, 228, 231233

script scopes, 140161

passing objects by value/by reference, 146150

types of, 143, 145

ScriptEngine class, 8, 135, 150, 157

ScriptHost class, 154

scripting

application, 10, 239250

Web, 251, 257260

XAML, 260

Scripting.slvx file, 254, 272

ScriptRuntime class, 8, 137

executing code via, 139143

loading assemblies via, 152

MarshalByRefObject class and, 157

programming language configuration and, 140143

script runtimes run in separate process, 159

script runtimes run remotely, 156

scripting an object model via, 143

ScriptScope class, 137, 140, 145

ScriptSource class, 137, 150

Execute method, 8

MarshalByRefObject class and, 157

semantics, 21

serialization, DLR Expression and, 29

server-activated objects (SAOs), 159

SetIndex late-bound operation/action, 97

SetIndexMember class, 99

SetMember late-bound operation/action, 97

SetMemberBinder class, 99

shape-based design, 32

Silverlight, 154, 251274

building DLR source code for, 266

custom languages and, 265274

Gestalt components for, 253257

"just text" approach for, 251, 256264, 271274

SimpleLoggingAdvice class, 172

Singleton SAO objects, 159

software components used in this book, downloading, 4

solution files, 69

source language, dynamic objects and, 91

Spring.NET AOP, 167170, 174183

statements, DLR Expression and, 29

static data access, 202

static languages, 1620, 134

static objects, 91

AOP and, 177, 180183

vs. dynamic objects, 109

static scoping, 4044, 66

Stitch domain-specific language, 211238

DLR Hosting API and, 211

examples of, 214218

grammar of, 218225

hosting DLR/non-DLR-based languages and, 216

parallel execution of, 217, 230

sequential execution of, 216, 217

syntax of, 212214

Stitch runtime, 225238

DlrScript class and, 233

language plug-ins for, 234237

script engine and, 227

script runners and, 231233

StitchDemoApplication project, 215, 225

strongly typed languages, 17

switch expressions, 38

Switch factory method (Expression class), 38

SwitchCase factory method (Expression class), 38

SwitchExpression class, 38

syntax, 21, 29

System.Core.dll assembly, 69

System.Linq.Expressions namespace, 76

Expression class. See Expression class

IndexExpression class, 52

LoopExpression class, 48

T

Target delegate, 72, 77, 78

target language

binders and, 92

dynamic objects and, 91

Task Parallel Library (TPL), 230

Text Visualizer tool, 75

time, binding and, 66

ToLower method (String class), 67

tools, 4, 75

TPL (Task Parallel Library), 230

Try methods (DynamicObject class), 119

type checking/type definition, 1720

Type property

BinaryExpression class, 33

Expression class, 31, 54

U

UnaryOperation late-bound operation/action, 97

UnaryOperationBinder class, 99

unit test framework, 23

Update delegate, 79

user interface

for Ball World sample application, 248

for Hello console sample application, 269

utilities, 4, 75

V

variable binders, 50

variable passing, 147150

VB.NET, IL instructions and, 28

Visit method (Visitor class), 57, 59

VisitBinary method (ExpressionVisitor class), 62

VisitChildren method (Expression class), 58

VisitConstant method (ExpressionVisitor class), 61

VisitExtension method (ExpressionVisitor class), 59, 61

Visitor class hierarchy (Visitor pattern), 56

Visitor design pattern, 32, 5563

Visual Studio, Text Visualizer tool and, 75

Visual Studio 2010 Express, 5

W

web browsers, Silverlight and, 252

Web platforms, 251

Web scripting

approaches to, 251

HTML scripting and, 257260

web servers, Silverlight and, 252

while loop, 48

while statements (C#), 48

Windows Presentation Foundation (WPF), 144, 240

WPF (Windows Presentation Foundation), 144, 240

WPF assemblies, loading into script runtime and, 152

X

XAML scripting, 260

XML builder API (sample), 10, 122130

XML documents, XML builder API for, 122130

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.172.132