Hace tiempo hice mis primeros pinitos en mono, mediante ASP.NET pero como ya puse en ese post, no me terminaba de convencer que las decisiones de la comunidad libre sean inexistentes y quedemos vendidos a mono frente a una política comun en Microsoft: Adoptar, Extender y Extinguir.
Vala es una alternativa a mono iniciada por los desarrolladores de GNOME:
http://live.gnome.org/Vala
Aqui unos benchmarkings, como podeis observar, su rendimiento comparado con mono es aplastante, y juega en la misma liga que los mismisimos C/C++.
Nombre del benchmarking | C++ | Mono | plain-C | Vala |
mandelbrot | 14.50 | 54.61 | 12.39 | 13.13 |
partialSums | 33.04 | 56.13 | 35.00 | 34.95 |
recursive | 12.94 | 30.14 | 8.44 | 8.72 |
binaryTrees | 27.87 | 43.87 | 21.56 | 30.84 |
sumFile | 17.11 | 22.89 | 13.99 | 15.06 |
fannkuch | 11.46 | 27.05 | 11.26 | 12.44 |
spectralNorm | 32.82 | 49.82 | 33.25 | 33.36 |
nsieve | 25.32 | 28.03 | 25.31 | 25.09 |
De hecho lo estoy considerando para programar videojuegos, ya que es lo que siempre he deseado, un alto nivel que te ahorra tiempo con eficiencia de código nativo, sin maquinas virtuales. Lo digo por este ejemplo de Vala en OpenGL: http://live.gnome.org/Vala/OpenGLSamples
Como inconveniente, habría que analizar su capacidad de multiplataforma (incluso con KDE).
Por último os pasteo un poco de código de Vala para que veais que se aprende en 2 tardes sabiendo algo de C/C++/C#.
public class NumberGuessing { private int min; private int max; public NumberGuessing (int min, int max) { this.min = min; this.max = max; } public void start () { int try_count = 0; int number = Random.int_range (min, max); stdout.printf ("Welcome to Number Guessing!\n\n"); stdout.printf ("I have thought up a number between %d and %d\n", min, max); stdout.printf ("which you have to guess now. Don't worry, I will\n"); stdout.printf ("give you some hints.\n\n"); while (true) { try_count++; stdout.printf ("Try #%d\n", try_count); stdout.printf ("Please enter a number between %d and %d: ", min, max); int input = stdin.read_line ().to_int (); if (number == input) { stdout.printf ("Congratulations! You win.\n"); break; } else { stdout.printf ("Wrong. The wanted number is %s than %d.\n", number > input ? "greater" : "less", input); } } } public static int main (string[] args) { var game = new NumberGuessing (1, 100); game.start (); return 0; } }
Fuente:
http://live.gnome.org/Vala
http://code.google.com/p/vala-benchmarks/wiki/BenchResults
Filed under: .NET, ASP.NET, c#, juegos, mono, programación, software libre | 3 Comments »