Common Language Specification

Why Trust Techopedia

What Does Common Language Specification Mean?

The Common Language Specification (CLS) is a fundamental set of language features supported by the Common Language Runtime (CLR) of the .NET Framework. CLS is a part of the specifications of the .NET Framework. CLS was designed to support language constructs commonly used by developers and to produce verifiable code, which allows all CLS-compliant languages to ensure the type safety of code. CLS includes features common to many object-oriented programming languages. It forms a subset of the functionality of common type system (CTS) and has more rules than defined in CTS.

Advertisements

Techopedia Explains Common Language Specification

CLS defines the base rules necessary for any language targeting common language infrastructure to interoperate with other CLS-compliant languages. For example, a method with parameter of “unsigned int” type in an object written in C# is not CLS-compliant, just as some languages, like VB.NET, do not support that type.

CLS represents the guidelines to the compiler of a language, which targets the .NET Framework. CLS-compliant code is the code exposed and expressed in CLS form. Even though various .NET languages differ in their syntactic rules, their compilers generate the Common Intermediate Language instructions, which are executed by CLR. Hence, CLS allows flexibility in using non-compliant types in the internal implementation of components with CLS-compliant requirements. Thus, CLS acts as a tool for integrating different languages into one umbrella in a seamless manner.

Advertisements

Related Terms

Margaret Rouse
Senior Editor
Margaret Rouse
Senior Editor

Margaret is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages.