Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vala (C#-like language) compiles to C?

Tags:

c

gtk

vala

I'm a C# developer who stumbled across a new programming language for linux called vala. It has almost exactly the same syntax as C#, which is awesome. I never really was a big fan of Mono. This allows programmers to write GTK+ apps in a C# style language. My question is: Does vala get compiled into C?

like image 874
Kredns Avatar asked Mar 17 '09 01:03

Kredns


People also ask

What is Vala used for?

Vala is intended to provide runtime access to existing C libraries, especially GObject-based libraries, without the need for runtime bindings. To use a library with Vala, all that needed is an API file (. vapi) containing the class and method declarations in Vala syntax.

Is Vala a good programming language?

While it is true that a more mainstream language would lower the barrier to entry for new first-party and third-party developers, Vala has proven to be a tremendously effective tool for our needs. Vala is an object-oriented programming language developed by the GNOME Foundation, which was first released in 2006.

What is in Vala?

Vala is a programming language using modern high level abstractions without imposing additional runtime requirements and without using a different ABI compared to applications and libraries written in C.

Is Vala dead?

But as they prepared to take the route themselves, an Eclipse cultist armed with a machine gun appeared and opened fire. Vala, caught out of cover, was shot to death.


3 Answers

Yes, Vala is compiled directly to C. From the Vala homepage:

valac produces C source and header files from Vala source files as if you've written your library or application directly in C. Using a Vala library from a C application won't look different than using any other GObject-based library. There won't be a vala runtime library and applications can distribute the generated C code with their tarballs, so there are no additional run- or build-time dependencies for users.

You can read more about it here (and also get tutorials, mailing lists, et cetera). It's quite an interesting project.

like image 93
John Feminella Avatar answered Oct 09 '22 06:10

John Feminella


From Wikipedia:

Rather than being compiled directly to assembler or to an intermediate language, Vala is compiled to C which is then compiled with the platform's standard C compiler.

like image 14
Chris Lutz Avatar answered Oct 09 '22 07:10

Chris Lutz


As John and Chris pointed out, Vala does indeed get compiled to C.

In fact, you can see the generated C code by running the Vala compiler with the -C (or --ccode) flag.

like image 11
Can Berk Güder Avatar answered Oct 09 '22 07:10

Can Berk Güder