SequenceL is designed to be as simple as possible to learn and use, focusing on algorithmic code where it adds value, e.g., the inventors chose not to reinvent I/O since C handled that well. As a result, the full language reference for SequenceL is only 40 pages, with copious examples, and its formal grammar has around 15 production rules. SequenceL is strictly evaluated (like
Lisp), statically typed with
type inference (like
Haskell), and uses a combination of infix and prefix operators that resemble standard, informal
mathematical notation (like
C,
Pascal,
Python, etc.). It is a purely declarative language, meaning that a programmer defines functions, in the mathematical sense, without giving instructions for their implementation. For example, the mathematical definition of
matrix multiplication is as follows: :The product of the
m×
p matrix
A with the
p×
n matrix
B is the
m×
n matrix whose (
i,
j)'th entry is ::\sum_{k=1}^p A(i,k)B(k,j) The SequenceL definition mirrors that definition more or less exactly: matmul(A(2), B(2)) [i,j] := let k := 1...size(B); in sum( A[i,k] * B[k,j] ); The subscripts following each parameter
A and
B on the left hand side of the definition indicate that
A and
B are depth-2 structures (i.e., lists of lists of scalars), which are here thought of as matrices. From this formal definition, SequenceL infers the dimensions of the defined product from the formula for its (
i,
j)'th entry (as the set of pairs (
i,
j) for which the right hand side is defined) and computes each entry by the same formula as in the informal definition above. Notice there are no explicit instructions for iteration in this definition, or for the order in which operations are to be carried out. Because of this, the SequenceL compiler can perform operations in any order (including parallel order) which satisfies the defining equation. In this example, computation of coordinates in the product will be parallelized in a way that, for large matrices, scales linearly with the number of processors. As noted above, SequenceL has no built-in constructs for
input/output (I/O) since it was designed to work in an additive manner with other programming languages. The decision to compile to multithreaded C++ and support the 20+ Simplified Wrapper and Interface Generator (
SWIG) languages (C, C++, C#, Java, Python, etc.) means it easily fits into extant design flows, training, and tools. It can be used to enhance extant applications, create multicore libraries, and even create standalone applications by linking the resulting code with other code which performs I/O tasks. SequenceL functions can also be queried from an
interpreter with given inputs, like Python and other interpreted languages. ==Normalize–transpose==