Jump to content

Hoc (programming language)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Nyh (talk | contribs) at 09:07, 8 August 2007 (new page). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

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.