[Mono-list] PInvoke Conventions
James Perry
jeperry@uwaterloo.ca
Mon, 30 Jul 2001 23:29:17 +0100
> >Microsoft certainly don't have to concern themselves with this - they
> >aren't aiming to make a portable runtime.
>
> I'm doubting this. MS themselves have probably thought about
> portability problems - they must be targeting 64 bit at some point,
> they must have thought about this. And MS has actively supported
> porting .NET to other architectures. It's possible the current
> implementation hasn't thought this through, but MS is going to be
> interested in a solution, too.
Yes, they will have to support multiple architectures (PocketPC/WinCE, and
Win64 come to mind), but they don't have to worry so much about a portable
runtime. If Microsoft want to move their current framework to Win64 they can
take their current version and modify it by hand if necessary, something
that really isn't an option for Mono. Similarly, they've said their
shared-source implementation of .NET will be for FreeBSD; they haven't
mentioned any other platforms and I don't get the impression they're aiming
for ease of portability to other platforms in that project. I certainly
wouldn't rely on it. :)
Unless I've been mistaken about the goals, Mono is intended to be very
easily ported from architecture to architecture (and having
platform-dependent libraries doesn't seem a very good end to this goal),
given the number of different platforms that exist now, hand-modifying the
runtime for each and every architecture simply isn't reasonable or feasible;
noone wants Miguel to die of a heart-attack or anything (well, maybe some /.
posters...;).
As I said, though, IMHO I think they've provided enough to create a platform
independent implementation of PInvoke without any necessarily fiddling with
custom attributes or external wrappers. :)
> This problem isn't unique to Mono, it'd be a good place to come
> together with engineers from other implementation efforts to come up
> with a common solution.
Yes, ultimately if the System.Runtime.Interop stuff /doesn't/ provide enough
to fully implement PInvoke then a platform-dependent solution (beyond the
runtime, of course) would be necessary, a common solution would be a good
way to partially deal with the lack of portability.:)
- James Perry