Clojure
Appearance
Paradigm | Multi-paradigm, Dynamic, Functional |
---|---|
Designed by | Rich Hickey |
Developer | Rich Hickey |
First appeared | 2007 |
Stable release | 20080916
/ 2008-09-16 |
Typing discipline | dynamic, strong |
OS | Cross-platform |
License | Common Public License |
Website | http://clojure.org |
Influenced by | |
Lisp, Java, ML, Haskell, Erlang |
Clojure is a dialect of Lisp that runs on the Java Virtual Machine. It is a general-purpose language sporting interactive development, and it encourages a functional programming style that enables simplified multithreaded programming. Clojure honors the code-as-data philosophy and has a sophisticated Lisp macro system.
Philosophy
- Lisp is a good thing.
- Functional programming is a good thing.
- VMs, not OSes, are the platforms of the future.
- The JVM has a huge set of facilities, both built-in and 3rd-party.
- Object orientation is overrated.
- Polymorphism is a good thing.
- Concurrency and the multi-core are the future.
Syntax
Like any other Lisp, Clojure's syntax is built on S-expressions that are first parsed by a reader before being compiled. Unlike other lisps Clojure's reader supports maps and vectors in addition to lists.
Clojure is not intended to be code-compatible with other dialects of Lisp.
Clojure is a Lisp-1.
Language Features
- Dynamic development with a read-eval-print loop
- Provides a rich set of persistent data structures
- Concurrent programming through software transactional memory
- Can natively call methods from any Java library
- Java compatible: Clojure can call natively call methods from any Java library, and Java programs can call Clojure functions
- Clojure is a Compiled language producing JVM Bytecode
External links
References
- "Rationale". Rich Hickey. clojure.org. Retrieved 2008-10-17.