Clojure 是什么?
引自官方网站的介绍
引用
Features
* Dynamic Development
* Functional Programming
* Lisp
* Runtime Polymorphism
* Concurrent Programming
* Hosted on the JVM
* Dynamic Development
* Functional Programming
* Lisp
* Runtime Polymorphism
* Concurrent Programming
* Hosted on the JVM
它基于JVM,能调用Java的类库,支持并发,与Scala(http://www.scala-lang.org/)很相似。先前曾有人将Scala比作是Java平台上的Erlang语言。
官方例子:基于Lisp语法,使用了Java并发库的并发编程
代码
可见这里的并发只是使用了Java的线程,并非像Scala那样基于Actor模型。
在论坛 http://groups.google.com/group/clojure/browse_thread/thread/2a2b24ffef5d1631 上面,有人提出了这样的对比:
引用
Erlang: The Movie <=> Clojure: The Podcast
Single Assignment <=> Immutable Data Structures
Mnesia <=> STM
ErlangVM <=> JVM
Hipe <=> JIT
Pattern Matching <=> Multimethods
Erlang Shell <=> REPL
Hot Code Reload <=> Dynamic Compilation
Behaviours <=> Extensible Abstractions
Tail Recursion <=> recur
fun <=> fn
syntax from 1987 <=> syntax from 1958
EMP2 <=> CL style macros
Fiber/Actor <=> Termite
Single Assignment <=> Immutable Data Structures
Mnesia <=> STM
ErlangVM <=> JVM
Hipe <=> JIT
Pattern Matching <=> Multimethods
Erlang Shell <=> REPL
Hot Code Reload <=> Dynamic Compilation
Behaviours <=> Extensible Abstractions
Tail Recursion <=> recur
fun <=> fn
syntax from 1987 <=> syntax from 1958
EMP2 <=> CL style macros
Fiber/Actor <=> Termite
有兴趣的朋友,可以到 http://clojure.sourceforge.net/ 下载