figshare
Browse
tensors_libjit.pdf (419.75 kB)

Implementing Arrays and Tensors with Ruby and libJIT

Download (0 kB)
journal contribution
posted on 2014-04-27, 16:18 authored by Jan WedekindJan Wedekind, Hussein Abdul-Rahman, Martin Howarth, Ken Dutton

Implementing numerical algorithms typically demands a trade-off between readability and performance of the code. However the way we write programs affects our understanding of the problems we are trying to solve.
Statically typed languages represent numbers and arrays with primitive types. This means that the most relevant data types for signal processing have only very limited capabilities in those languages. The dynamically typed programming language Ruby is pure object-oriented and makes it easy to implement algorithms which will work on arrays with elements of any numerical type. However the current Ruby interpreter is lacking in terms of processing speed.
This paper presents a Ruby extension which makes use of the libJIT just-in-time compiler. Dynamical typing is used to analyze closures and translate corresponding element-wise operations for arrays to machine code. The same approach is used to compile tensor operations thus allowing the use of Einstein notation in Ruby.

History

Usage metrics

    Licence

    Exports

    RefWorks
    BibTeX
    Ref. manager
    Endnote
    DataCite
    NLM
    DC