我可以使用哪些库来使用 Erlang 构建 GUI?
我可以使用哪些库来为 Erlang 应用程序构建 GUI? 请每个答案选一个选项。
What libraries can I use to build a GUI for an Erlang application? Please one option per answer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
我觉得有点令人费解的是,有人想用 Erlang 以外的东西为 Erlang 程序编写 GUI? Erlang 的并发模型使其成为编写 GUI 的优秀语言。UI 元素和事件完美地映射到 Erlang 进程和消息。
I find it a little puzzling that anyone would want to write a GUI for a Erlang program in something other than Erlang? Erlang's concurrency model makes it an excellent language to write GUIs in. UI elements and events map perfectly onto Erlang processes and messages.
对于为 Erlang 编写本机 GUI,wxErlang 似乎是当今最成熟的库(也在 SourceForge 上)。
For writing native GUIs for Erlang, wxErlang seems to be the most mature library today (also on SourceForge).
即将推出的用于构建前端的 Scenic 库。 它所拥有的特定于 erlang 的方法看起来很有前途。
There’s the up and coming Scenic library for building frontends. It looks promising with the erlang-specific approach it has.
我将违反“每个帖子一个选项”的要求 - 抱歉,但使用哪种工具实际上取决于您的优先事项。
一个相当稳定的库是 gtkNode。 它使用一种简单但强大的方法将所有 GTK 小部件映射到 Erlang,并且应该在各个版本中继续保持稳定。 它还可以与 Glade GUI 构建器配合良好。 它由 Erlang 大师 Mats Cronqvist 积极维护,但它当然是尽力而为。
WxWidgets 非常有前途,有望成为 Erlang 的主要 GUI 库,但它仍处于测试阶段,界面还不稳定,也没有做出向后兼容性的承诺。
因此,如果您想走在最前沿,WxWidgets 可能就是您的选择。 否则,gtkNode 应该为您提供一个美观且相对轻松和安全的 GUI。
Erlang 唯一官方支持的 GUI 库是 GS,它是OTP 版本并保证与即将发布的版本兼容。 因此,如果这比原生外观和现代外观更重要,那么它可能是一个选择。
I'll violate the 'one option per post' request - sorry, but which tool to use really depends on what your priorities are.
One fairly stable library is gtkNode. It uses a simple but powerful way to map all GTK widgets to Erlang, and should continue to be stable across releases. It also works well with the Glade GUI builder. It's actively maintained by Erlang guru Mats Cronqvist, but it's of course best-effort.
WxWidgets is very promising and will hopefully become the main GUI library for Erlang, but it's still in beta, and the interface is not yet stable and no promises of backward compatibility are made yet.
So if you want to be a bit on the bleeding edge, WxWidgets may be your thing. Otherwise, gtkNode should give you a good-looking GUI with relative ease and safety.
The only officially supported GUI library for Erlang is GS, part of the OTP release and guaranteed to work with upcoming releases. So if this is more important than native look and feel and a modern looking facade, it may be an option.
我不确定是否有...但我在网络上找到了 Erlbol ,以及 X11 GUI 听起来很有趣,并且 GTK2(pdf 链接)
I'm not sure there are any... but I found Erlbol on the web, and a X11 GUI which sounds interesting, and GTK2 (pdf link)
我在 http://wxerlang.dougedmunds.com 上发布了 wxErlang 教程
I've posted a wxErlang tutorial at http://wxerlang.dougedmunds.com
大多数人并不用 Erlang 编写实际的 GUI。 更常见的方法是用 Java 或 C# 编写 GUI 层,然后通过套接字或管道与您的 Erlang 应用程序通信。
考虑到这一点,您可能想要研究用于在 java 或 .Net 应用程序与 Erlang 之间进行 RPC 的各种库:
http://weblogs.asp.net/nleghari/archive/2008/01/08/integrating-net-and-erlang- using-otp-net.aspx
http://www.otp-net.aspx theserverside.com/tt/articles/article.tss?l=IntegratingJavaandErlang
编辑 如果您确实决定在 erlang 中编写界面,您可能会考虑做一个基于 Web 的 GUI 服务通过 Erlang Web 服务器 Yaws:
http://yaws.hyber.org/appmods.yaws
Most people don't code the actual GUI in Erlang. A more common approach would be to write the GUI layer in Java or C# and then talk to your Erlang app via a socket or pipe.
With that in mind, you probably want to look into various libraries for doing RPC between java or .Net applications and Erlang:
http://weblogs.asp.net/nleghari/archive/2008/01/08/integrating-net-and-erlang-using-otp-net.aspx
http://www.theserverside.com/tt/articles/article.tss?l=IntegratingJavaandErlang
EDIT If you're truly set on coding an interface in erlang, you might consider doing a web-based GUI served via Yaws, the erlang web server:
http://yaws.hyber.org/appmods.yaws
对于 Erlang 中的 GUI 应用程序,您应该使用 r13b 版本中包含的 wxErlang。 Beta 版已经在源代码中存在了一段时间,但现在从 r13a 开始,包含在主要的 OTP 版本中。
For GUI application in Erlang you should use wxErlang which is included in the r13b release. The beta has been around on source for some time but is now, since r13a, included in the main OTP release.