An Interface Between Clojure and Wolfram Mathematica
Note: Clojuratica is not maintained (but reports are it still works - source in the GitHub repo).
What is Clojuratica?
Clojuratica brings together two of today's most exciting tools for high-performance, parallel computation.
Clojure is a new dynamic programming language with a compelling approach to concurrency and state, exciting facilities for functional programming and immutability, and a growing reputation for doing all the right things. Wolfram Mathematica is one of the world's most powerful integrated tools for numerical computation, symbolic mathematics, optimization, and visualization and is built on top of a functional programming language of its own.
By linking the two:
Clojure is a new dynamic programming language with a compelling approach to concurrency and state, exciting facilities for functional programming and immutability, and a growing reputation for doing all the right things. Wolfram Mathematica is one of the world's most powerful integrated tools for numerical computation, symbolic mathematics, optimization, and visualization and is built on top of a functional programming language of its own.
By linking the two:
- Clojuratica lets you write and evaluate Mathematica code in Clojure with full syntactic integration. Now Clojure programs can take advantage of Mathematica's enormous range of numerical and symbolic mathematics algorithms and fast matrix algebra routines.
- Clojuratica provides the seamless and transparent translation of native data structures between Clojure and Mathematica. This includes high-precision numbers, matrices, N-dimensional arrays, and evaluated and unevaluated Mathematica expressions and formulae.
- Clojuratica lets you call, pass, and store Mathematica functions just as if they were first-class functions in Clojure. This is high-level functional programming at its finest. You can write a function in whichever language is more suited to the task and never think again about which platform is evaluating calls to that function.
- Clojuratica facilitates the "Clojurization" of Mathematica's existing parallel-computing capabilities. Mathematica is not designed for threads or concurrency. It has excellent support for parallel computation, but parallel evaluations are initiated from a single-threaded master kernel which blocks until all parallel evaluations return. By contrast, Clojuratica includes a concurrency framework that lets multiple Clojure threads execute Mathematica expressions without blocking others. Now it is easy to run a simulation in Clojure with 1,000 independent threads asynchronously evaluating processor-intensive expressions in Mathematica. The computations will be farmed out adaptively and transparently to however many Mathematica kernels are available on any number of processor cores, either locally or across a cluster, grid, or network.
News
11/22/09: Version 2 alpha 2 was released today. Added is the evaluator flag :N (and corresponding flag :no-N). Like the Mathematica function N, it stands for numeric. When enabled, the flag speeds up by a factor of 10 the Mathematica-to-Clojure parsing of homogeneous numeric lists (and multidimensional arrays). The trade-off is that the contents become doubles. The flag affects what would otherwise become Clojure vectors/seqs of integers, doubles, bigints, and bigdecimals; these are all cast to vectors/seqs of doubles. Vectors/seqs of rationals (Clojure ratios) are unaffected by the flag and receive neither casting nor speedup.
11/20/09: Version 2 alpha 1 was released today! Please see Intro for more information. Yes, we skipped 1.x. With the new syntactic integration and complete rewrite it seemed right to commemorate the release with a full increment.
8/22/09: Clojuratica v0.96 was released today. The software is now feature-complete for v1.0. Standout improvements in this release:
8/02/09: Clojuratica v0.91 will be released later this week. The GitHub repository already contains most of the new features, for those ambitious enough to brave it without documentation.
7/27/09: Clojuratica v0.9 was released to the Clojure community. Suggestions are welcome!
11/20/09: Version 2 alpha 1 was released today! Please see Intro for more information. Yes, we skipped 1.x. With the new syntactic integration and complete rewrite it seemed right to commemorate the release with a full increment.
8/22/09: Clojuratica v0.96 was released today. The software is now feature-complete for v1.0. Standout improvements in this release:
- Full Mathematica interface to Clojure. Call Clojure from Mathematica with seamless data-type translation.
- First-class Mathematica functions in Clojure. Write Mathematica functions and call them in Clojure as though they were Clojure functions. The evaluation is handled transparently by Mathematica. Parallelization of the function calls is automatic and transparent.
- Greatly improved internals. Better data structure handling. Data-type translation is many times faster than before. Parallel computation queue is lightening fast.
- Rewritten Tutorial covering all features.
8/02/09: Clojuratica v0.91 will be released later this week. The GitHub repository already contains most of the new features, for those ambitious enough to brave it without documentation.
7/27/09: Clojuratica v0.9 was released to the Clojure community. Suggestions are welcome!
More On Clojure
It has been said that Clojure feels like a programming language beamed back from the near future. It is well suited to "concurrency-oriented programming," a new paradigm brought on by the proliferation of multicore machines and high-performance computational clusters.
|
More On Mathematica
Wolfram Mathematica is perhaps the most powerful piece of software available today for numerical and symbolic mathematics, optimization, data visualization, and data analysis.
|
Author
Clojuratica was created by Garth Sheldon-Coulson, a graduate student at the Massachusetts Institute of Technology and Harvard Law School. See the Community page to find out how to contribute to Clojuratica, suggest features, report bugs, or ask general questions.
Legal
The product names used in this web site are for identification purposes only. All trademarks and registered trademarks, including "Wolfram Mathematica," are the property of their respective owners. Clojuratica is not a product of Wolfram Research. The software on this site is provided "as-is," without any express or implied warranty.