[英]Bruce Tate:恐懼是我寫作《七週七語言》的初衷(圖靈訪談)

盼盼姐發表於2015-06-30

Bruce Tate現任icanmakeitbetter.com的CTO,他的團隊主要工作語言是Elixir以及Ruby on Rails。他曾任職於IBM公司13年,並擔任過多家公司的客戶解決方案總監和CTO。Bruce是一位受歡迎的國際講師,他曾在丹麥、班加羅爾、華盛頓、斯特哥爾摩等世界各地發表過主題演講。Bruce著有十餘本技術書,其中包括3本JavaOne暢銷書,以及兩本Jolt大獎獲獎圖書:《七週七語言》Better, Faster, Lighter Java

iTuring: What was the inspiration for you to write Seven Languages in Seven Weeks?

Interesting question! You might not have guessed, but Seven Languages in Seven Weeks was written out of fear. I was concerned that as hardware designs changed, the crop of programming languages like Java, Ruby, Python, C# and C++ would not be good languages to handle multiple cores. I was afraid because most of my own experience was in these languages. I decided to do some research. After a while, I thought others might want to follow me through this journey, so the idea for Seven Languages in Seven Weeks was born.

The title is kind of audacious. No one can really learn seven languages in seven weeks, but the title makes people think, "Why should I try to learn languages? What do I have to gain?" I didn't expect the book to be popular, but the idea took off.

iTuring: If you are going to rewrite Seven Languages in Seven Weeks,would you select the same languages or would you include one or two more new languages?

That's a question I've already answered, because I wrote a second book, Seven More Languages. Hopefully, it will be translated soon. I wrote about Elixir, a language inspired by the first Seven in Seven book. I also wrote about Elm, a book to do reactive programming, and compiles to JavaScript. Fred Doad wrote a chapter on Factor; Ian Dees wrote about Idris (a mind-blowing language that explores type theory) as well as Lua, and Jack Moffitt wrote on Julia (concurrency friendly technical computing) and the final chapter was on MiniKanren, basically Lisp meets Prolog. The other authors allowed me to attack a new book much more quickly than I would have done myself.

iTuring: Why did you choose Clojure, the dialect of Lisp, instead of Lisp itself to be included in your book?

Clojure is the most active Lisp dialect by a long shot. Part of writing a book is finding topics that interest potential readers, and Clojure captures our imagination. It's focused on the right set of issues, like making Lisp more accessible and the concurrency mechanisms. I like that this language is giving Lisp new life. I've always been a closet Lisp fan, but Clojure is more. The small syntax tweaks and accessibility to the Java virtual machine change the character of Lisp, and also make it much more accessible.

iTuring: With the feature of functional programming added to Java 8, is it possible that Scala would lose some of its major advantages comparing to Java? Will Scala's future still be promising?

Java really had to change. It was long past time that Java add closures. Still, it's not enough for true functional programming. Scala adds so many tremendous ideas, like currying, a better type system, type inference, and great libraries. You can see Scala exploding in popularity, and there's a good reason for that. It brings true functional programming to the Java community and allows object oriened programming at the same time.

iTuring: What are the major factors that decide the popularity of a programming language?

That's the question I was wrestling with as I wrote Seven Languages. Many factors go into language adoption. There's always some underlying business problem, a catalyst, if you will. In this case, the catalyst is concurrency and new hardware designs. But there's also things like accessibility, beauty, and practicality. New languages have to work through community. Great languages, and popular languages, decide when to take a stand, and stay true to their goals. Marketing is of course huge. And some of it comes down to taste.

All of that is to say, I don't know, and that's ok! I think seven is more fun than one, in many ways.

iTuring: Logic programming is not very popular right now, would there be opportunities for it to become a mainstream? What kind of opportunity would it be?

Logic programming is not main stream, but constraint-based systems form a very important part of our ecosystem. Problems like scheduling and logistics demand logic-based systems, and people who can solve those kinds of problems in these kinds of languages can do very well for themselves.

iTuring: What language has caught your eye recently? What would you expect languages to be like in the future?

My company is investing heavily in Elixir right now. I am also a huge fan of Elm. But I think the next generation of programming languages will use types much more effectively than we do right now. I could see a language with a type system like Haskell, but maybe the language is not so strict, or has features to make that strictness more accessible to programmers.

iTuring: Functional programming seems to be especially difficult for beginners to learn, do you think functional programming languages were designed for coders with higher intelligence?

I do think functional programming is hard for object oriented developers. But I don't think it's necessarily harder to learn than object oriented programming was. I just think it's new. The problem is that we're going to teach a new generation of programmers not just functional programming, but also advanced concepts like concurrency and distribution, and maybe higher level abstractions like type classes or macros or things like that. It's hard to learn so many new concepts at once.

iTuring: As a coder, what is the most efficient way to find the most suited language for oneself?

Code in different languages! Use a language to write something non-trivial. You'll become a better programmer, and even a better person.

iTuring: Why does your team choose Elixir as your working language? It takes courage for a whole team to adopt a minority language, what unique advantages has it brought? Is there anything to look out (as advice for other teams who have interests in adopting minority languages)?

Our team loves Ruby, because it is so productive. The metaprogramming is excellent, and the syntax and features feel natural. The tooling is excellent. Still, we were hitting a wall because when we had to solve concurrency problems, the language was holding us back. We expected this problem to continue, and get worse over time.

Elixir provides the higher level abstractions, but still maintains the joy that Matz built into Ruby. It also provides the concurrency enabled by Erlang, and the models for monitoring and failure that we love.

I don't think other teams will need to be nudged very hard to adapt new languages, because the new hardware designs will make it obvious soon that the old languages are no longer getting it done. My advice is to try out languages and see how well you need them to fit the problems you need to solve. Finally, take your time. It took us two years to choose functional programming and Elixir. It will take a while to move our most important production systems to it.


更多精彩,加入圖靈訪談微信!

相關文章