<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Jb in a nutshell</title>
    <link>http://evain.net/blog/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description />
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/jbevain" /><feedburner:info uri="jbevain" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Présentation MonoTouch à Paris</title>
      <description>&lt;p&gt;&lt;a href="http://www.flickr.com/photos/jbevain/3986727817/" title="MonoTouch by Jb Evain, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3426/3986727817_de02b09135.jpg" width="500" height="333" alt="MonoTouch" style="border: 2px solid black" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Certains vont à la Tour Eiffel, d&amp;#8217;autres se ruent dans des Starbucks, mais moi, quand je monte conquérir Paris, je vais aux réunions &lt;a href="http://www.altnetfr.org/"&gt;alt.net&lt;/a&gt;. C&amp;#8217;est souvent amusant, et toujours de bonne compagnie. En plus j&amp;#8217;ai l&amp;#8217;honneur, que dis-je le privilège d&amp;#8217;être en haut de l&amp;#8217;affiche de la prochaine réunion. Évidemment, je n&amp;#8217;aurai pas de complet bleu, moi j&amp;#8217;aime les rayures.&lt;/p&gt;


	&lt;p&gt;Lundi prochain, 12 octobre, je vais présenter &lt;a href="http://www.monotouch.net"&gt;MonoTouch&lt;/a&gt;. MonoTouch, c&amp;#8217;est un produit de &lt;a href="http://www.novell.com"&gt;Novell&lt;/a&gt;, qui permet d&amp;#8217;écrire des applications pour iPhone en C#, comme on le ferait pour le framework .net. Ou presque.&lt;/p&gt;


	&lt;p&gt;Cette session sera donc l&amp;#8217;occasion de voir ce que l&amp;#8217;on peut faire avec, de rentrer un peu dans les détails du pourquoi du comment ça marche, et d&amp;#8217;en discuter. Parce que c&amp;#8217;est vraiment ce qui fait le charme de ces rencontres alt.net. Les discussions post-session, un verre à la main, une cravate dans l&amp;#8217;autre.&lt;/p&gt;


	&lt;p&gt;Notre hôte pour cette &lt;a href="http://www.altnetfr.org/2009/10/01/altnet-paris-18-mono-touch-avec-jean-baptiste-evain/"&gt;session&lt;/a&gt; sera &lt;a href="http://www.zenika.com"&gt;Zenika&lt;/a&gt;, qui m&amp;#8217;a réservé &lt;a href="http://www.zenika.com/conference/dotnet/mono-touch-avec-jean-baptiste-evain/"&gt;une page&lt;/a&gt; rien que pour moi, et surtout qui permet de &lt;a href="http://www.zenika.com/conference/dotnet/mono-touch-avec-jean-baptiste-evain/"&gt;s&amp;#8217;inscrire&lt;/a&gt;. Dépêchez vous de vous inscrire, le nombre de place est probablement limité.&lt;/p&gt;


	&lt;p&gt;Le synopsis de la session:&lt;/p&gt;


&lt;blockquote&gt;
Aujourd&amp;#8217;hui, dans l&amp;#8217;informatique, tout le monde ou presque a entendu parler de l&amp;#8217;iPhone. Et à plus forte raison depuis que celui-ci supporte le copier-coller. C&amp;#8217;est aujourd&amp;#8217;hui un acteur important dans le monde de la mobilité, et sa démocratisation rapide en fait une plateforme de choix pour développer des applications, aussi bien pour l&amp;#8217;entreprise que pour le particulier.

	&lt;p&gt;Si à l&amp;#8217;origine développer pour cette platforme signifiait utiliser le langage d&amp;#8217;Apple, l&amp;#8217;Objective-C, on assiste à la naissance de solutions tierces destinées à fournir d&amp;#8217;autres moyens de programmer pour l&amp;#8217;iPhone.&lt;/p&gt;


Cette session sera l&amp;#8217;occasion de voir non seulement comment il est possible de réutiliser son code et ses compétences .net sur l&amp;#8217;iPhone grâce à MonoTouch, mais aussi d&amp;#8217;en expliquer le fonctionnement.
&lt;/blockquote&gt;

	&lt;p&gt;À lundi prochain donc.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/jbevain/~4/0ziDKR1VNVA" height="1" width="1"/&gt;</description>
      <pubDate>Tue, 06 Oct 2009 16:56:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:a8b6d8c6-719c-4466-9e78-d23eb1207d83</guid>
      <author>Jb Evain</author>
      <link>http://feedproxy.google.com/~r/jbevain/~3/0ziDKR1VNVA/pr%C3%A9sentation-monotouch-%C3%A0-paris</link>
      <category>Mono</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/588</trackback:ping>
    <feedburner:origLink>http://evain.net/blog/articles/2009/10/06/pr%C3%A9sentation-monotouch-%C3%A0-paris</feedburner:origLink></item>
    <item>
      <title>Rebasing System.Reactive to the .net CLR</title>
      <description>&lt;p&gt;&lt;a href="http://www.flickr.com/photos/jbevain/3489550358/" title="Purple rain by Jb Evain, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3356/3489550358_d70e7147ec.jpg" width="500" height="333" alt="Purple rain" style="border: 2px solid black" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;There has been &lt;a href="http://themechanicalbride.blogspot.com/2009/07/introducing-rx-linq-to-events.html"&gt;a&lt;/a&gt; &lt;a href="http://themechanicalbride.blogspot.com/2009/07/developing-with-rx-part-1-extension.html"&gt;lot&lt;/a&gt; &lt;a href="http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Brian-Beckman-and-Erik-Meijer-Inside-the-NET-Reactive-Framework-Rx/"&gt;of&lt;/a&gt; &lt;a href="http://www.infoq.com/news/2009/07/Reactive-Framework-LINQ-Events"&gt;interest&lt;/a&gt; &lt;a href="http://www.paulbatum.com/2009/07/reacting-to-reactive-framework-part-5.html"&gt;towards&lt;/a&gt; the Rx framework lately. It&amp;#8217;s definitely an interesting piece of software, and the video linked on channel 9 is quite fascinating. The only issue is that the only assembly you can get right now is compiled against Silverlight, making it impossible to use on the traditional .net framework. Impossible, really?&lt;/p&gt;


	&lt;p&gt;Well, I for one would not recommend it, but if you really can&amp;#8217;t wait to try it, you could use &lt;a href="http://gist.github.com/158643"&gt;this little piece of code&lt;/a&gt; which uses &lt;a href="http://mono-project.com/Cecil"&gt;Cecil&lt;/a&gt; to turn the assembly compiled against Silverlight into an assembly that will work on the .net framework. Of course the assembly will lose its strong name in the process. But at least, it will be usable.&lt;/p&gt;


	&lt;p&gt;For instance, here&amp;#8217;s &lt;a href="http://gist.github.com/158644"&gt;the sample that Jafar is showing on his blog&lt;/a&gt;, running on Mono:&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://evain.net/public/test-rx.png" /&gt;&lt;/p&gt;


	&lt;p&gt;Update: don&amp;#8217;t miss the &lt;a href="http://evain.net/blog/articles/2009/07/30/rebasing-system-reactive-to-the-net-clr#comments"&gt;comment&lt;/a&gt; &lt;a href="http://sebastien.lebreton.free.fr/"&gt;Sébastien&lt;/a&gt; posted, and how he would do it with &lt;a href="http://sebastien.lebreton.free.fr/reflexil/"&gt;Reflexil&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/jbevain/~4/JDPWoHbU9MI" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 30 Jul 2009 12:24:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:2398db3b-6b11-4b71-8e83-9447f44d85ad</guid>
      <author>Jb Evain</author>
      <link>http://feedproxy.google.com/~r/jbevain/~3/JDPWoHbU9MI/rebasing-system-reactive-to-the-net-clr</link>
      <category>Cecil</category>
      <category>Mono</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/582</trackback:ping>
    <feedburner:origLink>http://evain.net/blog/articles/2009/07/30/rebasing-system-reactive-to-the-net-clr</feedburner:origLink></item>
    <item>
      <title>Getting the field backing a property using Reflection</title>
      <description>&lt;p&gt;&lt;a href="http://www.flickr.com/photos/jbevain/3488735265/" title="Pluie, Pluie by Jb Evain, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3362/3488735265_ec8a06bec5.jpg" width="500" height="333" alt="Pluie, Pluie" style="border: 2px solid black" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;&lt;b&gt;Update&lt;/b&gt;: the code has been moved to its own &lt;a href="http://github.com/jbevain/mono.reflection"&gt;project page&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Let&amp;#8217;s consider you&amp;#8217;re writing a &lt;span class="caps"&gt;LINQ&lt;/span&gt; provider. And that you need to opimize the following &lt;span class="caps"&gt;LINQ&lt;/span&gt; query:&lt;/p&gt;


&lt;pre&gt;
from Person p in db where p.Age &amp;gt; 18 select p;
&lt;/pre&gt;

	&lt;p&gt;Let&amp;#8217;s add a constraint. The underlying storage engine stores data according to the field name. That would mean that when generating the query for the underlying storage system, you&amp;#8217;ll have to map &lt;pre&gt;p.Age&lt;/pre&gt; into something that the underlying storage system will understand. In that case, a field. And all you have is a &lt;a href="http://msdn.microsoft.com/en-us/library/system.linq.expressions.memberexpression.aspx"&gt;MemberExpression&lt;/a&gt;, giving you a &lt;a href="http://msdn.microsoft.com/en-us/library/system.reflection.propertyinfo.aspx"&gt;PropertyInfo&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;The issue here is that you have no way to get the &lt;a href="http://msdn.microsoft.com/en-us/library/system.reflection.fieldinfo.aspx"&gt;FieldInfo&lt;/a&gt; backing the property. If you think about it, it&amp;#8217;s normal. The setter and the getter of a property being traditional methods, they can contain any kind of code. Meaning that you can&amp;#8217;t always find a field backing the property.&lt;/p&gt;


	&lt;p&gt;But in that case, it&amp;#8217;s ok, we&amp;#8217;re only interested in those forms of properties:&lt;/p&gt;


&lt;pre&gt;
public int Age { get; set; }

private string name;

public string Name {
    get { return name; }
    set { name = value; }
}
&lt;/pre&gt;

	&lt;p&gt;Of course here what&amp;#8217;s interesting is how to actually get the field. I&amp;#8217;ve used the &lt;a href="http://evain.net/blog/articles/2009/04/30/reflection-based-cil-reader"&gt;Reflection based &lt;span class="caps"&gt;CIL&lt;/span&gt; reader&lt;/a&gt; I wrote about yesterday. I disassemble the body of either a getter or a setter of the property, and if it matches a simple IL pattern, that is, if it looks to be a property backed by a field, I simply return the field.&lt;/p&gt;


	&lt;p&gt;To do the actual IL matching, I re-implemented something &lt;a href="http://blogs.codehaus.org/people/bamboo/"&gt;Rodrigo&lt;/a&gt; and I wrote when we were working on instrumenting assemblies at &lt;a href="http://developer.db4o.com/"&gt;db4o&lt;/a&gt;. The code itself is pretty neat.&lt;/p&gt;


	&lt;p&gt;Anyway, that&amp;#8217;s another opportunity to write a simple extension method:&lt;/p&gt;


&lt;pre&gt;
public static FieldInfo GetBackingField (this PropertyInfo self)
&lt;/pre&gt;

	&lt;p&gt;Again, you&amp;#8217;re more than welcome to have a look at &lt;a href="http://gist.github.com/104006"&gt;the implementation&lt;/a&gt;. Don&amp;#8217;t forget that it depends on the &lt;a href="http://gist.github.com/104001"&gt;Reflection based &lt;span class="caps"&gt;CIL&lt;/span&gt; reader&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/jbevain/~4/qQldOxCfUOI" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 01 May 2009 10:46:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:f2491cf8-96b8-46ef-a621-8804811c2586</guid>
      <author>Jb Evain</author>
      <link>http://feedproxy.google.com/~r/jbevain/~3/qQldOxCfUOI/getting-the-field-backing-a-property-using-reflection</link>
      <category>Mono</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/581</trackback:ping>
    <feedburner:origLink>http://evain.net/blog/articles/2009/05/01/getting-the-field-backing-a-property-using-reflection</feedburner:origLink></item>
    <item>
      <title>Reflection based CIL reader</title>
      <description>&lt;p&gt;&lt;a href="http://www.flickr.com/photos/jbevain/3489549862/" title="Le diamant by Jb Evain, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3312/3489549862_2c07beba16.jpg" width="500" height="333" alt="Le diamant" style="border: 2px solid black"/&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;&lt;b&gt;Update&lt;/b&gt;: the code has been moved to its own &lt;a href="http://github.com/jbevain/mono.reflection"&gt;project page&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;As I was &lt;a href="http://evain.net/blog/articles/2009/04/18/cecil-and-the-cci"&gt;writing&lt;/a&gt;, earlier this month, when I worked on a static aspect weaver, the first library we used, to programmatically retrieve the &lt;a href="http://en.wikipedia.org/wiki/Common_Intermediate_Language"&gt;&lt;span class="caps"&gt;CIL&lt;/span&gt; bytecode&lt;/a&gt;, was a library published by Lutz Roeder (the original author of the most famous Reflector tool), called ILReader.&lt;/p&gt;


	&lt;p&gt;It suffered from a number of limitation, and you were tied to the whole &lt;a href="http://msdn.microsoft.com/en-us/library/system.reflection.aspx"&gt;System.Reflection&lt;/a&gt; infrastructure. Which, during the .net 1.0 time, was somewhat limited, and lacked a few features required to get access to every single detail in an assembly, including the &lt;span class="caps"&gt;CIL&lt;/span&gt; bytecode. It evolved since, for instance, starting from .net 2.0, there&amp;#8217;s a &lt;a href="http://msdn.microsoft.com/en-us/library/system.reflection.methodbody.getilasbytearray.aspx"&gt;GetILAsByteArray&lt;/a&gt; on a MethodBody used to get the raw &lt;span class="caps"&gt;CIL&lt;/span&gt; code.&lt;/p&gt;


	&lt;p&gt;Anyway, most of those concerns were addressed by &lt;a href="http://www.mono-project.com/Cecil"&gt;Cecil&lt;/a&gt;, but still, for some use-cases, it could be nice to be able to have access to the &lt;span class="caps"&gt;CIL&lt;/span&gt; bytecode at a higher level of abstraction than a plain raw byte array.&lt;/p&gt;


	&lt;p&gt;On .net, you can use a library also named &lt;a href="http://blogs.msdn.com/haibo_luo/archive/2006/11/06/system-reflection-based-ilreader.aspx"&gt;ILReader&lt;/a&gt;, but it has a few checks that are specific to .net, there&amp;#8217;s no information about a license of the code, and also, I&amp;#8217;m not especially fond of the way instructions are represented.&lt;/p&gt;


	&lt;p&gt;So last time, for an hack I&amp;#8217;ll soon write about, I extracted Mono.Cecil&amp;#8217;s Instruction type, and wrote a cute extension method, or rock, as I like to call them. Its signature:&lt;/p&gt;


&lt;pre&gt;
public IList&amp;lt;Instruction&amp;gt; GetInstructions (this MethodBase self)
&lt;/pre&gt;

	&lt;p&gt;I would have loved to declare the extension method on the System.Reflection.MethodBody type, to make things more consistent with the methods it already has, but there&amp;#8217;s no cross platform way to get a System.Reflection.MethodBase from a System.Reflection.MethodBody.&lt;/p&gt;


	&lt;p&gt;Anyway, it&amp;#8217;s terribly easy to use if you&amp;#8217;ve already used Cecil. The only difference is that for branches, the operand is the offset as an integer, not the target instruction. As a sample usage, here&amp;#8217;s a (very) incomplete &lt;span class="caps"&gt;CIL&lt;/span&gt; reflection based disassembler:&lt;/p&gt;


&lt;pre&gt;
static void PrintByteCode (MethodInfo method)
{
    foreach (Instruction instruction in method.GetInstructions ())
        PrintInstruction (instruction);
}

static void PrintInstruction (Instruction instruction)
{
    Console.Write ("{0}: {1} ",
        Labelize (instruction.Offset),
        instruction.OpCode.Name);

    switch (instruction.OpCode.OperandType) {
    case OperandType.InlineNone :
        break;
    case OperandType.InlineSwitch :
        var branches = instruction.Operand as int [];
        for (int i = 0; i &amp;lt; branches.Length; i++) {
            if (i &amp;gt; 0)
                Console.Write (", ");
            Console.Write (Labelize (branches [i]));
        }
        break;
    case OperandType.ShortInlineBrTarget :
    case OperandType.InlineBrTarget :
        Console.Write (Labelize ((int) instruction.Operand));
        break;
    case OperandType.InlineString :
        Console.Write ("\"{0}\"", instruction.Operand);
        break;
    default :
        Console.WriteLine (instruction.Operand);
        break;
    }

    Console.WriteLine ();
}
&lt;/pre&gt;

	&lt;p&gt;And of course, you&amp;#8217;re welcome to have a look at the &lt;a href="http://gist.github.com/104001"&gt;implementation&lt;/a&gt;, under the &lt;span class="caps"&gt;MIT&lt;/span&gt;/X11 license.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/jbevain/~4/DB9Qx03ob8g" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 30 Apr 2009 22:25:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:b71812e9-2a05-4894-8ed9-2b66bf78fbf9</guid>
      <author>Jb Evain</author>
      <link>http://feedproxy.google.com/~r/jbevain/~3/DB9Qx03ob8g/reflection-based-cil-reader</link>
      <category>Mono</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/580</trackback:ping>
    <feedburner:origLink>http://evain.net/blog/articles/2009/04/30/reflection-based-cil-reader</feedburner:origLink></item>
    <item>
      <title>pdb2mdb and Mono.Cecil.Pdb</title>
      <description>&lt;p&gt;&lt;a href="http://www.flickr.com/photos/jbevain/3470936776/" title="Sainte Anne by Jb Evain, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3536/3470936776_0401d96d84.jpg" width="500" height="333" alt="Sainte Anne" style="border: 2px solid black" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;I always complained about the fact that debug symbols were not portable between different &lt;span class="caps"&gt;CLR&lt;/span&gt; implementations. The .net &lt;span class="caps"&gt;CLR&lt;/span&gt; consumes pdb files, which is an undocumented format. Another file format was added to the &lt;a href="http://www.ecma-international.org/publications/standards/Ecma-335.htm"&gt;&lt;span class="caps"&gt;ECMA&lt;/span&gt;-335&lt;/a&gt; in a late revision. I &lt;a href="http://evain.net/blog/articles/2005/07/31/clidb-a-standard-debugging-symbol-store"&gt;wrote&lt;/a&gt; about this file format a while ago.&lt;/p&gt;


	&lt;p&gt;To sum up, it was added very late while Mono already started to use its own format (mdb) and the .net &lt;span class="caps"&gt;CLR&lt;/span&gt; doesn&amp;#8217;t understand it anyway. So even if it&amp;#8217;s not a bad format (it could use some improvements, like a &lt;span class="caps"&gt;GUID&lt;/span&gt; heap similar to the one in a .net assembly), basically no one uses it in the real world.&lt;/p&gt;


	&lt;p&gt;As mentioned in a &lt;a href="http://evain.net/blog/articles/2009/04/18/cecil-and-the-cci"&gt;recent post&lt;/a&gt;, the &lt;span class="caps"&gt;CCI&lt;/span&gt; contains an interesting piece of code, a managed &lt;a href="http://en.wikipedia.org/wiki/Program_database"&gt;pdb&lt;/a&gt; reader, licensed under the Ms-PL. I extracted it, and used it to be able to better share debug symbols between the .net &lt;span class="caps"&gt;CLR&lt;/span&gt; and Mono.&lt;/p&gt;


&lt;h4&gt;pdb2mdb&lt;/h4&gt;

	&lt;p&gt;Robert Jordan, a long time Mono contributor, first wrote a tool named pdb2mdb, to convert a pdb to a mdb. The issue is that it was based on a combination of &lt;span class="caps"&gt;COM&lt;/span&gt; and the mixed mode assembly ISymWrapper which comes with the .net framework. All in all, it means that this version of pdb2mdb could only run on on the .net framework on Windows.&lt;/p&gt;


	&lt;p&gt;With the managed pdb reader, it was very easy to write a fully managed pdb2mdb tool. It&amp;#8217;s now available in &lt;a href="http://anonsvn.mono-project.com/source/trunk/mcs/tools/pdb2mdb"&gt;svn&lt;/a&gt;, and it will come with every other developer tool, such as ilasm or the linker. It&amp;#8217;s very easy to use. Say you&amp;#8217;re deploying a .net application on Linux, you have an assembly Foo.dll, and a Foo.pdb file, just use:&lt;/p&gt;


&lt;pre&gt;
pdb2mdb Foo.dll
&lt;/pre&gt;

	&lt;p&gt;And the tool will generate a file Foo.dll.mdb, that Mono can use to display line information in stack traces.&lt;/p&gt;


&lt;h4&gt;Mono.Cecil.Pdb&lt;/h4&gt;

	&lt;p&gt;&lt;a href="http://anonsvn.mono-project.com/source/trunk/cecil/pdb"&gt;Mono.Cecil.Pdb&lt;/a&gt; is an assembly that you use together with Cecil, to have line information at the IL level. It&amp;#8217;s used by tools such as Gendarme, or MoMA, to help diagnose and locate issues.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;ve integrated the managed reader, and the folks from NDepend were kind enough to beta test it. After a few fixes, the managed reader passed all NDepend tests, and was performing a lot better than its unmanaged counterpart. It&amp;#8217;s now the default, and only the pdb writer uses the ISymWrapper approach.&lt;/p&gt;


	&lt;p&gt;It would be an interesting challenge for someone to try to write a managed writer from the information gathered in the reader. It may not be easy though.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/jbevain/~4/owWebUyDOSM" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 27 Apr 2009 20:07:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:b39a8f01-ac7e-49e4-a125-2f1e15c65860</guid>
      <author>Jb Evain</author>
      <link>http://feedproxy.google.com/~r/jbevain/~3/owWebUyDOSM/pdb2mdb-and-mono-cecil-pdb</link>
      <category>Cecil</category>
      <category>Mono</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/574</trackback:ping>
    <feedburner:origLink>http://evain.net/blog/articles/2009/04/27/pdb2mdb-and-mono-cecil-pdb</feedburner:origLink></item>
    <item>
      <title>Converting Delegates to Expression Trees</title>
      <description>&lt;p&gt;&lt;a href="http://www.flickr.com/photos/jbevain/3466496686/" title="Plage du diamant by Jb Evain, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3621/3466496686_90e55ed199.jpg" width="500" height="333" alt="Plage du diamant" style="border: 2px solid black" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Back when I was working at &lt;a href="http://developer.db4o.com/"&gt;db4o&lt;/a&gt;, we had fun implementing a &lt;a href="http://developer.db4o.com/Resources/view.aspx/Reference/Object_Lifecycle/Querying/Native_Queries"&gt;mechanism&lt;/a&gt; somehow similar to &lt;span class="caps"&gt;LINQ&lt;/span&gt;, to have strongly typed queries expressed using code itself. The implementation uses &lt;a href="http://www.mono-project.com/Cecil"&gt;Mono.Cecil&lt;/a&gt; and Cecil.FlowAnalysis to decompile a delegate into an &lt;span class="caps"&gt;AST&lt;/span&gt;, that db4o&amp;#8217;s query optimizer can process.&lt;/p&gt;


	&lt;p&gt;Since .net 3.5, an &lt;span class="caps"&gt;API&lt;/span&gt;, System.Linq.Expressions, can be used to get a representation of a C# lambda expression into an object graph. An expression tree. .net 4.0 will add support for statements to this &lt;span class="caps"&gt;API&lt;/span&gt;, but as far as I know, the language itself hasn&amp;#8217;t been updated to produce those new nodes.&lt;/p&gt;


	&lt;p&gt;Anyway, a few days ago, someone on &lt;a href="http://stackoverflow.com/"&gt;Stack Overflow&lt;/a&gt;, asked &lt;a href="http://stackoverflow.com/questions/767733/converting-a-net-funct-to-a-net-expressionfunct"&gt;how to turn a delegate into a &lt;span class="caps"&gt;LINQ&lt;/span&gt; expression tree&lt;/a&gt;. There&amp;#8217;s no builtin feature to do that, it&amp;#8217;s not a straightforward process. You basically have to decompile the compiled method. I guess it&amp;#8217;s a good thing that I&amp;#8217;m working on &lt;a href="http://evain.net/blog/articles/2008/12/15/cecil-decompiler"&gt;a decompiler&lt;/a&gt;, if I need to decompile something.&lt;/p&gt;


	&lt;p&gt;Tonight I wrote a short spike to verify the feasibility of my idea, and it turns out to be pretty simple. Sample:&lt;/p&gt;


&lt;pre&gt;
static void Main ()
{
    Func&amp;lt;int, int&amp;gt; magic = i =&amp;gt; i * 42;

    Expression&amp;lt;Func&amp;lt;int, int&amp;gt;&amp;gt; expression =
        DelegateConverter.ToExpression (magic);

    Console.WriteLine (expression.ToString ());
    // prints: i =&amp;gt; i * 42
    Console.WriteLine (expression.Compile ().Invoke (1));
    // prints: 42
}
&lt;/pre&gt;

	&lt;p&gt;DelegateConverter is implemented as a simple visitor which walks over a Cecil.Decompiler &lt;span class="caps"&gt;AST&lt;/span&gt;, and generates, if possible, the according Linq Expression Tree. Pretty cool isn&amp;#8217;t it?&lt;/p&gt;


	&lt;p&gt;You can browse &lt;a href="http://anonsvn.mono-project.com/viewvc/trunk/cecil/decompiler/dbg/Linq.cs?content-type=text%2Fplain&amp;#38;view=co"&gt;the code of the spike&lt;/a&gt;. Keep in mind that it&amp;#8217;s nowhere to be complete, and that it&amp;#8217;s just a proof of concept. Still, I think it&amp;#8217;s a pretty cool usage of the Cecil.Decompiler library.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/jbevain/~4/NaJR4sqIVxQ" height="1" width="1"/&gt;</description>
      <pubDate>Wed, 22 Apr 2009 21:03:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:08ce72ea-195d-49fe-967f-9f4ed4ce70a3</guid>
      <author>Jb Evain</author>
      <link>http://feedproxy.google.com/~r/jbevain/~3/NaJR4sqIVxQ/converting-delegates-to-expression-trees</link>
      <category>Cecil</category>
      <category>Mono</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/559</trackback:ping>
    <feedburner:origLink>http://evain.net/blog/articles/2009/04/22/converting-delegates-to-expression-trees</feedburner:origLink></item>
    <item>
      <title>Cecil and the CCI</title>
      <description>&lt;p&gt;&lt;a href="http://www.flickr.com/photos/jbevain/3451856715/" title="Ponton by Jb Evain, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3313/3451856715_6715c4c938.jpg" width="500" height="333" alt="Ponton" style="border: 2px solid black" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Quite a number of friends pinged me about the &lt;a href="http://blogs.msdn.com/hermanventer/archive/2009/04/14/a-bit-of-help-compiling-your-next-net-hosted-programming-language.aspx"&gt;recent release&lt;/a&gt; of the &lt;a href="http://cciast.codeplex.com/"&gt;&lt;span class="caps"&gt;CCI&lt;/span&gt;&lt;/a&gt;, under the &lt;a href="http://www.opensource.org/licenses/ms-pl.html"&gt;Ms-PL&lt;/a&gt;, and were curious about my take on it, and its effect on &lt;a href="http://www.mono-project.com/Cecil"&gt;Cecil&lt;/a&gt; and its ecosystem.&lt;/p&gt;


	&lt;p&gt;First of all, there&amp;#8217;s a bit of a story here, and I&amp;#8217;ll write it here for those who like me, love software history. Back in the years 2003 and 2004, I was working with &lt;a href="http://www.thomasgil.com/"&gt;Thomas Gil&lt;/a&gt;, one of my mentor and programming hero, on one of the first static aspect weaver on .net, &lt;a href="http://aspectdng.tigris.org/"&gt;AspectDNG&lt;/a&gt;, now abandoned. I was actively researching better ways to do &lt;a href="http://en.wikipedia.org/wiki/Common_Intermediate_Language"&gt;&lt;span class="caps"&gt;CIL&lt;/span&gt;&lt;/a&gt; injection.&lt;/p&gt;


	&lt;p&gt;We went from raw IL text manipulation, to &lt;a href="http://msdn.microsoft.com/en-us/library/system.reflection.aspx"&gt;Reflection&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/system.reflection.emit.aspx"&gt;Reflection.Emit&lt;/a&gt; using &lt;a href="http://blog.lutzroeder.com/"&gt;Lutz&lt;/a&gt;&amp;#8217;s ILReader library, to &lt;a href="http://rail.dei.uc.pt/"&gt;&lt;span class="caps"&gt;RAIL&lt;/span&gt;&lt;/a&gt;, until I decide to work on Cecil.&lt;/p&gt;


	&lt;p&gt;In the meantime, I&amp;#8217;ve stumbled upon &lt;a href="http://research.microsoft.com/en-us/people/mbarnett/ilmerge.aspx"&gt;ILMerge&lt;/a&gt;, a tool from &lt;a href="http://research.microsoft.com/en-us/people/mbarnett/"&gt;Mike Barnett&lt;/a&gt;, and mailed him to ask what powered the tool, and he put me in contact with &lt;a href="http://blogs.msdn.com/hermanventer/default.aspx"&gt;Herman Venter&lt;/a&gt;, the man behind the &lt;span class="caps"&gt;CCI&lt;/span&gt; effort. I wrote Herman a couple of mails, in a terrible English, and begged him to push for a release of the &lt;span class="caps"&gt;CCI&lt;/span&gt; under a license we could use in AspectDNG. That was in March 2004.&lt;/p&gt;


	&lt;p&gt;As you can guess, it quite didn&amp;#8217;t work out at that time, so I started working on Cecil. A few weeks after, &lt;a href="http://tirania.org/blog/archive/2004/Dec-01.html"&gt;Miguel blogged&lt;/a&gt; about the need of such library. He already had the &lt;a href="http://www.mono-project.com/Linker"&gt;Mono Linker&lt;/a&gt; in mind. I mailed him, got &lt;span class="caps"&gt;SVN&lt;/span&gt; access, checked in the beginning of Cecil, got &lt;a href="http://pages.infinit.net/ctech/poupou.html"&gt;Sébastien&lt;/a&gt; interested, etc.&lt;/p&gt;


	&lt;p&gt;I had the opportunity to be invited by Microsoft to attend an informal &lt;a href="http://research.microsoft.com/en-us/events/aop/default.aspx"&gt;&lt;span class="caps"&gt;AOP&lt;/span&gt; workshop&lt;/a&gt; the year later, and to met with Herman, which I remember as a very nice person. I am not sure he remembers the terribly shy kid that did a terrible presentation in a terrible English. But all in all, I&amp;#8217;m happy that five years later, my request went through.&lt;/p&gt;


	&lt;p&gt;Now the &lt;span class="caps"&gt;CCI&lt;/span&gt; release in its own CodePlex page is not really a big event, as it was already released and licensed under the Ms-PL, as it&amp;#8217;s part of &lt;a href="http://www.codeplex.com/Sandcastle"&gt;Sandcastle&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Anyway, Cecil is quite mature in its current form, it&amp;#8217;s used by a &lt;a href="http://groups.google.com/group/mono-cecil/web/projects-using-cecil"&gt;fair number of (known) applications&lt;/a&gt; (please help to improve the list), and I&amp;#8217;m currently working on two things.&lt;/p&gt;


	&lt;p&gt;The first one is a refactoring of Cecil, which vastly reduces memory consumption as well as reading/writing time. Hopefully I&amp;#8217;ll have a beta in a month or so. We have great plans for this version of Cecil, and it&amp;#8217;s consuming a lot of my time, more on this later.&lt;/p&gt;


	&lt;p&gt;The second one is an extensible decompiler, &lt;a href="http://evain.net/blog/articles/2008/12/15/cecil-decompiler"&gt;Cecil.Decompiler&lt;/a&gt;, that will greatly benefit from the Cecil refactoring. The time I dedicate to it is a bit phagocyted by the Cecil refactoring right now, but it&amp;#8217;s certainly one of my favorite project.&lt;/p&gt;


	&lt;p&gt;The &lt;span class="caps"&gt;CCI&lt;/span&gt; is a combination of Cecil, the decompiler, and something to write a decompiled &lt;span class="caps"&gt;AST&lt;/span&gt; back, which will be the natural evolution of the Cecil decompiler. Note that the &lt;span class="caps"&gt;CCI&lt;/span&gt; decompilation/compilation process is not extensible. Now that it&amp;#8217;s open source, you can hack it yourself, sadly, the &lt;span class="caps"&gt;CCI&lt;/span&gt; code is well, a bit messy to be polite, or not exactly a joy to read. Also you probably won&amp;#8217;t be able to contribute back to the &lt;span class="caps"&gt;CCI&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;Anyway, it does its job alright, and so does Cecil. Choice is always good, let&amp;#8217;s welcome the &lt;span class="caps"&gt;CCI&lt;/span&gt; in the small family of such tools. I, for one, will surprisingly keep hacking on and with Cecil :)&lt;/p&gt;


	&lt;p&gt;To conclude on a very positive note, the fantastic thing about this release is that the &lt;span class="caps"&gt;CCI&lt;/span&gt; contains a fully managed &lt;span class="caps"&gt;PDB&lt;/span&gt; reader and writer. That&amp;#8217;s great news as so far, we failed to get any details about this file format. This means that we can now implement a fully managed Mono.Cecil.Pdb support, and that&amp;#8217;s just great.&lt;/p&gt;


	&lt;p&gt;&lt;b&gt;&lt;span class="caps"&gt;UPDATE&lt;/span&gt;&lt;/b&gt;: it appears that only the &lt;span class="caps"&gt;PDB&lt;/span&gt; reader is fully managed, the &lt;span class="caps"&gt;PDB&lt;/span&gt; writer is just a wrapper over the &lt;span class="caps"&gt;COM&lt;/span&gt; stuff, just like the current implementation of Mono.Cecil.Pdb. Well, at least it&amp;#8217;s a start.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/jbevain/~4/fXf-FPkL-s0" height="1" width="1"/&gt;</description>
      <pubDate>Sat, 18 Apr 2009 14:26:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:37c49e88-4ba8-4bfe-bf4d-eccaaf10ff4c</guid>
      <author>Jb Evain</author>
      <link>http://feedproxy.google.com/~r/jbevain/~3/fXf-FPkL-s0/cecil-and-the-cci</link>
      <category>AspectDNG</category>
      <category>Cecil</category>
      <category>Mono</category>
      <category>Personal</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/549</trackback:ping>
    <feedburner:origLink>http://evain.net/blog/articles/2009/04/18/cecil-and-the-cci</feedburner:origLink></item>
    <item>
      <title>Offline</title>
      <description>&lt;p&gt;&lt;a href="http://www.flickr.com/photos/jbevain/462171978/" title="View from the balcony by Jb Evain, on Flickr"&gt;&lt;img src="http://farm1.static.flickr.com/207/462171978_61439778f2.jpg" width="500" height="333" alt="View from the balcony" style="border: 2px solid black" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;ll be offline until April 20th.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/jbevain/~4/Sc8S6OKBlUw" height="1" width="1"/&gt;</description>
      <pubDate>Sun, 05 Apr 2009 11:52:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:668b9079-e27d-422d-a5b3-44c83977edeb</guid>
      <author>Jb Evain</author>
      <link>http://feedproxy.google.com/~r/jbevain/~3/Sc8S6OKBlUw/offline</link>
      <category>Personal</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/548</trackback:ping>
    <feedburner:origLink>http://evain.net/blog/articles/2009/04/05/offline</feedburner:origLink></item>
    <item>
      <title>Mono embedder managed tool-chain</title>
      <description>&lt;p&gt;&lt;a href="http://www.flickr.com/photos/jbevain/2194122850/" title="sncf by Jb Evain, on Flickr"&gt;&lt;img src="http://farm3.static.flickr.com/2343/2194122850_a85716353a.jpg" width="500" height="333" alt="sncf" style="border: 2px solid black" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://tirania.org/blog/"&gt;Miguel&lt;/a&gt; blogged a &lt;a href="http://tirania.org/blog/archive/2009/Jan-07.html"&gt;list of iPhone applications&lt;/a&gt; that were made using &lt;a href="http://unity3d.com/"&gt;Unity3D&lt;/a&gt;, and scripted with &lt;a href="http://mono-project.com"&gt;Mono&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m delighted to have cute applications using Mono to show, and one involves raptors!&lt;/p&gt;


	&lt;p&gt;One of the concern for Unity3D is to reduce the size of the download as much as possible. And Mono certainly weight a little bit in the download. We have &lt;a href="http://www.mono-project.com/Small_footprint"&gt;a page on our wiki&lt;/a&gt; which describes how to reduce the size of the runtime, but am writing today about what Unity3D uses to reduce the size of the different managed parts, be it the core libraries, or the managed part of the game itself.&lt;/p&gt;


	&lt;p&gt;They are using two different tools to reduce the size of the assemblies. So first of all, once the application is compiled, the first tool they use is the &lt;a href="http://www.mono-project.com/Linker"&gt;Mono Linker&lt;/a&gt;. I already had the occasion to &lt;a href="http://evain.net/blog/articles/2006/08/21/link-to-link"&gt;write about the linker&lt;/a&gt;, as it is a tool that I started writing during the second Google Summer of Code I spent as a student, and that I&amp;#8217;ve worked on when I joined Novell. The linker is today a mature piece of code, that is exercised during every single Mono build, as it is &lt;a href="http://www.mono-project.com/MoonlightNotes"&gt;used to produce the Moonlight 2.0 version of our class library&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;So they are using the linker, and this makes sure that everything that is not needed by the game or the engine is removed from the assemblies.&lt;/p&gt;


	&lt;p&gt;When the linking stage is achieved, they pre-compile the assemblies to native code using our &lt;a href="http://www.mono-project.com/AOT"&gt;&lt;span class="caps"&gt;AOT&lt;/span&gt; (Ahead of Time) compiler&lt;/a&gt;. This is necessary, as the iPhone prevents any &lt;span class="caps"&gt;JIT&lt;/span&gt; to run.&lt;/p&gt;


	&lt;p&gt;After &lt;span class="caps"&gt;AOT&lt;/span&gt;, you end up with a native binary, and the original managed binary, which still contains the intermediate code. If the assembly has been completely AOTed, this intermediate code is no longer necessary.&lt;/p&gt;


	&lt;p&gt;Here comes the second tool they&amp;#8217;re using. This is a tool which is pretty new, and that I wrote for this specific usage. It&amp;#8217;s called `mono-cil-strip`, and is now built along the traditional tools that we ship, such as ilasm or the linker. It uses a special mode of Cecil I hacked on, which preserves the original metadata structure of the assembly, but empties every single method body. It&amp;#8217;s necessary to keep the native binary in sync with the managed binary, while still removing parts of it.&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;re compiling your assemblies ahead of time, and looking for some bytes to save, here&amp;#8217;s a neat way to do so.&lt;/p&gt;


	&lt;p&gt;Sadly I don&amp;#8217;t have numbers handy, so I&amp;#8217;ll encourage you to give it a try, but here we are, every single iPhone application produced using Unity3D went through &lt;a href="http://www.mono-project.com/Cecil"&gt;Cecil&lt;/a&gt; (twice!).&lt;/p&gt;


	&lt;p&gt;And that&amp;#8217;s pretty cool :)&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/jbevain/~4/hA27mKlCpLw" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 09 Jan 2009 12:07:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:33195162-76ef-43df-a302-99f27b9e3e7a</guid>
      <author>Jb Evain</author>
      <link>http://feedproxy.google.com/~r/jbevain/~3/hA27mKlCpLw/mono-embedder-managed-tool-chain</link>
      <category>Cecil</category>
      <category>Mono</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/544</trackback:ping>
    <feedburner:origLink>http://evain.net/blog/articles/2009/01/09/mono-embedder-managed-tool-chain</feedburner:origLink></item>
    <item>
      <title>The Thing About ExpressionVisitor</title>
      <description>&lt;p&gt;&lt;a href="http://www.flickr.com/photos/jbevain/3068345308/" title="Brouillard by Jb Evain, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3034/3068345308_aa2e001dd4.jpg" width="500" height="333" alt="Brouillard" style="border: 2px solid black" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;There was &lt;a href="http://codebetter.com/blogs/jeremy.miller/archive/2008/12/04/i-love-ayende-and-oss.aspx"&gt;a discussion&lt;/a&gt; recently about why the class &lt;a href="http://msdn.microsoft.com/en-us/library/bb882521.aspx"&gt;ExpressionVisitor&lt;/a&gt;, which every programmer that developed a &lt;span class="caps"&gt;LINQ&lt;/span&gt; provider or code manipulating .net 3.5 expression trees knows about.&lt;/p&gt;


	&lt;p&gt;I certainly agree that this class could have been made public, as basically everyone ends up embedding it. Even if it could use a little refactoring to visit lists.&lt;/p&gt;


	&lt;p&gt;Thing is that I have a naming issue with this class ever since I saw it on &lt;a href="http://blogs.msdn.com/mattwar/archive/2007/07/31/linq-building-an-iqueryable-provider-part-ii.aspx"&gt;Matt&amp;#8217;s blog&lt;/a&gt;. To me it does more than just visiting an expression tree. It allows you to transform it. And when I&amp;#8217;m facing an expression tree, I often like to sometimes visit it, and at some other times, transform it.&lt;/p&gt;


	&lt;p&gt;That&amp;#8217;s basically the reason why I have both a:&lt;/p&gt;


&lt;pre&gt;
class ExpressionVisitor {

    public void Visit (Expression expression)
    {
        // ..
    }

    // ...
}
&lt;/pre&gt;

	&lt;p&gt;And a:&lt;/p&gt;


&lt;pre&gt;
class ExpressionTransformer {

    public Expression Visit (Expression expression)
    {
        // ..
    }

    // ...
}
&lt;/pre&gt;

	&lt;p&gt;Simply because I write a lot of code that would look like:&lt;/p&gt;


&lt;pre&gt;
SomethingExpression VisitSomethingExpression (SomethingExpression expression)
{
    if (Foo (expression))
        return expression;

    if (Bar (expression))
        return expression;

    Baz (expression);
    return expression;
}

&lt;/pre&gt;

	&lt;p&gt;And it looks a lot better (and is also a tiny bit faster) this way:&lt;/p&gt;


&lt;pre&gt;

void VisitSomethingExpression (SomethingExpression expression)
{
    if (Foo (expression))
        return;

    if (Bar (expression))
        return;

    Baz (expression);
}
&lt;/pre&gt;

	&lt;p&gt;So if they make the current ExpressionVisitor public, having a real non transforming ExpressionVisitor will introduce an interesting naming issue.&lt;/p&gt;


	&lt;p&gt;I submitted a &lt;a href="http://www.codeplex.com/dlr/WorkItem/View.aspx?WorkItemId=1101"&gt;bug to the &lt;span class="caps"&gt;DLR&lt;/span&gt; CodePlex&lt;/a&gt;, as the namespace System.Linq.Expressions will come from the &lt;span class="caps"&gt;DLR&lt;/span&gt; in .net 4. What about voting for it?&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/jbevain/~4/PgHQw42IxP0" height="1" width="1"/&gt;</description>
      <pubDate>Tue, 16 Dec 2008 14:25:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:a77de277-55ea-4ffb-b680-bf536821a9a1</guid>
      <author>Jb Evain</author>
      <link>http://feedproxy.google.com/~r/jbevain/~3/PgHQw42IxP0/the-thing-about-expressionvisitor</link>
      <category>Mono</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/525</trackback:ping>
    <feedburner:origLink>http://evain.net/blog/articles/2008/12/16/the-thing-about-expressionvisitor</feedburner:origLink></item>
  </channel>
</rss>
