Erlang 与 OCaml(最适合的利基)

发布于 2024-08-02 16:34:42 字数 484 浏览 2 评论 0原文

嗨,我想学习一门 FP 语言(当你从事不需要学习太多知识的职位时,这总是很痛苦),经过一些研究,我觉得 Erlang 和 OCaml 是我真正想要的两种语言我喜欢涉足其中,原因如下:

1)我主要从事 C++ 的高可用性 Web 服务器后端系统。我听说 Erlang 在可扩展性和容错性方面得到了很好的解决。虽然我不认为我现在的公司会有任何 Erlang 的项目,但我觉得 Erlang 对于我的长期职业发展来说可能是一门很好的语言。

2)我有一个同事非常擅长OCaml,我的意思是他真的很擅长(但他现在不在日常工作中从事这方面的工作。他维护着几个库)。所以我想如果我学习 OCaml,他可能是一个很好的资源。

我的兴趣主要是分布式系统(我目前的工作是一些中间件开发工作)和高性能计算(你猜怎么着,我在研究生院研究了几年,特别是金融应用中的偏微分方程 - 所以我总觉得我可能稍后会回去做一些财务建模工作)

有什么建议吗?请不要建议“两者都学”,因为我没那么聪明:-)

谢谢

Hi I'd like to pick up one FP language (it's always a pain when you work in a position that does not require you learn much), and after doing some research, I felt Erlang and OCaml are the two that I'd really like to get my feet wet for the following reasons:

1) I work mainly on high-availability web server back-end system in C++. I heard Erlang is a great fix in scalability and fault-tolerance. Though I don't think my current company will have any project in Erlang, I feel Erlang may be a good language for my long term career development.

2) I have a co-worker who is really good at OCaml, I mean he is really good at it (but he does not work on that for his daily work now. He maintains several library). So I figured that he may be a good resource if I learn OCaml.

My interests are mainly on distributed systems (my current work is some midldle-ware development work) and high-performance computing (guess what, I had a couple of years graduate school research on it, in particular PDE in Financial applications -- so I always felt I may go back to do some finance modeling work maybe sometime later)

Any suggestions? Please don't suggest "learn both", as I am not that smart :-)

Thanks

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

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

发布评论

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

评论(5

南汐寒笙箫 2024-08-09 16:34:42

OCaml 是一种很棒的语言——我最喜欢的语言之一——但如果你的兴趣是分布式系统,那么我建议你使用 Erlang,它在分布式系统方面远远领先于其他 FP 语言(尽管有一个分支) OCaml 名为 Jocaml ,它有一些有趣的方面)。

考虑到其底层架构,即使仅考虑并行性,OCaml 也较弱。恕我直言,Haskell 和 Clojure 都有更好的故事。 (也就是说:一旦你掌握了一种 FP 语言,你就能够很容易地将基本原理移植到其他语言中,并且它们在将来可能会很有用。Scala 和 Clojure 都可以凭借以下特性轻松地潜入组织中: JVM。)

OCaml is a great language -- one of my favorites -- but if your interest is distributed systems than I'd recommend going with Erlang, which is head and shoulders ahead of the other FP languages with regards to distributed systems (although there's an offshoot of OCaml called Jocaml which has some interesting aspects).

OCaml is weaker even when just looking at parallelism, given its underlying architecture. Both Haskell and Clojure have better stories here, IMHO. (That said: once you get one FP language, you'll be able to carry the fundamental principles to other languages pretty easily, and they might be useful in the future. Both Scala and Clojure could easily sneak their way into organizations by virtue of the JVM.)

半城柳色半声笛 2024-08-09 16:34:42

我认为 OCaml 是开始 FP 的好方法,一旦你掌握了基本的 FP 概念,Erlang 就不是很困难。

但是“aneccodeal”的建议非常棒——也就是说,如果您对 OCaml 感兴趣并且有一个朋友在这方面已经很强大,那么请务必为其开发一个并发(也许是 MPI)库。

但请记住,使 OCaml 并发的障碍之一是缺乏并发垃圾收集(或者我读到过)。

I think OCaml is a great way to get started in FP, and Erlang is not very difficult once you have the basic FP concepts down.

But the suggestion from 'aneccodeal' is fantastic-- i.e., if you are interested in OCaml and have a friend who is already strong in it, by all means develop a concurrency (perhaps MPI) library for it.

Keep in mind, however, that one of the barriers to making OCaml concurrent is the lack of concurrent garbage collection (or so I have read).

纵性 2024-08-09 16:34:42

如果您的同事对 OCaml“非常好”,那么假设他/她愿意回答您的问题,那么您似乎拥有丰富的资源。当周围有知识渊博的人可以在你遇到困难时向他提问时,学习总是更容易。

是的,确实 OCaml 在并行性方面没有最好的故事,但是有一些方法可以在 OCaml 中获得并行性(基于 fork 似乎是最常见的 - 查看 prelude.ml,其中包括并行映射之类的内容: < a href="http://github.com/kig/preludeml/tree/master" rel="nofollow noreferrer">http://github.com/kig/preludeml/tree/master )。而且,Erlang 基于 Actor 的并发性似乎很容易在其他语言中复制。也许您和您的同事可以参与一个项目,为 OCaml 开发基于 Actor 的并发库?这会给你一个很好的学习项目,你的同事可能会觉得很有趣,愿意和你一起工作……此外,你最终可能会创建一些对整个 OCaml 社区有用的东西。

If you have a co-worker who is "really good" with OCaml then it sounds like you have a great resource assuming that s/he is willing to answer your questions. It's always easier to learn when there's someone knowledgeable around that you can ask questions of if you get stuck.

Yes it's true that OCaml doesn't have the best story when it comes to parallelism, but there are ways to get parallelism in OCaml (fork-based seems to be the most common - checkout prelude.ml which includes things like parallel map: http://github.com/kig/preludeml/tree/master ). Also, it seems that Erlang's Actor-based concurrency is really fairly easy to duplicate in other languages. Maybe you and your co-worker could work on a project to develop an Actor-based concurrency library for OCaml? That would give you a nice learning project that you co-worker would probably find interesting enough to work on with you... in addition you could end up creating something useful for the entire OCaml community.

趁年轻赶紧闹 2024-08-09 16:34:42

我还会考虑看看 F#(特别是当 VS 2010 发布时)。
有了一个好的 IDE,学习一门新语言会变得更加容易和方便。
F# 和 OCaml 非常相似,正如您在其他 SO 线程中看到的那样(例如 此处

I would also consider to look at F# (especially when VS 2010 is out).
Learning a new language is a lot easier and more convenient with a nice IDE.
F# and OCaml are very similar as you can see in other SO threads (e.g. here)

北斗星光 2024-08-09 16:34:42

虽然 Erlang 的执行速度可能比 OCaml 慢,但它仍然有其优势。例如,如果速度不是您的首要任务,您可以从 Erlang 的 OTP 和轻量级进程中受益。

While Erlang may execute slower than OCaml, it still has its advantages. For instance, if speed isn't your top priority, you can benefit from Erlang's OTP and light weight process.

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