Jump to content

Managed code: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
No edit summary
Line 1: Line 1:
{{Merge|Interpreted language|date=October 2009}}
{{Merge|Interpreted language|date=October 2009}}


'''Managed code''' is a disambiguation created by Microsoft to identify [[Source code|computer program code]] that executes under the "management" of a [[virtual machine]], unlike standard compilations, which is executed directly by the computer's [[Central processing unit|CPU]]. Some of the benefits of managed code include programmer convenience (by increasing the level of abstraction, creating smaller models) and enhanced security guarantees, depending on the platform (including the VM implementation).
'''Managed code''' is a disambiguation created by Microsoft to identify [[Source code|computer program code]] that executes under the "management" of a [[virtual machine]], unlike standard compilations, which is executed directly by the computer's [[Central processing unit|CPU]]. This disambiguation is prevalent and relevant only when developing Microsoft OS applications that interact with the [[.NET Framework]] or other [[Common Language Runtime]] implementations, like [[Mono (software)|Mono]].


Programs in any [[programming language]] could, in principle, be compiled into either managed code or normal binaries. In practice, however, each programming language is typically compiled into one type. For example, the [[Java (programming language)|Java]] programming language is almost always compiled into [[Java bytecode|bytecode]], although there are Java compilers that can generate binaries (such as [[GNU Compiler for Java]]), and similarly for the [[python (programming language)|Python language]]. By contrast, Microsoft's Visual C++ development environment can produce both managed code (running under the .NET Common Language Runtime) or compiled binaries, running directly on the Windows platform with the help of its C Runtime Library.<ref name="Gregory">{{cite web |author=Gregory, Kate |title=Managed, Unmanaged, Native: What Kind of Code Is This? |date=2003-04-28 |url=http://www.developer.com/net/cplus/article.php/2197621 |accessdate=2009-04-22 }}</ref>.
Programs in any [[programming language]] could, in principle, be compiled into either managed code or normal binaries. In practice, however, each programming language is typically compiled into one type. For example, the [[Java (programming language)|Java]] programming language is almost always compiled into [[Java bytecode|bytecode]], although there are Java compilers that can generate binaries (such as [[GNU Compiler for Java]]), and similarly for the [[python (programming language)|Python language]]. By contrast, Microsoft's Visual C++ development environment can produce both managed code (running under the .NET Common Language Runtime) or compiled binaries, running directly on the Windows platform with the help of its C Runtime Library.<ref name="Gregory">{{cite web |author=Gregory, Kate |title=Managed, Unmanaged, Native: What Kind of Code Is This? |date=2003-04-28 |url=http://www.developer.com/net/cplus/article.php/2197621 |accessdate=2009-04-22 }}</ref>.


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

Benefits of using managed code include programmer convenience (by increasing the level of abstraction, creating smaller models) and enhanced security guarantees, depending on the platform (including the VM implementation).


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]]).
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]]).

Revision as of 04:59, 8 November 2009

Managed code is a disambiguation created by Microsoft to identify computer program code that executes under the "management" of a virtual machine, unlike standard compilations, which is executed directly by the computer's CPU. This disambiguation is prevalent and relevant only when developing Microsoft OS applications that interact with the .NET Framework or other Common Language Runtime implementations, like Mono.

Programs in any programming language could, in principle, be compiled into either managed code or normal binaries. In practice, however, each programming language is typically compiled into one type. For example, the Java programming language is almost always compiled into bytecode, although there are Java compilers that can generate binaries (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 compiled binaries, 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.

Benefits of using managed code include programmer convenience (by increasing the level of abstraction, creating smaller models) and enhanced security guarantees, depending on the platform (including the VM implementation).

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.