21.07.2015 Views

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

298 <strong>G<strong>AWK</strong></strong>: <strong>Effective</strong> <strong>AWK</strong> <strong>Programming</strong>This section briefly lists extensions and possible improvements that indicate the directionswe are currently considering for gawk. The file ‘FUTURES’ in the gawk distribution liststhese extensions as well.Following is a list of probable future changes visible at the awk language level:Loadable module interfaceIt is not clear that the awk-level interface to the modules facility is as good as itshould be. The interface needs to be redesigned, particularly taking namespaceissues into account, as well as possibly including issues such as library searchpath order and versioning.RECLEN variable for fixed-length recordsAlong with FIELDWIDTHS, this would speed up the processing of fixed-lengthrecords. PROCINFO["RS"] would be "RS" or "RECLEN", depending upon whichkind of record processing is in effect.Additional printf specifiersThe 1999 ISO C standard added a number of additional printf format specifiers.These should be evaluated for possible inclusion in gawk.DatabasesIt may be possible to map a GDBM/NDBM/SDBM file into an awk array.More lint warningsThere are more things that could be checked for portability.Following is a list of probable improvements that will make gawk’s source code easier towork with:Loadable module mechanicsThe current extension mechanism works (see Section C.3 [Adding New BuiltinFunctions to gawk], page 287), but is rather primitive. It requires a fairamount of manual work to create and integrate a loadable module. Nor is thecurrent mechanism as portable as might be desired. The GNU libtool packageprovides a number of features that would make using loadable modules mucheasier. gawk should be changed to use libtool.Loadable module internalsThe API to its internals that gawk “exports” should be revised. Too manythings are needlessly exposed. A new API should be designed and implementedto make module writing easier.Better array subscript managementgawk’s management of array subscript storage could use revamping, so thatusing the same value to index multiple arrays only stores one copy of the indexvalue.Integrating the DBUG libraryIntegrating Fred Fish’s DBUG library would be helpful during development,but it’s a lot of work to do.Following is a list of probable improvements that will make gawk perform better:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!