A new release of the Mono runtime and SDK is available for UNIX and Windows. Mono 0.24 represents a significant advance in many areas of the Mono platform, including:
- New code generation engine: The new code generation engine is the core of the Mono JIT, and now also features a code pre-compiler.
- Runtime: Mono now provides the GC system with object maps, providing better collection and improving applications speed. Also debugging information works across application domains.
- ASP.NET: WebForms parser has been rewritten.
- Remoting: Plenty of updates to the remoting infrastructure.
- C# compiler: Various speed improvements, plus support for C# 2.0 iterators.
- XML: XML deserialization, RELAX NG validating XmlReader, improved XmlNodeReader, XmlTextReader non-UTF8 stream support by default, plus a primitive DTD parser.
- Windows.Forms: Lots of updates, and System.Drawing progress.
- Globalization: Data files for supporting the various cultures are in, Chinese encoding support.
- New tools: Binding generator for C programs, security tools, mono-xsd.
- Ongoing development: ILASM, JScript, Soap, XmlSerialization.
- Mono Basic: Many improvements.
- Security: Uses new BigInteger, many new classes.
- 152 bugs closed, 3397 individual CVS commits.
Binaries for various platforms is available from our web site from the download section:
Source code for Mono, MCS, and XSP is also available from our web site
- MCS package (Class Libraries, C# and VB.NET compiler and managed tools): http://www.go-mono.com/archive/mcs-0.24.tar.gz
- Mono package (Runtime engine, JIT compiler, pre-compiled compiler and class libraries ): http://www.go-mono.com/archive/mono-0.24.tar.gz
- XSP package (XSP test web server for ASP.NET webforms): http://www.go-mono.com/archive/xsp-0.4.tar.gz
- iPAQ packages are available from: mono::handhelds
We are also shipping Gtk# 0.9 packages and MonoDoc 0.4 packages for Red Hat 9.0 and Red Hat 8.0.
This release of Mono is brought to you by (in reverse order):
Zoltan Varga, Vlad Kaluzhny, Ville Palo, Tim Haynes, Tim Coleman, Sergey Chaban, Sebastien Pouliot, Rodrigo Moya, Reggie Burnett, Ravi Pratap, Rafael Teixeira, Piers Haken, Petr Danecek, Per Arneng, Pedro Martinez, Patrik Torstensson, Paolo Molaro, Nick Drochak, Mike Kestner, Miguel de Icaza, Martin Willemoes Hansen, Martin Baulig, Mark Crichton, Marco Ridoni, Malte Hildingson, Lluis Sanchez, Lee Mallabone, Juli Mallett, Jonathan Pryor, Johannes Roith, Joel Basson, Jean-Marc Andre, Jaime Anguiano, Jackson Harper, Hector E. Gomez Morales, Gonzalo Paniagua, Gaurav Vaish, Eduardo Garcia, Duncan Mak, Dietmar Maurer, Dick Porter, Dennis Hayes, Daniel Morgan, Daniel Lopez, Christopher Bockner, Charles Iliya Krempeaux, Cesar Octavio Lopez Nataren, Carlos Alberto Cortes, Ben Maurer, Atsushi Enomoto, Alp Toker, Alexandre Pigolkine, Aleksey Ryabchuk, Aleksey Demakov, Alejandro Sanchez, and Alan Tam.
Zoltan changed the way objects are allocated: heap objects are allocated with GC descriptors which describe which fields are holding object references and which do not. This speeds up collections and decreases memory usage since fewer objects are mistakenly retained.
The synchronized attribute is now supported.
Gonzalo rewrote most of our ASP.NET WebForms parser.
The ASP.NET code generator uses CodeDom now so, ideally, once we have mbas working and someone implements an ICodeCompiler and a CodeDomProvider for VB.NET we will support VB.NET in aspx pages.
ControlBuilders are supported now. When a ControlBuilderAttribute is applied to a control it can modify the parsing behaviour beyond the posibilities offered by ParseChildrenAttribute (enable/disable white space literals, modify children as they are added, including changing their Type and more). This is required to run some of the sample applications released at http://www.asp.net.
Some improvements in error pages for parsing and compilation. We even mark with red color generated source lines (MS doesn't :).
Added support for including files. This can save some typing when headers, footers or whatever are reused in more than one page/control.
Many bugs have been fixed, and various speed improvements added. Zoltan added a change to reduce memory consumption, which reduced the compilation times. A cache that was underutilized has been fully activated, and the total speedup is 40%. Now MCS bootstraps itself in 6.3 seconds on a 1.8GHz Mobile P4.
Iterators in classes are supported now. This is a feature from the upcoming C# 2.0 release, it has not been wildly tested. To use iterators, pass the -v2 flag to the compiler. Notice that code that uses iterators will not compile with the current Microsoft compiler.
Iterators were prototyped for C# by Todd Proebsting, and they vastly simplify the implementation of enumerators in classes. Instead of being a tedious task, the results is that you can not wait to add enumerable support to the simplest of your classes.
A few samples are included in mcs/tests/2*.cs, but you can also read the article at MSDN: C# Programming Language Future Features.
Lluis continues to improve the Remoting infrastructure:
Implemented support for Contexts and ContextBoundObjects, including all context message sinks.
Support for interfaces and abstract classes in proxies.
The TCP channel and the binary formatter are now compatible with MS.NET.
OneWay methods are now working.
The first implementation of XML deserialization has been done. It's not complete but XmlSerializer has now become somewhat symmetric.
Mono now ships Atsushi's RELAX NG validating XmlReader for XML (namespace: Commons.Xml.Relaxng). This is also the first XML validation engine for Mono.
Dogfooding-wise: We are using a Relax-NG schema and a simple program to validate our documentation now.
XmlTextReader has many improvements. XmlTextReader now can parse a supplied inline or external DTD (only infiles for now). It is also capable of auto encoding detection for its input.
XmlNodeReader has also improved to be compatible with XmlTextReader.
Alan added support for passing arguments to XSLT transformations
So far, Windows.Forms development has continued by using a special version of the runtime that is linked to Wine. This is about to change. Vlad from OpenLink has modified Wine to be used as a library, and this new version of Wine has no interaction problems with the Mono GC and works without making changes to the Mono runtime. So the same runtime can be used to run any kind of applications.
Alexandre and Aleksey have been very busy at work with Windows.Forms, and have done a lot of progress here.
Improvements to Control/Form architecture: Layout management, MDI implementation, menu merging, modal forms, user paint.
Implementation added to controls: Button, ComboBox, CheckedListBox, DomainUpDown, Form, GroupBox, NumericUpDown, Label, ListBox, Panel, ProgressBar, RadioButton, StatusBar, StatusBarPanel, TabControl, TabPage, TextBox, TrackBar and ToolTip.
Alan added support for two Chinese encodings: Big5 and GB2312.
Duncan has been working on getting our CultureInfo completed. Currently we have checked in stubs for various XML files that describe the various characteristics of the CultureInfo. Currently they all contain the information for English, so we will need people to help provide translations and localization to these files.
New Code Generation Engine
This release contains the new code generation engine that Dietmar and Paolo have been working on for the past seven months. This new code generator can be used both as a just-in-time compiler or a CIL pre-compiler.
The new engine had a number of goals:
- Simplify porting the JIT engine.
- Provide a solid framework for implementing advanced optimizations in the JIT engine.
- Support ahead-of-time compilation (precompilation).
The new code generator replaces `mono' as our JIT engine. The old JIT engine is still distributed as `oldmono', but will be phased out.
In JIT mode, you have to run it like this:
In pre-compiler mode you first need to pre-compile your assembly. You do that by passing the --aot flag:
mono --aot program.exe mono --aot mylibrary.dll
That will generate program.exe.so and mylibrary.dll.so respectively. These contain the precompiled code. Then to execute your precompiled binary, invoke the compiler like this:
The runtime will automatically pick up the precompiled binaries as long as they are in the same directory as the original assembly.
We are very happy with the new framework, because it is very modular, and it allows us to cleanly replace in the future components of it, if we choose to, or revamp components of it. The new code generator has also an SSA representation that is the foundation for plenty of optimizations today and in the future.
The following optimizations are implemented:
Branch optimizations, conditional moves, constant folding, constant propagation, copy propagation, dead code elimination, emit per-domain code, fast x86 FP compares, inline method calls, instruction scheduling, intrinsic method implementations, linear scan global reg allocation, loop related optimizations, peephole postpass, tail recursion and tail calls
A whitepaper on the internals of the new compilation engine is available on mono/mini/mini-doc.txt, if you are interested in understanding the new engine, this document is a good starting point.
The job of doing a good JIT requires a tradeoff between compilation speed and code generation quality. Some are computing-time expensive and some are cheap. In JIT mode, we only turn on a few optimizations, but you might want to turn them all on when doing pre-compilations (-O=all, see the mono man page for details).
The new JIT engine is closer to the spec so plenty of checks and tests that were not implemented before, are implemented now.
We can now focus on tuning the performance of the JIT engine
cilc: Alp Toker has provided us with cilc, a tool that can generate C bindings to any assembly. This tool is useful if you want to reuse managed code from your C application. This is typically used by those who embed the Mono runtime into their existing C code.
This is of particular interest to Gnome developers, as they can now easily import new widgets written in C# into their applications.
monoxsd: Duncan has started work on our XSD replacement. Currently its limited to generating an XML schema out of an assembly.
Security tools: Sebastien has added a few tools to use the cryptographic support libraries in Mono, like the certificate creation tool.
Jackson continues work on our IL assembler. The IL assembler has most of the high-level features now, and 50% of the instruction set is handled. The next release should have a complete version.
Cesar continues work on our JScript compiler. All of the public class contracts in the Microsoft.JScript namespace are there, and the parser is mostly done. Work is underway to emit dynamic assemblies.
Work has begun on making the SOAP client support in Mono functional. To this end, we are starting to re-architect the XmlSerialization infrastructure, which had not been maintained for a while. We will be devoting significant effort in getting the Web services client functional now.
Marco Ridoni has been making a lot of progress in Mono Basic. Also Rafael has added preprocessor support to it. Here is a full list of new features: Compound operators added
- Member access now work correctly
- A lot of array fixes/improvements
- LateIndexGet/Set calls are generated correctly
- Overloading in constructors fixed
- Array access when the array is a parameter fixed
- Invocation resolution improved* Added readonly modifier for properties
Sebastien has continued improving the security classes. Not only we have convinced him to use Linux, but he has also wrote his first two .NET GUI applications: one SWT, one Gtk#.
The RSA and DSA code are faster, and also the whole security system uses Ben's updated BigInteger code. The new BigInteger code is a lot faster.
Special thanks go to Duncan Mak for helping putting together this release.