C.5.2 Goals For A New Mechanism

Some goals for the new API were:

Some additional important goals were:

During development, it became clear that there were other features that should be available to extensions, which were also subsequently provided:

The requirement to avoid access to gawk’s symbols is, at first glance, a difficult one to meet.

One design, apparently used by Perl and Ruby and maybe others, would be to make the mainline gawk code into a library, with the gawk utility a small C main() function linked against the library.

This seemed like the tail wagging the dog, complicating build and installation and making a simple copy of the gawk executable from one system to another (or one place to another on the same system!) into a chancy operation.

Pat Rankin suggested the solution that was adopted. See How It Works at a High Level, for the details.


Footnotes

(124)

The symbols are the variables and functions defined inside gawk. Access to these symbols by code external to gawk loaded dynamically at runtime is problematic on MS-Windows.