Hoc (programming language)
Appearance
hoc, an acronym for High Order Calculator is an interpreted programming language that was used in the 1984 book The Unix Programming Environment to demonstrate how to build interpreters using Yacc.
Hoc was developed as a glorified interactive calculator. Its basic functionality is to evaluate floating-point numerical expressions, e.g., "1+2*sin(0.7)". Then, variables were added, loops, user-defined functions, simple IO, and more, using a syntax resembling C.
An improved Hoc interpreter was included in Research Unix, but it has not been generally adopted by later Unix or Linux systems. Instead, the calculator languages dc and bc have been adopted.
External links
- Source code of Hoc, released as free software. This version is the Research Unix version, slightly improved over the one in the book.