[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can a functional language be sequential?

On 2003.06.02 13:03 Matt Hellige wrote:
> When pure functional programmers say something is without side
> effects, they mean side effects OF ANY KIND. Using the term in a less
> precise way will certainly get you in hot water in some circles

As long as "hot water in some circles" refers to hot tubs, I don't
mind ;)

Based on your comments and others', I can see that because it does
not entirely rule out side effects, Bento is not strictly speaking
a functional language.

But the side effects in Bento are entirely from external calls; if
there were no external calls, or if they were rendered somehow
"side effect free" (e.g. via monads), there would be no side
effects.  I can see that this would be a good thing, and plan to
look at monads and other features which could eliminate or at
least put constraints on external side effects.

I'm still left wondering whether putting expressions in a sequence
which describes the order of assembly of the resulting values, not
the order of evaluation, in and of itself disqualifies a lanugage
from being functional.  Since it does not introduce any side
effects (barring fatal errors and nontermination), it seems to me
it could still be considered functional, technically if not
stylistically.  Or am I missing something?

This is slightly more than academic, since Bento programs do not
always need external calls.  Input data can be passed in from the
outside before the program starts, and output is generally implicit
at program termination (the output simply consists of the final
result of the evaluation).  External calls must be explicitly
enabled by the "extern" keyword at the head of the file, so the
absence of this keyword in a Bento program should indicate that the
program is free of side effects.  Or once again, am I missing
something here?


Michael St. Hippolyte