Hoc (short from High Order Calculator) is an interpreted language for floating-point calculations. Its most basic use is as a powerful and convenient calculator, interactively evaluating expressions such as 1+2*sin(0.7). But hoc is no ordinary calculator: It also lets you assign values to variables, define your own functions, and use loops, conditionals, and everything else you'd expect in a programming language.
The Hoc language was introduced and developed in the book The Unix Programming Environment, by Brian Kernighan and Rob Pike (Addison-Wesley, 1984). Countless people are indebted to this book, and its author, for introducing them to Unix and its fantastic programming tools like the shell, C, and Yacc. Some of these people were strongly impressed by Kernighan and Pike's feat of building an interpreter so easily (something which, before the advent of Yacc, was to be attempted only by experts).
One of these people was Nadav Har'El, the author of this package, who in 1986, as an 11 year old boy, typed in the source code of "Hoc 6" from the book, and started using it and once in a while added to it features that he wished for. This package is the result of almost a decade of such slow evolution of Hoc. It has numerous improvements over the book's version, which are described below. The code was also modernized, to compile and run on a large variety of machines and compilers that appeared since 1984, and most importantly on ANSI C compilers (although the code should still work on a K&R C compiler, if you can find one in a museum).
Compiling and Installing:
First run configure, to generate the Makefile.
Then, compile and install hoc: