设为首页 收藏本站
查看: 885|回复: 0

[经验分享] [Erlang 0038] Node.js & Erlang

[复制链接]

尚未签到

发表于 2017-2-23 09:20:17 | 显示全部楼层 |阅读模式
没有应用场景上下文做编程语言的比较就是一场关公战秦琼的乱斗而已,而语言的比较一次又一次的比较,并非开发者无聊,而是这的确关乎开发者时间精力的投入和未来可能的回报.现在估计问的最多的就是做Android开发还是iOS开发,仅次于它的就是选Node.js还是Erlang?众说纷纭,自己看吧,甚至Joe Armstrong等牛人也也加入了讨论!
     
     阅读下面的文章有两点提示1.文章下面的评论,很多评论比文章精彩.2.注意文章发表的时间,有些观点是具有时效性的

博客文章


互联网从来不缺观点,缺少的是数据和事实,下面按照干货的多少推荐几篇文章:
  A comparison between Misultin, Mochiweb, Cowboy, NodeJS and Tornadoweb
  http://www.ostinelli.net/a-comparison-between-misultin-mochiweb-cowboy-nodejs-and-tornadoweb/
  发表时间May 2011
恰如其名,这篇文章比较了 Misultin, Mochiweb, Cowboy, NodeJS and Tornadoweb,看比较图吧,评论也精彩:



socket.io-erlang-vs-nodejs
https://github.com/Papipo/socket.io-erlang-vs-nodejs
基于socket.io项目做的erlang与node.js的比较

In the webpage that will be displayed when you go to http://localhost:3000, you can set a number of messages to be sent to the server via socket.io.
In my computer nodejs processes 10k messages in 1250ms, and erlang version does the same in 1050ms.
With 100k messages, erlang handles them in 70secs, and node drops the connection thus failing the test.
We know that benchmarks aren't really that useful, since they differ from real production code. But this one served me to decide to go with erlang instead of node for a game I will be developing. Not being able to handle 100k messages is a no-no, given that erlang is able to handle them without problem.



Node.js vs Erlang: SyncPad’s Experience

墙内地址: http://www.cnblogs.com/me-sa/articles/2354787.html
原文在墙外:http://blog.mysyncpad.com/post/2073441622/node-js-vs-erlang-syncpads-experience
2010年2月2日的文章,SyncPad’s 的开发者比较Node.js和Erlang的方案.应该说作者在Node.js上是遇到不少问题的;CPU飙高,内存泄漏,在node.js还是下了很多功夫的甚至尝试了multi-node:



Node.js v. Erlang
January 25, 2012的文章
墙内地址:http://www.cnblogs.com/me-sa/articles/2354769.html
原文在墙外: http://ksdlck.com/post/16493417514/node-js-v-erlang
从实现机制上做了一个比较,对两种技术的关键点做了高度的概括,节录文章开头和结尾:

Node and Erlang both set out to solve an issue that developers of a particular class of systems routinely face: dealing with massive concurrency.


In the end, Node and Erlang find their way to almost the same place. They are both dynamic languages, with similar native datastructures, and one can see that Node’s ubiquitous EventEmitter is, in many ways, isomorphic to Erlang’s message passing scheme. Libraries like hook.ioprovide some semblance of the agnosticism with which one treats the location of an adressee in Erlang. Hotplugging of code is possible with no particular hassle, but—arguably as it should be—the responsibility of the programmer to do in such a way as to not break the application. They both are ideall suited to workloads that are primarily bottlenecked on IO, and both excel at shifting data from one place to another.





Node.js vs Erlang is the wrong battle.
墙内地址:http://www.cnblogs.com/me-sa/articles/2354824.html
原文在墙外:http://jlouisramblings.blogspot.com/2011/05/nodejs-vs-erlang-is-wrong-battle.html

墙内地址:http://www.cnblogs.com/me-sa/articles/2354855.html
原文在墙外:http://jlouisramblings.blogspot.com/2010/12/differences-between-nodejs-and-erlang_14.html
评论更精彩:http://www.reddit.com/r/programming/comments/h5ixh/nodejs_vs_erlang_is_the_wrong_battle/
作者第二篇文章要实际一些,conclusion写得很搞:

My main goal was to set out and exemplify a major difference in how a system like Node.js handles requests compared to Erlang. I think I have succeeded. It underpins the idea that you need to solve problems depending on platform. In Node.js, you will need to break up long-running jobs manually to give others a chance at the CPU (this is essentially cooperative multitasking). In Erlang, this is not a problem — and a single bad process can’t hose the system as a whole. On the other hand, I am sure there are problems for which Node.js shines and it will have to be worked around in Erlang.

  Erlang vs node.js
Posted by David N. Welton on Thursday, April 29, 2010
http://journal.dedasys.com/2010/04/29/erlang-vs-node-js
  "Good enough" concurrency, combined with a language that is at least an order of magnitude more popular than Erlang, and a fast runtime, combined with ease of use in general (it's way easier to get started with node.js than with most Erlang web stuff) make for a system that's likely to do fairly well in terms of diffusion and popularity, and is going to "eat some of Erlang's lunch". Or perhaps, rather than actually taking users away from Erlang, it's likely to attract people that might have otherwise gone to Erlang.
  
  Felix's Node.js Convincing the boss guide
http://nodeguide.com/convincing_the_boss.html
  Felix Geisendörfer, an early node.js core contributor and co-founder of transloadit.com.
  But please be careful here, since JavaScript is a dynamic / garbage collected language, your response times may sometimes vary depending on how often and long the garbage collection kicks in (at which point your program is stopped). So don't try to build hard realtime systems in node, that require consistent response times. Erlang is probably a better choice for these kinds of applications.
问答站


这种问题肯定会在技术问答站落户,从争论中找到学习的路径,分析的方法,收获不止这一个问题那么简单了:
StackOverflow上的这篇:
Node.js or Erlang
http://stackoverflow.com/questions/3011317/node-js-or-erlang
Node.Js in Erlang style?
http://stackoverflow.com/questions/4437601/node-js-in-erlang-style




StackExchange站点围观地址:
Learning Erlang vs learning node.js
http://programmers.stackexchange.com/questions/85975/learning-erlang-vs-learning-node-js
这里的讨论包含了很多学习的指导,其中提到了这篇妙趣横生的 An Open Letter to the Erlang Beginner (or Onlooker) http://ferd.ca/an-open-letter-to-the-erlang-beginner-or-onlooker.html


Google Group围观地址:node.js compared to erlang  
http://groups.google.com/group/erlang-programming/browse_thread/thread/142aed19df0decd9/a6fbf0414b50c8ee
在这个讨论中,惊现神人:Erlang之父Joe Armstrong 以及Nabble – Erlang 的作者Max Lapshin等等

2012-2-26 13:34:17更新
Web And Scripting Programming Language Job Trends – February 2012


DSC0000.png

DSC0001.png

DSC0002.png

  图1: JavaScript的需求远远超出其他的语言。PHP和Python的增长很稳健。Groovy虽然在增长,但是总量还是太小了。Erlang呢,几乎可以忽略。
图2: 从短期18个月看,基本上没有太大增长,期间有些波动。基本上过去一年都没有什么增长,不知是否和整体的经济有关。
图3: 各个语言的增量对比,从增量上看,Erlang和Groovy虽然总量很小,但是增长的比例很高。而JS和PHP的需求已经非常大,增长100%就是很大的数字。这也是可以理解的。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-345975-1-1.html 上篇帖子: Web Essentials之JavaScript,TypeScript和CoffeeScript 下篇帖子: 将node-expat扩展编译至node.exe中
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表