欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2, C++/F#/Lisp
Erlang
小 (→链接) |
小 (→项目) |
||
(未显示1个用户的123个中间版本) | |||
第1行: | 第1行: | ||
− | |||
{{SeeWikipedia|Erlang (programming language)}} | {{SeeWikipedia|Erlang (programming language)}} | ||
− | [[Image: | + | [[Image:erlang-logo.png|right|Erlang]] |
− | == | + | Erlang |
− | + | ||
+ | ==简介== | ||
+ | Erlang是一个结构化,动态类型编程语言,内建并行计算支持。最初是由爱立信专门为通信应用设计的,比如控制交换机或者变换协议等,因此非常适合于构建分布式、软实时并行计算系统。 | ||
+ | |||
+ | ==新闻== | ||
+ | [http://www.planeterlang.com/ Planet = erlang.] | ||
+ | |||
+ | ==功能== | ||
+ | [https://www.erlang.org/eep.html EEP] Erlang Enhancement Process | ||
+ | |||
+ | Erlang是参与者模型([[Actor model]])最佳实践。 | ||
使用Erlang编写出的应用运行时通常由成千上万个轻量级进程组成,并通过消息传递相互通讯。进程间上下文切换对于Erlang来说仅仅只是一两个环节,比起C程序的线程切换要高效得多得多了。 | 使用Erlang编写出的应用运行时通常由成千上万个轻量级进程组成,并通过消息传递相互通讯。进程间上下文切换对于Erlang来说仅仅只是一两个环节,比起C程序的线程切换要高效得多得多了。 | ||
第10行: | 第19行: | ||
使用Erlang来编写分布式应用要简单的多,因为它的分布式机制是透明的:对于程序来说并不知道自己是在分布式运行。 | 使用Erlang来编写分布式应用要简单的多,因为它的分布式机制是透明的:对于程序来说并不知道自己是在分布式运行。 | ||
− | + | [[Erlang VM|Erlang运行时环境]]是一个虚拟机,有点像Java虚拟机,这样代码一经编译,同样可以随处运行。它的运行时系统甚至允许代码在不被中断的情况下更新。另外如果你需要更高效的话,字节代码也可以编译成本地代码运行。 | |
− | [ | + | [https://www.erlang.org/doc/reference_manual/typespec.html Types and Function Specifications] |
− | [http://yarivsblog.com/articles/2006/07/11/erlang-yaws-vs-ruby-on-rails Erlang + Yaws vs. Ruby on Rails] | + | *[http://yarivsblog.com/articles/2006/07/11/erlang-yaws-vs-ruby-on-rails Erlang + Yaws vs. Ruby on Rails] |
+ | *[[Open Telecom Platform]] (OTP) is written in Erlang. | ||
+ | *[https://ferd.ca/the-zen-of-erlang.html The Zen of Erlang] | ||
− | [[ | + | [[Elixir programming language]] |
− | == | + | ==版本== |
− | + | *[https://www.erlang.org/blog/my-otp-24-highlights/ Erlang/OTP 24 Highlights] | |
+ | *[http://docs.huihoo.com/erlang/23 23] [https://www.erlang.org/blog/otp-23-highlights/ OTP 23 Highlights] | ||
+ | *[http://docs.huihoo.com/erlang/22 22] [https://www.erlang.org/blog/otp-22-highlights/ OTP 22 Highlights] | ||
+ | *[http://docs.huihoo.com/erlang/21 21] [https://www.erlang.org/blog/my-otp-21-highlights/ My OTP 21 Highlights] | ||
+ | *[http://docs.huihoo.com/erlang/20 20] | ||
+ | *[http://docs.huihoo.com/erlang/19 19] | ||
+ | *[http://docs.huihoo.com/erlang/18 18] | ||
+ | *[http://docs.huihoo.com/erlang/17 17] | ||
+ | |||
+ | ==指南== | ||
+ | ===下载=== | ||
+ | [https://www.erlang-solutions.com/downloads/ 下载安装包] | ||
+ | |||
+ | ===源代码=== | ||
+ | 通过 [[kerl]] 编译和安装 Erlang 实例 | ||
+ | kerl build git git://github.com/erlang/otp OTP_R16B01_RC1 r16b01_rc1 | ||
− | == | + | ===macOS=== |
− | + | brew unlink erlang | |
+ | brew install erlang | ||
+ | 或 [http://packages.macports.org/erlang/ Erlang MacPorts 包] | ||
sudo port selfupdate | sudo port selfupdate | ||
sudo port install erlang | sudo port install erlang | ||
第28行: | 第56行: | ||
1> toolbar:start(). | 1> toolbar:start(). | ||
2> mnesia:start(). | 2> mnesia:start(). | ||
+ | erl -man io | ||
===Linux/UNIX=== | ===Linux/UNIX=== | ||
第45行: | 第74行: | ||
or debian | or debian | ||
apt-get install erlang | apt-get install erlang | ||
+ | or centos | ||
+ | yum install erlang | ||
===Windows=== | ===Windows=== | ||
先安装.exe文件, 再将 D:\Program Files\erlang-5.6\bin 加入 path 环境变量 | 先安装.exe文件, 再将 D:\Program Files\erlang-5.6\bin 加入 path 环境变量 | ||
− | ==使用== | + | ===使用=== |
1> toolbar:start(). | 1> toolbar:start(). | ||
2> halt(). // 退出 | 2> halt(). // 退出 | ||
第58行: | 第89行: | ||
7> TheRest. | 7> TheRest. | ||
8> io:format("hello world~n", []). | 8> io:format("hello world~n", []). | ||
+ | |||
+ | ==函数式编程== | ||
+ | *[http://book.huihoo.com/learn-you-some-erlang-for-great-good/higher-order-functions.html 高阶函数] | ||
+ | -module(hhfuns). | ||
+ | -compile(export_all). | ||
+ | one() -> 1. | ||
+ | two() -> 2. | ||
+ | add(X,Y) -> X() + Y(). | ||
+ | increment([]) -> []; | ||
+ | increment([H|T]) -> [H+1|increment(T)]. | ||
+ | decrement([]) -> []; | ||
+ | decrement([H|T]) -> [H-1|decrement(T)]. | ||
+ | map(_, []) -> []; | ||
+ | map(F, [H|T]) -> [F(H)|map(F,T)]. | ||
+ | incr(X) -> X + 1. | ||
+ | decr(X) -> X - 1. | ||
==工具== | ==工具== | ||
− | * [[ErlyBird]] for NetBeans | + | *[http://docs.huihoo.com/erlang/20/lib/tools-2.11/doc/html/erlang.el.html erlang.el] [http://docs.huihoo.com/erlang/20/lib/tools-2.11/doc/html/erlang_mode_chapter.html The Erlang mode for Emacs] |
− | * [[ErlIDE]] for Eclipse | + | 在用户目录下创建.emacs,如 /Users/huihoo/.emacs 加入以下内容: |
+ | (setq load-path (cons "/usr/local/opt/erlang/lib/erlang/lib/tools-2.9.1/emacs" load-path)) | ||
+ | (setq erlang-root-dir "/usr/local/opt/erlang") | ||
+ | (setq exec-path (cons "/usr/local/otp/erlang/bin" exec-path)) | ||
+ | (require 'erlang-start) | ||
+ | *[https://github.com/tjarvstrand/edts Erlang Development Tool Suite] | ||
+ | *[[ErlyBird]] for NetBeans | ||
+ | *[[ErlIDE]] for Eclipse | ||
+ | *[https://github.com/RefactoringTools/wrangler Wrangler] Erlang重构工具 | ||
+ | |||
+ | ==wxWidgets== | ||
+ | *[http://docs.huihoo.com/erlang/17.4/lib/wx-1.3.2/doc/html/wx.html wxWidgets at Erlang] | ||
==项目== | ==项目== | ||
+ | [[Erlang ecosystem]] | ||
+ | *[https://github.com/drobakowski/awesome-erlang Awesome Erlang] [[文件:Awesome.png]] | ||
+ | *[https://github.com/h4cc/awesome-elixir Awesome Elixir] [[文件:Awesome.png]] | ||
+ | *[https://github.com/erlang/otp Erlang @ GItHub] | ||
+ | *[https://github.com/llaisdy/beam_languages Languages, and about languages, on the BEAM] | ||
+ | *[https://github.com/esl Erlang Solutions] | ||
+ | *[https://github.com/synrc N2O] Enterprise Frameworks © SYNRC | ||
+ | *[[mnesia]] A distributed telecommunications DBMS | ||
+ | *[[cowboy]] | ||
+ | *[[Riak]] 值得关注的k/v分布式存储数据库 | ||
+ | *[[chicago boss]] Web框架 | ||
*[[Apache CouchDB]] | *[[Apache CouchDB]] | ||
+ | *[[Couchbase]] | ||
*[[Zotonic]] | *[[Zotonic]] | ||
*[[Megaco]] | *[[Megaco]] | ||
第75行: | 第145行: | ||
*[[Scalaris]] | *[[Scalaris]] | ||
*[[Disco]] MapReduce框架,Erlang + Python | *[[Disco]] MapReduce框架,Erlang + Python | ||
+ | *[[EMQ]] | ||
+ | *[[MongooseIM]] | ||
*[[ejabberd]] | *[[ejabberd]] | ||
*[[RabbitMQ]] | *[[RabbitMQ]] | ||
+ | *[https://github.com/seth/pooler pooler] An OTP Process Pool Application | ||
+ | *[https://github.com/hamidreza-s/Tnesia Tnesia] Time-series Data Storage | ||
+ | *[https://github.com/asdf-vm/asdf asdf] - install and manage different [[Elixir]] and Erlang versions | ||
==案例== | ==案例== | ||
第83行: | 第158行: | ||
Facebook选择了C++和Erlang的组合。C++模块用户用于记录聊天信息,而Erlang模块“将在线用户的对话保存在内存中并且对长时间轮询(long-polled)请求提供支持”。epoll,Linux 2.6中出现的新系统调用,被用于驱动Erlang模块。Eugene 解释了决定选用Erlang的原因:简单的说就是因为Erlang能很好地满足我们的要求。Erlang是一种面向同步的函数式语言,它具有极其轻量级的用户空间“进程”,无共享的消息传递语义,内置的分布式系统和一个被二十多年实时软件系统实践所检验过的灾难恢复系统。 | Facebook选择了C++和Erlang的组合。C++模块用户用于记录聊天信息,而Erlang模块“将在线用户的对话保存在内存中并且对长时间轮询(long-polled)请求提供支持”。epoll,Linux 2.6中出现的新系统调用,被用于驱动Erlang模块。Eugene 解释了决定选用Erlang的原因:简单的说就是因为Erlang能很好地满足我们的要求。Erlang是一种面向同步的函数式语言,它具有极其轻量级的用户空间“进程”,无共享的消息传递语义,内置的分布式系统和一个被二十多年实时软件系统实践所检验过的灾难恢复系统。 | ||
*Yahoo用Erlang重写了[http://delicious.com/ Delicious] [http://docs.huihoo.com/erlang/developing-erlang-at-yahoo.pdf Developing Erlang at Yahoo] | *Yahoo用Erlang重写了[http://delicious.com/ Delicious] [http://docs.huihoo.com/erlang/developing-erlang-at-yahoo.pdf Developing Erlang at Yahoo] | ||
+ | *[http://www.csdn.net/article/2014-02-27/2818559-an-overview-at-whatsapp%27s-19b-architecture 支撑4.5亿活跃用户的WhatsApp架构概览]、[http://www.csdn.net/article/2014-04-04/2819158-how-whatsapp-grew-to-nearly-500-million-users-11000-cores-an/1 日600亿消息,月4.65亿用户——WhatsApp的Erlang世界]、[http://docs.huihoo.com/erlang/WhatsApp-Scaling-to-Millions-of-Simultaneous-Connections.pdf Scaling to Millions of Simultaneous Connections] | ||
+ | *[http://docs.huihoo.com/erlang/erlang-at-worktile.pdf Worktile千万级消息系统构建实践] | ||
+ | *[http://docs.huihoo.com/erlang/conference/euc2015/Using-Erlang-Riak-and-the-ORSWOT-CRDT-at-bet365-for-Scalability-and-Performance.pdf Using Erlang, Riak and the ORSWOT CRDT at bet365 for Scalability and Performance] | ||
+ | *[http://docs.huihoo.com/erlang/conference/euc2015/Lessons-learnt-re-writing-a-PubSub-system.pdf bet365 Lessons learnt re-writing a PubSub system] | ||
+ | *[http://docs.huihoo.com/erlang/conference/euc2015/Realtime-performance-at-scale-the-search-for-the-Holy-Grail.pdf 游戏 Game of War:Realtime performance at scale: the search for the Holy Grail] | ||
+ | *[http://docs.huihoo.com/erlang/conference/euc2015/Building-a-Scalable-Real-Time-Bidding-Exchange.pdf AOL RTB 系统,Real Time Bidding with Erlang] | ||
+ | *[http://docs.huihoo.com/erlang/conference/berlin2014/Implementing-Automated-Trading-System-for-the-Power-Market.pdf 挪威国家电力使用Erlang/OTP开发的电力市场自动化交易系统] | ||
+ | *[http://docs.huihoo.com/cufp/2013/Introducing-Erlang-to-OpenX.pdf Introducing Erlang to OpenX] | ||
+ | |||
+ | ==P2P== | ||
+ | *[http://www.infoq.com/cn/interviews/haskell-erlang-p2p-implementation Haskell语言和Erlang语言实现P2P协议的对比] | ||
+ | *[http://codemacro.com/2013/06/20/magnet-search/ 使用Erlang实现P2P磁力搜索] | ||
==图集== | ==图集== | ||
<gallery> | <gallery> | ||
+ | image:actor.png|Actor | ||
+ | image:why-erlang.png|Why Eralng? | ||
+ | image:BEAM-languages.png|BEAM语言 | ||
+ | image:Whatsapp-Viber-Wechat-Technical-Architecture.jpg|Whatsapp, Viber, Wechat技术架构 | ||
+ | image:Erlang-EEP-workflow.png|EEP工作流 | ||
image:erlang-r16b-tools.png|工具 | image:erlang-r16b-tools.png|工具 | ||
+ | image:worktile-xmpp-cluster.png|Worktile | ||
+ | image:taobao-ump.png|淘宝MySQL | ||
+ | image:couchbase-enterprise-edition.png|Couchbase企业版 | ||
+ | image:erlang-spawn-3000000-processes.png|创建300万个进程 | ||
+ | image:Think-in-Erlang.png|Think in Erlang | ||
</gallery> | </gallery> | ||
+ | |||
+ | ==图书== | ||
+ | *[http://book.huihoo.com/concurrent-programming-in-erlang/zh-cn/ 《Erlang并发编程》中文版] | ||
+ | *[http://book.huihoo.com/learn-you-some-erlang-for-great-good/ 《Learn You Some Erlang for great good!》] [http://code.huihoo.com/erlang/learn-you-some-erlang-for-great-good 随书源代码] [http://book.huihoo.com/learn-you-some-erlang-for-great-good/zh/ 中文版,还在翻译中] | ||
+ | *[https://en.wikibooks.org/wiki/Erlang_Programming 维基图书《Erlang Programming》] | ||
+ | *[https://adoptingerlang.org/ 《Adopting Erlang》] | ||
+ | *[https://erlang-in-anger.com/ 《Stuff Goes Bad - Erlang in Anger》] | ||
+ | |||
+ | ==文档== | ||
+ | *[https://erlang.org/download/armstrong_thesis_2003.pdf Making reliabledistributed systemsin the presence ofsodware errors] | ||
+ | *[https://jeena.net/t/GGS.pdf Generic Game Server] | ||
+ | *[https://uu.diva-portal.org/smash/get/diva2:641311/FULLTEXT01.pdf Multiplayer Game Server for Turn-Based Mobile Games in Erlang] | ||
+ | *[https://kth.diva-portal.org/smash/get/diva2:392243/FULLTEXT01.pdf Characterizing the Scalability of ErlangVM on Many-core Processors] | ||
+ | *[http://docs.huihoo.com/erlang/conference/euc2014/scalable-distributed-erlang.pdf Scalable Distributed Erlang] | ||
+ | *[http://www.dcs.gla.ac.uk/research/sd-erlang/release-summary-arxiv.pdf Scaling Reliably: Improving the Scalability of the Erlang Distributed Actor Platform] | ||
+ | *[http://docs.huihoo.com/infoq/qconbeijing-erlang-development-practices-20130425.pdf Erlang开发实践, 在淘宝MySQL平台(UMP)的应用] @淘宝褚霸 | ||
+ | *[http://docs.huihoo.com/infoq/qconbeijing/2015/day2/%e5%9f%ba%e4%ba%8eErlang%e6%9e%84%e5%bb%ba%e5%a4%a7%e8%a7%84%e6%a8%a1%e5%ae%9e%e6%97%b6%e7%b3%bb%e7%bb%9f.pdf 基于Erlang构建大规模实时系统] | ||
+ | *[http://docs.huihoo.com/erlang/inside-the-erlang-vm-with-focus-on-smp-2008.pdf Inside the Erlang VM with focus on SMP] | ||
+ | *[http://docs.huihoo.com/erlang/an-erlang-game-stack-euc2012.pdf An Erlang Game Stack,基于 Erlang + Lua + VoltDB 构建] | ||
+ | *[http://docs.huihoo.com/erlang/ip-inquiry-service-with-erlang.pdf Erlang实战 - 构建IP查询服务] | ||
+ | *[http://docs.huihoo.com/cufp/2013/Medical-Device-Automation-Using-Message-Passing-Concurrency-in-Scheme.pdf Medical Device Automation Using Message-Passing Concurrency in Scheme] | ||
+ | *[https://docs.huihoo.com/cufp/2012/erlang-web-frameworks.pdf Erlang Web Frameworks 460页PPT] | ||
==链接== | ==链接== | ||
+ | *[http://www.erlang.org/ Erlang官网] | ||
+ | *[https://www.erlef.org/ Erlang Ecosystem Foundation] | ||
+ | *[http://www.erlang.org/eep.html Erlang Enhancement Process] | ||
*[http://docs.huihoo.com/erlang/ Erlang开放文档] | *[http://docs.huihoo.com/erlang/ Erlang开放文档] | ||
+ | *[http://docs.huihoo.com/erlang/conference Erlang大会资料] | ||
+ | *[http://lfe.io/ Lisp Flavored Erlang] | ||
*[http://v.ku6.com/special/show_3859073/D00rqtnRwKzJdIsB.html 章亦春:nginx的http服务器&套Web应用开发框架] (注: 章亦春, 国内最活跃的Nginx模块开发者) | *[http://v.ku6.com/special/show_3859073/D00rqtnRwKzJdIsB.html 章亦春:nginx的http服务器&套Web应用开发框架] (注: 章亦春, 国内最活跃的Nginx模块开发者) | ||
*[http://blog.mylkcn.net/senzung.php 轻松实现可伸缩性,容错性,和负载平衡的大规模多人在线系统] | *[http://blog.mylkcn.net/senzung.php 轻松实现可伸缩性,容错性,和负载平衡的大规模多人在线系统] | ||
第98行: | 第222行: | ||
*[http://computebank.spaces.live.com/blog/cns!955689A6CF175077!439.entry 分布式、并行计算语言Erlang 学习笔记(第三部分)] | *[http://computebank.spaces.live.com/blog/cns!955689A6CF175077!439.entry 分布式、并行计算语言Erlang 学习笔记(第三部分)] | ||
*[http://yarivsblog.com/ Yariv's Blog]: Adventures in Open Source Erlang | *[http://yarivsblog.com/ Yariv's Blog]: Adventures in Open Source Erlang | ||
− | |||
*[http://cean.process-one.net/ Comprehensive Erlang Archive Network] | *[http://cean.process-one.net/ Comprehensive Erlang Archive Network] | ||
*http://wagerlabs.com/ | *http://wagerlabs.com/ | ||
第104行: | 第227行: | ||
*http://download.huihoo.com/erlang/ | *http://download.huihoo.com/erlang/ | ||
*[http://blog.csdn.net/slmeng2002/article/details/5532771 Erlang 游戏服务器开发] | *[http://blog.csdn.net/slmeng2002/article/details/5532771 Erlang 游戏服务器开发] | ||
+ | *[http://shiningray.cn/docs/mnesia-a-distributed-robust-dbms-for-telecommunications-applications Mnesia——针对电信应用的健壮分布式DBMS] | ||
+ | *[http://blog.yufeng.info/ 系统技术非业余研究] @淘宝褚霸 | ||
+ | *[http://blog.yufeng.info/archives/2615 whatsapp深度使用Erlang有感] | ||
+ | *[http://blog.yunba.io/go-vs-erlang/ Go vs Erlang] | ||
+ | *[http://blog.yunba.io/erlang-memory-leak/ Erlang 内存泄漏分析] | ||
+ | *[http://www.blogjava.net/yongboy/archive/2013/04/28/398558.html 100万并发连接服务器笔记之Erlang完成1M并发连接目标] | ||
+ | *[http://blog.csdn.net/turingbooks/article/details/3247749 一位Erlang程序员的自白] | ||
+ | *[https://github.com/DavidAlphaFox/erts 对Erlang运行时代码阅读笔记] | ||
+ | *[https://rocketeer.be/articles/concurrency-in-erlang-scala/ Concurrency in Erlang & Scala: The Actor Model] | ||
− | + | [[category:programming language]] | |
− | + | [[category:c programming language]] | |
− | [[ | + | [[category:functional programming]] |
− | [[ | + | [[category:erlang]] |
[[category:concurrent computing]] | [[category:concurrent computing]] | ||
+ | [[category:actor model]] | ||
+ | [[category:Internet of Things]] | ||
+ | [[category:game]] | ||
+ | [[category:advertising]] | ||
+ | [[category:IM]] | ||
+ | [[category:Huihoo Foundation]] |
2023年9月17日 (日) 01:47的最后版本
您可以在Wikipedia上了解到此条目的英文信息 Erlang Thanks, Wikipedia. |
Erlang
目录 |
[编辑] 简介
Erlang是一个结构化,动态类型编程语言,内建并行计算支持。最初是由爱立信专门为通信应用设计的,比如控制交换机或者变换协议等,因此非常适合于构建分布式、软实时并行计算系统。
[编辑] 新闻
[编辑] 功能
EEP Erlang Enhancement Process
Erlang是参与者模型(Actor model)最佳实践。
使用Erlang编写出的应用运行时通常由成千上万个轻量级进程组成,并通过消息传递相互通讯。进程间上下文切换对于Erlang来说仅仅只是一两个环节,比起C程序的线程切换要高效得多得多了。
使用Erlang来编写分布式应用要简单的多,因为它的分布式机制是透明的:对于程序来说并不知道自己是在分布式运行。
Erlang运行时环境是一个虚拟机,有点像Java虚拟机,这样代码一经编译,同样可以随处运行。它的运行时系统甚至允许代码在不被中断的情况下更新。另外如果你需要更高效的话,字节代码也可以编译成本地代码运行。
Types and Function Specifications
- Erlang + Yaws vs. Ruby on Rails
- Open Telecom Platform (OTP) is written in Erlang.
- The Zen of Erlang
[编辑] 版本
- Erlang/OTP 24 Highlights
- 23 OTP 23 Highlights
- 22 OTP 22 Highlights
- 21 My OTP 21 Highlights
- 20
- 19
- 18
- 17
[编辑] 指南
[编辑] 下载
[编辑] 源代码
通过 kerl 编译和安装 Erlang 实例
kerl build git git://github.com/erlang/otp OTP_R16B01_RC1 r16b01_rc1
[编辑] macOS
brew unlink erlang brew install erlang
sudo port selfupdate sudo port install erlang erl 1> toolbar:start(). 2> mnesia:start(). erl -man io
[编辑] Linux/UNIX
mkdir /usr/local/erlang cd /usr/local/erlang mkdir otp_r7b cd otp_r7b gunzip -c <SOME-DIR>/<PREFIX>.tar.gz | tar xfp - ./Install /usr/local/erlang/otp_r7b ln -s /usr/local/erlang/otp_r7b/bin/erl /usr/local/bin/erl
or Unpack, configure, make, and install as follows:
$ tar -xzf otp_src_R11B-4.tar.gz $ cd otp_src_R11B-4 $ ./configure $ make $ sudo make install
or debian
apt-get install erlang
or centos
yum install erlang
[编辑] Windows
先安装.exe文件, 再将 D:\Program Files\erlang-5.6\bin 加入 path 环境变量
[编辑] 使用
1> toolbar:start(). 2> halt(). // 退出 3> 2 + 5. 4>(42 + 77) * 66 / 3. 5> [First |TheRest] = [1,2,3,4,5]. 6> First. 7> TheRest. 8> io:format("hello world~n", []).
[编辑] 函数式编程
-module(hhfuns). -compile(export_all). one() -> 1. two() -> 2. add(X,Y) -> X() + Y(). increment([]) -> []; increment([H|T]) -> [H+1|increment(T)]. decrement([]) -> []; decrement([H|T]) -> [H-1|decrement(T)]. map(_, []) -> []; map(F, [H|T]) -> [F(H)|map(F,T)]. incr(X) -> X + 1. decr(X) -> X - 1.
[编辑] 工具
在用户目录下创建.emacs,如 /Users/huihoo/.emacs 加入以下内容: (setq load-path (cons "/usr/local/opt/erlang/lib/erlang/lib/tools-2.9.1/emacs" load-path)) (setq erlang-root-dir "/usr/local/opt/erlang") (setq exec-path (cons "/usr/local/otp/erlang/bin" exec-path)) (require 'erlang-start)
- Erlang Development Tool Suite
- ErlyBird for NetBeans
- ErlIDE for Eclipse
- Wrangler Erlang重构工具
[编辑] wxWidgets
[编辑] 项目
- Awesome Erlang
- Awesome Elixir
- Erlang @ GItHub
- Languages, and about languages, on the BEAM
- Erlang Solutions
- N2O Enterprise Frameworks © SYNRC
- mnesia A distributed telecommunications DBMS
- cowboy
- Riak 值得关注的k/v分布式存储数据库
- chicago boss Web框架
- Apache CouchDB
- Couchbase
- Zotonic
- Megaco
- Eddie
- Wings 3D
- Jungerl
- ErlyWeb
- MochiWeb
- Yaws - http://yaws.hyber.org/
- Scalaris
- Disco MapReduce框架,Erlang + Python
- EMQ
- MongooseIM
- ejabberd
- RabbitMQ
- pooler An OTP Process Pool Application
- Tnesia Time-series Data Storage
- asdf - install and manage different Elixir and Erlang versions
[编辑] 案例
Facebook选择了C++和Erlang的组合。C++模块用户用于记录聊天信息,而Erlang模块“将在线用户的对话保存在内存中并且对长时间轮询(long-polled)请求提供支持”。epoll,Linux 2.6中出现的新系统调用,被用于驱动Erlang模块。Eugene 解释了决定选用Erlang的原因:简单的说就是因为Erlang能很好地满足我们的要求。Erlang是一种面向同步的函数式语言,它具有极其轻量级的用户空间“进程”,无共享的消息传递语义,内置的分布式系统和一个被二十多年实时软件系统实践所检验过的灾难恢复系统。
- Yahoo用Erlang重写了Delicious Developing Erlang at Yahoo
- 支撑4.5亿活跃用户的WhatsApp架构概览、日600亿消息,月4.65亿用户——WhatsApp的Erlang世界、Scaling to Millions of Simultaneous Connections
- Worktile千万级消息系统构建实践
- Using Erlang, Riak and the ORSWOT CRDT at bet365 for Scalability and Performance
- bet365 Lessons learnt re-writing a PubSub system
- 游戏 Game of War:Realtime performance at scale: the search for the Holy Grail
- AOL RTB 系统,Real Time Bidding with Erlang
- 挪威国家电力使用Erlang/OTP开发的电力市场自动化交易系统
- Introducing Erlang to OpenX
[编辑] P2P
[编辑] 图集
[编辑] 图书
- 《Erlang并发编程》中文版
- 《Learn You Some Erlang for great good!》 随书源代码 中文版,还在翻译中
- 维基图书《Erlang Programming》
- 《Adopting Erlang》
- 《Stuff Goes Bad - Erlang in Anger》
[编辑] 文档
- Making reliabledistributed systemsin the presence ofsodware errors
- Generic Game Server
- Multiplayer Game Server for Turn-Based Mobile Games in Erlang
- Characterizing the Scalability of ErlangVM on Many-core Processors
- Scalable Distributed Erlang
- Scaling Reliably: Improving the Scalability of the Erlang Distributed Actor Platform
- Erlang开发实践, 在淘宝MySQL平台(UMP)的应用 @淘宝褚霸
- 基于Erlang构建大规模实时系统
- Inside the Erlang VM with focus on SMP
- An Erlang Game Stack,基于 Erlang + Lua + VoltDB 构建
- Erlang实战 - 构建IP查询服务
- Medical Device Automation Using Message-Passing Concurrency in Scheme
- Erlang Web Frameworks 460页PPT
[编辑] 链接
- Erlang官网
- Erlang Ecosystem Foundation
- Erlang Enhancement Process
- Erlang开放文档
- Erlang大会资料
- Lisp Flavored Erlang
- 章亦春:nginx的http服务器&套Web应用开发框架 (注: 章亦春, 国内最活跃的Nginx模块开发者)
- 轻松实现可伸缩性,容错性,和负载平衡的大规模多人在线系统
- http://forum.javaeye.com/viewtopic.php?t=22318
- 分布式、并行计算语言Erlang 学习笔记(第一部分)
- 分布式、并行计算语言Erlang 学习笔记(第二部分)
- 分布式、并行计算语言Erlang 学习笔记(第三部分)
- Yariv's Blog: Adventures in Open Source Erlang
- Comprehensive Erlang Archive Network
- http://wagerlabs.com/
- http://erlang-china.org/
- http://download.huihoo.com/erlang/
- Erlang 游戏服务器开发
- Mnesia——针对电信应用的健壮分布式DBMS
- 系统技术非业余研究 @淘宝褚霸
- whatsapp深度使用Erlang有感
- Go vs Erlang
- Erlang 内存泄漏分析
- 100万并发连接服务器笔记之Erlang完成1M并发连接目标
- 一位Erlang程序员的自白
- 对Erlang运行时代码阅读笔记
- Concurrency in Erlang & Scala: The Actor Model