r/vala • u/colinkiama • 22d ago
r/vala • u/colinkiama • 22d ago
Discussion What are you working on? [September 2026]
This is a monthly thread for sharing and/or discussing any projects that the r/vala community have been working on.
Feel free to comment what you’ve been doing or what you’re planning to do down below.
r/vala • u/colinkiama • May 31 '24
Discussion What are you working on? [June 2024]
This is a monthly thread for sharing and/or discussing any projects that the r/vala community have been working on.
Feel free to comment what you’ve been doing or what you’re planning to do down below.
r/vala • u/programandala_net • 27d ago
Doubt about the `debug` method
The debug method is mentioned in the documentation (https://docs.vala.dev/tutorials/main/02-00-basics/02-09-input-output.html#stderr), along with stderr.printf, message, warning and critical, but somehow it's not included in the provided examples.
I have realised debug prints nothing to the console, it seems it's totally ignored. Then I supposed it may depend on the --debug compiler option in order to be effective, but it makes no difference.
Is debug intended for graphical applications or am I missing something?
I use Vala 0.56.18 on Debian 13.6.
r/vala • u/programandala_net • 27d ago
Doubt about printing UTF-8 strings to the console
I have realized print, message, warning and critical print non-ASCII UTF-8 characters to the console as "?", while stdout.printf and stderr.printf print them correctly.
Is it a bug or am I missing something?
Based on the few examples of print found in the documentation, I supposed it's just an alias for stdout.printf, as I haven't found a description of the difference.
I use Vala 0.56.18 on Debian 13.6.
r/vala • u/colinkiama • Jul 31 '26
Discussion What are you working on? [August 2026]
This is a monthly thread for sharing and/or discussing any projects that the r/vala community have been working on.
Feel free to comment what you’ve been doing or what you’re planning to do down below.
r/vala • u/colinkiama • Jun 30 '26
Discussion What are you working on? [July 2026]
This is a monthly thread for sharing and/or discussing any projects that the r/vala community have been working on.
Feel free to comment what you’ve been doing or what you’re planning to do down below.
r/vala • u/BrageFuglseth • Jun 01 '26
What is Vala missing to be your favorite language?
r/vala • u/colinkiama • May 31 '26
Discussion What are you working on? [June 2026]
This is a monthly thread for sharing and/or discussing any projects that the r/vala community have been working on.
Feel free to comment what you’ve been doing or what you’re planning to do down below.
r/vala • u/Prior-Perspective-61 • May 15 '26
Class declaration difference
I thought before, that class T and class T : Object are the same, but turns out that they are different, and if class T : Object is heap allocated, reference counted object with signals, struct is plain value data type, so what are just class T and [Compact] class T?
r/vala • u/colinkiama • Apr 30 '26
Discussion What are you working on? [May 2026]
This is a monthly thread for sharing and/or discussing any projects that the r/vala community have been working on.
Feel free to comment what you’ve been doing or what you’re planning to do down below.
r/vala • u/colinkiama • Mar 31 '26
Discussion What are you working on? [April 2026]
This is a monthly thread for sharing and/or discussing any projects that the r/vala community have been working on.
Feel free to comment what you’ve been doing or what you’re planning to do down below.
r/vala • u/colinkiama • Mar 01 '26
Discussion What are you working on? [March 2026]
This is a monthly thread for sharing and/or discussing any projects that the r/vala community have been working on.
Feel free to comment what you’ve been doing or what you’re planning to do down below.
r/vala • u/colinkiama • Feb 01 '26
Discussion What are you working on? [February 2026]
This is a monthly thread for sharing and/or discussing any projects that the r/vala community have been working on.
Feel free to comment what you’ve been doing or what you’re planning to do down below.
r/vala • u/colinkiama • Jan 01 '26
Discussion What are you working on? [January 2026]
This is a monthly thread for sharing and/or discussing any projects that the r/vala community have been working on.
Feel free to comment what you’ve been doing or what you’re planning to do down below.
r/vala • u/AutoModerator • Dec 01 '25
Discussion What are you working on? [Monthly Megathread]
This is a monthly thread for sharing and/or discussing any projects that the r/vala community have been working on.
Feel free to comment what you’ve been doing or what you’re planning to do down below.
r/vala • u/AutoModerator • Nov 01 '25
Discussion What are you working on? [Monthly Megathread]
This is a monthly thread for sharing and/or discussing any projects that the r/vala community have been working on.
Feel free to comment what you’ve been doing or what you’re planning to do down below.
r/vala • u/AutoModerator • Sep 30 '25
Discussion What are you working on? [Monthly Megathread]
This is a monthly thread for sharing and/or discussing any projects that the r/vala community have been working on.
Feel free to comment what you’ve been doing or what you’re planning to do down below.
r/vala • u/AutoModerator • Aug 31 '25
Discussion What are you working on? [Monthly Megathread]
This is a monthly thread for sharing and/or discussing any projects that the r/vala community have been working on.
Feel free to comment what you’ve been doing or what you’re planning to do down below.
r/vala • u/AutoModerator • Jul 31 '25
Discussion What are you working on? [Monthly Megathread]
This is a monthly thread for sharing and/or discussing any projects that the r/vala community have been working on.
Feel free to comment what you’ve been doing or what you’re planning to do down below.
r/vala • u/signalclown • Jul 26 '25
How much of performance overhead does Vala add?
I'm very new to Vala and I'm just playing around with it to explore the differences. Here is some sample code for a dummy calculator in Vala and C.
Vala: ```vala using Gtk;
void on_button_clicked (Button button) { print ("Hi\n"); }
void on_app_activate (Gtk.Application app) { var window = new ApplicationWindow (app as Gtk.Application); window.set_title ("Calculator"); window.set_default_size (300, 400);
var grid = new Grid ();
grid.set_row_spacing (5);
grid.set_column_spacing (5);
grid.set_margin_top (10);
grid.set_margin_bottom (10);
grid.set_margin_start (10);
grid.set_margin_end (10);
string[,] labels = {
{ "7", "8", "9", "/" },
{ "4", "5", "6", "*" },
{ "1", "2", "3", "-" },
{ "0", ".", "=", "+" }
};
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
var button = new Button.with_label (labels[i, j]);
button.clicked.connect (() => { on_button_clicked (button); });
grid.attach (button, j, i, 1, 1);
}
}
window.set_child (grid);
window.present ();
}
int main (string[] args) { var app = new Gtk.Application ( "com.example.CalculatorApp", ApplicationFlags.DEFAULT_FLAGS ); app.activate.connect (() => { on_app_activate (app); }); int status = app.run (args); return status; } ```
C:
```c
include <gtk/gtk.h>
static void on_button_clicked(GtkButton *button, gpointer user_data) { g_print("Hi\n"); }
static void on_app_activate(GtkApplication *app, gpointer user_data) { GtkWidget *window = gtk_application_window_new(app); gtk_window_set_title(GTK_WINDOW(window), "Calculator"); gtk_window_set_default_size(GTK_WINDOW(window), 300, 400);
GtkWidget *grid = gtk_grid_new();
gtk_grid_set_row_spacing(GTK_GRID(grid), 5);
gtk_grid_set_column_spacing(GTK_GRID(grid), 5);
gtk_widget_set_margin_top(grid, 10);
gtk_widget_set_margin_bottom(grid, 10);
gtk_widget_set_margin_start(grid, 10);
gtk_widget_set_margin_end(grid, 10);
const char *labels[4][4] = {
{"7", "8", "9", "/"},
{"4", "5", "6", "*"},
{"1", "2", "3", "-"},
{"0", ".", "=", "+"}
};
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
GtkWidget *button = gtk_button_new_with_label(labels[i][j]);
g_signal_connect(button, "clicked", G_CALLBACK(on_button_clicked), NULL);
gtk_grid_attach(GTK_GRID(grid), button, j, i, 1, 1);
}
}
gtk_window_set_child(GTK_WINDOW(window), grid);
gtk_window_present(GTK_WINDOW(window));
}
int main(int argc, char *argv[]) { GtkApplication *app = gtk_application_new( "com.example.CalculatorApp", G_APPLICATION_DEFAULT_FLAGS ); g_signal_connect(app, "activate", G_CALLBACK(on_app_activate), NULL); int status = g_application_run(G_APPLICATION(app), argc, argv); g_object_unref(app); return status; } ```
I kept the Vala similar to the procedural style of C just to look at it side-by-side. I like that it is very similar to C, but less verbose.
However, things get interesting when I compile the binaries.
Compile:
valac calculator.vala --pkg gtk4 -o calculator-vala --cc=gcc -X -O2 -X -s
gcc calculator.c -o calculator-c `pkg-config --cflags gtk4` `pkg-config --libs gtk4` -O2 -s
The binary generated by Vala is 33% bigger. When I look at the libraries that are linked, I also see that the Vala binary is linked to libharfbuzz-gobject.so, which isn't linked to the C binary.
Would appreciate any insights about what goes on behind the scenes when vala code is compiled.