GithubHelp home page GithubHelp logo

orb / clojuratica Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gasc/clojuratica

10.0 4.0 2.0 2.87 MB

An interface between Clojure and Mathematica

Home Page: http://clojuratica.weebly.com/

Clojure 45.71% Mathematica 54.29%

clojuratica's Introduction

Clojuratica

An interface between Clojure and Wolfram Mathematica.

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 concurrancy and state, exciting facilities for functional programming and immutability, and a growing reputation for doing all the right things. Wolfram Mathematica is arguably the world's most powerful integrated tool for numerical computation, symbolic mathematics, optimization, and visualization and is build on top of its own splendid functional programming language.

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, matricies, 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.

Clojuratica is open-source and targeted at applications in scientific computing, computational economics, finance, and other fields that rely on the combination of parallelized simulation and high-performance number-crunching. Clojuratica gives the programmer access to Clojure's most cutting-edge features--easy concurrency and multithreading, immutable persistent data structures, and software transactional memory---alongside Mathematica's easy-to-use algorithms for numerics, symbolic mathematics, optimization, statistics, visualization, and image-processing.

The canonical pronunciation of Clojuratica starts with Clojure and rhymes with erotica.

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. It is currently maintained by Norman Richards.

Dependencies

Clojuratica requires J/Link, which is currently only available with a Mathematica install. On Mac OS X, for example, J/Link is located in /Applications/Mathematica.app/SystemFiles/Links/JLink/JLink.jar.

To install JLink as a maven dependency:

mvn install:install-file -DgroupId=com.wolfram.jlink -DartifactId=JLink -Dversion=4.4 -Dpackaging=jar -Dfile=jlink/JLink.jar

To install the JLink native JAR for OS X:

mvn install:install-file -DgroupId=com.wolfram.jlink -DartifactId=JLink-native -Dversion=4.4 -Dclassifier=native-osx -Dpackaging=jar -Dfile=jlink/JLink-native-osx.jar

If we don't have a native JAR for your platform, set the JLINK_LIB_DIR to the JLink directory in your platform's mathematica installation.

export JLINK_LIB_DIR=/Applications/Mathematica.app/SystemFiles/Links/JLink/

The Clojuratica team is working on making the use of J/Link smoother.

Running

OS X Example

$ lein with-profile +osx repl
nREPL server started on port 49363 on host 127.0.0.1
REPL-y 0.3.0
Clojure 1.5.1
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

user=> (init-osx)
(#'user/math)
user=> (math (WolframAlpha "How many licks does it take to get to the center of a Tootsie Pop?"))
[(-> [["Input" 1] "Plaintext"] "How many licks does it take to get to the Tootsie Roll center of a Tootsie Pop?") (-> [["Result" 1] "Plaintext"] "3481\n(according to student researchers at the University of Cambridge)")]
user=> (math (N Pi 20))
3.141592653589793238462643383279502884197169399375105820285M

License

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

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.

clojuratica's People

Contributors

gasc avatar orb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

dfarmer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.