.NET Programming Language Research @ MSR Cambridge

Microsoft Research, Cambridge
Programming Principles and Tools

Some .NET research :

Slide 4

Some .NET research for today :

Part 1
SML.NET

Advanced Programming Languages on the CLR ?

Our favourite language: ML

SML code for parsing

Parsing continued…

What is SML.NET?

Extract from SML.NET code

Language Interop?
A well-known issue

1. Explicit Bilateral Interface

Example: C code in JNI

2. IDL-based interop

Interop in .NET

Interop in .NET continued

SML.NET interop

Re-use SML features

Extend our language

Extract from WinForms interop

Example: ray tracing in ML

Ray tracing in SML.NET

Cross-language debugging demo

Part 2
Generics in the CLR and C#

Generics?

"Parameterized classes,"

Generics by example (in C#)

Simple: Constructed types

Simple: Constructed types

Simple: Constructed types

Simple: Constructed types

Medium: Generic classes

Medium: Generic classes

Medium: Generic classes

Medium: Generic classes

Medium: Generic classes

Medium: Generic classes

Medium: Generic classes

Medium: Generic classes

Medium: Generic classes

Medium: Generic interfaces

Medium: Generic structs

Medium: Generic methods

Dynamic Constraints

Static Constraints

Our design (review)

How does it work?

How does it work (cont’d) ?

Implementing Generics (0)

Implementing Generics (0)

Implementing Generics (1)

Implementing Generics (2)

Implementing Generics (2)

Implementing Generics (3)

Generics: Performance

Generics: Design Comparison

Comparison with C++ templates

Comparison with C++ templates

Summary

Part 3
Polyphonic C#

The Brave New World

The  programmer’s perspective

Asynchronous Programming

C#, CLR and .NET Frameworks

Polyphonic C#

Polyphony (in one slide)

A Simple Buffer

A Simple Buffer

A Simple Buffer

A Simple Buffer

A Simple Buffer

A Simple Buffer

Reader/Writer

Reader/Writer in five chords

Asynchronous Service
Requests and Responses

Asynchronous Service Requests and Responses - join

Asynchronous Service Requests and Responses - select

Why Chords?

Extending C# with chords

Inheritance

Implementation 1

Implementation 2

Compiling chords

Adding synchronization code

Implementation issues

Example: Sum of Squares

Sum of Squares

Sum of Squares Code

Sum of Squares Translation

Sum of Squares Translation

Sum of Squares Translation

Technical issues

Further Work

Predictable Demo:
Dining Philosophers

Code

Summary

Conclusions

Questions?