Mono (software)
Mono is a free and open-source software framework that aims to run software made for the.NET Framework on Linux and other OSes. Originally by Ximian which was acquired by Novell, it was later developed by Xamarin which was acquired by Microsoft. In August 2024, Microsoft transferred ownership of Mono to WineHQ.
History
When Microsoft first announced their.NET Framework in June 2000 it was described as "a new platform based on Internet standards", and in December of that year the underlying Common Language Infrastructure was published as an open standard, "ECMA-335", opening up the potential for independent implementations. Miguel de Icaza of Ximian believed that.NET had the potential to increase programmer productivity and began investigating whether a Linux version was feasible. Recognizing that their small team could not expect to build and support a full product, they launched the Mono open-source project, on July 19, 2001, at the O'Reilly conference.After three years of development, Mono 1.0 was released on June 30, 2004. Mono evolved from its initial focus of a developer platform for Linux desktop applications to supporting a wide range of architectures and operating systems - including embedded systems.
Novell acquired Ximian in 2003. After Novell was acquired by Attachmate in April 2011, Attachmate announced hundreds of layoffs for the Novell workforce, putting in question the future of Mono.
On May 16, 2011, Miguel de Icaza announced in his blog that Mono would continue to be supported by Xamarin, a company he founded after being laid off from Novell. The original Mono team had also moved to the new company. Xamarin planned to keep working on Mono and had planned to rewrite the proprietary.NET stacks for iOS and Android from scratch, because Novell still owned MonoTouch and Mono for Android at the time. After this announcement, the future of the project was questioned, MonoTouch and Mono for Android being in direct competition with the existing commercial offerings now owned by Attachmate, and considering that the Xamarin team would have difficulties proving that they did not use technologies they formerly developed when they were employed by Novell for the same work. However, in July 2011, Novell, now a subsidiary of Attachmate, and Xamarin, announced that it granted a perpetual license to Xamarin for Mono, MonoTouch and Mono for Android, which officially took stewardship of the project.
On February 24, 2016, Microsoft announced it had signed a definitive agreement to acquire Xamarin.
On August 27, 2024, Microsoft transferred ownership of Mono to WineHQ, the developer team of Wine, a Windows compatibility layer.
Current status and roadmap
Mono's current version is 6.12.0. This version provides the core API of the.NET Framework and support for Visual Basic.NET and C# 7.0. LINQ to Objects, XML, and SQL are part of the distribution. Windows Forms 2.0 is also supported, but not actively developed, and as such its support on Mono is incomplete. Version 4.0 was the first version that incorporates Microsoft original source code that was released by Microsoft as part of the.NET Core project.As of January 14, 2021, Mono has full support for all the features in.NET 4.7 except Windows Presentation Foundation and Windows Workflow Foundation, and with only limited support for Windows Communication Foundation and the ASP.NET async stack. However, System.Web and WCF are candidates for 'almost immediate' porting from the.NET reference source back to Mono. Some missing parts of the.NET Framework are under development in an experimental Mono subproject called .
The Mono project has also created a Visual Basic.NET compiler and a runtime designed for running VB.NET applications. It is currently being developed by Rolf Bjarne Kvinge.
Moonlight
An open-source implementation of Microsoft Silverlight, called Moonlight, has been included since Mono 1.9. Moonlight 1.0, which supports the Silverlight 1.0 APIs, was released January 20, 2009. Moonlight 2.0 supports Silverlight 2.0 and some features of Silverlight 3.0. A preview release of Moonlight 3.0 was announced in February 2010 and contains updates to Silverlight 3 support.The Moonlight project was abandoned on May 29, 2012. According to Miguel, two factors sealed the fate of the project: Microsoft added "artificial restrictions" that "made it useless for desktop programming", and the technology had not gained enough traction on the Web. In addition, Silverlight itself was deprecated by Microsoft by 2012.
Mono components
Mono consists of three groups of components:- Core components
- Mono/Linux/GNOME development stack
- Microsoft compatibility stack
The Mono/Linux/GNOME development stack provide tools for application development while using the existing GNOME and free and open-source libraries. These include: Gtk# for graphical user interface development, Mozilla libraries for working with the Gecko rendering engine, Unix integration libraries, database connectivity libraries, a security stack, and the XML schema language RelaxNG. Gtk# allows Mono applications to integrate into the Gnome desktop as native applications. The database libraries provide connectivity to the object-relational database db4o, Firebird, Microsoft SQL Server, MySQL, Open Database Connectivity, Oracle, PostgreSQL, SQLite, and many others. The Mono project tracks developing database components at its website.
The Microsoft compatibility stack provides a pathway for porting Windows.NET applications to Linux. This group of components include ADO.NET, ASP.NET, and Windows Forms, among others. As these components are not covered by Ecma standards, some of them remain subject to [|patent fears and concerns].
Framework architecture
The major components of Mono include:- [|Code Execution Engine]
- Class Libraries
- * Base Class Library
- *.NET Compatibility Class Libraries
- * Mono specific class libraries:
- ** Cross platform class libraries for both Mono and.NET
- ** Unix-specific class libraries
- ** Platform-specific class libraries
- CLI Assemblies
- CLI Metadata
- Mono's Common Language Runtime
- * Compatible with the ECMA Common Language Infrastructure/.NET Common Language Runtime
- * Mono-specific enhancements:
- ** Mono.SIMD support
- ** Mono co-routines and continuations.
- Mono-specific enhancements
- Native interop services and COM interop
- Security -
Code Execution Engine
The code generator is exposed in three modes:
- Just-in-time compilation: The runtime will turn ECMA CIL byte codes into native code as the code runs.
- Ahead-of-Time compilation: this code turns the ECMA CIL byte codes and generates native code stored in an operating system, architecture and CPU specific file. This mode of operation compiles most of the code that is typically done at runtime. There are some exceptions like trampolines and other administrative code that still require the JIT to function, so AOT images are not fully standalone.
- Full Static Compilation: this mode is only supported on a handful of platforms and takes the Ahead-of-Time compilation process one step further and generates all the trampolines, wrappers and proxies that are required into a static file that can be statically linked into a program and eliminates the need for a JIT at runtime. This is used on Apple's iOS, Sony's PlayStation 3 and Microsoft's Xbox 360 operating systems.
Starting with the Mono 2.7 preview, it is no longer necessary to pick one engine over the other at configuration time. The code generation engine can be selected at startup by using the
--llvm or --nollvm command line arguments, and it defaults to the fast-starting Mono code generation engine.Starting with Mono 5.18, support for LLVM is a default configuration option. Previous versions required a special LLVM fork, but now mono can fall back to its own code generator when it encounters something not handled by LLVM.
Garbage collector
As of Mono 2.8, the Mono runtime ships with two garbage collectors: a generational collector and the Boehm–Demers–Weiser Conservative Garbage Collector. The Boehm garbage collector could exhibit memory leaks on certain classes of applications, making it unsuitable for some long-running server applications. Mono switched to Simple Generational GC as the default collector in version 3.1.1.The SGen garbage collector has many advantages over a traditional conservative scanner. It uses generational garbage collection where new objects are allocated from a nursery, during the garbage collection cycle, all objects that survived are migrated to an older generation memory pool. The idea is that many objects are transient and can quickly be collected and only a handful of objects are long-term objects that live for the entire life of the application. To improve performance this collector assigns memory pools to each thread to let threads allocate new memory blocks without having to coordinate with other threads. Migration of objects from the nursery to the old generation is done by copying the data from the nursery to the old generation pool and updating any live pointers that point to the data to point to the new location. This can be expensive for large objects, so Mono's SGen uses a separate pool of memory for large objects and uses a mark-and-sweep algorithm for those objects.