Refreshing Vintage Hoc by Robin Williams

ACCU Oxford
ACCU Oxford
Public group
Location image of event venue


In their classic 1984 book, Kernighan & Pike describe the development of 'hoc' [ ]. Over the course of a chapter, hoc grows from a four-function calculator into a fairly complete scripting language, with variables, control logic and procedures. This pattern can be applied to use cases ranging from flexible control file input to compiler front-ends.

In this talk, we will revisit the development of hoc from the perspective of 2019. While Kernighan & Pike's emphasis on the value of incremental development remains valid, other aspects of the presentation have not aged as well. Their book pre-dates Test Driven Development, with large increments by modern standards (including a ground-up re-write) and free use of global variables. By now, the STL provides the required data structures and safe memory management.

We'll start by applying TDD to the initial development of the four-function calculator, and review the code which results. I'll then describe one onward route, circumventing the K&P's rewrite and applying Parsing Expression Grammars to allow for fully dynamic flexibility in the language represented.

About our Speaker
Robin has been programming in C and C++ since the publication of K&P, and his input keeps coming alive.

All Welcome
This event is free due to the kind support of our ACCU ( Members and Sponsors. ACCU Members and non-members are all welcome so spread the message far and wide. I will have ACCU Magazines ( to give away free to new attendees.

This event is sponsored by Oxford Computer Consultants ( and JetBrains ( for whose support of our community we very much appreciate.

JetBrains ( has donated a 1 year single personal use license to any one of the JetBrains Toolbox products ( to be given away.

Nigel Lester
ACCU - Professionalism in Programming -