有没有Elixir可以做的事情,Erlang不能,反之亦然? [英] Are there things Elixir can do that Erlang cannot, or vice versa?

查看:137
本文介绍了有没有Elixir可以做的事情,Erlang不能,反之亦然?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题是在波束虚拟机及其提供的功能的上下文中,而不是在图灵完整语言可以做的一般背景下。我想投资一些时间学习纯Erlang或Elixir。我得到了两者之间的基本差异,我正在倾向于Elixir,因为宏,更好的语法和更快的语言开发这一天。



我的问题是:if我选择Elixir,我会绊倒我不能做的事情,但是可以在Erlang做吗?我可以使用所有的OTP东西,所有的Erlang库,代码重新加载等与Elixir?



我不是要求某人的偏好在两者之间;只是关于语言可能性的事实。

解决方案

只是前言 - 我只使用了Elixir在生产中,而不是Erlang。 / p>

我会诚实地推荐Elixir。这是我的意见,不一定是适合你的,但下面我将列出我的理由。


  1. 生产力:我来自Ruby / Rails背景,所以Elixir的语法和风格是我非常熟悉的。帮助我确定是否学习语言的主要因素之一是我能做到多么有成效 - 主要是为什么我选择了Ruby。药剂是一样的我可以像Ruby一样工作,并发和模式匹配的所有附加益处。

  2. Erlang:由于Elixir是建立在Erlang之上的,并且编译到erlang和光束vm,您可以访问每个erlang模块和包。所以如果你担心使用药剂,并且错过了Erlang的所有功能,那么你不应该是。 Elixir甚至拥有大部分更大的Erlang / OTP功能的实现,如GenServer,GenEvent等。

  3. 社区/资源:Elixir社区真的是一个伟大的社区。松散的频道真的很受欢迎,是初学者问题得到一些答案的好方法。已经有一些很好的书写在这个语言上(编程Elixir 1.2 - Dave Thomas,Ruby Pickaxe的作者)也使得进入这个语言真的很容易。

真的,如果你和这两个人混乱,你可能会相同的决定,Elixir是一个更好的语言Erlang + More的所有功能。它也在上升,我不记得确切的数字,但我记得从Hex网站(包管理器)读取一些关于包下载量大幅增加的东西。


This question is in the context of the Beam VM and the capabilities that it provides, not in the general context of what a Turing complete language can do. I want to invest some time to learn either pure Erlang or Elixir. I get the basic differences between the two and I am leaning towards Elixir because of the macros, better syntax and faster development of the language this day.

My question is: if I choose Elixir, will I stumble on something that I cannot do in it, but can do in Erlang? Can I use all the OTP stuff, all the Erlang libraries, code reload, etc. with Elixir?

I am not asking for someone's preference between the two; just facts about the possibilities of the languages. Preferably from someone who used both in production.

解决方案

Just to preface - I have only used Elixir in production and not Erlang.

I would honestly recommend Elixir. This is my opinion and not necessarily the right one for you, but below I will list my reasons why.

  1. Productivity: I come from a Ruby/Rails background so the Elixir syntax and style is something that was very familiar to me. One of the main factors that helps me determine whether or not to learn a language is how productive I can be in it - mainly why I chose Ruby. Elixir is the same. I can work just as fast in it as I can Ruby with all the added benefits of concurrency and pattern matching.
  2. Erlang: Since Elixir is built on top of Erlang and compiles down to erlang and the beam vm, you have access to every erlang module and package. So if you are worried about using elixir and missing out on all of the features of Erlang, you shouldn't be. Elixir even has it's own implementations of most of the bigger Erlang/OTP features such as GenServer, GenEvent etc.
  3. Community/Resources: The Elixir community is really a great one. The slack channel is really popular and great way to get some answers for beginner questions. There are already some really good books written on the language (Programming Elixir 1.2 - Dave Thomas, Author of the Ruby Pickaxe) also that make getting into the language really easy.

Really, if you have a mess around with the two you will probably come to the same decision that Elixir is a much nicer language with all the features of Erlang + More. It's on the rise as well, I can't remember the exact numbers but I remember reading something from the Hex website (package manager) about a considerable increase in package downloads.

这篇关于有没有Elixir可以做的事情,Erlang不能,反之亦然?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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