Standard Libraries (CLI)

Last updated

Standard Libraries (CLI).png

The Standard Libraries are a set of libraries included in the Common Language Infrastructure (CLI) in order to encapsulate many common functions, such as file reading and writing, XML document manipulation, exception handling, application globalization, network communication, threading, and reflection, which makes the programmer's job easier. It is much larger in scope than standard libraries for most other languages, including C++, and is comparable in scope and coverage to the standard libraries of Java.

Contents

The Standard Libraries are the Base Class Library (BCL), Runtime Infrastructure Library (both part of the kernel profile), Network Library, Reflection Library, XML Library (which with the first two listed libraries form the compact profile), Extended Array Library, Parallel Library, Floating Point Library and Vararg Library.

The Framework Class Library (FCL) is the original implementation of the Standard Libraries as the .NET Framework, which includes it, is the first implementation of the CLI.

Profiles

The main standard libraries are organized into two Standard Profiles, the Kernel Profile, and the Compact Profile. [1] The following standard libraries do not belong to any profile: the Extended Array Library, the Extended Numerics Library, the Parallel Library and the Vararg Library. [2] [3] [4] [5]

Kernel Profile

The Kernel Profile is a subset of the Compact Profile. The Kernel Profile contains the Base Class Library (BCL) and Runtime Infrastructure Library. [6]

Compact Profile

The Compact Profile contains those libraries in the Kernel Profile as well as the Network Library, the Reflection Library and the XML Library. [7]

Libraries

Base Class Library

The Base Class Library is a simple runtime library for modern programming languages. It serves as the Standard for the runtime library for the language C# as well as one of the CLI Standard Libraries. It provides types to represent the built-in data types of the CLI, simple file access, custom attributes, security attributes, string manipulation, formatting, streams, collections, among other things. [8] It defines types in the following namespaces:

System
Defines the Object class which all reference type objects derive from (including value-type objects) and the ValueType class which all value type objects derive from. It also defines the base data types like integers, floating point numbers, character, strings, Boolean, enumeration and more. Support for the environment and platform and a command-line interface is provided along with base classes for exceptions and attributes. It defines arrays and delegates, mathematical functions and many other types.
System.Collections
Defines many common container types used in programming, such as dictionaries, hashtables, lists, queues and stacks.
System.Collections.Generic
Defines generic types of the container types in the System.Collections namespace.
System.Diagnostics
Defines types that provide the ability to diagnose applications. It includes event logging, performance counters, tracing and interaction with system processes.
System.Globalization
Defines types that define culture-related information, including language, country/region, calendars in use, format patterns for dates, currency and numbers and sort order for strings.
System.IO
Defines type that enable reading from and writing to different streams, such as files or other data streams. Also provides a connection to the file system.
System.Security
Defines types that represent the security system and permissions.
System.Security.Permissions
Defines types that control access to operations and resources based on policy.
System.Text
Defines types that support various character encodings, regular expressions and a more efficient mechanism for manipulating strings.
System.Threading
Defines types that enable multithreaded programming.
UML package diagram of the stream hierarchy in .NET UML dotnet streams.svg
UML package diagram of the stream hierarchy in .NET

Runtime Infrastructure Library

The Runtime Infrastructure Library provides the services needed by a compiler to target the CLI and the facilities needed to dynamically load types from a stream in a specified file format. [9] It defines types in the following namespaces:

System
Defines types for the application domain, pointers, handles and more.
System.Reflection
Defines types that provide a managed view of loaded types, methods and fields, and that can dynamically create and invoke types. These types are relevant to the program runtime.
System.Runtime.CompilerServices
Defines types that provide functionality for compiler writers who use managed code to specify attributes in metadata that affect the run-time behavior of the Virtual Execution System.
System.Runtime.InteropServices
Defines types that support Platform Invocation Services (P/Invoke).

Network Library

The Network Library provides simple networking services including direct access to network ports as well as HTTP support. [10] It defines types in the following namespaces:

System
Defines types that provide an object representation of a uniform resource identifier (URI) and easy access to the parts of the URI.
System.Collections.Specialized
Defines specialized and strongly-typed collections; for example, a linked list dictionary, a bit vector, and collections that contain only strings.
System.Net
Defines types that provide a simple programming interface for a number of network protocols.
System.Net.Sockets
Defines type that provide a managed implementation of the Windows Sockets (Winsock) interface for developers who need to tightly control access to the network.

Reflection Library

The Reflection Library provides the ability to examine the structure of types, create instances of types and invoke methods on types, all based on a description of the type. [11] It defines types in the following namespaces:

System
Defines the void type, a return value type for a method that does not return a value.
System.Globalization
Defines type that provide information about a specific culture (called a locale for unmanaged code development). The information includes the names for the culture, the writing system, the calendar used and formatting for dates and sort strings.
System.Reflection
Defines types that provide a managed view of loaded types, methods and fields, and that can dynamically create and invoke types.
System.Security.Permissions
Defines types that control access to operations and resources based on policy. These types are relevant to the reflection.

XML Library

The XML Library provides a simple "pull-style" parser for XML. It is designed for resource-constrained devices, yet provides a simple user model. [12] It defines types in the following namespace.

System.Xml
Defines types for processing XML.

Extended Array Library

The Extended Array Library provides support for non-vector arrays. That is, arrays that have more than one dimension or arrays that have non-zero lower bounds. [2] The Extended Array Library doesn't add any extra types, but it does extend the array-handling mechanism. [13]

Extended Numerics Library

The Extended Numerics Library provides support for floating-point (System.Single, System.Double) and extended-precision (System.Decimal) data types. Like the Base Class Library, this library is directly referenced by the C# standard. [3]

Parallel Library

The Parallel Library provides easy parallelism for non-expert programmers, so that multithreaded CPUs can be exploited. [4]

Vararg Library

The Vararg Library provides support for dealing with variable-length argument lists. [5]

See also

Related Research Articles

The Common Language Infrastructure (CLI) is an open specification and technical standard originally developed by Microsoft and standardized by ISO/IEC and Ecma International that describes executable code and a runtime environment that allows multiple high-level languages to be used on different computer platforms without being rewritten for specific architectures. This implies it is platform agnostic. The .NET Framework, .NET and Mono are implementations of the CLI. The metadata format is also used to specify the API definitions exposed by the Windows Runtime.

The Common Language Runtime (CLR), the virtual machine component of Microsoft .NET Framework, manages the execution of .NET programs. Just-in-time compilation converts the managed code into machine instructions which are then executed on the CPU of the computer. The CLR provides additional services including memory management, type safety, exception handling, garbage collection, security and thread management. All programs written for the .NET Framework, regardless of programming language, are executed in the CLR. All versions of the .NET Framework include CLR. The CLR team was started June 13, 1998.

Common Intermediate Language (CIL), formerly called Microsoft Intermediate Language (MSIL) or Intermediate Language (IL), is the intermediate language binary instruction set defined within the Common Language Infrastructure (CLI) specification. CIL instructions are executed by a CIL-compatible runtime environment such as the Common Language Runtime. Languages which target the CLI compile to CIL. CIL is object-oriented, stack-based bytecode. Runtimes typically just-in-time compile CIL instructions into native code.

DotGNU is a decommissioned part of the GNU Project that started in January 2001 and aimed to provide a free software replacement for Microsoft's .NET Framework. The DotGNU project was run by the Free Software Foundation. Other goals of the project are better support for non-Windows platforms and support for more processors.

The Shared Source Common Language Infrastructure (SSCLI), previously codenamed Rotor, is Microsoft's shared source implementation of the CLI, the core of .NET. Although the SSCLI is not suitable for commercial use due to its license, it does make it possible for programmers to examine the implementation details of many .NET libraries and to create modified CLI versions. Microsoft provides the Shared Source CLI as a reference CLI implementation suitable for educational use.

An XML schema is a description of a type of XML document, typically expressed in terms of constraints on the structure and content of documents of that type, above and beyond the basic syntactical constraints imposed by XML itself. These constraints are generally expressed using some combination of grammatical rules governing the order of elements, Boolean predicates that the content must satisfy, data types governing the content of elements and attributes, and more specialized rules such as uniqueness and referential integrity constraints.

Ecma International is a nonprofit standards organization for information and communication systems. It acquired its current name in 1994, when the European Computer Manufacturers Association (ECMA) changed its name to reflect the organization's global reach and activities. As a consequence, the name is no longer considered an acronym and no longer uses full capitalization.

Managed Extensions for C++ or Managed C++ is a deprecated set of language extensions for C++, including grammatical and syntactic extensions, keywords and attributes, to bring the C++ syntax and language to the .NET Framework. These extensions were created by Microsoft to allow C++ code to be targeted to the Common Language Runtime (CLR) in the form of managed code, as well as continue to interoperate with native code.

C++/CLI is a variant of the C++ programming language, modified for Common Language Infrastructure. It has been part of Visual Studio 2005 and later, and provides interoperability with other .NET languages such as C#. Microsoft created C++/CLI to supersede Managed Extensions for C++. In December 2005, Ecma International published C++/CLI specifications as the ECMA-372 standard.

Metadata, in the Common Language Infrastructure (CLI), refers to certain data structures embedded within the Common Intermediate Language (CIL) code that describes the high-level structure of the code. Metadata describes all classes and class members that are defined in the assembly, and the classes and class members that the current assembly will call from another assembly. The metadata for a method contains the complete description of the method, including the class, the return type and all of the method parameters.

<span class="mw-page-title-main">C Sharp (programming language)</span> Programming language

C# is a general-purpose high-level programming language supporting multiple paradigms. C# encompasses static typing, strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.

In Microsoft's .NET Framework, the Common Type System (CTS) is a standard that specifies how type definitions and specific values of types are represented in computer memory. It is intended to allow programs written in different programming languages to easily share information. As used in programming languages, a type can be described as a definition of a set of values, and the allowable operations on those values.

The Open Packaging Conventions (OPC) is a container-file technology initially created by Microsoft to store a combination of XML and non-XML files that together form a single entity such as an Open XML Paper Specification (OpenXPS) document. OPC-based file formats combine the advantages of leaving the independent file entities embedded in the document intact and resulting in much smaller files compared to normal use of XML.

The Framework Class Library (FCL) is a component of Microsoft's .NET Framework, the first implementation of the Common Language Infrastructure (CLI). In much the same way as Common Language Runtime (CLR) implements the CLI Virtual Execution System (VES), the FCL implements the CLI foundational Standard Libraries. As a CLI foundational class libraries implementation, it is a collection of reusable classes, interfaces, and value types, and includes an implementation of the CLI Base Class Library (BCL).

<span class="mw-page-title-main">.NET Framework</span> Software platform developed by Microsoft

The .NET Framework is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until being superseded by the cross-platform .NET project. It includes a large class library called Framework Class Library (FCL) and provides language interoperability across several programming languages. Programs written for .NET Framework execute in a software environment named the Common Language Runtime (CLR). The CLR is an application virtual machine that provides services such as security, memory management, and exception handling. As such, computer code written using .NET Framework is called "managed code". FCL and CLR together constitute the .NET Framework.

The Native Image Generator, or simply NGen, is the ahead-of-time compilation (AOT) service of the .NET Framework. It allows a CLI assembly to be pre-compiled instead of letting the Common Language Runtime (CLR) do a just-in-time compilation (JIT) at runtime. In some cases the execution will be significantly faster than with JIT.

Windows Runtime (WinRT) is a platform-agnostic component and application architecture first introduced in Windows 8 and Windows Server 2012 in 2012. It is implemented in C++ and officially supports development in C++, Rust/WinRT, Python/WinRT, JavaScript-TypeScript, and the managed code languages C# and Visual Basic (.NET) (VB.NET).

<span class="mw-page-title-main">Mono (software)</span> Computer software project

Mono is a free and open-source software framework that aims to run software made for the .NET Framework on Linux and other OSes. Originally by Ximian which was acquired by Novell, it was later developed by Xamarin which was acquired by Microsoft. In August 2024, Microsoft transferred ownership of Mono to WineHQ.

The following outline is provided as an overview of and topical guide to C++:

References

  1. "IV.3 The Standard Profiles". Standard ECMA-335 – Common Language Infrastructure (CLI) (Technical report) (6th ed.). Ecma International. June 2012. p. 437.
  2. 1 2 "IV.5.8 Extended array library". Standard ECMA-335 – Common Language Infrastructure (CLI) (Technical report) (6th ed.). Ecma International. June 2012. p. 441.
  3. 1 2 "IV.5.7 Extended numerics library". Standard ECMA-335 – Common Language Infrastructure (CLI) (Technical report) (6th ed.). Ecma International. June 2012. p. 441.
  4. 1 2 "IV.5.10 Parallel library". Standard ECMA-335 – Common Language Infrastructure (CLI) (Technical report) (6th ed.). Ecma International. June 2012. p. 441.
  5. 1 2 "IV.5.9 Vararg library". Standard ECMA-335 – Common Language Infrastructure (CLI) (Technical report) (6th ed.). Ecma International. June 2012. p. 441.
  6. "IV.3.1 The Kernel Profile". Standard ECMA-335 – Common Language Infrastructure (CLI) (Technical report) (6th ed.). Ecma International. June 2012. p. 437.
  7. "IV.3.2 The Compact Profile". Standard ECMA-335 – Common Language Infrastructure (CLI) (Technical report) (6th ed.). Ecma International. June 2012. p. 437.
  8. "IV.5.3 Base Class Library (BCL)". Standard ECMA-335 – Common Language Infrastructure (CLI) (Technical report) (6th ed.). Ecma International. June 2012. p. 440.
  9. "IV.5.2 Runtime infrastructure library". Standard ECMA-335 – Common Language Infrastructure (CLI) (Technical report) (6th ed.). Ecma International. June 2012. p. 440.
  10. "IV.5.4 Network library". Standard ECMA-335 – Common Language Infrastructure (CLI) (Technical report) (6th ed.). Ecma International. June 2012. p. 440.
  11. "IV.5.5 Reflection library". Standard ECMA-335 – Common Language Infrastructure (CLI) (Technical report) (6th ed.). Ecma International. June 2012. p. 440.
  12. "IV.5.6 XML library". Standard ECMA-335 – Common Language Infrastructure (CLI) (Technical report) (6th ed.). Ecma International. June 2012. p. 440.
  13. King, Jason; Easton, Mark (2004). "Chapter 4: The NET Framework Dissected". In Gilmore, Jason (ed.). Cross-Platform .NET Development: Using Mono, Portable.NET, and Microsoft .NET. Apress. p. 110. ISBN   1-59059-330-8. LCCN   2004018339.