Mono (software)


Mono is a free and open-source project to create an Ecma standard-compliant.NET Framework-compatible software framework, including a C# compiler and a Common Language Runtime. Originally by Ximian, it was later acquired by Novell, and is now being led by Xamarin, a subsidiary of Microsoft and the.NET Foundation. The stated purpose of Mono is not only to be able to run Microsoft.NET applications cross-platform, but also to bring better development tools to Linux developers. Mono can be run on many software systems including Android, most Linux distributions, BSD, macOS, Windows, Solaris, and even some game consoles such as PlayStation 3, Wii, and Xbox 360.
The Mono project has been controversial within the open-source community, as it implements portions of.NET Framework that may be covered by Microsoft patents. Although standardized portions of.NET Framework are covered under Microsoft Open Specification Promise—a covenant stating that Microsoft will not assert its patents against implementations of its specifications under certain conditions—other portions are not, which led to concerns that the Mono project could become the target of patent infringement lawsuits. Following Microsoft's open-sourcing of several core.NET technologies since 2014 and its acquisition of Xamarin in the beginning of 2016, an updated patent promise has been issued for the Mono project.
The logo of Mono is a stylized monkey's face, mono being Spanish for monkey.

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' 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, 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.

Current status and roadmap

Mono's current version is 6.0.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.
Mono's aim is to achieve full support for the features in.NET 4.5 except Windows Presentation Foundation , Windows Workflow Foundation, limited Windows Communication Foundation. 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:
  1. Core components
  2. Mono/Linux/GNOME development stack
  3. Microsoft compatibility stack
The core components include the C# compiler, the virtual machine for the Common Language Infrastructure and the core class libraries. These components are based on the Ecma-334 and Ecma-335 standards, allowing Mono to provide a standards compliant, free and open-source CLI virtual machine. Microsoft issued a statement that covers both standards under their Community Promise license.
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 GNU/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:
The Mono runtime contains a code execution engine that translates ECMA CIL byte codes into native code and supports a number of processors: ARM, MIPS, SPARC, PowerPC, S390, x86, x86-64 and IA-64 for 64-bit modes.
The code generator is exposed in three modes:
Starting with Mono 2.6, it is possible to configure Mono to use the LLVM as the code generation engine instead of Mono's own code generation engine. This is useful for high performance computing loads and other situations where the execution performance is more important than the startup performance.
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 defult 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 conservative collector.
The default garbage collector prior to Mono 3.1.1, has significant limitations compared to commercial garbage-collected runtimes like the Java Virtual Machine or the.NET framework's runtime. Because the garbage collector could exhibit memory leaks on certain classes of applications, it may not have been suitable for long-running server applications prior to updating to 3.1.1 or later.
, a new generational collector called the Simple Generational GC became available as part of Mono. Starting with Mono 3.1.1 this is the default. For versions of Mono from 2.8 to 3.1.0, users can elect to use the SGen garbage collector by passing the --gc=sgen switch to the Mono runtime at startup. This new 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 being 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.
Currently SGen treats the stack and registers conservatively and pins any objects that could be referenced by any of these roots. The upcoming version of Mono scans the managed stack precisely, reducing the number of pinned objects.

Class library

The class library provides a comprehensive set of facilities for application development. They are primarily written in C#, but due to the Common Language Specification they can be used by any.NET language. The class library is structured into namespaces, and deployed in shared libraries known as assemblies. Speaking of the.NET framework is primarily referring to this class library.

Namespaces and assemblies

Namespaces are a mechanism for logically grouping similar classes into a hierarchical structure. This prevents naming conflicts. The structure is implemented using dot-separated words, where the most common top-level namespace is System, such as System.IO and System.Net. There are other top-level namespaces as well, such as Accessibility and Windows. A user can define a namespace by placing elements inside a namespace block.
Assemblies are the physical packaging of the class libraries. These are.dll files, just like Win32 shared libraries. Examples of assemblies are mscorlib.dll, System.dll, System.Data.dll and Accessibility.dll. Namespaces are often distributed among several assemblies and one assembly can be composed of several files.

Common Language Infrastructure and Common Language Specification

The Common Language Infrastructure as implemented by the Common Language Runtime, is implemented by the Mono executable. The runtime compiles and executes.NET applications. The common language infrastructure is defined by the ECMA standard. To run an application, you must invoke the runtime with the relevant parameters.
The Common Language Specification is specified in chapter 6 of ECMA-335 and defines the interface to the CLI, such as conventions like the underlying types for Enum. The Mono compiler generates an image that conforms to the CLS. This is the Common Intermediate Language. The Mono runtime takes this image and runs it. The ECMA standard formally defines a library that conforms to the CLS as a framework.

Managed and unmanaged code

Within a native.NET/Mono application, all code is managed; that is, it is governed by the CLI's style of memory management and thread safety. Other.NET or Mono applications can use legacy code, which is referred to as unmanaged, by using the System.Runtime.InteropServices libraries to create C# bindings. Many libraries which ship with Mono use this feature of the CLI, such as Gtk#.

Mono-specific innovations

Mono has innovated in some areas with new extensions to the core C# and CLI specifications:
In addition, Mono is available on a variety of operating systems and architectures.

System requirements

Windows 7, Windows 8, Windows 8.1, Windows 10, macOS or Linux

Related projects

Several projects extend Mono and allow developers to use it in their development environment. These projects include:
Cross-platform:
macOS:
Mobile platforms:
Windows:
has a version of.NET 2.0 now available only for Windows XP, called the Shared Source CLI. Microsoft's shared source license may be insufficient for the needs of the community.
Free Software Foundation's decommissioned Portable.NET project.

MonoDevelop

MonoDevelop is a free GNOME integrated development environment primarily designed for C# and other.NET languages such as Nemerle, Boo, and Java, although it also supports languages such as C, C++, Python, and Vala. MonoDevelop was originally a port of SharpDevelop to Gtk#, but it has since evolved to meet the needs of Mono developers. The IDE includes class management, built-in help, code completion, Stetic, project support, and an integrated debugger.
The MonoDoc browser provides access to API documentation and code samples. The documentation browser uses wiki-style content management, allowing developers to edit and improve the documentation.

Xamarin.iOS and Xamarin.Android

Xamarin.iOS and Xamarin.Android, both developed by Xamarin, are implementations of Mono for iPhone and Android-based smartphones. Previously available only for commercial licensing, after Microsoft's acquisition of Xamarin in 2016, the Mono runtime itself was relicensed under MIT license and both Xamarin.iOS and Xamarin.Android are being made free and open-source.

Xamarin.iOS

Xamarin.iOS is a proprietary library that allows developers to create C# and.NET based applications that run on the iPhone, iPod and iPad devices. It is based on the Mono framework and developed in conjunction with Novell. Unlike Mono applications, Xamarin.iOS "Apps" are compiled down to machine code targeted specifically at the Apple iPhone and iPad. This is necessary because the iOS kernel prevents just-in-time compilers from executing on the device.
The Xamarin.iOS stack is made up of:
Xamarin Studio is used as the primary IDE, however additional links to Xcode and the iOS simulator have been written.
From April to early September 2010, the future of MonoTouch was put in doubt as Apple introduced new terms for iPhone developers that apparently prohibits them from developing in languages other than C, C++ and Objective-C, and the use of a middle layer between the iOS platform and iPhone applications. This made the future of MonoTouch, and other technologies such as Unity, uncertain. Then, in September 2010, Apple rescinded this restriction, stating that they were relaxing the language restrictions that they had put in place earlier that year.

Xamarin.Android

Xamarin.Android, initially developed by Novell and continued by Xamarin, is a proprietary implementation of Mono for Android-based smart-phones. It was first released on April 6, 2011. Mono for Android was developed to allow developers to more easily write cross-platform applications that will run on all mobile platforms. In an interview with H-Online, Miguel de Icaza stated, "Our vision is to allow developers to reuse their engine and business logic code across all mobile platforms and swapping out the user interface code for a platform-specific API."
In August 2010, a Microsoft spokesman, Tom Hanrahan of Microsoft's Open Source Technology Centre, stated, in reference to the lawsuit filed by Oracle against Google over Android's use of Java, that "The type of action Oracle is taking against Google over Java is not going to happen. If a.NET port to Android was through Mono it would fall under the Microsoft Community Promise Agreement."
The Xamarin.Android stack consists of the following components:
Mono is dual licensed by Xamarin, similar to other products such as Qt and the Mozilla Application Suite. Mono's C# compiler and tools are released under the GNU General Public License , the runtime libraries under the GNU Lesser General Public License and the class libraries under the MIT License. These are all free software and open-source licenses and hence Mono is free and open-source software.
The license of the C# compiler was changed from the GPL to the MIT X11 license to allow the compiler code to be reused in a few instances where the GPL would have prevented such:
On March 18, 2016, Microsoft's acquisition of Xamarin was officially closed.
On March 31, 2016, Microsoft announced at Microsoft Build that they'll completely re-license Mono under the MIT License even in scenarios where previously a commercial license was necessary, and Microsoft stated that they won't assert any "applicable patents" against parties that are "using, selling, offering for sale, importing, or distributing Mono." It was also announced that Xamarin had contributed the Mono Project to the.NET Foundation.

Mono and Microsoft's patents

Mono's implementation of those components of the.NET stack not submitted to the ECMA for standardization has been the source of patent violation concerns for much of the life of the project. In particular, discussion has taken place about whether Microsoft could destroy the Mono project through patent suits. This discussion is now moot after Microsoft acquired Xamarin, the primary maintainers of Mono. In June 2009 the Ubuntu Technical Board stated that it saw "no reason to exclude Mono or applications based upon it from the archive, or from the default installation set."
The base technologies submitted to the ECMA, and therefore also the Unix/GNOME-specific parts, are claimed to be safe due to Microsoft's explicitly placing both ECMA 334 and ECMA 335 standards under the Microsoft Community Promise. The concerns primarily relate to technologies developed by Microsoft on top of the.NET Framework, such as ASP.NET, ADO.NET and Windows Forms, i.e. parts composing Mono's Windows compatibility stack. These technologies are today not fully implemented in Mono and not required for developing Mono-applications, they are simply there for developers and users who need full compatibility with the Windows system.
Should patent issues ever arise, the Mono project's stated strategy for dealing with them is as follows:
Mono is also included in the list of software that the Open Invention Network has sworn to protect.
On July 6, 2009, Microsoft announced that it was placing their ECMA 334 and ECMA 335 specifications under their Community Promise pledging that they would not assert their patents against anyone implementing, distributing, or using alternative implementations of.NET. However, their position regarding the non-ECMA components like ASP.NET, ADO.NET, and Windows Forms remains unclarified.
The Free Software Foundation's Richard Stallman has stated in that "we should discourage people from writing programs in C#. Therefore, we should not include C# implementations in the default installation of GNU/Linux distributions or in their principal ways of installing GNOME". In, Brett Smith stated that "Microsoft's patents are much more dangerous: it's the only major software company that has declared itself the enemy of GNU/Linux and stated its intention to attack our community with patents.", "C# represents a unique threat to us" and "The Community Promise does nothing to change any of this".
Fedora Project Leader Paul Frields has stated, "We do have some serious concerns about Mono and we'll continue to look at it with our legal counsel to see what if any steps are needed on our part", yet "We haven't come to a legal conclusion that is pat enough for us to make the decision to take mono out".
In November 2011 at an Ubuntu Developer Summit, developers voted to have the Mono-based Banshee media player removed from Ubuntu's default installation beginning on Ubuntu 12.04; although reported reasonings included performance issues on ARM architecture, blocking issues on its GTK+ 3 version, and it being, in their opinion, "not well maintained", speculation also surfaced that the decision was also influenced by a desire to remove Mono from the base distribution, as the remaining programs dependent on Mono, gbrainy and Tomboy, were also to be removed. Mono developer Joseph Michael Shields defended the performance of Banshee on ARM, and also the claims that Banshee was not well-maintained as being a "directed personal insult" to one of its major contributors.
On March 31, 2016, Microsoft announced at Microsoft Build that they will completely re-license Mono under the MIT license. Microsoft issued the Patent Promise for Mono stating that they won't assert any "applicable patents" against parties that are "using, selling, offering for sale, importing, or distributing Mono". It was also announced that Xamarin had contributed the Mono Project to the.NET Foundation.
significant parts of Microsoft's own code for the.NET platform has been released under FOSS licenses, including the.NET Compiler Platform, ASP.NET,.NET Core, the.NET Micro Framework, WinForms, WPF, and WinUI.

Software developed with Mono

Many programs covering a range of applications have been developed using the Mono application programming interface and C#. Some programs written for the Linux Desktop include Banshee, Beagle, F-Spot, Gbrainy, Docky/GNOME Do, MonoTorrent, Pinta, and Tomboy. The program, Logos 5 Bible Study Software, was written for the MacOS.
A number of video games, such as The Sims 3 and Second Life, OpenSimulator virtual world server, or games built with the Unity or MonoGame game engines, also make use of Mono.

Citations