Thalatta
Thalatta is an algorithmic graph description language.
It is a specialized tool
combining graph description task
with a programming language
by having a syntax for procedural generation.
Language overview
The following is an example
of Thalatta language program:
and = 0;
xor = 1;
bits = 2;
a = [bits]node(xor, 0);
b = [bits]node(xor, 1);
c = node(and) <- node(xor, 2);
out = [bits+1]node(xor);
p = [bits]node(xor) <- a <- b;
g = [bits]node(and) <- a <- b;
out[0:bits] <- ([bits]node(and) <- p);
foreach (out) {
@ <- (node(and) <- p[0:@0] <- c);
for (i = 0; i < @0; ++i)
@ <- (node(and) <- p[i+1:@0] <- g[i]);
}
If to consider nodes storing 0 as logic and gates
and 1 as logic xor gates consequently
with directed edges connecting them,
this creates a valid 2-bit carry-lookahead adder.
It can be expressed as the following graph:
Reference for the latest Thalatta version is distributed
together with the reference implementation source.
Thalatta Compiler
This page offers a reference implementation
of a Thalatta compiler.
As of dependencies it requires
- C89 compiler with the following extensions
- Anonymous structures
- Passing structures by value
- ANSI-compliant C library
- POSIX make (optional)
Available versions for downloading are
- v0.1.0
Well, the first version to be published...
- v0.2.0
- Some minor fixes
- Better allocation
- Code example
- Closures
Complete changelog is available
through a git repository at
anongit at git dot nakidai dot ru colon thac.