Welcome!

Linux Containers Authors: Elizabeth White, Carmen Gonzalez, Yeshim Deniz, Sematext Blog, Liz McMillan

Related Topics: Linux Containers

Linux Containers: Article

Bringing the CLI to Open Source

Ximian's Mono Project means you have a choice

Those who like .NET may find themselves lamenting, "I still have to deploy applications on the Windows operating system. I am still locked to one vendor - Microsoft." If this sounds like you, Ximian's Mono project might be the answer. The Mono project was started in July 2001 by Miguel de Icaza, cofounder of Ximian, with the aim of bringing the Common Language Infrastructure platform to free systems.

Mono is an open source implementation of the Microsoft .NET Framework. It has a compiler for C#, an ECMA-compatible runtime engine for the Common Language Infrastructure, and class libraries. Mono implements various technologies developed by Microsoft that have now been submitted to the ECMA for standardization. The Mono project enables building and deploying cross-platform .NET applications. For example, a solution created using C# can be executed in Windows 2000 and also in Linux, Windows, Solaris, FreeBSD, HP-UX, and Mac OS X using Mono.

Architecture
Mono's core components are shown in Figure 1.

 
  • C#, logo, and basic compiler: These compilers generate code in a Common Intermediate Language (CIL), which is an intermediate representation of a compiled program and is easy to compile to native code using just-in-time (JIT) engines. Compiled code can be arranged in assemblies, which are a fundamental unit of deployment. The C# compiler is written in C# and is highly portable.
  • Class libraries: Mono includes a set of class libraries that can work with any language that works on Common Language Runtime. Core class libraries include collections, XML and Schema, database access, and file system access. These libraries use GNOME infrastructure components (GUI toolkit, XML libraries, CORBA implementation, printing architecture, and imaging system). The class library is structured into namespaces and deployed in assemblies. The top-level namespace for most of the .NET Framework is System.
  • Virtual machine: A virtual machine for the common intermediate language (CIL) byte codes is also included. It also has a JIT compiler for x86 CPUs. The Mono runtime provides CIL image loading, verification, and execution along with garbage collection, thread and I/O support, interaction with existing libraries (P/Invoke), and a security system.
Development
The good news about Mono is that you can choose from a variety of IDEs. You can use an open source IDE like Eclipse or #developer, a free IDE for C# and VB.NET projects on Microsoft's .NET platform. Eclipse is a very important project for future application development in this framework; it already has a basic C# plug-in that implements auto-indenting and syntax highlighting for this language. In addition, Eclipse can use the Gtk2 toolkit on GNU/Linux. This is great for GNOME users because it adapts better to the environment.

You can also use Visual Studio .NET, which provides great features for developing applications in C#. Programs written using Visual Studio .NET can be compiled and executed using Mono.

Other tools available to help in developing with Mono are NUnit, NAnt, NGen, and the Mono debugger. NUnit is a unit-testing framework for all .NET languages. Initially ported from JUnit, the current version, 2.1, is the second major release of xUnit-based unit testing tools for Microsoft .NET. It is written entirely in C# and has been completely redesigned to take advantage of many .NET language features. NAnt is a free .NET build tool that's very much like Ant. NGen is under development and will create native images from a managed assembly. The Mono debugger's purpose is to help developers in debugging Mono applications.

Documentation of these tools is available in MonoDoc, a documentation browser.

Advanced Features

  • ASP.NET: Mono, together with Apache, brings ASP.NET to Linux . This has opened the market for creating ASP.NET controls for Linux developers as well. ASP.NET can currently be deployed using either XSP Web server or Apache Web server with mod_mono. Finally, Mono makes writing dynamic Web pages using C++ or Logo possible.
  • Web services: Mono implements the same set of classes that have been authored in the .NET Framework. Mono provides many tools that can expedite the development of Web services, such as "wsdl" to create a local class from a WSDL file, and an XML Schema definition tool to convert XSD to XDR, XML to XSD, XSD to dataset, XSD to classes, and classes to XSD.
  • ADO.NET: ADO.NET data providers like IBM DB2, Oracle, Microsoft SQL Server, Sybase, MySQL, ODBC, and OLEDB are available in Mono, but many other data providers are available through various open source projects. SAP DB, Informix, and FoxPro are some of the databases that are supported only via ODBC and OLEDB. Main tools for ADO.NET include SQL# command-line query and SQL# for Gtk#. SQL# is a command-line tool to test connection strings, execute SQL statements, and save output in a text, HTML, or XML file. SQL# for Gtk# is a graphical database query tool with a toolbar and menu for various tasks.
  • Windows forms: System.Windows is Microsoft's GUI toolkit shipped with the .NET Framework. Mono implements the Win32 API using wineLIB.
  • Security: Mono implements many assemblies that implement .NET Framework cryptography. Mono makes X.509 certificates, XML digital signatures, cryptographic algorithms, and code signing available in 100% managed code.
  • Mono for GNOME applications: GNOME is a popular multiplatform free desktop environment. Mono provides Gtk#, which can be used by C# to create GNOME applications.
Advantages
Mono provides language and platform independence. It supports GNOME, KDE, and Windows desktop environments. It allows writing applications in many languages, so existing modules written in many languages can be used to create new applications with less effort using contract/interface-based programming. Currently Java is not supported. It will be interesting to see if the Mono project supports Java in the future, which will allow using C# components in Java and vice versa. The Mono runtime supports XPCOM on Unix systems and COM on Windows. The embedded Mono runtime in applications makes it possible to call C functions from CIL and CIL functions from C code. Mono has rich libraries for cryptography, HTTP, networking, directory services, and others. Garbage collection and SOAP support are faster than Java, and SandBox provides better security. Because of all these features, Mono can play a major role in helping Linux succeed as a desktop operating system.

Mono supports ahead-of-time compilation to convert developers' code to native code, which is done in Microsoft with ngen.exe tool.

The Mono project integrates with open source projects like Apache and makes open source development easier. The Mono C# compiler is released under the terms of the GNU GPL; the runtime libraries are under the GNU Library GPL; and the class libraries are released under the terms of the MIT X11 license. This permits creating proprietary applications using Mono.

The Mono project community is also growing, which ensures quick bug fixes. Ximian support for the Mono project is expected to continue in the future.

Interoperability
Writing interoperable applications between Microsoft .NET and Mono will remain challenging because ASP.NET, ADO.NET, Windows.Forms, and many other higher-level blocks are not part of ECMA standard. Many .NET class libraries have not been implemented completely in Mono. This means that it is very likely that when Mono is released, applications written for .NET may not be portable to Mono.

Microsoft's .NET strategy includes many other efforts such as Windows applications; Passport-centralized, single sign-on systems, and others. These efforts are not part of the Mono project.

To make applications more interoperable:

  • Avoid use of Microsoft.* packages
  • Avoid absolute paths
  • Use 100% .NET assemblies
  • Use Gtk# rather than System.Windows.Forms
  • Do not use the Microsoft registry
Mono brings Microsoft and open source projects closer. Mono is new, and its success will depend on many other open source initiatives, including the Eclipse plug-in to compile the C# code using the Mono C# compiler, C# code generator (XSP) for ASP.NET, and so on. In the future, it will be interesting to see if C# developers will be able to use the Java API (Struts, log4J, etc.) to create an application and deploy it in J2EE application servers.

More Stories By Deepak Mittal

Deepak Mittal is a technology evangelist. His expertise is in automating business processes using workflow engines, Web services, e-form, data integration, business object modeling, and rule engines.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


IoT & Smart Cities Stories
Darktrace is the world's leading AI company for cyber security. Created by mathematicians from the University of Cambridge, Darktrace's Enterprise Immune System is the first non-consumer application of machine learning to work at scale, across all network types, from physical, virtualized, and cloud, through to IoT and industrial control systems. Installed as a self-configuring cyber defense platform, Darktrace continuously learns what is ‘normal' for all devices and users, updating its understa...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
Apptio fuels digital business transformation. Technology leaders use Apptio's machine learning to analyze and plan their technology spend so they can invest in products that increase the speed of business and deliver innovation. With Apptio, they translate raw costs, utilization, and billing data into business-centric views that help their organization optimize spending, plan strategically, and drive digital strategy that funds growth of the business. Technology leaders can gather instant recomm...
OpsRamp is an enterprise IT operation platform provided by US-based OpsRamp, Inc. It provides SaaS services through support for increasingly complex cloud and hybrid computing environments from system operation to service management. The OpsRamp platform is a SaaS-based, multi-tenant solution that enables enterprise IT organizations and cloud service providers like JBS the flexibility and control they need to manage and monitor today's hybrid, multi-cloud infrastructure, applications, and wor...
The Master of Science in Artificial Intelligence (MSAI) provides a comprehensive framework of theory and practice in the emerging field of AI. The program delivers the foundational knowledge needed to explore both key contextual areas and complex technical applications of AI systems. Curriculum incorporates elements of data science, robotics, and machine learning-enabling you to pursue a holistic and interdisciplinary course of study while preparing for a position in AI research, operations, ...
After years of investments and acquisitions, CloudBlue was created with the goal of building the world's only hyperscale digital platform with an increasingly infinite ecosystem and proven go-to-market services. The result? An unmatched platform that helps customers streamline cloud operations, save time and money, and revolutionize their businesses overnight. Today, the platform operates in more than 45 countries and powers more than 200 of the world's largest cloud marketplaces, managing mo...
Codete accelerates their clients growth through technological expertise and experience. Codite team works with organizations to meet the challenges that digitalization presents. Their clients include digital start-ups as well as established enterprises in the IT industry. To stay competitive in a highly innovative IT industry, strong R&D departments and bold spin-off initiatives is a must. Codete Data Science and Software Architects teams help corporate clients to stay up to date with the mod...
In his session at 21st Cloud Expo, Raju Shreewastava, founder of Big Data Trunk, provided a fun and simple way to introduce Machine Leaning to anyone and everyone. He solved a machine learning problem and demonstrated an easy way to be able to do machine learning without even coding. Raju Shreewastava is the founder of Big Data Trunk (www.BigDataTrunk.com), a Big Data Training and consulting firm with offices in the United States. He previously led the data warehouse/business intelligence and Bi...
The Japan External Trade Organization (JETRO) is a non-profit organization that provides business support services to companies expanding to Japan. With the support of JETRO's dedicated staff, clients can incorporate their business; receive visa, immigration, and HR support; find dedicated office space; identify local government subsidies; get tailored market studies; and more.
With the introduction of IoT and Smart Living in every aspect of our lives, one question has become relevant: What are the security implications? To answer this, first we have to look and explore the security models of the technologies that IoT is founded upon. In his session at @ThingsExpo, Nevi Kaja, a Research Engineer at Ford Motor Company, discussed some of the security challenges of the IoT infrastructure and related how these aspects impact Smart Living. The material was delivered interac...