Theme index -- Keyboard shortcut: 'u'  Previous theme in this lecture -- Keyboard shortcut: 'p'  Next slide in this lecture -- Keyboard shortcut: 'n'Introduction to C#

A complete PDF version of the text book is now available. The PDF version is an almost complete subset of the HTML version (where only a few, long program listings have been removed). See here.

5.  The C# Language and System

This chapter, together with Chapter 6, Chapter 7, and Chapter 9, is an introduction to the C# language and the C# system. On Windows, the latter is known as .Net. On purpose, we will keep the .Net part of the material very short. Our main interest in this lecture is how to program in C#, and how this is related to programming in other languages such as C, Java, and Visual Basic.

5.1 C# seen in a historic perspective5.3 C# Compilation and Execution
5.2 The Common Language Infrastructure
 

5.1.  C# seen in a historic perspective
Contents   Up Previous Next   Slide Annotated slide Aggregated slides    Subject index Program index Exercise index 

It is important to realize that C# stands on the shoulders of other similar object-oriented programming languages. Most notably, C# is heavily inspired by Java. Java, in turn, is inspired by C++, which again - on the object-oriented side - can be traced back to Simula (and, of course, to C on the imperative side).

Here is an overview of the most important object-oriented programming languages from which C# has been derived:

  • Simula (1967)

    • The very first object-oriented programming language

  • C++ (1983)

    • The first object-oriented programming language in the C family of languages

  • Java (1995)

    • Sun's object-oriented programming language

  • C# (2001)

    • Microsoft's object-oriented programming language

 

5.2.  The Common Language Infrastructure
Contents   Up Previous Next   Slide Annotated slide Aggregated slides    Subject index Program index Exercise index 

The Common Language Infrastructure (CLI) is a specification that allows several different programming languages to be used together on a given platform. The CLI has a lot of components, typically referred to by three-letter abbreviations (acronyms). Here are the most important parts of the Common Language Infrastructure:

  • Common Intermediate language (CIL) including a common type system (CTS)

  • Common Language Specification (CLS) - shared by all languages

  • Virtual Execution System (VES)

  • Metadata about types, dependent libraries, attributes, and more

The following illustration, taken from Wikipedia, illustrates the CLI and its context.

Figure 5.1    Wikipedia's overview diagram of the CLI

.Net is one particular implementation of the Common Language Infrastructure, and it is undoubtedly the most complete one. .Net is closely associated with Windows. .Net is, however, not the only implementation of the CLI. Mono is another one, which is intended to work on several platforms. Mono is the primary implementation of the CLI on Linux. Mono is also available on Windows.

MONO and .NET are both implementations of the Common Language Infrastructure

The C# language and the Common Language Infrastructure are standardized by ECMA and ISO

 

5.3.  C# Compilation and Execution
Contents   Up Previous Next   Slide Annotated slide Aggregated slides    Subject index Program index Exercise index 

The Common Language Infrastructure supports a two-step compilation process

  • Compilation

    • The C# compiler: Translation of C# source to CIL

    • Produces .dll and .exe files

    • Just in time compilation: Translation of CIL to machine code

  • Execution

    • With interleaved Just in Time compilation

    • On Mono: Explicit activation of the interpreter

    • On Window: Transparent activation of the interpreter

.dll and .exe files are - with some limitations - portable in between different platforms

Generated: Monday February 7, 2011, 12:12:53
Theme index -- Keyboard shortcut: 'u'  Previous theme in this lecture -- Keyboard shortcut: 'p'  Next slide in this lecture -- Keyboard shortcut: 'n'