This is the source repo for Stephan Beal's fork/adaptation of Richard Hipp's TH1 ("Test Harness 1") script language engine, more or less as it existed at this point in fossil's history, minus the fossil-specific features and refactored a tiny bit to make it easier to use as a drop-in in other projects. This TH1 implementation has no compatibility requirements with its origin implementation and "might" eventually change significantly from Fossil's version.
TH1 is an embeddable TCL-like language, but is a mini-language. It has only a few built-in commands, has no just-in-time compiler or such fancy bells and whistles, stores all values as strings, and internally allocates/frees memory very often. It is not a high-performance solution to your embedded scripting problems. It is an easy way to quickly create a scripting API for, e.g., running library/application test code (which is what it was originally designed for - running sqlite tests on Symbian OS).
TH1 is written in ANSI C89 and "should" compile as-is on any C89 platform. It requires no esoteric or non-standard language features. Build files are provided for GNU Make. They assume one is using gcc but can be used with other C compiler/linker by setting the CC/CXX makefile vars. e.g. make CC=clang CXX=clang CFLAGS="-g -Wall -Werror" CXXFLAGS="-g". For more significant build tweaks, one might be required to edit config.make or Makefile.
This library is more or less functional but needs more docs and might see some experimentation along the way. e.g. it "might be interesting" to extend its data type support to internally use something closer to native values (e.g. JSON-compatible data types), and a separate library is under construction to experiment with that.
License: Simplified BSD License (a.k.a. 2-Clause BSD License, a.k.a. FreeBSD License).
Useful links:
- Download the code.
- Creating a so-called AmalgamationBuild of these sources.
- The only manual for Fossil's TH1 language.
- That same manual, ported to Google Docs and expanded to include details specific to this API.
- Exceedingly brief HowTo for this library.
- The "ob" API th1 API extension provided by this code.