managed code
   HOME

TheInfoList



OR:

Managed code is
computer program A computer program is a sequence or set of instructions in a programming language for a computer to Execution (computing), execute. It is one component of software, which also includes software documentation, documentation and other intangibl ...
code that requires and will execute only under the management of a
Common Language Infrastructure The Common Language Infrastructure (CLI) is an open specification and technical standard originally developed by Microsoft and standardized by International Organization for Standardization, ISO/International Electrotechnical Commission, IEC (ISO/ ...
(CLI); Virtual Execution System (VES);
virtual machine In computing, a virtual machine (VM) is the virtualization or emulator, emulation of a computer system. Virtual machines are based on computer architectures and provide the functionality of a physical computer. Their implementations may involve ...
, e.g.
.NET The .NET platform (pronounced as "''dot net"'') is a free and open-source, managed code, managed computer software framework for Microsoft Windows, Windows, Linux, and macOS operating systems. The project is mainly developed by Microsoft emplo ...
, CoreFX, or .NET Framework; Common Language Runtime (CLR); or Mono. The term was coined by
Microsoft Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
. Managed code is the compiler output of
source code In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer. Since a computer, at base, only ...
written in one of over twenty high-level programming languages, including C#, J# and Visual Basic .NET.


Terminology

The true and fine distinction between managed and unmanaged code is prevalent and only relevant when developing applications that interact with CLR implementations. Since many older programming languages (list) have been ported to the CLR, the differentiation is needed to identify managed code, especially in a mixed setup. In this context, code that does not rely on the CLR is termed "unmanaged". A source of confusion was created when Microsoft started connecting the .NET Framework with C++, and the choice of how to name the Managed Extensions for C++. It was first named Managed C++ and then renamed to C++/CLI. The creator of the C++ programming language and member of the C++ standards committee, Bjarne Stroustrup, even commented on this issue, "On the difficult and controversial question of what the CLI binding/extensions to C++ is to be called, I prefer C++/CLI as a shorthand for 'The CLI extensions to ISO C++'. Keeping C++ as part of the name reminds people what is the base language and will help keep C++ a proper subset of C++ with the C++/CLI extensions."


Uses

The Microsoft Visual C++ compiler can produce both managed code, running under CLR, or unmanaged binaries, running directly on Windows. 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). There are many historical examples of code running on virtual machines, such as the language UCSD Pascal using p-code, and the operating system Inferno from
Bell Labs Nokia Bell Labs, commonly referred to as ''Bell Labs'', is an American industrial research and development company owned by Finnish technology company Nokia. With headquarters located in Murray Hill, New Jersey, Murray Hill, New Jersey, the compa ...
using the Dis virtual machine.
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
popularized this approach with its
bytecode Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (normal ...
executed by the
Java virtual machine A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally descr ...
.
Google Google LLC (, ) is an American multinational corporation and technology company focusing on online advertising, search engine technology, cloud computing, computer software, quantum computing, e-commerce, consumer electronics, and artificial ...
also mentions that
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
and Kotlin are managed code in their
Android NDK The Android Native Development Kit (NDK) provides a cross-compiling tool for compiling code written in C (programming language), C/C++ can be compiler, compiled to ARM architecture, ARM, or x86 native code (or their x86-64, 64-bit variants) for An ...
JNI documents.


References

{{Reflist


External links


Microsoft Research OS written in managed C# code
Channel 9 .NET terminology