From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,443bdb49f330df3f,start X-Google-Attributes: gid10d4db,public From: THEIVENDRA LEONARD WIJENDRAN Subject: AWK-to-C Translator Date: 1996/06/06 Message-ID: #1/1 X-Deja-AN: 159004296 organization: ? followup-to: comp.os.linux.development.apps newsgroups: comp.os.linux.announce -----BEGIN PGP SIGNED MESSAGE----- This is to announce the first beta release of an AWK-to-C Translator that I've been developing for the past few months. It is based on GNU awk (GAWK) and is supported on various Unix platforms as well as Windows NT/95, MS-DOS, OS/2 on PC systems. It is at a stage where I think many of you will find some practical use for it. I've been doing most of the development on Linux and have occasionally tested it on Windows NT. So far, it seems to work on every warped testcase that I've thrown at it. The translator currently supports all the core feature of AWK (i.e. associative arrays, regexp matching, etc). Features not implemented yet (will perhaps be in the next release): - All builtin functions (i.e: printf, gsub, split, etc). Note however that the 'print' statement is supported which takes the translator out of the realm of uselessness :-) - String concatanations - The 'for XX in YY' statement (assoc. arrays are otherwise fully supported) - I/O re-direction within AWK program - Variable initializations via command line - User functions I suppose most of you are wondering about the speed improvements over interpreted awk scripts... My tests show, that depending on the nature of the AWK program and the size of the input set, speed increases range from minimal to over 2000% (20+ times as fast). The translator features an optimizer which analyzes the variables and number <-> string type conversions they undergo, and then emits optimal C code to maximize runtime performance. Please refer to the 'README' file and 'Technotes' file in the doc/ subdirectory of the package for further details. Generally, if your AWK program involves loops, fair to intense expression processing, or is generally large, then the speed improvement is greater. Also, as the number of input records increase, the speed improvement also gets better (regardless of the nature of the AWK program). Where to get it / Installation - ------------------------------ I'm still looking for a primary site to house this package. For the moment, I'll upload it to ftp://ftp.cdrom.com/pub/win95/incoming and ftp://sunsite.unc.edu/pub/Linux/Incoming. The file is 'awk2c050.tgz' (gzipped tar file). Please note that it falls under the GPL license. Read the 'README' file in the 'doc/' subdirectory for instructions on configuring/installing/using it under your operating system and C compiler. For those who interested in the design of the translator, look at the 'Technotes' file in the same subdir. I'll be interested in any comments you have (including problems/bugs). You can either e-mail me at the first address shown below or post to the comp.lang.awk newsgroup. Leonard Theivendra IBM Toronto Software lab - ------------------------------------------------------------------------------ E-Mail: theiven@skule.ecf.toronto.edu (<= 08/31/96) theivend@torolab6.vnet.ibm.com (>= 07/01/96) Standard Disclaimer: Any opinions expressed are solely my own and not that of IBM Corp. -----BEGIN PGP SIGNATURE----- Version: 2.6.2i iQCVAwUBMbbzj4QRll5MupLRAQGaWAQA2RhnjFRIx+ay61omI3b7JS02uFjDRLgP rhGmFoQHnlqh/DVdJo/+kPIllzHjAB3nnBXJUXwjc2a5p4TlasyFRd0qCqKdzgdm UavaOHRMqaVlg7F3TGr1GRU3f2PKsHkdnrmV2dczw93HgYG/iZhiRZjBtf9vdY4K jBIbsUrMIwI= =ZC9N -----END PGP SIGNATURE----- -- This article has been digitally signed by the moderator, using PGP. Finger wirzeniu@kruuna.helsinki.fi for PGP key needed for validating signature. Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov PLEASE remember a short description of the software and the LOCATION.