Jump to content

Managed code

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Martyn Lovell (talk | contribs) at 18:15, 30 October 2009 (Article mistakenly connects unmanaged apps to MFC. Existing reference already explains this correctly, so no new reference needed.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Managed code is computer program code that executes under the management of a virtual machine, unlike unmanaged code, which is executed directly by the computer's CPU. The benefits of managed code include programmer convenience and enhanced security guarantees.

Programs in any programming language could, in principle, be compiled into either managed or unmanaged code. In practice, however, each programming language is typically compiled into one type. For example, the Java programming language is almost always compiled into managed code, although there are Java compilers that can generate unmanaged code (such as GNU Compiler for Java), and similarly for the Python language. By contrast, Microsoft's Visual C++ development environment can produce both managed code (running under the .NET Common Language Runtime) or unmanaged code, running directly on the Windows platform with the help of its C Runtime Library.[1].

There are many historical examples of managed code running on a virtual machine, such as UCSD Pascal utilizing p-code. Java popularized this approach with its bytecode executed by the Java Virtual Machine. Microsoft uses managed code in its CLR virtual machine in the .NET Framework, or another similar virtual machine.

Some compilers produce intermediate "pseudocode" with intention of compiling it further into target machine code, not running it within a virtual machine as managed code (see, for example, BCPL or ALGOL 68C).

References

  1. ^ Gregory, Kate (2003-04-28). "Managed, Unmanaged, Native: What Kind of Code Is This?". Retrieved 2009-04-22.