telakka (TeLa Kernel Konstruction Accessory) is a program that generates new Tela kernels. It is implemented as a shell script. It is used much as a C compiler. C-tela files (.ct files) written by you can be compiled and linked into Tela using telakka. For example, if mystuff.ct contains your own function named myfunction,
unix> cat mystuff.ct
[y] = myfunction(x)
/* This does something really stupid */
{
cout << "in myfunction, x = " << x << "\n";
y = 3.14;
Add(y,y,x);
return 0; // successful exit to Tela
}
unix> telakka -o mytela mystuff.ct
unix> ./mytela
This tela is a tensor language, Version 0.5g.
Type ?help for help.
->Try: docview(), source("demo")
>help myfunction
This does something really stupid
>myfunction(42)
in myfunction, x = 42
45.14
>
The executable mytela is a full Tela plus the C-tela functions from mystuff.ct. The help command finds the C-style comment /* ... */ following the function header automatically. Also name completion will recognize myfunction. C-tela code is C++ code with one syntactic extention: the function header is simpler and follows Tela conventions. There is a preprocessor, named ctpp, which converts C-tela to ordinary C++ by transforming function headers. Telakka calls ctpp, the system C++ compiler and the linker automatically as needed. You can pass other object files, libraries and C compilation switches to telakka as you need.
On systems that support DLD dynamic linking there is a faster method to bring your own code in Tela. Just compile the .ct file with telakka -c to produce an .o file. Then use the link function in Tela to bring the functions in Tela executable; in this way you don't have to generate a full new copy of the kernel. The link function does not exist on systems that do not have DLD.
Next Chapter, Previous Chapter
Table of contents of this chapter, General table of contents
Top of the document, Beginning of this Chapter