Joe Armstrong,Erlang最初的设计者和实现者,他也是Erlang OTP系统项目的首席架构师。他拥有瑞典皇家理工学院博士学位,是容错系统开发领域的世界级专家。Armstrong起初是一名物理工作者,在攻读物理学博士学位时因为用完积蓄而转向了计算机科学,找到一份研究员的工作,为英国人工智能领域奠基人之一的Donald Michie工作。在此期间,他成为英国机器人学会的创始成员并撰写了一些有关机器人视觉的论文。人工智能的资金来源枯竭,Armstrong又回到了物理学领域。开始时他在欧洲非相干散射科学协会工作,后来又到了瑞典空间研究中心,最后加入了爱立信计算机科学实验室,Erlang就是在那里发明的。

在现代语言的版图中,Erlang有点另类。同很多流行的语言相比,它既老又新。早在1986年,也就是Perl出现的前一年,Armstrong就已经开始了Erlang的工作,当时它只作为商用产品出售并且主要在爱立信公司内部使用。这种情况直到1998年Erlang作为开源项目发布后才发生变化,那时Java和Ruby已经问世3年了。当时Erlang设计初衷也相当明确,它针对的软件是类似于电话交换机那样的高可用性、高可靠性系统。

iTuring: There are hundreds of programming languages in the world, some of them are highly efficient and concise, but they have never been widely used. In your opinion, what does it take to make a successful language?

A: A new language has to be extremely good for solving some particular class of problem. The type of problem must be one that people want to solve, and the alternative languages should be bad at solving this problem. For commercial success somebody must be able to earn money by using the language. Use of the language should give some competitive advantage over the use of other languages.

iTuring: What have been the crucial factors that have made Erlang as it is today?

A: Erlang's first opportunity came due to the failure of a large project programmed in a different programming language. We were able to save the project by reprogramming the hardware in Erlang.

The second significant factor was when Erlang was briefly banned by Ericsson in 1998. This led to a sequence of events where Erlang became open source and a number of companies were formed that chose Erlang as their principle technology.

More recently WhatsApp was purchased by Facebook for $19B USD - making this the largest ever software acquisition. WhatsApp was programmed in Erlang, and this fact has attracted a lot of interest.

iTuring: You have commented highly about Elixir. Do you think Erlang will be influenced by Elixir in the future?

A: Yes - but not only by Elixir, also by developments in other languages.

iTuring: How Erlang is going to evolve? Are there any key points?

A: Erlang was developed when machine memories were of the order of a few Megabytes, so we decided to only allow two versions of the same module to co-exist. Now we have Gigabyte memories, so we could have thousands of versions and let the garbage collector remove unused versions.

In the original Erlang implementation, message passing times between processes on the same machine was constant. On multi-core computers this is no longer true, so we have to consider the physical placement of processors on multi-cores.

In the very near future we will see the emergence of massively multi-cores with thousands of CPUs per chip, some of the cores will be broken due to manufacturing problems and so we need to learn how to map Erlang processes onto the available cores.

We also need to understand energy use. For environmental reasons it is important to understand how to maximize performance and simultaneously minimize energy consumption. Massive multi-cores running at low voltages and clock rates can be used to minimize energy consumption, but we still need to do a lot of work to understand how to program these.

iTuring: Do you think Erlang and Scala are rivalries to each other? What are their unique advantages?

A: They are rivals - but Scala is closely tied to the JVM. Scala provides a migration path for Java programmers, but Scala has completely different run-time characteristics to Erlang. There are many problems for which Erlang is good and Scala bad and the other way around.

iTuring: Among concurrent, parallel and distributed programming, which area Erlang does best? And which area it does worst? Why is that?

A: Erlang is best at co-ordinating parallel activities and handling faults, Erlang programs also scale well when run on multi-cores.

Erlang is not good at memory intensive numerical computations. The reason for this has to do with fault-tolerance and memory management. To make things fault-tolerant we have to keep copies of data in different places so if one process crashes we can restart it somewhere else. All this copying takes time. Efficient numerical computations can be done in-memory and without much copying, but this is at the expense of fault-tolerance.

Making things fault-tolerant costs CPU time and memory, so if you don't want fault-tolerant and distribution you would be better off not using Erlang.

iTuring: If you can start again, is there anything you would like to change in Erlang?

A: Yes - many things. But the language is slowly changing. There are several things I'd like to see. Everything should be first class. Modules, for example, are not first class, we can't easily turn a module into a list of functions, or a list of functions into a module. We should be able to construct and deconstruct any Erlang object. Things like protocols, which are implicit, should be made explicit.

The Erlang programming model for distributed programming needs to be extended for "planetary scale distribution". Right now we can register a process on an individual Erlang node, or on a cluster of nodes, but not in away that would allow every computer in the world to access it.

iTuring: XML language doesn't’t seem to fit in today’s environment of big data. What feature the new language ML9 should have to keep up XML’s advantages while eliminating its defects?

A: ML9 was an experiment which I'm no longer maintaining. XML is fine but should never be used for long-term storage or transmission of large volumes of data. XML is great for small configuration files and so on, but not large data volumes.

iTuring: There are many programmers of Ruby, Java, or Python who would like of learn Erlang, do you have some learning suggestions for them?

A: Read my book!

iTuring: You have mentioned that Dave Thomas had advised you a lot about writing, what have you learned from your writing experience? And what advices would you like to give to other new authors?

A: I've really learned to enjoy writing, and to keep on revising and re-writing the text to improve it. I also get a set of mixed readers to read the text and tell me if they understand it. I really appreciate lots of feedback, so if people don't understand what I have written then I can write more explanation. Without feedback I don't know which parts people find easy to understand and which parts are difficult.

For many years I found writing very difficult, at school I was good at math but bad at writing, but I worked at it and Dave Thomas gave me lot's of great advice so now it's the other way around.

The most difficult part of being an author is trying to put yourself in the position of somebody who does not know what you know, so you have to imagine the problems they will have and try and solve them before the have them.


更多精彩,加入图灵访谈微信!