选择用于实现分布式消息传递算法的编程语言

发布于 2024-11-30 19:41:48 字数 238 浏览 2 评论 0 原文

基本上,我想实现以下算法并分析使用这些算法构建的系统在不同条件下的行为。

  • Gossip 协议
  • 多个 paxos
  • 一致性哈希

我的兴趣在于这些算法。我基本上是在寻找一种编程语言,可以让我快速编写这些算法并深入理解这些算法。

我应该选择哪种语言? Java、Scala、Erlang 或其他任何东西。

目前,我了解 Java 和 C++。

Basically, I would want to implement the following algorithms and analyze how the system built using these algorithms behave under different conditions.

  • Gossip protocol
  • Multiple paxos
  • Consistent hashing

My interest here is in these algorithms. I basically am looking for a programming language that lets me write these algorithms quickly and deeply understand these algorithms.

Which language should I choose?
Java, Scala, Erlang or anything else.

Currently, I know Java and C++.

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

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

发布评论

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

评论(4

预谋 2024-12-07 19:41:48

您可以尝试在 Erlang 中实现协议。

  • 进程通信非常优雅地融入到语言和虚拟机中。两个 elrang 进程之间的异步消息传递,无论是在同一 VM 中还是在语义上等效的跨 VM。
  • 在 erlang 中,算法的容错方面/重试逻辑等方面的编码是轻而易举的。将所有内容封装到轻量级进程中,并使用称为主管的特殊进程来重新启动它们。
  • 序列化 Erlang 对象非常简单。您不必显式编码序列化逻辑(例如在 Java 中实现 Serialized)。
  • Erlang 发行版附带了一个名为 rpc 的模块,它允许您调用远程虚拟机上的函数。
  • Elrang shell 是真正的天赐之物。您可以将 shell 附加到任何远程虚拟机。 shell 允许您分析内部表/数据结构。该虚拟机还具有极其复杂的调试和跟踪功能,您可以通过 shell 来使用这些功能。
  • 您可以查看 Riak,一个 开源 NoSQL 数据存储,以 Amazon Dynamo 为模型,用 Erlang 编写。它实现了一致性哈希和 Gossip 协议。

You could try implementing the protocols in Erlang.

  • Process communication is very elegantly baked into the language and VM. Asynchronous message passing between two elrang process whether in the same VM or across VMs in semantically equivalent.
  • Coding in the fault tolerance aspects / retry logic etc. of the algorithm is a breeze in erlang. Encapsulate everything into light weight processes and use special processes called supervisors to restart them.
  • Serializing Erlang objects are really simple. You dont have to explicitly code your Serialization logic (such as implementing Serializable in Java).
  • The Erlang distribution comes with a module called rpc which lets you invoke functions on remote VMs.
  • The Elrang shell is a real god send. You can attach a shell to any remote VM. The shell lets you profile internal tables/data structures. The VM has also extremely sophisticated debugging and tracing features which is available to you via the shell.
  • You can take a look at Riak, an open source NoSQL datastore written in Erlang modelled on Amazon's Dynamo. It implements both Consistent Hashing and the Gossip protocol.
海夕 2024-12-07 19:41:48

哦是的 !你可以通过查看这些来开始 Erlang 编程:

  1. 学习一些 Erlang 会有很大好处
  2. < b>Erlang 书籍第 1 部分
  3. Orielly 的 Erlang 编程教科书(Francesco Cezarini 和 Simon Thompson)
  4. Joe Armstrong 的《Erlang 编程》教科书

上面的链接将为您提供您可能需要的所有 Erlang 编程资源。不过,我建议您从 Joe Armstrongs 编程 Erlang 教科书 开始,在阅读时,使用以下网站:学习一些 erlang,大有裨益(参考文献 1)以上)作为进一步理解数据结构的参考。

您可以从这里下载 Erlang:Erlang 下载官方页面

您可能需要其他链接和资源(应用程序、库等),其中大部分已在此处建立索引:Erlang/OTP .com 网站

有时,您可以随时在 Stackoverflow 上提出任何问题,也可以从 sourceforge 搜索工具和库。

Oh yes ! you can start Programming Erlang by looking at these:

  1. Learn You some Erlang for great good
  2. Erlang Book Part 1
  3. Orielly's Erlang Programming Text Book (Francesco Cezarini and Simon Thompson)
  4. Joe Armstrong's Programming Erlang Text Book

Those links above will provide you with resources to all the Erlang programming you may need. I however suggest that you begin with Joe Armstrongs Programming Erlang Text Book, and as you read it, use the website: Learn you some erlang for great good (reference No. 1 above) as a reference for further understanding the data structures.

You can download Erlang from here: Erlang Download official Page.

You may need other links and resources (applications, libraries e.t.c.), most of which are indexed here: Erlang/OTP .com website.

Occasionally, you can always ask any question on Stackoverflow here, or you can search for tools and libraries from sourceforge.

优雅的叶子 2024-12-07 19:41:48

所有这些协议都已在各种 Erlang 项目中实现。看
MnesiaRiakCouchDBScalaris 了解更多详细信息(并非每个项目中的所有协议)。我无法想象比 Erlang 更友好的环境来进行此类协议实验。

All of those protocols was already implemented in various Erlang projects. See
Mnesia, Riak, CouchDB, Scalaris for more details (not all protocols in each project). I can't imagine more friendly environment for this kind of protocol experiments than Erlang.

丑疤怪 2024-12-07 19:41:48

您决定好您的消息传递库了吗?如果您对 MPI 感兴趣,可以使用它的 java 和 C++ 版本。

MPI 为您执行许多工作,例如广播消息和检索回复,这在您的算法中至关重要。因此,我建议您找到适合 C++ 或 Java 的 MPI 版本并开始工作。

看一下:

Have you decided about your message passing library? If you are interested in MPI, both java and C++ editions of it are available.

MPI performs lots of jobs for you, such as broadcasting a message and retrieving the replies, which is essential in your algorithms. As a result, I recommend you to find a proper version of MPI for C++ or Java and kick off the work.

Take a look at:

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