Common Language Infrastructure Annotated Standard, Addison-Wesley
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
|
Contents |
C# Online.NET Book Review
The Common Language Infrastructure (CLI) is an ECMA standard (ECMA-335) that enables .NET applications to be written in a variety of high-level programming languages and executed on a common runtime system. CLI is one of the foundations of Microsoft .NET technology.
Programming languages which conform to the CLI Standard
- are compiled into the common Intermediate Language (IL);
- are executed on the common runtime system—Common Language Runtime (CLR);
- have access to the common Base Class Library (BCL).
Common Language Infrastructure specifies a Virtual Execution System (VES) comparable to the Java Virtual Machine (JVM) by Sun Microsystems. Both employ compilers to process source language statements into bytecode—an intermediate form of executable code.
The Common Language Infrastructure Standard specifies:
- the common intermediate language via the Common Language Specification (CLS);
- the common set of data types supported by all .NET languages—Common Type System (CTS);
- component structure, exception handling, machine state management.
And, now to the book review. The book is an essential reference work useful, primarily, to people who implement .NET compilers or design .NET libraries or write .NET tools. It is a difficult text not meant to be read straight through. The tedium of the specifications is frequently relieved by annotations by Microsoft experts who worked either on the spec or its implementation or both. The annotations make the spec more accessible and, at times, even amusing.
Basically, this book will not go out of date; because, it details the contract—structure and semantics—between an abstract Virtual Execution System (VES) and the application code.
This book is based on these ECMA and ISO standards:
- ECMA: Standard ECMA-335, 2nd Edition, December 2002.
- ISO: ISO/IEC 23271:2003(E), Information Technology—Common Language Infrastructure (CLI).
Bottom line
The Common Language Infrastructure Annotated Standard is the authoritative reference to the Common Language Infrastructure Standard and belongs in the library of every language, library, and tool designer.
From the back cover
The Common Language Infrastructure Annotated Standard is the definitive guide to understanding the annotated specification for the Common Language Infrastructure (CLI) standard. With annotations and code samples from both the ECMA standards committee and the Microsoft Common Language Runtime (CLR) team, this book goes beyond the online documentation to clarify and amplify the original standard and describe its implementation.
The core of this book is the international CLI standard. The text describes the CLI and its parts and provides all the information needed to implement a Virtual Execution System (VES) or design a compiler that runs on top of a VES and generates portable code. Author Jim Miller draws upon his experience as editor of the CLI standard and lead of the Microsoft CLR team to guide readers through the CLI blueprint and to a complete understanding of the CLR.
Features of this book include:
- A heavily annotated architectural overview of the standard
- A description of the semantics of metadata
- A complete specification of the Portable Executable (PE) file format
- Coverage of file format and metadata layout
- An overview of the CLI libraries
- A detailed description of the Common Intermediate Language (CIL) instruction set
- Sample programs and other annexes to the standard
- An enhanced online index that allows readers to quickly and easily search the entire text for specific topics
The Common Language Infrastructure Annotated Standard is the single source programmers, language and tool designers, and library and VES developers need to render the CLI and the CLR fully comprehensible.
About the author(s)
James S. Miller serves as software architect of the Microsoft team that developed the CLR and as the editor of the ECMA and ISO Common Language Infrastructure (CLI) Standards. Prior to joining Microsoft he was part of the World Wide Web Consortium’s senior management team and served on the research staffs of the Massachusetts Institute of Technology (MIT) Artificial Intelligence Lab, the MIT Lab for Computer Science, Digital Equipment Corporation, and the Open Software Foundation. He earned his Ph.D. in computer science from MIT and has been a member of the Brandeis University faculty.
Susann Ragsdale was the original documentation manager for the CLR team, and currently is a consulting technical writer. Before the CLR, she was a lead writer for COM (Microsoft’s Component Object Model). This followed a long and diverse career in consulting on multiprocessor supercomputers, simulation systems, test systems, and integrated circuits.
Table of Contents (abbreviated)
1. Introduction to the Common Language Infrastructure.
2. Partition I: Concepts and Architecture.
3. Partition IIA: Metadata Semantics.
4. Overview of File Format.
5. Partition IIB: Metadata File Format.
6. Partition III: CIL Instruction Set.
7. Partition IV: Profiles and Libraries.
8. Partition V: Annexes.
Appendix: Microsoft Portable Executable and Object File Format Specification.
Appendix: Example Object File.
Appendix: Calculating Image Message Digests.
Glossary.
Preface
This book, The Common Language Infrastructure Annotated Standard, annotates and amplifies the Common Language Infrastructure (CLI) Standard. It describes the CLI and its parts, and contains all of the information required to understand and implement a Virtual Execution System (VES) or design a compiler that generates portable code and runs on top of a VES.
This book is indispensable for anyone who wants to understand the CLI Standard. By necessity, standards follow a specific set of guidelines, including non-repetition of information. The result is a good standard, but it can be difficult to read and easily understand.
The annotations in this book came directly from the authors of the original specification (primarily Jim Miller) and from the highly talented ECMA technical committee that is responsible for standardizing that specification. The many annotations explain and expand on the original standard, clarifying it, connecting the dots, and supplying many more cross-references to make the system understandable.
This book is intended for four audiences:
- Language and tool designers
- Developers of libraries
- Those interested in developing or understanding a Virtual Execution System * Programmers, who will use primarily the Base Class Libraries, published in companion volumes to this one, and entitled the .NET Framework Standard Library Annotated Reference
About This Book
Along with the complete text of the CLI Standard, except for the portion describing the class libraries, this book contains some other information that may be of help.
Chapter 1 is an overview of CLI and describes, in context, where to go in this book to find specific technical areas.
Chapter 2 contains the annotated Partition I of this standard, an architectural overview and recommended to anyone who needs to understand the CLI. It also contains the specifications for the Common Language Specification (CLS), the restrictions on the CLI for anyone writing code that may be used across languages.
Chapter 3 is the part of the standard describing the semantics of metadata, with annotations. It contains the first 20 sections of Partition II, and uses an assembly language, ilasm, to describe these semantics.
Chapter 4 contains information that is not in the standard. It is an overview of the second half of Partition II, and describes how to find different areas of information. It also provides some information on the PE (Portable Executable) file format for managed files and its relation to the layout of metadata.
Chapter 5 contains the annotated second half of Partition II of the standard, sections 21-24, which describes the file format as it relates to managed files, and the physical metadata layout.
Chapter 6 is Partition III of the standard, which consists primarily of a detailed description of the Common Intermediate Language (CIL) instruction set. In addition, this chapter includes an annotated section important to both language designers and developers of Virtual Execution Systems that describes the effect of various numeric operations between types.
Chapter 7 is the annotated Partition IV, which is an overview of the CLI libraries, also describing what is, and is not, required for a conforming CLI implementation. In the International Standard, this Partition contains the Base Class Libraries in XML format. In this series, however, these are published in companion volumes entitled the .NET Framework Standard Library Annotated Reference.
Chapter 8 is the annotated Partition V, which is a set of annexes to the standard. These include sample programs in ilasm with corresponding annotations containing approximate high-level language examples for the same programs, implementation information for a version of ilasm, library design guidelines, and other information of interest to CLI implementers.
The Appendix in this book reprints the Microsoft Portable Executable and Object File Format Specification . This specification includes a good deal of information on the file format that is specific to Microsoft products and hence not standardized. This information allows you to see how the file format for managed code, described in Chapter 5, relates to the existing Microsoft Windows file format. It also helps clarify why the file format for managed code is more complicated than would be necessary if one were designing a portable format strictly for CIL. For those designing a Microsoft Windows-compatible implementation of the VES, it describes how to handle unmanaged code.
Goals of the Standard and of This Book
The goal of any standard is to set out what must be done to comply with the standard, not to tell you how to implement it. The information makes it possible to guarantee that if you write a program and compile it on one implementation of the VES, it will also run on another implementation, unless the program violates the rules. It specifies both what is needed for portability and the limits of portability. It also specifies the rules for creating a Virtual Execution System (VES).
It was not a goal of this standard to describe why decisions were made. However, many of the annotations in this book attempt to provide some of that context, to make the system more coherent.
Another important part of the International Standard is an implementation of a set of libraries that work on all compliant implementations and are language-independent, called the Base Class Libraries. These libraries are described in detail in companion volumes to this one, entitled the .NET Framework Standard Library Annotated Reference.
Where Did the Standard Come From?
This standard started with a band of troublemakers (as most big ideas do), this time at Microsoft. They had a vision of a multi-language standard that would allow programmers to use whichever language best fit the programming task for any module. Furthermore, they believed that these modules should not only work together correctly, but it should be possible to run them on any operating system without rewriting or recompiling.
This idea faced a lot of opposition in a company whose different divisions had invested huge amounts of time and effort in different programming models; no group wanted to give up its special model. Good technology finally prevailed, however, and the .NET concept, with the development of the Common Language Runtime, gained acceptance.
Language groups within Microsoft were involved in early design talks, and by 1999 the talks had expanded to include language developers from outside Microsoft. Many of these discussions were contentious, but they resulted, eventually, in the CTS and the CLS. More significantly, all of Microsoft's Visual Studio languages did what was necessary to comply with the rules. All of the languages had to make significant changes to their initial designs. The Visual Basic team, in fact, did a complete redesign of the language. Another thing that laid the foundation for creating a standard is that the group at Microsoft started partnerships very early in the process with language and system developers around the world, to ensure that it would really work as a standard, not just an in-house flash in the pan.
Early on, the development team recognized that the concept of the CLI made sense only if it was in wide use, and the best way to do that was to turn it into a standard that was freely available. So, in 2000, long before the release of Microsoft's Common Language Runtime, Jim Miller, a senior architect of the CLI, went to a meeting of ECMA International, an international industry association for the standardization of information and communications systems, to talk about creating a standard. At that time, it was informally agreed that the CLI should be submitted.
About a year later, after Hewlett-Packard and Intel had joined Microsoft as co-sponsors, a meeting of the ECMA Technical Committee TC39 in Bristol, England, was presented with three documents-;(1) what is now Partition I of this book, (2) a document containing information for compiler designers (now the first half of Partition II), and (3) an XML version of the documentation of the Base Class Libraries. Other companies, such as Fujitsu, who was interested in developing a compliant COBOL, had also joined the effort. The copyright was turned over to ECMA, and standardization really began.
At this writing, Microsoft has shipped as product five implementations of the CLI (or a large subset thereof). Of those, three are completely independent implementations, sharing no code at all. These are:
1. The Common Language Runtime, and derived from that is the Shared Source CLI (commonly known as Rotor).
2. The .NET Compact Framework, and derived from that code base is a CLI being used for the Microsoft TV platform, called the Microsoft .NET Compact Framework TV Edition.
3. A minimal CLI, called the Smart Personal Objects Technology (SPOT), being used for very small devices, like watches.
Other CLIs are under development by other companies, such as the Mono project by Ximian, an open-source project called the DotGNU Portable.NET, and one developed as a research project at Intel Corporation.
Books in this series
Microsoft .NET Development Series (Addison-Wesley):
- .NET Developer's Guide to Directory Services Programming, Addison-Wesley
- .NET Developer's Guide to Windows Security, Addison-Wesley
- .NET Framework Standard Library Annotated Reference, v.1, Addison-Wesley
- .NET Framework Standard Library Annotated Reference, v.2, Addison-Wesley
- .NET Internationalization, Addison-Wesley
- .NET Web Services, Addison-Wesley
- ASP.NET 2.0 Illustrated, Addison-Wesley
- C# Programming Language, The, 2nd Ed., Addison-Wesley
- Common Language Infrastructure Annotated Standard, Addison-Wesley
- Data Binding with Windows Forms 2.0, Addison-Wesley
- Enterprise Services with the .NET Framework, Addison-Wesley
- eXtreme .NET, Addison-Wesley
- Framework Design Guidelines, Addison-Wesley
- Visual Studio Tools for Office, Addison-Wesley
- Windows Forms 2.0 Programming, Addison-Wesley