[Mono-list] RE: Mono-list digest, Vol 1 #6 - 20 msgs
Tue, 10 Jul 2001 19:01:09 -0400
> -----Original Message-----
> From: Stefan Arentz [mailto:email@example.com]
> > > From: Bob Smith <firstname.lastname@example.org>
> > > Subject: [Mono-list] binding
> > >
> > > I'm looking at implementing the Math class and I was wondering would
> > > be better to implement it from scratch in C#, or bind it to standard C
> > > math functions. Each way is just as portable as the other, both I
> > > will be just about the same performance, the C binding requires less
> > > work, and the C# way would probably be cleaner. What is the general
> > > consensus about binding vs codeing when it comes to making use of
> > > standard C libs?
> > >
> > Bind it to standard C (My vote).
> That defeats one of the great features of an interpreted (jit-compiled)
> system; portability.
Obviously, functions like System.Math.Min can be done in IL. Unfortunately,
not everything will be. Take this example from .Net from System.Math
.method public hidebysig static float64 Cos(float64 d) cil managed
} // end of method Math::Cos
Now load up MSVCR70.DLL in the Dependency Walker and look at ordinal 61
My vote was for the standard C libraries in this case. Feel free to post