作者:永欣慧娟766 | 来源:互联网 | 2023-05-19 13:01
InErlangIwasabletoimmediatelyunderstandthenotionofanode-aself-containedErlangVM.
In Erlang I was able to immediately understand the notion of a 'node' - a self-contained Erlang VM. I could start a node on one machine with erl -name gandalf -setCOOKIE abc
, and another node on another machine (on the same LAN) with erl -name bilbo -setCOOKIE abc
. I could then spawn processes on gandalf which would communicate magically with other processes on bilbo. Now, since I also wanted to serve up a jazzy webpage with animated graphical results from my Erlang processes, I picked up some Javascript and learnt jQuery. Still a humble paduwan, but I sort of understand how Javascript fits into the scheme of things.
在Erlang中,我能够立即理解“节点”的概念——一个自包含的Erlang VM。我可以在一台机器上用erl -name gandalf -setCOOKIE abc启动一个节点,在另一台机器上(在同一个局域网上)用erl -name bilbo -setCOOKIE abc启动另一个节点。然后,我可以在gandalf上生成进程,它将与bilbo上的其他进程通信。现在,由于我也想用Erlang过程生成的动画图形结果创建一个花哨的网页,所以我学习了一些Javascript并学习了jQuery。仍然是一个不起眼的paduwan,但是我有点理解Javascript是如何融入事物的计划的。
I recently came across node.js and an (evil) voice started whispering: 'This is it! Now you can do everything with Javascript! Forget Erlang and guards and periods, stick to a language that everyone uses'.
我最近遇到node。js和一个(邪恶的)声音开始窃窃私语:“就是这个!”现在你可以用Javascript做任何事情了!忘掉Erlang、警卫和句号,坚持大家都用的语言。
I've read the docs a bit, but I still don't understand what a node is in node.js. Do I have to run a http server and that becomes my node? What if I don't like http, or I don't care how gandalf talks to bilbo - that's what I like in Erlang. Maybe I nai:vely expect that node.js is erlang with Javascript sugar?
我已经读了一些文档,但是我仍然不理解node.js中的节点是什么。我是否必须运行一个http服务器,然后它就成为我的节点?如果我不喜欢http,或者我不在乎甘道夫怎么和比尔博说话——这就是我喜欢Erlang的地方。也许我奈:非常期待那个节点。js是erlang和Javascript糖吗?
4 个解决方案