4tH is a Forth compiler with a little difference. Instead of the standard Forth engine it features a
conventional compiler. 4tH is a very small compiler that can create bytecode, C-embeddable bytecode, standalone executables, but also works fine as a scripting language. It supports about 95% of the ANS Forth CORE wordset and features conditional compilation, pipes, files, assertions, forward declarations, enumerations, structures, suspended execution, recursion, include files, etc. It comes with an RPN calculator, line editor, preprocessor, compiler, decompiler, C-source generator, a virtual machine, and a multitasking environment.
The library files now support logfiles, automated date parsing, LZ77 file compression and CSV file creation.
The last defined word can be compiled anonymously. Object orientation now supports regular methods. The Sourceforge "Block reserved extension words" were added. New peephole optimizers were added to the compiler, allowing automatic compile time calculations. exec_4th() can be optimized for GCC by using the compiler switch -DUSEGCCGOTO. The word 'SMOVE' was added.
Unions and pragmas can be defined. The library files now support several polynomials, RAM disks, menus, bitfields, bit arrays, several new sorting algorithms, Morse signs, and 3VL. The preprocessor was enhanced, supporting S\", token concatenation, string comparison, variable assignment, and smart double number/FP literals. 'DOES>' can be used to change the execution semantics of basic data types. A bug in the Linux Makefile was fixed. Overflow and underflow errors in number conversion were fixed. A bug in the 'IF' statement of 4tsh was fixed. The accuracy of the 'FERF' words was improved.
Specific code can be executed after a failed 'WHILE' just before exiting the loop. Binary strings can be tagged individually. The library files now support UTF-8 to GBK/2 conversion (and vice versa), infix formula translation, string pattern matching, finite state machines, statistical functions, enhanced command line parsing and the full range of ANS Forth floating point words for ZEN float. The preprocessor now supports string parsing with custom delimiters, macros within macros, and a string stack. A Markov engine and an infix-to-postfix converter were added to the examples.
A peephole optimizer was added. The library files now support a tiny database management system, double number multiplication, double number division, LaTeX file generation, and the XCHAR wordset. SEEK can now be used to reposition the file to the end. The words 2NIP and [FORCE] were added. Several obscure bugs were fixed. Support for 64-bit architectures was greatly improved. On Linux, compilation is now staged. A nuclear test simulation was added to the preprocessor examples.
The words ’DELETE-FILE’ and ’ENVIRON@’ have been added. The library files now support writing OpenOfﬁce, KOfﬁce, and Microsoft XML spreadsheets, different sorting algorithms, the creation of ﬂoating point interpreters, GTK-server, Forth compatible ﬂoating point I/O for ZEN ﬂoat, portable bitmap graphics and Turtle graphics. Files can now be deleted and environment variables can be queried. The maximum symbol length is increased to 23 characters. Two tiny spreadsheet programs were added to the examples.