# Why choose Vala to build Kangaroo?

# Some thoughts about building Kangaroo

While I decide to build my own app, giving the talent to app is the most important thing, what kind of talent the new app must have? I think they are:

  1. Performance: native app's speed is the best.
  2. Keep code safe: the app must have capability to against reverse-engineering or modification, by making it difficult for a third-party to access your source code.
  3. Platform independent: one copy of code can compile all of platforms.
  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 musts familiar by me.

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. 语法兼容C#和Java,表达能力强,生产力高

有C#/Java 的强大表达能力,又有原生编译的性能和速度,更有接地气的独特特性;

Vala for Java Programmers (opens new window)

Vala for C# Programmers (opens new window)

  1. 内存所有权和使用引用计数管理,内存使用安全无烦恼

  2. 支持接口:支持抽象接口,也支持接口实现

接口实现类似于PHP traits 和 JavaScript 的 MIXIN 的功能;

  1. 点分名字空间支持大型应用开发

DBKangaroo 工具编写了 210 多个源码模块,至今用起来很顺,一个点(.)搞定;

  1. 语言级别的正则表达式支持

正则表达式给予了我强大的力量,在我的代码中无处不在,越用越熟练。
顺便推荐在线好工具: Regex101 (opens new window)

  1. 有C的速度和良好的互操作性支持

可以生成C头文件和C代码并获得全平台支持,也可以Vala与C混合编译。

  1. 强大且成熟的类库支持(官方支持约250个库)

基于GLib的强大类库体系,有工业级成熟度的各种库和GUI框架。
默认基于 GObject 的对象系统,也支持构建自己的单根对象体系。

  1. 有丰富且完善的文档支持,也有大量开源项目可供参考学习

Vala 官方在线文档 (opens new window)

Vala 项目集合 1(GNOME) (opens new window)

Vala 项目集合 2(Github) (opens new window)

  1. 有多种语言服务器【LSP】实现,支持各种编辑器和IDE

Vala Language Server on GNOME by Daniel Espinosa (opens new window)
最新版本为0.14.1,已实现Vala 语言服务器(LSP 1.4) ,支持代码自动完成,并快速演进中......

Vala Language Server on Github by Ben Iofel / Princeton Ferro (opens new window)
正在开发中,还未发布版本,已支持跳转到定义,代码自动完成正在实现中......

Visual Studio Code (opens new window) + Vala (opens new window)
VSCode 仍然是最值得推荐的IDE

  1. Gnome 和 Elementary OS官方钦定语言,并获得IBM公司研究机构采用

有大型机构和大公司采用 Vala 能给予普通开发者更大的信心加持, 采用 Vala 的完整公司列表 (opens new window)