c - Vala 和 Genie 生产准备好了吗?

标签 c vala gobject genie

<分区>

我正在处理一些遗留的 C 代码,我需要对其进行重构和全面清理,以删除意大利面条式编程,遵守 DRY 原则等。

我正在考虑使用 C++ 重写,但我不想走那么远,并希望尽可能接近 C(同时使用一些 OOP 概念 [无需手动编写代码])。

我最近遇到了 GObject、Vala 和 Genie。后两个是相当新的。有没有人知道生产代码中使用了 Vala 或 Genie?

最后但并非最不重要的一点 - 是否有两种语言之间的优缺点比较列表。我有点倾向于 Genie,因​​为我喜欢 Python 并且不太热衷于 C#,但是 Genie(显然?)对选项卡的坚持在实践中可能有点烦人 - 我会对以下优点和缺点的列表感兴趣两种语言(假设其中一种或两种都已准备好用于生产)。

顺便说一句,我在 Linux 上开发,所以任何与 Windows 相关的问题都与我无关。

最佳答案

Unity ,所有最新版本的 Ubuntu 使用的用户界面都使用 Vala。

Here is a list使用 Vala 开发的应用程序。其中一些是一些主要 GNU/Linux 发行版的默认 GUI 安装的一部分。

至于 Genie:它是 Vala 编译器可以理解的另一种语言(具有类似 Python 的语法)。所以这真的只是你喜欢哪种语法的问题(在我看来)。这是 Genie 语言指南中的引述,似乎在说同样的话:

Genie is very similar to Vala in functionality but differs in syntax allowing the developer to use cleaner and less code to accomplish the same task.

Like Vala, Genie has the same advantages:

  • Programs written in Genie should have have similar performance and resource usage to those written directly in Vala and C
  • Genie has none of the bloat and overhead that comes with many other high level languages which utilize a VM (e.g. Python, Mono, Java)
  • Classes in Genie are actually GObjects so Genie can be used for creating platform code like widgets and libraries where GObjects are required for binding to other languages

如果您不喜欢 TAB 字符,可以使用空格代替:

[indent=2] //two space indent instead of TAB
init
  print "Hello World"

关于c - Vala 和 Genie 生产准备好了吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10395430/

相关文章:

c - 从链表中递归删除数字

c++ - C 与 C++ 数值配方

Vala 获取文件修改日期

c - 在 32 位 Controller 上访问 SFR(特殊功能寄存器)

c - 为什么以下不将数组内容写入文件

gtk3 - 如何在 Gtk.TreeView 右键单击​​上显示上下文菜单?

oop - 不支持链接到 'Gtk.Box.new'

c - 将结构中的结构传递给 GSourceFunc 的最佳方法

c - 在 Vala 中继承接口(interface) - 与基本方法不兼容