Mathematica is a fantastic platform for Mathematical analysis, physics, quantitative finance and most realms of scientific work.

However, it doesn't serve well for general purpose programming, in particular web apps.

If I have some code running in Mathematica doing some analysis and a web app written E.G. Ruby-on-Rails, Django etc what are some methods to synchronize and manage the interactions between Mathematica and the web fronted?

An example might be, a Django based dating site, which the Mathematica code needs to do some calculations to find your true love, and write results back into a database. Beyond a cron job running Mathematica every 10 minutes I can't see a straightforward way to do this.

How can one make Mathematica play well in a heterogeneous environment?

  • 1
    $\begingroup$ If you're not using WebMathematica and try to integrate a "regular" copy with a web interface, you're probably violating the license agreement. But to decide that, you'd (a) need a specific example and (b) ultimately still may need to ask Wolfram support. $\endgroup$ – Jens Apr 1 '15 at 1:12
  • 1
    $\begingroup$ Well right now it's just MathematicaScript updating stuff in a database via a cron job every 15 minutes. I'm pretty sure that's within the license. $\endgroup$ – user4860 Apr 1 '15 at 1:14
  • 1
    $\begingroup$ Two (possible) solutions for this integration problem would be webMathematica and CloudAPI $\endgroup$ – Mike Honeychurch Apr 1 '15 at 1:33
  • $\begingroup$ As an answer to the (very general) title: check External Interfaces & Connections in the documentation. $\endgroup$ – Szabolcs Apr 2 '15 at 3:47


Java (and java interop) Mathematica has very good Java interoperability. So if you can interface with your platform of choice via Java there are options available.

  1. If your web app or application is written in Java interface directly with it via Java.
  2. Message queue. There's a Java library for practically every message queue out there. So you can use a message queue to communicate between your Mathematica code and your application.


  1. Cron job. Run your process once every few minutes as a MathematicaScript Via Cron job. This is the simplest solution that could possibly work.
  2. ??? I"m missing something here, I'm sure.

Wolfram universe options I call these wolfram universe options because things that come out of Wolfram seem to have a distinct flavour differing from the rest of the technology/software development world. Not necessarily better or worse, but definitely a different viewpoint and flavour.

  1. Cloud deployment, as an API.
  2. Scheduled tasks. Mathematica now has its own version of Cron jobs! You can use Mathematica scheduled tasks to run your analysis on regularly scheduled intervals.

What other options are there?

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy