Re: My thoughts on C# and gaming.

Miguel de Icaza <[email protected]>
Newsgroups gmane.games.devel.sweng
Organization Novell, Inc.
Message-ID <[email protected]>
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.