Reasoning about Programming Languages in a Functional Manner

Jack Waugh — 2001-05-31 14:54:39

The group blurb says, among other things, "In short, concatenative
languages behave in a way [that] looks imperative (like C or Perl),
but can be reasoned about in a functional manner (like ML or
Haskell).".

What is one characteric of Joy, ML, and Haskell that makes it
possible to reason about them in a way that isn't possible with, say,
C?

C is based on function composition, denoted by the ";" operator.
Each C "statement" denotes a function in one parameter to produce one
result. In all cases, the type of the parameter and that of the
result is "execution state". An execution state includes a stack, an
indexed memory space, open files, the system clock, the mental states
of the users, the phase of the moon, etc. Since the result of a
function has the same type as the parameter and this type is the same
for all functions in the language, we can readily construct
compositions of any of the functions. . . .