After talking to some folks yesterday, I realized that there are a lot of people who likely drive by this blog, take a look at my RbDynamicMethod project and wonder if I’m out of my mind. Surely John can’t be advocating that we all go out and write CIL code using Ruby!
I’m really happy to see that at least Anders Noras gets the core idea behind why I’m creating RbDynamicMethod in the first place: I want to put a more humane interface on top of the DynamicMethod API that was introduced in .NET 2.0. RbDynamicMethod will make it much easier for me to define the CIL shims that must be generated on the fly when some Ruby code wants to call some CLR code (and vice-versa).
I found after writing my first bridge entirely in managed C++ that it was just too difficult to see the CIL through all the code that was required to create it. And when the complexity of the shims went up (to deal with generic method overloading for example), I knew that it was time to hit the reset button.
I’m writing my first bits of CIL test code to interact with generic types in the CLR today. It’s forcing me to change things slightly in RbDynamicMethod, and I’ll post the results of those experiments shortly.