The Tela Tensor Language

The 3D plot of the classic sinx/x function you see here was created with Tela, one of the fastest
scripting math languages available. It is used and made freely available by the
Finnish Meteorological Institute, and created by Pekka Janhunen.

Unlike some of the math languages out there, such as Octave, Tela is an
Ndimensional matrix language like Yorick and PDL. That means it can handle
matrices of more than 2 dimensions  up to 5 in fact. It follows Fortran90
style syntax, and so is similar in syntax to MATLAB, Octave, and Euler.
Tela Syntax
Matrix creating, indexing and referencing is similar to MATLAB and Octave,
though not exactly the same:
Create a 3 by 4 matrix
x = #(1,2 ,3 ,4 ; 11,12,13,14 ; 21,22,23,24)
Reference sub matrix, rows 1 to 2, columns 3 to 4
y = x[1:2,3:4]
To combine two x matrices by rows
y = #(x,x)
To combine two x matrices by columns
y = #(x',x')'
Matrix multiply x and y
z = x**y
Take each element of matrix to power of 2
y = x^2
As you can see by the examples, the #(...) operator is used to directly
create matrices. Inherently, the operator combines matrices by rows. To combine
by columns, use the #(...) operator to combine transposes of the matrices (the
' operator), and transpose the result.
Notice that the operator to take a variable to a power is the ^ operator.
The ** operator indicates a matrix multiply in Tela.
Tela has a list type of data object that allows one to hold associated
objects of potentially different type or size into a list structure. The object
is called voids. A voids object is declared as a specific size, in more
than one dimension if desired, and each element of the voids object can be
equated with a data item.
Declare a voids object to hold 10 lists of 3 matrices each.
v = voids(10,3)
Set the 1st of 10 lists to 3 matrices, possibly of different size
v[1,1] = x;
v[1,2] = y;
v[1,3] = z;
The voids object can be referenced like a matrix, but each element may
itself be a matrix.
Functions are declared similar to the way Octave functions are, except that
compound statements (functions, loops, ifthenelse) are all indicated by the
curly brackets.
To define a function
function [x,y,z] = dosomething(a,b,c){
...
}
To receive multiple arguments
[x,y,z] = dosomething(a,b,c)
As you can see, the syntax is similar in concept, but a bit different in
operator syntax from other languages you may have used.
Tela File I/O

Tela is a bit limited in file I/O for my tastes in that it gives little in
the way of primitive functions. Without primitive functions, one is limited to
files created in certain standard formats. Tela can read and write MATLAB 4
files and HDF files, and PNM graphic files. Tela can also read data from plain
ASCII files. As long as the products you interface with uses one of these
forms, you are in fine shape. But if you're trying to use data from a C or
other language program for example, the burden is on the other language to
create data forms compatible with Tela.

Tela Graphics
Tela definitely has graphics. It relies on the plotmtv
plotting package for producing a wide range of graphs. Plotmtv, while called
from Tela, can also be directly passed plotting instructions by the user.
And, as with Tela in general, the graphics is fast.
Tela is equipped to produce line plots, multiline plots (with color), 3D
filled and wiremodel mesh plots, contour lines, and color contours, many of
which are illustrated in the composite above.
As used with Tela, each graph includes a set of controls at the top of the
graph. The image above is an example of the controls, which may vary according
to the kind of plot being produced. All plots can be zoomed in or out, and all
plots can be exported as GIF or postscript files. Line and point plots can
interactively switch the x and y axis and functions between linear and
logarithmic presentations. 3D plots can interactively be rotated by steps in
the horizontal and vertical axis.
Note that while one may interact with a graph to alter the presentation, the
interaction is with plotmtv, not with Tela. Because of this, it appears that
Tela provides no mechanism to let the user click locations on a graph and have
those locations picked up by Tela. Tela formulates the data and passes it off
one way to plotmtv.
Each plot command issued to Tela produces another plot window, so multiple
graphs can be displayed and examined at one time. It is also possible to pass
control options that will cause plotmtv to plot multiple plots, each on its
own axes, on a single window. One can also instruct plotmtv to stack
multiple plots, and one can step through the plot window to see each of the
plots.
These examples were captured from Tela screen images using the imagemagick
import function. When plots are exported to postscript, the blue background
becomes a white background for better reproduction in documents. Exported
postscripts defaults to black and white, but a color option is available.
Keen Designs TShirts and Mugs
Summary
Tela has a full range of math functions, including regression, statistical,
interpolation, and Fourier Transform routines. All of these can operate on
Ndimensional matrices, though the FFT routines work on only 1 dimension of a
multidimensional matrix. Given Tela's speed and ample supply of data handling
functions, it is well positioned to be both a model building utility and a data
processing utility. The only weakness I see is that for data processing, the
file I/O options are limited.
I found the greatest features of Tela to be it's relatively simple
syntax, albeit a bit different than other languages, it's ability to handle
Ndimensional matrices, and it's absolutely blinding speed. Out of a halfdozen
other matrix languages I tried, the only one that came close to Tela's speed
was Yorick.
As an example, as I struggled to grasp how to accomplish a convolution
filter with the Tela FFT routines, I resorted to a simple 2 dimensional
conventional convolution method in the time domain. Common wisdom says that
this is a much slower technique than if the convolution can instead be a
simple multiply in the frequency domain via FFT transforms. While this proved
true in all the the other Matrix languages at my disposal, I was surprised to
find that the timedomain convolution in Tela could run as fast as the
Frequency domain method in other languages. I was impressed.
In getting to know Tela better, I eventually mastered the FFT convolution
technique and created a few image handling routines in Tela. Below is an
example of my efforts. I converted one of my moon images to a pgm
file, loaded it into Tela with the import_PNM routine, then
sharpened it with my newly created Tela sharpen routine. See my
Astronomyhints web page for
astrophotography details.


Stacked Tycho Image 
Tela Sharpened Image 
Here's my subjective pros and cons on the Tela language.
Pros:
Freely available for the Linux operating system.
What stands out most is that Tela is Fast.
Can work with greater than 2 dimensional matrices (up to five by default).
Can support a record structure with the use of the Void
operator.
Has a simple programming language, similar to Octave.
Is integrated with the plotmtv package, and can make 2D and 3D
color plots. The plots are interactive by default.
Has file I/O support for some common standards such as MATLAB, HDF, and
the PNM graphics files.
Tela not only does matrix operations fast, but is even amazingly tolerant
to moderate use of loops.
Has sufficient ASCII file support to move files between most external
utilities.
Cons:
Isn't available for many operating systems.
Doesn't have an extensive library of specialized functions.
Has limited lowlevel file I/O support, making it difficult to deal with
especially binary files generated externally.
While the plotmtv graphics are interactive as to display characteristics,
mouse clicks can not deliver information back to a Tela script.
