12.27.2010

RTTI revamped

I think I can rework my RTTI system in a way, so that you'll never need to specifiy which class is a possible RTTI class or not. As my experiments on garbage collection continue, I found a nice way of simply wrapping elements with a template wrapper instead of deriving their functionalities. That's quite a nice way for that, plus you can really give EVERY class a typeID. Only drawback is that you won't be able to add typeIDs with specifying that Object XY should have one. But well - having one wrapper for EVERYTHING makes it a better deal by default. I still wonder if I should create wrapper classes for normale datatype. You can't just take an int as a baseclass - you'll need a wrapper for that. Well, it's just an annoying amount of type work, so I think I'll leave it to what I originally planned - RTTI only for special objects like in GUI systems.

So far, this stuff is getting really cool and slick now. More like C++'s own class system, like a nice library extension you could need in a lot of cases. I'm also quite happy with the concept of my garbage collector, which I'll better call memory manager, as it doesn't collect the program's garbage, rather the garbage you left and created via a memory manager instance. I'm also thinking about an efficient way to make some kind of second version memory manager that simply acts like memory allocation like in C++. So you can use the garbage collector for important and buggy parts in the code and replacing it with a non-overhead, slimmed-down version. So you can get debugging functionality while running the program at full speed in release mode. I've so far NEVER used a debugger for C/C++ programs, I always created logs and nullpointer checks to be 100% sure where what fails. A debugger is great for really complex problems, but if you manage to find a way for a program to debug itself, it can be a great source information, as it gives the possibility to have one of the most clean views on a running program structure. This stuff will be useful in the future. And instead of tinkering around with slow bytecode languages like Java, I can rely on my own system and still get full speed later. Rejoice!

No comments: