cwal

th1ish
Login

th1ish

ACHTUNG: on 20160216, th1ish was removed from the trunk, placed into the th1ish-R.I.P. branch, kept only for historical interest. It is holding cwal back from several improvements and is not worth the effort to maintain. s2 is its replacement (and the two are generally about 98% code-compatible when it comes to client-side cwal bindings).

th1ish - a cwal-based Scripting Language

[print "Hello, world!"]
$print 'Hello, world!'
print({Hello, world!})
$print <<<EOF
Hello, world!
EOF
api.io.output("Hello, world!\n")

th1ish is an experimental/toy scripting language initially (conceptually) based off of TH1, a lesser (and lesser-known) dialect of TCL. th1ish inherits much of TH1's syntax but is expression-centric (not command-centric), adds the richer types supported by cwal (which closely mimics JavaScript), and scoping/lifetime rules similar (but not identical) to C++. While there is still tweaking and experimentation to be done, th1ish is currently functional and ready to use in its original intended role: a simple-to-use platform with which to write scriptable test harnesses for C/C++ libraries and apps, and similar "light" scripting tasks. Binding client-side functionality to scripts is easy to do, including binding custom native types in such a way that th1ish can track their lifetimes and destroy them (using a client-provided finalizer) when the proper time comes.

th1ish is experimental and a toy, but can do far, far more than was originally envisioned/planned for it. (If nothing else, th1ish has proven to be an invaluable test-bed for the core cwal library.) th1ish is essentially feature-complete, but it is continually being tweaked.

See th1ish/th1ish*.c for the current code, th1ish/shell.c for the test app, and th1ish/unit/*.th1ish for various test scripts. th1ish is being documented in detail in a pair of public Google Documents:

As of this writing (May 2014), those two docs weighs in at 265 kb of text, just over 100 pages, mostly about how to use it script-side, but also how to use it from C. The docs get updated as the code is written, so they always reflects the current trunk state or what will be checked into the trunk shortly.

News

Newest items at the top.