by Christer Swahn
A statically compiled, imperative, strongly typed programming language

Tuplex is a statically compiled, imperative, strongly typed programming language with innovations in semantics, data representation, and syntax.

It features a sophisticated and unified generic type system.

It strives to be easy to write, easy to read, easy to avoid memory and concurrency bugs, while being fast to execute.

Tuplex originated as a research project with a two-fold purpose:

  • Designing a uniform, easy to write and read syntax, with powerful and efficient array, tuple, and custom container handling

  • A language test bed for developing a proof-of-concept of dataspaces which guarantee data race safety in concurrent programs

The compiler is developed using LLVM, enabling it to use LLVM’s extensive suite of optimizations and hardware targets.

import tx.c.puts;  ## imports the puts name from the tx.c module

/** converts arg to Float and returns its square */
square( intVal : Int ) -> Float : {
    return Float(intVal) * Float(intVal);
}

/** a global constant */
INT_VALUE := 9I;

main()->Int : {
    someLen := INT_VALUE;
    result := (2.0 + square( someLen )) / 3.14;
    if result > 20.0:
        puts( c"big!" );     ## C-string i.e. one character per byte
    tmp := ~ Int( result );  ## explicit cast from floating-point to Int
    while tmp > 0 : {
        puts( c"iteration!" );
        tmp = tmp - 1;
    }
    return 0;
}
Information updated 12/27/19
Note: This entry has not yet been moderated.
View Comments