# Why choose Vala to build Kangaroo?(Updated at 5/20/2022)

# Some thoughts about building Kangaroo

While I decided to build my own app, the most important thing is that what kind of talents of the new app should have? I think they are:

  1. Performance: native performance is the best.
  2. Keep code safe: the app must be safe to against to be cracked.
  3. Platform independent: support all platforms like Windows / macOS / Linux.
  4. Technology maturity: the technology stack could support to gain the business purpose, I need the money to continue the work.
  5. Master it easily: Language must be simple and powerful, sure it is familiar by yourself.

I had reviewed some kind of framework and languages like: QT / C++ vs WxWidget / C++ vs GTK-mm / C++ vs GTK-rs / Rust / Go-GTK / Go vs GTK / Vala

finally, I chosen GTK / Vala combination to be the Kangaroo's tech stack.

(adsbygoogle = window.adsbygoogle || []).push({});

# Benefits and strength from Vala

  1. Syntax compatible with C# and Java
    It gives your apps the performance of C/C++ with the productivity of C# and Java; pls see:
    Vala for Java Programmers (opens new window) Vala for C# Programmers (opens new window)

  2. Automatic memory management without GC
    Vala's memory management is based on automatic reference counting, no GC, no GC performance issue.

  3. Mixin interface support
    Vala's interface like PHP's traits and JavaScript's mixin.

  4. Dot(.) connect every thing
    DBKangaroo project has more than 400 source code files, divide them as three subproject with many namespaces and many levels, all of them connect with the character dot(.), and they work greatly and smoothly.

  5. First class regex expression support
    Regex expression treat as first class member, simple and powerful. Regex expression be used everywhere in DBKangaroo.

GLib.MatchInfo regex_match;
Regex regex = /(?<x>[\d\.\-]+),(?<y>[\s]*[\-\d\.]+)/mi;
if (regex.match(text, 0, out regex_match)) {
    point_new.set_x(double.parse(regex_match.fetch_named("x")));
    point_new.set_y(double.parse(regex_match.fetch_named("y")));
} 

Special gift: a powerful regex online tool: Regex101 (opens new window)

  1. Performance of C/C++ with great interoperability
    Vala produces C code as intermediate language to support all platforms, Vala code and C code could be compiled in the same project。

  2. Rich and powerful libraries
    There are 300+ Vala bindings for GNOME foundation and other populary project. VAPIs @ Github (opens new window) VAPIs @ Project (opens new window)

  3. Excellent documentation
    Vala has excellent documentation, be it in the form of tutorials (opens new window), code samples (opens new window) or a very easy-to-use API Reference (opens new window).
    Vala projects at GNOME (opens new window) Vala projects at Github (opens new window)

  4. Visual Studio Code with Vala language server support
    The best Vala IDE is Visual Studio Code (opens new window) + Vala plugin (opens new window) + Vala language server (opens new window) + Meson(Ninja)/MSYS2, enjoy them, comtribute them, we can.

  5. Elementary OS team's primary language
    Elementary's blog will tell you the truth: Why we write elementary apps in Vala (opens new window)

Last Updated: 2023-10-17T03:57:42.000Z