Conversation

Are you using Vala? Are you *not* using Vala?

What is missing to be your favorite programming language? What could we improve to make it more suitable for your use cases?

Let us know over at https://discourse.gnome.org/t/what-is-vala-missing-to-be-your-favorite-language/35239

4
4
0
@bugaevc Is Vala supposed to be my favourite language? Last time I used it, it was simple domain-specific language for Gtk apps. It was not "safe", nor it probably should be, due to performance constraints.

So I guess I'll keep using Python where it makes sense.
1
0
1

@pavel well, this was primarily targeted at GNOME people, not kernel hackers :D

But yeah, it's not tied to GTK at all (and there's a WIP mode where it's not even tied to GLib), you could just use it to write stuff, same as how C is not really tied to Unix, even though that's where it originated.

2
0
1

@pavel Compared to Python, it doesn't require a separate interpreter, has no GC or any special execution model (runs just like C), has really good interop with C in both directions (you can write a library in it and then use it from C).

1
0
1
@bugaevc Yeah, I know. It has rather nice string abstraction for being C-ish. But last time I check, it was not "safe" -- you could confuse it and get segfaults.

Plus, really, Vala is not a language in a same way Python or Rust is. I would not recommend it inside kernel, for example.

For Gtk, Python support is pretty cool, but I'd really like to see better Rust support. Not easy, I know, but Rust is well-known high-performance language.
1
0
0

@pavel yeah, it's not "safe" in that way, you can write use-after-frees in it. So would making it "safer" make it a lot more attractive to you, or would you not like it anyway?

wdym it's not a language in the way others are? For Rust and GTK, there is excellent gtk-rs 🦀, though unlike Vala it does have (unavoidable) overhead.

1
0
0
@bugaevc If Vala was safe in a way Rust is, and stayed simple... Yes, that would be huge game changer, because we would be doing Vala, not Rust, I suspect.

For gtk-rs, overhead was not a problem, writing anything useful with it was. My impression was Gtk really likes callbacks, and Rust really, really hates them.
0
0
0

@bugaevc wait! is the posix mode back to Vala? I had to workaround that to keep some of my non glib projects alive at the time.

1
0
0

@pancake it absolutely is, and we want to keep improving it, e.g. make both compact and non-compact classes work

(compact classes don't have run-time type info, regular classes do, so you would be able to do run-time type checks, use interfaces, etc, just without GObject)

so that would matter for you a lot?

0
0
0

@bugaevc After writing some Vala this week, I would really love it if we could just put libdex into the core of the language and remove the GAsyncResult/GTask code emitters.

Make structured concurrency built in, and if anything is missing, lets get it into libdex.

Drop the glib compat levels, it makes every language design problem 3-5 problems. Probably easier to aggressively use GLib features and backport occasionally if necessary.

1
0
0

@chergert @kolunmi this is something that I never quite understood, what sort of integration with libdex would you like the core language to have? You can just use libdex today, here's an example, ported from your TCP example: https://p.ip.fi/VkUf

Removing regular async is certainly not going to happen. But why would you want that?

So yeah, I'd be happy to improve something here, but I don't understand what needs improving.

1
0
0

@chergert @kolunmi something better for structured concurrency is something I'd love to have. My idea was stealing "async let" from Swift (would become "async var" in Vala) — this matches up really nicely with GAsyncResult semantics. Then you could have an "async switch" to check which of a few pending operations have completed.

1
0
0

@chergert @kolunmi One issue with this is it still wouldn't be fully structured, because you have to juggle cancellables explicitly, and ensure that you cancel and await everything on all exit paths.

0
0
0

@bugaevc i really liked it when i was building nontrivial stuff with it some 11 or so years ago, but i fell off it because of its atrocious mostly non-existent documentation and various problems with iirc gobject that basically condemn it to being just a linux language

0
0
0

@bugaevc @gnome I tried it briefly a couple years back, but found it really hard to learn. Maybe the documentation wasn't quite it, although I expect some of my difficulties could have been from a being new-to-gtk perspective

It's very well possible, that things have gotten a lot better since then

1
0
0

@daniel this is really really surprising to hear, because our intention, and my personal impression, with Vala is the opposite: that it's instantly obvious, familiar, and just makes sense. And no, I don't think it changed much in the last few years. So it would be good to identify the issues you have run into and get them fixed.

0
0
0