如何学习Erlang框架?

发布于 2024-10-02 01:48:21 字数 137 浏览 2 评论 0原文

我有两个关于 Erlang 的问题。

  1. 概念设计模式适合在Erlang中使用吗?想要快速理解架构。
  2. 您能推荐一些很棒的框架以及如何学习吗?从什么角度来解释这个erlang框架。

谢谢你。

I had two question about Erlang.

  1. Is design pattern of concept to be suitable for use in Erlang? Want to understand the architecture quickly.
  2. Could you recommend any great framework and how to learn? what view-point to explain this erlang framework.

Thanks for you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

街角卖回忆 2024-10-09 01:48:22

一次一个,我尝试回答“入门主题”中未回答的问题:

  • 设计模式:所有语言都有自己的一套通用习惯用法来解决特定问题。这些通常称为“设计模式”。然而事实证明,这些不能跨语言提升。 Java 或 C# 的 DP 可能根本不适用于 Erlang。反之亦然:Erlang 中的特定习惯用法可能在 C# 中没有用处。在学习 Erlang 时,您应该密切关注模式,但不要指望能够使用您从其他系统中了解到的现有模式。

  • 关于学习Erlang:保持开放的心态。并且在任何情况下都不要试图通过将您已知的OO概念与该语言联系起来来理解它。不要试图在 Erlang 中寻找接口对象的概念。他们不在那儿。我在学习 Erlang 和 Haskell 时看到过这个错误(误解通常围绕类型类)。新的语言需要新的方法和新的解决问题的技能。这就像学习一种新乐器:节奏和和声会保留下来,但有些东西不会。

  • Erlang 并没有真正的“框架”。最接近它的是一组标准通用行为,它们是标准库中内置的 OTP 的一部分。一个行为定义了一个通用的构造,服务器说,然后您可以将其专门化以满足您的需求。优点是很多稳健性的东西都“融入”到了行为中,所以当你的代码基于它时,你就可以免费获得这些东西。

One at a time, where I try to answer questions not answered in "Primer thread":

  • Design patterns: All languages have their own set of common idioms for solving specific problems. These are often called "Design Patterns". It turns out however, that these cannot be hoisted across languages. A DP for, i.e., Java or C# might not be applicable at all in Erlang. It also holds true vice versa: A specific idiom in Erlang might have no use in C#. When learning Erlang you should keep an open eye out for the patterns, but don't expect to be able to use existing patterns you know from other systems.

  • On learning Erlang: Keep an open mind. And do not under any circumstances try to understand it by relating your known OO concepts to the language. Don't try to find the concept of class, interface and object in Erlang. They are not there. I've seen this mistake when learning Erlang and when learning Haskell (where the misunderstanding is usually around Type Classes). A new language requires a new approach and new problem solving skills. It is like learning a new instrument: Rhythm and Harmonics carry over, but there are things which do not.

  • Erlang does not really have any "framework". The closest you can come to it is the set of standard generic behaviors which are part of the OTP built into the standard library. A behavior defines a generic construct, a server say, which you then can specialize to your needs. The advantage is that a lot of the robustness stuff is "baked in" into the behavior so when you base your code on it, you get these things for free.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文