~ubuntu-branches/ubuntu/raring/vala-0.20/raring-proposed

« back to all changes in this revision

Viewing changes to doc/vala/overview.xml

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2013-04-05 13:45:05 UTC
  • Revision ID: package-import@ubuntu.com-20130405134505-yyk3rec9904i7p8o
Tags: upstream-0.20.1
ImportĀ upstreamĀ versionĀ 0.20.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
<section id="overview">
 
3
        <h>Overview</h>
 
4
        <p>Vala is a new programming language that aims to bring modern programming language features to GNOME developers without imposing any additional runtime requirements and without using a different ABI compared to applications and libraries written in C.</p>
 
5
        <section id="gettingstarted">
 
6
                <h>Getting started</h>
 
7
                <p>The classic "Hello, world" example in Vala:</p>
 
8
                <blockcode>
 
9
using GLib;
 
10
 
 
11
public class Sample : Object {
 
12
        public Sample () {
 
13
        }
 
14
 
 
15
        public void run () {
 
16
                stdout.printf ("Hello, world!\n");
 
17
        }
 
18
 
 
19
        static int main (string[] args) {
 
20
                var sample = new Sample ();
 
21
                sample.run ();
 
22
                return 0;
 
23
        }
 
24
}</blockcode>
 
25
                <p>Store the code in a file whose name ends in ".vala", such as <code>hello.vala</code>, and compile it with the command:</p>
 
26
                <blockcode>valac -o hello hello.vala</blockcode>
 
27
                <p>This will produce an executable file called <code>hello</code>.</p>
 
28
        </section>
 
29
</section>
 
30