Version 8 of Parenthetcl

Updated 2006-04-30 18:14:23

http://www.smilax.org/99 - "ParentheTcl (pronounced "parenTHETical," abbreviated "p7tcl" or "P7") is a safe language for writing fast, compiled extensions for Tcl."

The language seems to RS a curious mix of Tcl and C - variables are strongly typed, expression syntax in parentheses is part of the language. Vector elements are also marked by parentheses (unlike C, but Fortran had it so...) Example:

 pproc (uni*)to_lower { (uni*)x } {
    for {set (int)i 0} ($i< [len $x] ) {incr i} {
        if ( 'A' <= $x($i) && $x($i) <= 'Z' ) {
            set x($i) ($x($i) - 'A' + 'a')
        }
    }
    set x
 }Commands so defined are compiled (to C), and made available as Tcl commands.

Notice that all extensions to Tcl syntax are marked with Parentheses -- thus the name ParentheTcl.

Not sure what to think of this... Experience reports are welcome on this page.

AK Feb 15, 2005: From the description above it sounds as if this wants to be or is already for Tcl what Pyrex is for Python. AK Feb 15, 2005: From the description above it sounds as if this wants to be or is already for Tcl what Pyrex [L1 ] is for Python. (So, if Python has Pyrex, Tcl should have...T-Rex?)

MS Is this comparable in any sense to critcl? - RS: The general direction seems to be the same, but critcl embeds standard C in Tcl, and generates source code to make a DLL from, while P. uses a hybrid language of its own, and seems to require a runtime module (so maybe not compiled to machine code, but some intermediate code) - but that's very much like Tcl itself then, isn't it? >Strick> It would be nice if ParentheTcl used critcl to



Category Language Category Tcl Implementations