Tip

The common language runtime


.NET Developer Tip
(Receive this column in your inbox,
click Edit your Profile to subscribe.)

The common language runtime
Peter G. Aitken and Phil Syme

    Requires Free Membership to View

If you haven't done any development for the .NET environment, chances are that you need to understand some basic terms about the concept. This tip, excerpted from InformIT, offers some definitions and explanations about the common language runtime (CLR) in the .NET framework.


The common language runtime (CLR) is the infrastructure that .NET uses to execute all your applications. The CLR includes a huge set of class libraries that you can use in your applications. Some interesting non-Internet–related classes include utilities that allow you to manipulate the Windows NT event log, Active Directory, cryptographic services, performance counters, COM+ services, object serialization, and Windows native services.

The CLR also takes care of compiling "intermediate language," or IL, code into native machine code. The basic process works as follows:

The Visual Basic compiler converts your code into IL. In terms of functionality and language complexity, IL is somewhere between assembly language and C. IL is optimized for quick compilation into machine code. Normally, you won't deal with IL in any of your development efforts. You can think of IL as an intermediate product of the compilation process.

Your Internet application is called by a user, or more precisely, by the Web server in response to a user's request.

The CLR takes over and compiles the IL into machine code. This happens function by function. If a function is used, it's compiled into machine code. If not, it remains as IL. The odds of an error occurring during this process are extremely small, equivalent to a compiler crash.

If this process seems roundabout and destined to make your application too slow, please suspend judgment until you've worked with .NET for a little while. You should be pleasantly surprised. At the minimum, this process makes development much faster, as the first step is much faster than other methods. You can also compile your .NET code directly into machine code by using standard tools installed with the .NET Framework.

The CLR contains other services, including support for running multiple .NET applications inside one process with a guarantee that they won't interfere with each other. This is a result of a concept called type safety. Any .NET language must guarantee type-safe code, which ensures that arrays and collections will never be accessed incorrectly, among other things. The Visual Basic compiler always enforces type safety when it compiles your code into IL.


To read the article from which this tip is excerpted, click over to InformIT. You have to register there, but the registration is free.

For More Information:

  • Looking for free research? Browse our comprehensive White Papers section by topic, author or keyword.
  • Are you tired of technospeak? The Web Services Advisor column uses plain talk without the hype.
  • For insightful opinion and commentary from today's industry leaders, read our Guest Commentary columns.
  • Hey Codeheads! Start benefiting from other time-saving XML Developer Tips and .NET Developer Tips.
  • Visit our huge Best Web Links for Web Services collection for the freshest editor-selected resources.
  • Choking on the alphabet soup of industry acronyms? Visit our helpful Glossary for the latest lingo.
  • Visit Ask the Experts for answers to your Web services, SOAP, WSDL, XML, .NET, Java and EAI questions.
  • Discuss this issue, voice your opinion or just talk with your peers in the SearchWebServices Discussion Forums.

This was first published in July 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.