wxHaskell和Gtk2HS有哪些相对优点? [英] What are the relative merits of wxHaskell and Gtk2HS?

查看:144
本文介绍了wxHaskell和Gtk2HS有哪些相对优点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于使用Haskell,wxWidgets(通过 wxHaskell )或GTK(通过< a href =http://www.haskell.org/gtk2hs/ =noreferrer> Gtk2HS )?

每个人的缺点?它是否会根据您的目标平台而有所不同(我主要在OS X上工作,但希望我的程序能在Linux和Windows上工作)? 解决方案方案

[声明:我是wxHaskell维护者]



两者都是稳定且相当完整的GUI绑定,您可以选择大多数项目置信度。两者都具有一定程度的'更高级别'Haskell绑定,但在这两种情况下,您都需要放入相当必要的'C'风格编码才能完成任务。我的印象是,wxHaskell允许你在更高级别的绑定中花费更多的时间,但是我没有做太多的GTK2HS,无论如何,你肯定会发现自己在两个库的包装器的最前端工作 - 我认为在这两种情况下,整体编程的复杂性是相似的。

因此,让我们把基本功能作为给定的,并且集中在差异上。请注意,我真的相信GTK2HS是一项出色的工作,如果您选择GTK2HS,您会很高兴。大多数我在下面说的是个人对差异的理解,为什么我选择自己和wxHaskell一起工作。


GTK2HS拥有一个更大的团队,并定期发布。 wxHaskell不是经常更新,但核心团队是活跃的,并且有定期的错误修正,但主要新功能的添加速度比我们想要的慢得多(我们都有日常工作)。



wxHaskell在所有支持的平台上提供真正的本机应用程序外观。当然,GTK2HS在Linux上是本地的,在Windows上具有相当不错的本地主题(即足以满足除了书呆子以外的所有其他人...),但在OSX上具有GTK外观和感觉,并且取决于是否安装了X11。我相信OSX的本地GTK库正在开发中,但被认为相对不成熟。一旦稳定,GTK2HS应该能够轻松受益于相同的部分原生外观和感觉(例如 GTK OSX截图)。



如果你不在Linux上,wxHaskell可能更容易构建GTK2HS可能更容易,如果你是Linux托管的话),但两者的构建都相当复杂,说实话,因为在这两种情况下都有相当数量的依赖关系。



根据wxHaskell分发应用程序稍微简单一点(恕我直言),只是因为它具有较少的库依赖关系。我在Windows上主要使用InnoSetup分发应用程序,并在OSX上分发应用程序软件包。我承认只需要少量的额外工作,GTK2HS也可以做到这一点,所以这可能是支持wxHaskell的最弱论据。

它是我个人认为wxHaskell对封闭源(例如商业)开发更友善。这当然是无休止的火焰战争的主题,所以我只会说wxHaskell在 wxWidgets许可证,明确允许封闭源代码开发。 GTK2HS是LGPL,所以你需要问你的律师 - 虽然我必须说清楚,很多人和公司都认为LGPL与商业开发兼容;我工作的公司的律师认为这对我们的项目是不合适的。我认为如果Linux是我的主要开发和交付平台,我可能会使用GTK2HS。然而,这不是:我偶尔会将OSX交付给Windows,我认为wxHaskell更适合这些平台,尽管这两个选项都支持所有三种平台。



我希望这会帮助您选择。


Which is better for developing GUI applications with Haskell, wxWidgets (via wxHaskell) or GTK (via Gtk2HS)?

What are the pros and cons of each? Does it vary depending on which platform you are targeting (I would primarily be working on OS X but would like my programs to work on Linux and Windows too)?

解决方案

[Disclaimer: I am a wxHaskell maintainer]

Both are stable and fairly complete GUI bindings, and you could choose either for most projects with confidence. Both have some degree of 'higher-level' Haskell bindings, but in both cases you will need to drop into rather imperative 'C' style coding to get things done. My impression is that wxHaskell allows you to spend a little more time in the higher-level bindings, but I've not done much GTK2HS, and in any event, you definitely find yourself working on the thin end of the wrapper for both libraries - and I think the overall programming 'complexity' is similar in both cases.

Therefore, let's take the basic functionality as a given and concentrate on the differences. Please note that I genuinely believe that GTK2HS is an excellent piece of work, and that you will be happy if you choose it. Most of what I say below is a personal take on the differences, and why I choose to work on and with wxHaskell myself.

GTK2HS has a larger team working on it, and is released more regularly. wxHaskell is not updated as frequently, but the core team is active, and there are regular bugfixes, but with major new functionality being added rather more slowly than we would like (we all have day jobs).

wxHaskell gives true native application appearance on all supported platforms out of the box. GTK2HS is, of course, native on Linux and has a pretty good native theme on Windows (i.e. good enough to satisfy all but pedants...), but has GTK look and feel on OSX, and depends on having X11 installed. I believe that an OSX 'native' GTK library is under development, but is considered relatively immature. Once this is stable, GTK2HS should be able to easily benefit from the same 'partially native' look and feel (e.g. GTK OSX screenshot).

wxHaskell is probably a little easier to build if you are not on Linux (GTK2HS is likely easier if you are Linux hosted), but both are pretty complex to build, to be honest, as there are a significant number of dependencies in both cases.

It is slightly easier (IMHO) to distribute applications based on wxHaskell, simply because it has fewer library dependencies. I distribute applications using mainly InnoSetup on Windows, and as App bundles on OSX. I would admit that with only a small amount of extra work, the same could be done with GTK2HS, so this is probably the weakest argument in favour of wxHaskell.

It is my personal opinion that wxHaskell is friendlier to closed source (e.g. commercial) developments. This is, of course, the subject of interminable flame wars, so I will only say that wxHaskell is under the wxWidgets license which unambiguously allows for closed source development. GTK2HS is LGPL, so you'll need to ask your lawyer - although I must make it clear that many people and companies have concluded that LGPL is compatible with commercial development; the lawyers at the company I work for have concluded that it is inappropriate for our projects.

I think that if Linux was my main development and delivery platform, I'd probably use GTK2HS. It isn't, however: I deliver mainly to Windows with occasional OSX, and I think wxHaskell is a better match to these platforms, although both options support all three platforms.

I hope this will help you with your choice.

这篇关于wxHaskell和Gtk2HS有哪些相对优点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆