[Mono-dev] Guestimates for effort to port Mono to game console?

Miguel de Icaza miguel at novell.com
Tue Oct 16 00:32:54 EDT 2007


Hello,

> Can anyone give me a guestimate on the effort to port the mono runtime
> to an embedded PowerPC system (Wii and maybe even 360 if MS's 360 CLR
> doesn't stack up) and/or any hints as to what that would entail?  We are
> considering going this route so that we could use C# for the scripting
> needs in our games instead of Lua (what we are currently using and
> finding quite unsatisfactory) or a hypothetical home-brew dynamic
> language.  I've read through http://www.mono-project.com/Porting and
> everything it says sounds straight forward, but the sentence "If the OS
> doesn't support POSIX and the standard libc calls, you'll likely have to
> make changes in many places" has me concerned.  Not only does the Wii
> lack posix support for things like disk IO, it doesn't even have a
> harddrive.  

The page in particular details what is needed to have a complete
implementation of the Mono runtime on a given platform, and not having
Posix is a bit of a problem.

Now, for a game engine there are plenty of features that could be
disabled and this would most likely eliminate most of the Posix
requirements.

The only strict requirement (because it is not easy to remove) is to
have a decent threading API, something similar to POSIX threads is what
you will need to port.

> Ideally, what we would end up with is a tool chain running
> under Windows that can build native Wii code out of a (restricted
> subset) of a CLR assembly and statically link that with a Wii port of
> the runtime.  No JIT, no dynamic loading of assemblies, etc.

That particular setup seems like a lot of work;   It is possible, but it
will require a lot of work on the Mono runtime, it is not designed to
generate purely static code.  

Even the Mono AOT setup requires some amount of dynamic code generation.

> I realize that this is a absurdly open-ended question, but it's the
> question I need to come up with an answer to.  Even responses along the
> lines of "that's phycho -- it would take man-years" or "a smart dude w/
> compiler and language runtime experience could pull it off in a
> couple-three months" would be helpful.

Ok, so your setup is doable.   

If I had to be writing games for the Wii, I would certainly pick Mono
(shocking, shocking!) and would keep the JIT engine in place and just
make sure that this works.

Alternatively, if you can not afford the JIT time (which even us are
hard pressed to find a case where JIT is too slow) you could use AOT
with the standard Mono development process.

I would not attempt the 'static-link-everything' because it is not
necessary and it is just too much work.

Miguel.



More information about the Mono-devel-list mailing list