Tools for Expressive, Multifunctional Numerical Computing on the JVM

I am looking for numerical snap-ins on the JVM. My main requirements are expressiveness / readability, ease of use, evaluation and functions in terms of mathematical functions. I think I'm behind something like a Matlab kernel (possibly including some basic libraries and without graphics) on the JVM. I would like to be able to throw out the computational code on the running JVM and evaluate this code. I do not want to worry about types. Arbitrary accuracy and performance are not so important.

I suppose there are some good libraries, but I think an appropriate language is needed to get expressive.

What instrumentation do you propose to solve with the help of expressive, multifunctional numerical calculations on the JVM?

+4
source share
6 answers

On the jGroovyLab page:

The GroovyLab environment aims to provide the Matlab / Scilab scientific computing platform, which is supported by the Groovy scripting engine. A GroovyLab user can work either with the Matlab-lke command console or with a flexible editor based on the jsyntaxpane component ( http://code.google.com/p/jsyntaxpane/ ), which offers more convenient code development. In addition, GroovyLab supports computer algebra based on the symja project ( http://code.google.com/p/symja/ ).

And there is also GroovyLab :

GroovyLab is a set of Groovy classes for providing syntax and basic functions corresponding to matlab (linear algebra, 2D / 3D graphics). It is based on jmathplot and jmatharray libs:

Groovy has a smooth learning curve for Java programmers and a flexible syntax like Ruby. It is also quite easy to write DSL on it .

Although Groovy performance is pretty good for a dynamic language , you can use static compilation if you need it.

+3
source

Most of Mathworks Matlab is built on the Intel Math Core Library (MKL), which (IMHO) is an unrivaled champion in linear algebra computing. There is java support, but it costs $ 500 (MKL, not just java support) ...

The best second option if you want to use java is jblas , which uses BLAS and LAPACK, industry standards for linear algebra.

The effects of pure java libraries look awful, see here ...

+3
source

Spire sounds like it is aimed at the area you are looking at. It uses many of the latest scala functions, such as macros, to get decent performance without sacrificing the expressiveness of being in a high-level language.

There is also a breeze , which is designed for machine learning, but includes enough linear algebra material.

+2
source

Depending on what kind of work you want to learn and in which languages ​​you are already familiar, Incanter in the world of Clojure may be worth a look. Core.matrix is also rapidly developing in Clojure right now, the goal of which is to encapsulate common high-level abstractions in linear algebra implemented in various ways or packages.

You emphasized expressiveness in your post, and the nice thing about Clojure is that, like Lisp, you can create or extend DSLs to match problem domains. This is one of the great features of the language (and in general Lisps).

+2
source

I am the author of the original core.matrix for Clojure. Therefore, I have a clear affinity and much more knowledge in this particular space. However, I will still try to give you an honest answer :-)

I was in the same position as a year ago, looking for a solution for numerical computing that would be scalable, flexible, and suitable for deployment as a cluster cloud service.

I ended up with Clojure for the following reasons:

  • Functional programming : Clojure is a functional programming language at heart, more than most other languages ​​(although not as many as Haskell ....). Lazy infinite sequences, constant data structures, immutability, etc. Makes for elegant code when you are dealing with large calculations.
  • Metaprogramming . I saw the need for code generation for vector / computational experiments. Consequently, Lisp was a big plus: after you did the code generation in a homokino-language using the “whole language” macro system, it’s hard to find anything else that is close.
  • Concurrency - Clojure has an impressive and agile multicode concurrency approach. If you have not seen it, see: http://www.infoq.com/presentations/Value-Identity-State-Rich-Hickey
  • Interactive REPL . Something that I always felt is very important for working with data. You want to be able to work with your code / data "alive" to get a real idea of ​​its properties. Having a dynamically typed language with interactive REPL does wonders here.
  • JVM-based : A big advantage for pragmatic goals due to the huge library / tool ecosystem and the excellent JVM engineering as a runtime.
  • Community . I have seen a lot of innovation in Clojure, especially around the common area of ​​data and analytics.

The main drawback of Clojure at that time was a good library / API for matrix operations. At Incanter , but they were not a very common goal or performer. So I started developing core.matrix, which is formed before the idiomatic Clojure-fraudulent equivalent of NumPY / SciPY. It is still working now, but good enough for production if you are careful.

In terms of supporting low-level matrices, I also support vectorz-clj , which is my attempt to provide a core.mattrix implementation that offers high-performance vector / matrix operations while remaining pure Pure Java (i.e. without native dependencies). If you are interested in doing this, you might like:

My second choice after Clojure would be Scala. I liked Scala a bit more maturity and a decent static type system. Both languages ​​are JVM based, so the library / tool side was a tie. These were probably the Lisp functions that supported it.

+2
source

If you have access to Mathematica, then it's pretty easy to get it to work with the JVM using J / Link. For Clojure, Clojuratica is an excellent library that makes it as silent as possible, although it has not been maintained for a while, and may take some effort to get it working again in modern conditions.

0
source

Source: https://habr.com/ru/post/1469272/


All Articles