在游戏开发中,有些服务器就是通过Erlang来编写的。写一篇文章来分析服务器。
概述
Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability. Some of its uses are in telecoms, banking, e-commerce, computer telephony and instant messaging. Erlang’s runtime system has built-in support for concurrency, distribution and fault tolerance.
OTP is set of Erlang libraries and design principles providing middle-ware to develop these systems. It includes its own distributed database, applications to interface towards other languages, debugging and release handling tools.
大体结构
1 | -inc |
脚注
put/get语法
1 | 这段代码是一个 Erlang 监听器处理连接请求的函数,其具体含义如下: |
语法帮助
Elixir-脚本扩展
Erlang 之后发明的脚本语言是 “Elixir”。Elixir 是一种函数式编程语言,它运行在 Erlang 虚拟机(BEAM)上,继承了 Erlang 的并发和容错特性,并添加了更多现代编程语言的功能,如宏和扩展的元编程能力。