DRAFT DRAFT DRAFT
DRAFT DRAFT DRAFT
DRAFT DRAFT DRAFT
DRAFT DRAFT DRAFT
DRAFT DRAFT DRAFT
DRAFT DRAFT DRAFT
Mono 2.12 is a portable and open source implementation of the .NET framework for Unix, Windows, MacOS and other operating systems.
Mono 2.12 is an update to Mono 2.10 based on the master branch of github, it is not a minor upgrade to 2.10. Mono 2.12 is scheduled to be released in XXXX
Table of contents |
Important Information About Mono 2.12
Mono's Long Term Supported release continues to be Mono 2.10, the next long-term support release will be Mono 3.0.
Mono 2.12 ships the latest and greatest and updates and they have not received as much testing as they should. Users seeking absolute stability should stay on Mono 2.10.
Major Highlights
C# 5.0 support - the complete asynchronous support is now part of Mono
Portable Class Libraries
Updated Unicode tables, fixes long-standing 480178
System.Json is now available for everyone, even if originally limited to Silverlight
System.Threading.Tasks.Dataflow (aka TPL Dataflow) preview is now available
Alexander Chebaturkin has implemented initial version of static Code Contract analyser as part of SoC 2011.
Introducing the 4.5 preview API, a strict superset of the 4.0 API designed to better support asynchronous programming.
MacOS X 64 bit support:
- Runtime supports it
- But most libraries that people use with Mono are not 64 bit safe
- MonoMac, Gtk# nor Windows.Forms are 64 bit clean
4.5 Profile
The 4.5 Profile is a strict superset of the 4.0 API and is enable by default.
Although .NET 4.5 has not yet been officially released, the compiler now defaults to the 4.5 API, if you want to use different profile API you must use the -sdk:XXX switch to the command line compiler.
Because 4.5 API is a strict superset of 4.0 API they both share the same assembly version number, so we actually install the 4.5 library into the GAC.
Some of the changes in the 4.5 API family include:
- New Async methods
- WinRT compatibility API
- Newly introduced assemblies (System.Net.Http, System.Threading.Tasks.Dataflow)
Changes Since Mono 2.10
SGen now has a new task management system that allows it to easily scale new GC-related tasks across multiple CPUs if available:
- SGen on SMP systems is able to distribute more work across the worker threads. Previously only the mark phase was distributed.
- SGen is now able to perform parallel collection in the nursery.
- Sgen has been ported to Win32
- SGen has been ported to the MIPS platform
Implemented fast version of ThreadLocal<T>.
Major change in Mono to support the full table of Unicode surrogate characters. This code was written by Damien Diederen and David Mitchell from Logos software.
ASP.NET new error page
Mono.C5 library has been updated to C5 1.1
Default compiler is now based on IKVM.Reflection (include table of updates)
Runtime supports deferred attaching to the process (when using suspend=n,server=y the runtime collects metadata until a debugger is attached).
SGen now uses Mach APIs directly to speedup some tasks in the garbage collector.
Implement tail call optimizations on PowerPC for F# (Bug #664631)
DriveInfo now returns correct information on OSX.
New profiler that can be used with Intel's VTune Amplifier Profiler.
Asynchronous socket support on MacOS X and BSD now uses kqueue which increases performance.
Support for System.Net.NetworkInformation.NetworkChanged events on Linux.
New tool: crlupdate this is the Mono Certficate Revocation List Downloader and Updater and can be used to download of new, or update of existing, Certficate Revocation List (CRL) associated with the certificates present in the user (default) or machine stores. The CRL present in the stores are used to determine the validity of unexpired, trusted X.509 certificates.
New System.Net.Http stack from .NET 4.5
C# Compiler
There are two large updates to our C# compiler: it is now a C# 5.0 compiler with complete async support and we have also rebuilt the internals to support two code backends.
C# Async Support
Our C# compiler now has a complete implementation of the async extension to the language which allows developers to more easily create asynchronous applications.
The C# compiler now supports the async modifier and the await keyword by default.
The preview of 4.5 APIs that are part of the .NET 4.5 Developer Preview and are required to support async has been implemented.
C# Backend Rewrite
Our C# compiler has now completed its migration from using System.Reflection.Emit as its code generation backend to use the IKVM.Reflection API. This functionality was previewed in Mono 2.10 and is now the default. With this functionality, developers can use any mscorlib that they want (for example the MicroFramework one, or a custom one) without having to build a custom compiler. We were able to eliminate the multiple executables for the compiler, and unify all the compilers into one as well as reducing our build times significantly.
gmcs, dmcs and smcs are now merely aliases to call the mcs compiler with the proper -sdk flag.
| Tool/Library | Purpose | Profile | New Backend | 2.10 Backend | gmcs | C# Compiler | 2.0 | IKVM.Reflection | System.Reflection 2.0 | dmcs | C# compiler | 4.0 | IVKM.Reflection | System.Reflection 4.0 | smcs | C# Compiler | 2.1 (Silverlight, MonoTouch, MonoDroid) | IKVM.Reflection | System.Reflection 2.0 | mcs | C# Compiler | Any profile, any mscorlib | IKVM.Reflection | IKVM.Reflection | csharp | Interactive C# Shell/REPL | 4.5 | System.Reflection 4.5 | System.Reflection 4.0 | Mono.CSharp | C# Compiler as a Service | 2.0, 2.1 and 4.0. | System.Reflection 4.0 | System.Reflection |
System.Reflection is still used as a backend for the compiler as a service and the C# interactive shell.
TypedReference
The compiler now supports the TypedReference support: __refvalue, __reftype and __makeref.
C# Compiler as a Service
Evaluation can now Compile Types
The Evaluator.Eval () API is no longer limited to expressions and statements, you can now pass entire namespace, class, interface, struct definitions as a string and have the result get compiled.
This extends to the csharp command:
csharp> class X { public int a; } csharp> var t = new X () { a = 1 }; csharp> print (t.a); 1 csharp>
Instance API
The compiler as a service exposed by the Mono.CSharp library is no longer limited to be a global compiler, now you can instantiate multiple scopes for the compiler, each having its own set of localized types and global variables.
For example, the following sample assigns a string in one context and an int in another one:
using System; using Mono.CSharp; class MyWorld { public Evaluator Evaluator; public MyWorld (string [] args) { var r = new Report (new ConsoleReportPrinter ()); var cmd = new CommandLineParser (r); var settings = cmd.ParseArguments (args); if (settings == null || r.Errors > 0) Environment.Exit (1); Evaluator = new Evaluator (settings, r); } } class X { static int Main (string [] args) { var first = new MyWorld (args); var second = new MyWorld (args); first.Evaluator.Run ("var Demo = \"hello, world\";"); second.Evaluator.Run ("var Demo = 1;"); first.Evaluator.Run ("print (Demo);"); second.Evaluator.Run ("print (Demo);"); return 0; } }
C# Interactive Shell
New convenience function print, can be used instead of Console.WriteLine
Additionally, the C# interactive shell will by default use a terse syntax that does not require a semicolon at the end of an expression, for example:
csharp> 1 + 2 3 csharp>
Fast ThreadLocal<T>
The JIT now has knowledge about the ThreadLocal<T> data type and will automatically turn that into an accelerated version of it. Boosting the performance of any uses of ThreadLocal<T> (new with Parallel Frameworks)
GDB
- GDB support has been extended with a new gdb hook that is aware of the SGenGC internals.
- Added pretty printers for more runtime data structures like MonoVTable to the mono gdb mode.
MIPS port
The MIPS port is now complete, it can do a full bootstrap, and run the runtime/corlib test suites.
Soft Debugger
- Single stepping is now implemented using breakpoints in most cases, speeding it up considerably.
- Calls to System.Diagnostics.Debugger:Log()/Break () are now routed to the debugger using new UserLog/UserBreak event types.
- S390x is now supported (Neale Ferguson).
- MIPS is now supported.
- Added new methods to Mono.Debugger.Soft and the runtime to decrease the amount of packets transmitted between the debugger and the debuggee. This significantly improves performance over high latency connections like USB.
- Many bug fixes.
AOT
- Made changes to some AOT data structures to reduce their size, especially when using generics. This reduces the size of an mscorlib AOT image by about 1-2%.
SGEN
- Precise stack scanning has been improved considerably, and it is now supported on x86/ARM.
API Extensions
Mono.Data.Sqlite
It is now possible to configure the threading model for SQLite using the SetConfig method in the SQLiteConnection class.
Installing Mono 2.12
Binary Packages and Source Code Downloads:
Source code and pre-compiled packages for Linux, Solaris, MacOS X and Windows is available from our web site from the Downloads section.
Quick source code installation:
If we have no packages for your platform, installing from source code is very simple.
Compile libgdiplus to support System.Drawing:
$ tar xzf libgdiplus-2.12.tar.gz $ cd libgdiplus-2.12 $ ./configure $ make $ make install
Then compile Mono itself:
$ tar xzf mono-2.12.tar.gz $ cd mono-2.12 $ ./configure $ make $ make install
Bug Fixes
- mdoc update has been fixed so that -fno-assembly-versions and --delete interact properly, and delete XML types and members which do not exist in the target assembly. This allows copying e.g. corlib/Documentation/en, processing en against the Silverlight-profile mscorlib.dll, and removing all types and members which don't exist in the Silverlight profile.