Example

We show an example as follows.

Module mat_mult;

Define dmmul(mode_in int n, mode_in double A[n][n],
        mode_in double B[n][n],
        mode_out double C[n][n])
{
    double t;
    int i,j,k;
    for (i=0;i<n;i++){
        for (j=0;j<n;j++){
            t = 0;
            for (k=0;k<n;k++){
                t += A[i*n + k] * B[k*n+j];     /* inner product */
            }
            C[i*n+j] = t;
        }
    }
}

The module statement defines the module name. The functions inside this module are described by the "Define" statement The definitions of the arguments are similar to those in C language, but some differences exist, as follows.

After the Define statement, you can describe any program in C language inside of brace ({...}). Argument names can be used as the arguments in C language without modification.

You can call a library function, like the example, below.

Define dmmul(mode_in int n, mode_in double A[n][n],
        mode_in double B[n][n],
        mode_out double C[n][n])
Calls "C" mmul(n,A,B,C);
 

This above example calls "mmul" function, which writes in C language.

And, you can define multiple functions inside the module's definition file. These descriptions should be in the remote executable program.

At the time of this writing, fundamental data types and their arrays are supported. We are going to support structure data types in a future release.