martes, agosto 31, 2004

6 Invitations to

Today when I opened my gmail's inbox, the first thing I saw was the text in red, saying "Invite 6 friends to". Currently, almost all the people I know has already an account. Furthermore, almost all my friends hate internet, which is a bad thing. I wonder if they will be deleted or what.

Collection class finished
After two days without work station, and after a day in which I was totally sick, I could check for compatibility for this class with the .Net implementatiion. It looks like everything is ok, and all my tests were good. However, with gmcs I still can't compile -I still wonder why-.

Probably I will be committing to cvs tomorrow.

viernes, agosto 20, 2004

Bad, bad, bad

Ok, ok, I know, Mexico is not having a good time at Olympic Games. We could say that it is because of the government, the social problems, and things like that. And in fact, the could all be true. But for me, that represents the big, huge, importance of preparing yourself for your objectives. That's all. If you know your rivals are as twice strong as you, then you must go and get four times the potential you have.

Yesterda I heard at a tv show that the "heroes" from Mexico had arriven to Greece. Well, they lose one or two hours ago. Pretty bad. And it is very sad to observe that lot of people representing Mexico at the OG needed to train themselves for 4 years, every day, having to work, or to study. Now, imagine you are one of them, and that a small mistake makes you lose in your are. Bad, isn't it?

The most important thing is that all those persons that have to work harder and harder every day to do anything (sport, coding, etc) is that they must train and go to their limits from day to day. That's the only way I can imagine it.

Congratulations to those persons that go to OG and had to lose again the best of the best in this world. Increible that we still have people who can go beyond with almost nothing support by the government and its departments. Let's go, people!

A little paper about GC
Garbage collections is the routine of managing the memory in a certain environment. Maurimal (Mauricio's friendly name) got an excelent paper about GC here. Now I will have something to play with until I wait for that-gc-book-you-have-heard-about. Thanks Maurimal, you are my hero.

Linux event
Here in Puebla a Linux event will take place in the next month. It is an event ths is done yearlyby the Linux user group from Puebla and that intends to show to the people the big big power of Linux and the Open Source software.

Currently a call for papers is having place right now, so, if you think you have something to say, and something that someone should hear, then, send your paper!

I hope to see people from different universities in that event. If everything goes well, we will have Arturo Aldama Espinoza, Mancha, Gunnar Wolf and Federico. More info can be found here.

miércoles, agosto 18, 2004

Generics and more generics

While waiting for the GC Book Federico will lend me in a marvelous action, I'm working at Generics, a new feature that will be part of the Mono 1.2 release for next february and that will have compatibility with the .Net 2.0 from MS.

Currently I'm working implementing some classes in the System.Collections.Generic, specially in the Collection class, that it is designed to be the base for custom classes that need to keep a collection of objects, thus avoiding writing a new collection class from scratch. It is a small and easey-to-implement class, however, this is a great chance to code Generics and learn a lot of them. I highly recommend the document in the Generics site to understan the way they work and the internals to make this feature happen.

Some notes about Generics
There may be some people who doesn't want to go and read that paper, because of its complexity or because its size. For them, some notes about thus new feature called Generics, or Parametric Polymorphism.

Currently the collection classes (Stack, Queue, ArrayList, etc) use System.Object as a wrapper for the data (this could be the equivalent to void* in C world, but not exactly the same). However, this impact a lot in performance, beacuse when you use reference-based variables (instance classes, e.g. System.String), the runtime will have to 'wrap' your variable. Something worse happen with value-based variables (e.g. System.Int, System.Long, System.Enum, etc), because they originally live in an area called 'runtime stack', that make them very light, and thus casting them to be of type System.Object will create a reference-based variable, using more innecessary space and also creating an almos useless additional variable.

Then, when a value based variable is passed as argument for a method, it will be automatically casted and impact performance. When an instance class is passed, the impact will be smaller, but it will exists. Obviously, this can cause some coders to re-implement a custom collection class.

Because of that, Parametric Polymorphism exists. It is a feature similar to those 'templates' in C++ world (note that I'm not a C++ guru). As far as I know, templates is a mechanism similar to macros in C world, but better. Now, imagine you can use the capabilites of the CLI (Just-In-Time compilation, Metadata, etc), and then you will have an interesting design, creating custom classes based on the 'generic' class. So, everytime a class is requested, the runtime will check for it: if it previously exists, it will re-take the stubs; if not, it will create it.

Imagine the code:

class GenericClass <T> {
int Add (T item) {

Observe the new parameter, ''. The 'T' will be an alias for the types passed in the creation of the new class. This alias will be used along all the class definition and then will generate it depending on the type. For example, you could declare it as:

GenericClass <int> gclass = new GenericClass <int> ();
Add (6);

The above code will be valid, because the int type will be used as the base class,
having emitted code like:

int Add (int item) {...

Im my opinion, this is a great feature, and I recommend again the lecture of the paper that is on the Generics site.

lunes, agosto 09, 2004

Bad Days

There are days when you you so much problems that you can't believe it. Well, I'm in those days: my cpu got broken, my internet connection was having trouble the entire day, I couldn't go to see Federico last Saturday ... I only hope to have less problems in the next days ...


Finnaly done with the Generics Paper Lecture. It is very impressive that a lot of ideas behind it are a little old, and the way they were taken. Now I think I'm ready to begin implement some classes and test for the .Net 1.2 compatible Mono release (expected in next february).

Also, I can't wait to see Federico and read that Richard Jones' GC book. I hope to be at Xalapa next weekend or something like that ...