Tcl Static Prime (TSP) is an experimental compiler for the Tcl language that produces C or Java code, which is then compiled on-the-fly during execution of a Tcl program. TSP is a currently a work-in-progress; its performance varies greatly depending the Tcl commands that are currently compiled.
TSP compiles a typed subset of Tcl. Proc definitions and variables are typed by comment-based annotations. Native types supported are boolean, int (64-bit integers), double, string, and var (TclObjects for lists, dicts, etc.)
TSP language restrictions include restricting all arithmetic expressions (expr, if, while, etc) to using boolean, int, double, and string data types. Additionally, expressions may not include array references or nested commands. TSP also assumes that builtin Tcl commands are not re-defined, as builtin commands are compiled to C or Java, or the native command implementation is invoked directly, bypassing the Tcl interpreter.
TSP is written entirely in Tcl, with support libraries written in C and Java.
- Introduction
- Features
- Type System
- Compiled Commands
- Runtime
- Compiler Usage
- Future Improvements
- Install
- Misc.
Wiki (Q & A, discussion, other): http://wiki.tcl.tk/Tcl%20Static%20Prime