﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Morten Lyhr commented on Dynamic Methods</title><description>Ayende
  
  
It can be done a little bit smarter.
  
  
Look at thsi plug-in for Reflector.
  
  
http://www.codeplex.com/reflectoraddins/Wiki/View.aspx?title=ReflectionEmitLanguage&amp;referringTitle=Home
  
  
I made a post about it here:
  
http://morten.lyhr.dk/PermaLink,guid,a844104f-949a-4800-828c-1fde0fc711c1.aspx
</description><link>http://ayende.com/2919/dynamic-methods#comment12</link><guid>http://ayende.com/2919/dynamic-methods#comment12</guid><pubDate>Fri, 09 Nov 2007 09:16:35 GMT</pubDate></item><item><title>Thomas Danecker commented on Dynamic Methods</title><description>I was using dynamic methods to dispatch intercepted method calls for a log service (the typical AOP application). They are very, very efficient (the JIT compilation is damn fast, especially compared to reflection). You may check out my blog post: http://tdanecker.blogspot.com/2007/09/interception-with-proxies.html
  
</description><link>http://ayende.com/2919/dynamic-methods#comment11</link><guid>http://ayende.com/2919/dynamic-methods#comment11</guid><pubDate>Tue, 30 Oct 2007 20:40:18 GMT</pubDate></item><item><title>Nick commented on Dynamic Methods</title><description>I wrote a pretty cool template language that compiled templates into dynamic methods.  It's a huge performance win when you know that your code is going to be reusing the same template over and over.  Being able to skip visibility checks was especially nice, since it allowed the templates to call helper methods on an internal static class.  This allowed me to write as much code as possible in C#, and then "glue" it together using dynamically generated IL.
</description><link>http://ayende.com/2919/dynamic-methods#comment10</link><guid>http://ayende.com/2919/dynamic-methods#comment10</guid><pubDate>Tue, 30 Oct 2007 17:01:33 GMT</pubDate></item><item><title>Jeremy commented on Dynamic Methods</title><description>IL generation and developer productivity should never coexist in the same sentence.
  
  
Why fight with IL if we can just move over to a dynamic language where you write these kind of runtime extensions in the language itself?  If we could do this in Ruby instead, Metaprogramming extensions are well within the reach of mere mortal developers and far simpler mechanically.
</description><link>http://ayende.com/2919/dynamic-methods#comment9</link><guid>http://ayende.com/2919/dynamic-methods#comment9</guid><pubDate>Tue, 30 Oct 2007 15:50:52 GMT</pubDate></item><item><title>Ayende Rahien commented on Dynamic Methods</title><description>Morten,
  
that is what I usually do as well :-)
</description><link>http://ayende.com/2919/dynamic-methods#comment8</link><guid>http://ayende.com/2919/dynamic-methods#comment8</guid><pubDate>Tue, 30 Oct 2007 11:07:06 GMT</pubDate></item><item><title>Morten Lyhr commented on Dynamic Methods</title><description>I think reading MSIL makes my eyes hurt!
  
  
But it is very useful, especially if the code it generates is unit tested, and is isolated.
  
  
I have created a dynamic composite factory here:
  
http://morten.lyhr.dk/PermaLink,guid,aa797b7c-a418-45c0-9510-61dc395d7c2d.aspx
  
  
Its not done via DynamicMethod, it creates a whole new class, but MSIL is MSIL. I got it working by creating what i wanted in C#, compiled it to and assembly and opened it in reflector.
  
  
Is there a smarter way to do this?
</description><link>http://ayende.com/2919/dynamic-methods#comment7</link><guid>http://ayende.com/2919/dynamic-methods#comment7</guid><pubDate>Tue, 30 Oct 2007 11:00:14 GMT</pubDate></item><item><title>Niki commented on Dynamic Methods</title><description>IronPython can compile to dynamic methods, that's a very easy way to create code on the fly.
  
  
Omer: Using CodeDom has several disadvantages, worst of them is probably that the generated code is never unloaded or collected by the GC.
</description><link>http://ayende.com/2919/dynamic-methods#comment6</link><guid>http://ayende.com/2919/dynamic-methods#comment6</guid><pubDate>Tue, 30 Oct 2007 09:46:56 GMT</pubDate></item><item><title>Avish commented on Dynamic Methods</title><description>Boo does some pretty neat things with Dynamic Methods to allow fast duck-typing. 
</description><link>http://ayende.com/2919/dynamic-methods#comment5</link><guid>http://ayende.com/2919/dynamic-methods#comment5</guid><pubDate>Mon, 29 Oct 2007 21:28:29 GMT</pubDate></item><item><title>Tim B commented on Dynamic Methods</title><description>Regarding reflection based wrappers, check out RunSharp - http://www.codeproject.com/dotnet/runsharp.asp
</description><link>http://ayende.com/2919/dynamic-methods#comment4</link><guid>http://ayende.com/2919/dynamic-methods#comment4</guid><pubDate>Mon, 29 Oct 2007 21:21:23 GMT</pubDate></item><item><title>Ayende Rahien commented on Dynamic Methods</title><description>Omer,
  
Yes, but dynamic methods can skip visibility calls, so that is a significant advantage.
</description><link>http://ayende.com/2919/dynamic-methods#comment3</link><guid>http://ayende.com/2919/dynamic-methods#comment3</guid><pubDate>Mon, 29 Oct 2007 21:08:30 GMT</pubDate></item><item><title>Omer van Kloeten commented on Dynamic Methods</title><description>You could also use CodeDom to generate this. It would be easier and more readable, but will take longer during the first run.
</description><link>http://ayende.com/2919/dynamic-methods#comment2</link><guid>http://ayende.com/2919/dynamic-methods#comment2</guid><pubDate>Mon, 29 Oct 2007 21:05:55 GMT</pubDate></item><item><title>Marcos commented on Dynamic Methods</title><description>Hi there
  
  
I was using the Dynamic Methods for the FileHelpers and are awesome, there are a lot of libraries that simply the process.
  
  
This is one of the most hidden and wonderful features of .NET 2.0
  
  
http://blog.filehelpers.com/2007/01/improving-filehelpers-performance-now.html
  
  
I think that worth a lot the extra effort and if you cache (like you said) the delegate you are done =)
  
  
The performance gain is incredible !!
  
  
Cheers
</description><link>http://ayende.com/2919/dynamic-methods#comment1</link><guid>http://ayende.com/2919/dynamic-methods#comment1</guid><pubDate>Mon, 29 Oct 2007 20:56:24 GMT</pubDate></item></channel></rss>