Re: My thoughts on C# and gaming.

Douglas Cox <[email protected]>
Newsgroups gmane.games.devel.sweng
Message-ID <[email protected]>
Miguel,

We thought about using Mono for a while, and it still isn't out of the
question.

We have taken some shortcuts to make our implementation a little easier.
For instance we are currently only supporting single-dimension arrays.  And
a few things are cleaner since we're starting off with generic support and
not having to deal with COM.

Maybe this deserves another discussion regarding "What would make C# ideal
for games"? I certainly would like to hear peoples thoughts on it.

-doug

On Tue, Feb 23, 2010 at 7:05 PM, Miguel de Icaza <[email protected]> wrote:

> Hello Doug,
>
> Your description of making a C#-like language looks interesting.   You
> might save some time by reusing our open source C# compiler and adding a
> separate a separate backend that generates your C++ code from it.
>
> > Doing this does have advantages over using Mono or .Net, in that we
> > can fine tune memory allocators and garbage collection to what we want
> > vs what someone else decides to do (see XNA on 360's GC for a reason
> > of why this will be nice).  And we reduce some overhead by not
> > including language features that we do not need (LINQ/etc).
>
> You could plug a different allocator into the runtime and control the
> lifespan of objects if you chose to.   A few years ago we modified
> Mono's VM for to support allocating objects from different pools, the
> hack no longer works, but it is a few hours worth of work.
>
> The basic idea was to add an attribute to a class that stated where the
> data was going to be allocated from, like this:
>
>        [Pool (Constants.ImagePool)]
>        class MyBlob {
>                ...
>        }
>
> The runtime looks this up when it instantiates the class, and instead of
> allocating the objects from the GC, it would allocate it from the given
> pool.   The pool is managed elsewhere and all of the objects are
> disposed with no warnings of any kind.
>
> You do loose the safety (say, you keep an object alive after you
> released the pool), but you get the control that you need.
>
>

_______________________________________________
Sweng-Gamedev mailing list
[email protected]
http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.