Development using Vala?


mots

Member
Joined
Oct 24, 2005
Messages
257
Hey, I'm a python scripter, but think python is too slow for serious 3d-development. I can handle languages like java or c# as well, but they are still quite slow and anything above that is just too annoyingly low-level to me, making me pretty unproductive. Now I've found something that looks like it could be the solution to my problem: Vala. As far as I understood it, it's a language pretty similar to c#, with one BIG difference: It isn't compiled to VM-bytecode, but to pure c, which can then be compiled to native binaries. The advantage of this approach: speed!
bench-time.png

So, could vala be used to develop cross-platform games?

Please ignore mistakes, I might not be completely sober yet ;D
 
Well, it seems to be open-source, being based on GTK stuff.
It should certainly be able to use native C libraries like OpenGL, so as long as someone ports it, it should work fine.

I would disagree with the idea of Python being too slow for '3d' stuff.
As much as I dislike Python, it is probably easier to write in than C++, and if you're already using a C library to do all your matrix work, and simply calling that from Python, most of the calculation is already done in native code.

Python is definitely slow, but that's why you only use it for overall design, and you make C and C++ do the math work.
*says the person who exclusively programs in C++ because he thinks Python is too weird*
 
I've done small test applications in Vala over the last year. I think it'll work out OK for me, simply because I want to write gtk applications and I don't want to do all the gtk stuff by hand in C (this is what Vala does for you, in addition to being object oriented), and glade isn't always the right alternative for avoiding the handwork. C++ and GTK isn't the best combo (gtkmm and other wrappers are poorly maintained) and anyway I'm most definitely not a C++ guy anyway.

Vala may still be changing though, at least it has been changing constantly over the last year. I.e. your code of September may not compile now. But I think it's starting to settle down.

Even when the actual Vala compiler isn't ported to the target it's still possible to develop on another computer, translate the result to C, and compile the C code on the target.

Oh, and Vala comes with an alternative built-in compiler too.. for a Python-like language. It's not widely announced, and I can't even remember the name of the language, but if you write a source file with a .gs extention like so:
Code:
init
        print "Hello World"
it'll do the right thing.
 
mots said:
python is too slow for serious 3d-development.
I get over 2000 fps on an average quake 3 map with Pyrr. Just offload the 3D to existing C binaries like the irrlicht engine and do the fun stuff in Python.
untitled-1.jpg
 
Yes, you're right, python isn't too slow for development, it's just a PITA to deploy on windows (I did some pyogre and windows deployment was horrbile). So I'd love to have a non-interpreted alternative, which Vala seems to provide
Genie seems very interesting, though :D
 
mots said:
Yes, you're right, python isn't too slow for development, it's just a PITA to deploy on windows (I did some pyogre and windows deployment was horrbile). So I'd love to have a non-interpreted alternative, which Vala seems to provide
Genie seems very interesting, though :D
Deployment issues? I've deployed ogre4j with jBullet including platform-dependent native libraries, it took ages to set up... Only positive thing about it was that it ran on all platforms (Win, Lin, OSX, Solaris, BSD, mobile) without recompilation/modification.

Anyways, to step from C to C#-ish is a step backwards IMHO; I don't find C# to be a well-constructed language so it's not something you should try to imitate. I'd chose a completely different language if I were you (like, I dunno, Java? :p).
 
mots said:
it's just a PITA to deploy on windows
In what way? I just use py2exe or Freeze, then the user doesn't need to have any other things like the Python interpreter already installed. All you need to do is wrap up the exe, any referenced dll files and your media files into a zip file and you're done.
 
dflemstr said:
Anyways, to step from C to C#-ish is a step backwards IMHO; I don't find C# to be a well-constructed language so it's not something you should try to imitate. I'd chose a completely different language if I were you (like, I dunno, Java? :p).


C# is basically Java done right ...

Comparing C to C# makes no sense ... one is a low level language for hacking libraries or perhaps small and tight codebase ... the other full blown language for middle-tier development.
 
warmi said:
C# is basically Java done right ...
1996 - James Gosling invents Java by removing a bunch of useless features from C++ and cramming extra features in their place. Java is hailed as a great success.
2001 - Anders Hejlsberg invents C# by removing a bunch of useless features from Java and cramming extra features in their place. C# is hailed as a great success.
2009 - ??? invents C++09 by removing a bunch of useless features from C# and cramming extra features in their place. C++ is once again hailed as a great success.
:D


*concept stolen from http://james-iry.blogspot.com/2009/05/b ... wrong.html
 
WizardStan said:
2001 - Anders Hejlsberg invents C# by removing a bunch of useless features from Java and cramming extra features in their place. C# is hailed as a great success.
Well, sadly, this is where it all went wrong, for you see, the creator of C# didn't remove anything from Java really, but instead added loads and loads of stuff: Some good things, like operator overriding/overloading, or structs, and some really, REALLY bad stuff (in the sense that "goto" is bad: useful, but can lead to really bad problems if used incorrectly) like:
- PInvoke (unportable and unsafe)
- "native { }" sections (can be used for hacks, are unportable, and introduce memory leaks)
- "lock() { }" sections (often lead to unexplainable deadlocks)
- Attributes (can cause unexpected behaviors and security issues)
- Unforced exception handling (If you allow a method to spit out any exception it likes, how the heck are you going to catch all of them? Especially if the framework you are using is closed-source... You're forced to use a "catch (Exception ex)" every time.)
- Global variables (we see which problems that brought us in C)
- The "goto" statement (yep, not kidding... Do I need to explain why this is bad?)
- LINQ (can be useful, but shouldn't have been done in syntax but instead as a library so as to make cleaner code)
- A very messy array creation system with multidimensional arrays and weird collection constructs ("Dictionary<int, string>[,][][,,] myDictionaryArray")
- An, in my opinion, too useless "foreach" system.
- A badly constructed GUI system (It's very difficult to get a Form to scale it's contents proportionally without using various Panel setups that consume memory ,and even then it's not what you want half of the time)
- A very incomplete API in some cases (Try scaling a System.Drawing.PointF by a factor, or try inheriting a System.Drawing.Brush; it could've been handled better...)

To create a language while trying to copy something like C# is doomed to fail.
 
Kramy said:
dflemstr said:
WizardStan said:
... it was a joke :(
Yes, I know, I just wanted to cease the opportunity :p

Seize. ;)
And me who's been complaining about "they're" and "their"... I even thought it sounded wrong, too, bout oh well, t'was just a silly mistake I guess :p
The product of not living in an English-speaking country.
 
Jan-Nik said:
Tor said:
I can't even remember the name of the language
Genie: http://www.puppylinux.com/genie/
Thanks!

As for C derivatives.. D seems to have come a long way since the first time I looked at it. Just getting a 'printf' done right deserves a medal (although they had to back off using the actual 'printf' name.. for easier C porting I guess. Oh well.)
But I haven't done enough programming in D yet to know how it feels long term.
 
Back
Top