manpagez: man pages & more
info gawk
Home | html | info | man

File: gawk.info,  Node: Extension Philosophy,  Next: Advanced Features Summary,  Prev: Persistent Memory,  Up: Advanced Features

12.8 Builtin Features versus Extensions
=======================================

As this and subsequent major nodes show, 'gawk' has a large number of
extensions over standard 'awk' built-in to the program.  These have
developed over time.  More recently, the focus has moved to using the
extension mechanism (*note Dynamic Extensions::) for adding features.
This minor node discusses the "guiding philosophy" behind what should be
added to the interpreter as a built-in feature versus what should be
done in extensions.

   There are several goals:

  1. Keep the language 'awk'; it should not become unrecognizable, even
     if programs in it will only run on 'gawk'.

  2. Keep the core from getting any larger unless absolutely necessary.

  3. Add new functionality either in 'awk' scripts ('-f', '@include') or
     in loadable extensions written in C or C++ ('-l', '@load').

  4. Extend the core interpreter only if some feature is:

       A. Truly desirable.
       B. Cannot be done via library files or loadable extensions.
       C. Can be implemented without too much pain in the core.
   Combining modules with 'awk' files is a powerful technique.  Some of
the sample extensions demonstrate this.

   Loading extensions and library files should not be done
automatically, because then there's overhead that most users don't want
or need.

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.