Explore Vala!

CHALLENGE:
Try out Vala by making a simple app of any kind.
INTRODUCE THE LANGUAGE/TECHNOLOGY: Vala is a relatively new programming language (currently 0.7.9) that is designed as a wrapper for C and GLib/other GNOME Technology . It has support for OOP, generic programming, and assisted memory management. They language is very easy to read and write, and even 'noobs' could be writing programs in no time at all. Vala is also unique in the fact that is borrows much of it's syntax from both C#/Java as well as C++. This gives the language the ability to make developing easier/faster, without giving up any power.
IDEAS:
- Port pre-existing code
- Write an algorithm
- Test out it's many library bindings such as Gtk+ and OpenGL
RESOURCES:
The mother-load of information is on the Official Vala website:
http://live.gnome.org/Vala
Tutorials for both noobs and experienced:
- http://live.gnome.org/Vala/Tutorial
- http://live.gnome.or...harpProgrammers
- http://live.gnome.or...JavaProgrammers
Link to compiler/good IDE downloads:
http://code.google.c.../downloads/list
HOW TO GET STARTED:
I'm currently working on a tutorial for the Vala language that I plan to submit here on D.I.C. later on. Here is the first lesson (greatly shortened). It explains setting up Vala, and compiling a Hello World program.
Setting Up The Development Envionrment
Setting Up The Vala Compiler
If you already have valac installed, you can skip this section
The first step to setting up valac is to download it. Here is the direct link for the most current version (at the time of this writing) for Windows:
http://valide.google.../vala-0.7.8.exe
If you are using a different OS, or would like to see what else is available, you can look here (there might even be a newer one
*Five Minutes Later....*
Ok, now that you got it on your hard drive, we're ready to install. Go ahead and run the .EXE. The process for Windows 7 (and most other versions of Windows I assume) is as such:
- Select Language
- Next to start
- The license, accept it
- It will ask you what you want to install. Select what you want and continue.
- Choose the destination folder and click install
- You're done
To make sure is really worked, open a terminal and type 'valac'. As long as it doesn't say that the command wasn't found, you're good to go.
Compiling Vala
Now my conscious won't let me go any farther without a hello world example (Don't ask why
using GLib; // not required
public class HelloObject : GLib.Object {
public static int main(string[] args) {
stdout.printf("Hello World!");
return 0;
}
}
OK, valac compiles '.vala' files, so you'll need to paste this snippet and then save it as nameOfFile.vala. Compiling it is pretty straight forward. Open a terminal and run the following commands:
$ cd directory_were_vala_files_is
$ valac nameOfFile.vala
If there were errors, you'll need to fix them and recompile. Pretty easy huh? (I know I'm cool
$ nameOfFile.exe

New Topic/Question
Reply





MultiQuote





|