Common Language Runtime

Common Language Runtime

A language runtime allows an application to run on a target computer; it consists of code that's shared among all applications developed using a supported language. A runtime contains the "guts" of language code, such as code that draws forms to the screen, handles user input, and manages data. The runtime of .NET is called the common language runtime.

Unlike runtimes for other languages, the Common Language Runtime is designed as a multilanguage runtime. For example, both Visual Basic and Visual C# use the common language runtime. In fact, currently more than 15 language compilers are being developed to use the Common Language Runtime.

Because all .NET languages share the common language runtime, they also share the same IDE, forms engine, exception-handling mechanism, garbage collector (discussed shortly), and much more. One benefit of the multilanguage capability of the common language runtime is that programmers can leverage their knowledge of a given .NET language.

For example, some developers on a team might be comfortable with Visual C#, whereas others are more comfortable with Visual Basic. Because both languages share the same runtime, both can be integrated to deliver a single solution. In addition, a common exception-handling mechanism is built into the Common Language Runtime so that exceptions can be thrown from code written in one .NET language and caught in code written in another.

Code that runs within the common language runtime is called managed code because the code and resources used by the code (variables, objects, and so on) are fully managed by the common language runtime. Where Visual Basic is restricted to working only in managed code, other languages such as Visual C# are capable of dropping to unmanaged codecode that isn't managed by the common language runtime.

Another advantage of the common language runtime is that all .NET tools share the same debugging and code-profiling tools. In the past, tools like Visual Basic were limited in its debugging tools, whereas applications such as C++ had many third-party debugging tools available. All languages now share the same tools. That means that as advancements are made to the debugging tools of one product, they're made to tools of all products because the tools are shared. This aspect goes beyond debugging tools. Add-ins to the IDE such as code managers, for example, are just as readily available to Visual C# as they are to Visual Basicor any other .NET language, for that matter.

By the Way

Although Microsoft hasn't announced any official plans to do so, it's possible that it could produce a version of the common language runtime that runs on other operating systems, such as Macintosh OS or Linux. If this occurs, the applications that you've written for Windows should run on a newly supported operating system with little or no modification.

 Python   SQL   Java   php   Perl 
 game development   web development   internet   *nix   graphics   hardware 
 telecommunications   C++ 
 Flash   Active Directory   Windows