You are on page 1of 4

TAWK Compiler

by Thompson Automation Software

What's New in TAWK 5.0 What is all this about TAWK?


We believe the TAWK programming language is one of the major programming breakthroughs of this decade. It fills the niche providing the ease of use of simpler languages but the power and flexibility of more complicated languages. Try it and see if you don't agree this is the easiest way to program ever.

What is TAWK?
The Thompson AWK language, or TAWK for short, is a vastly improved compiled version of the normally interpreted awk language. Unlike awk, TAWK is a robust general purpose programming language that can handle any programming task. For those unfamiliar with awk, the TAWK language resembles the "C" programming language, but is much easier to use and has extensive built-in error checking that eliminates program crashes. Unlike "C", TAWK includes powerful built-in functions for searching, sorting and manipulating text and database records making it especially valuable for these types of applications. TAWK is backward compatible with the original awk language and retains the ease of use that made the awk language popular. The name "awk" was derived from the original author's names: Alfred Aho, Peter Weinberger and Brian Kernighan.

Why is TAWK so Easy to Use?

TAWK programs use a structured but free-form C-like language syntax but without the problems associated with C. Normally anyone who has used any other high-level language can learn TAWK in minutes. Much of the code that is common to many programs (opening files, parsing and recognizing data, searching and sorting) is already built-in to TAWK so you don't have to write it yourself. TAWK programs don't have to worry about variable declarations, pointers, and memory or object allocation/deallocation. TAWK provides extensive built-in error checking and diagnostics. It is very difficult to cause a TAWK program to crash. Variable declarations are optional. TAWK can determine each variable's type by its use. Many advanced capabilities are built-in: sorting capabilities are built in.

New TAWK Debugger


TAWK's new Full Screen Interactive TAWK Debugger provides you with visual execution of your program. Includes all debugger features: Trace into or over functions; Animate execution; Breakpoints; View, change or watch variables, and much more. What's more, the debugger itself is written in TAWK and the source code is included!

TAWK Language Features

100% compatible with the latest awk language standard and also supports variant awk forms. An "awk" compatible program is included. Superb text manipulation capabilities: text strings are a built-in data type and can be manipulated using a variety of built-in functions, including sophisticated pattern substitution and replacement functions. Memory management is built-in and transparent. Input record formats are programmable and include many types: free format text, comma or pattern delimited, fixed format (eg: dbase), etc. Includes example code showing how to read dbase III format files. Numeric handling is superb: Numbers automatically promote from integer to floating point when additional precision is required. TAWK also includes transcendental functions and a random number generator. Automatic type conversions are performed between variables of different types whenever required. TAWK tracks the type of each variable and also prints warnings for incompatible operations (instead of crashing, which is what other languages do.) Arrays in TAWK can be used as associative tables (like an indexed data-base) to store many types of data, with no fixed limits on array size. Even the DOS version (the smallest) can easily create arrays with over 100,000 elements.

TAWK Compiler Features


Generates executable (.exe) files that can be distributed royalty free like any other compiled programs. Compiler provides advanced features like incremental compilation to reduce compile times, local and global variable declarations for modular program development, and customizable compiler configuration file. Supports huge TAWK programs. TAWK automatically uses extended/expanded memory (under DOS) or disk space for programs that are too big to fit in regular memory. Regular DOS version uses up to 16 Mbytes of memory; OS/2 version uses up to 32 Mbytes; Windows/NT version is not limited. Optional DOS/32-bit version uses the Rational Systems DOS extender (the best!) to produce DOS 32-bit executables that use true virtual memory by using disk space. For DOS development you need this optional component if your string length exceeds 8000 bytes or the length of any single array will exceed about 150,000 elements or total memory needs exceeds 16 Mb. The DOS/32 bit version requires a 386 or better to run.

Typical AWK Applications These are just a few real applications reported by our customers. Some of these are huge commercial programs designed with the TAWK Compiler:

Data-base format converters of many types. Stock Exchange ticker tape data extractor. Appointment scheduler and optimizer. Monthly Accounting program. Program source code re-formatter. Ctags program (extracts function definitions). Chemical equation typesetter. Spell checker program. HPGL to Postscript graphics converter. General purpose flat-file data-base.

Why is TAWK Better?


The original awk language was easy to use and great for small text processing programs but was not designed for commercial applications. (It allowed only one source file, no variable declarations, no debugger, no compiler, etc.) TAWK is an industrial-strength commercialgrade program development system and includes extensive functionality that is missing in awk. Comparison of TAWK with the C Programming Language Here is a comparison of the TAWK language to the "C" language. These example programs were written using both a "C" compiler and the TAWK Compiler, then the development and execution times of the two languages were compared. These are real programs. We didn't make this up.
Program 1: Description: TAWK Compiler: C Compiler: Program 2: Description: TAWK Compiler: C Compiler: Program 3: Description: TAWK Compiler: C Compiler: Search files for pattern. Development Time: 1 minute; Development Time: 15 minutes; Execution Time: 4.9 sec; Execution Time: 4.4 sec;

Convert text file to postscript. Development Time: 15 minutes; Execution Time: 15.2 sec; Development Time: 90 minutes; Execution Time: 17.9 sec; Typesetter program. Development Time: 8 hours; Development Time: 4 days;

Execution Time: 6.3 sec; Execution Time: 2.3 sec;

Notes: C programs were compiled using Microsoft C, large model, with maximum optimization (/Ox option). Other tested C Compilers gave similar times.

These results are startling. You would naturally expect the program development time to be much faster using TAWK than C. But Program 2 actually runs faster using TAWK than using C! (This is not usually the case.) The reason for this program's speed is that the core functionality is implemented as a series of gsub (global substitution) function calls in TAWK, and as a small "switch" statement in C. The regular expression matching engine used by TAWK is so fast that several gsub function calls are actually faster than a case statement to implement the same functionality in C. Program 3 ran slower in TAWK than in C, but this is not the whole story. The output of the typesetter program needs to be accurate to 1/12000 of an inch. The C version of the program goes to a great deal of effort to offset all font and page measurements so that the resulting values fit into an integer. The TAWK version of the program simply used floating point to implement the same functionality, which was extremely easy to do. The difference in times is primarily due to the difference between floating point and integer operations. You should not really expect your TAWK programs to run faster that equivalent C versions in all cases. However, for text processing applications, the functions that we have provided inside TAWK are highly optimized, and will often out-perform hand-written code in C. Its hard to lose developing with the TAWK Compiler: even when you plan to write the final program in C you benefit from having a working prototype in a fraction of the time!

System Requirements:

Version for Microsoft Windows Requires any modern version of Microsoft Windows (Windows XP, Windows ME, Windows 2000, Windows NT, Windows 98 or Windows 95. The ancient Windows version 3 or older is not supported.) All programs are full 32-bit executables and support long filenames on both FAT and NTFS disk partitions. Version for DOS Requires DOS version 3.3 or higher, or Microsoft Windows version 3.1, or Windows for Work-groups. Extended or expanded memory is used automatically. A minimum of 512K memory is required. A floating point unit is not required but will be utilized if available. //////////////// AWK es un lenguaje de programacin diseado para procesar datos basados en texto, .... Thompson AWK o TAWK es un compilador AWK para DOS y Windows, ...