为什么用clojure作为storm 的主要开发语言

Posted 牛顿的小脑

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了为什么用clojure作为storm 的主要开发语言相关的知识,希望对你有一定的参考价值。


Why you choose Clojure as the development language of Storm? Could you talk about your long practical experience about using this language (like its advantages and disadvantages)? Which feature won‘t appear in the Storm, if you were not using Clojure?

Clojure is the best language I‘ve ever used, by far. I use it because it makes me vastly more productive by allowing me to easily use techniques like immutability and functional programming. Its dynamic nature by being Lisp-based ensures that I can always mold Clojure as necessary to formulate the best possible abstractions. Storm would not be any different if I didn‘t use Clojure, it just would have been far more painful to build.


What do you do to improve your skills as a programmer?

I get better by doing a lot of programming and trying new things. One of the best ways to become a better programmer is to learn new programming languages. By learn I mean more than just learning the syntax of the language, I mean understanding the language‘s idioms and writing something substantial in it. For me, learning Clojure made me a much better programmer in all languages.

还有邮件组里的[2]:
"Is Storm mostly written in Java?"

If you look at the languages graph on Github, it says that Storm is
"64% Java". However, this is inaccurate because those numbers include
the Java code generated by the Thrift compiler. If you exclude the
generated code, you‘ll find that Storm is over 50% Clojure in terms of
line count. In terms of functionality though, Storm is around 98%
Clojure. The Java code I wrote is mostly interfaces and small classes
that a user of Storm would encounter in the public API (Java is, ahem,
verbose).

"Why isn‘t Storm written completely in Clojure?"

I want Storm to be as accessible to as wide an audience as possible. A
user‘s language preference or constraints shouldn‘t prevent them from
being able to use Storm to solve their realtime computation problems.
This is why I chose to define Storm‘s main interfaces in Java, and
this is also why Storm supports using any language (including non-JVM
ones) on top of Storm. That said, Storm has a Clojure DSL for
programming topologies which is what I personally use for developing
topologies.

Clojure was a magnificent language to use to build Storm. Storm is a
complex, intricate system, and Clojure helped a great deal in managing
the complexity of the implementation. 

以上是关于为什么用clojure作为storm 的主要开发语言的主要内容,如果未能解决你的问题,请参考以下文章

Clojure环境的搭建

大数据实战项目必备技能三:storm

为什么需要用 Clojure 来开发你的下一个微服务

Storm集成Kafka应用的开发

大数据(十四) - Storm

Storm集成Kafka应用的开发