Next: Artificial Language vs. Up: Introduction to Semantics Previous: The Purpose of

Declarative Language vs. Procedural Language

When we look at the declarative language (like Prolog) and procedural language (like C), we can see the distinction is critical. The declarative programming try to blur the distinction between a program as a set of instructions and a program as an assertion about the desired answer, in other words, the declarative programs can be dually viewed as programming commands or mathematical assertions. Thus, it is easy to understand the semantics of declarative language using the way we understand ordinary mathematics.

This crutial distinction between declarative language and procedural language will be a main theme, especially as it concerns FUNCTIONAL programming languages. There are some hot discussion on the net recently which concerns the question: why do we need functional programming language stuff while C seems to be powerful enough? Here I'd like to quote some points from two users of SML:

  1. SML is good for programming:
    • SML is close to mathematics. It is possible to embed recommended program design methodology ( starting with an abstract specification and refining to a concrete implementation ) in the actual code, instead of in a soon forgotten design document.
    • Due to the ML type system, it is easier to program and nearly error-free.

  2. ...SML takes for granted capabilities that I had never before even dreamed of in a programming language. Functors, Safe polymorphism, it was a whole new world... and I know that the codes are more solid and more reusable the anything else I've ever written in my life.

There are also some research work on this topic which is very helpful: John Hughes' article `` Why Functional Programming Matters'' ( in collection of hughes-functional, Chapter 2), and a book ``Research Topics in Functional Programming'' ( from UT Year of Programming Series ).


Next: Artificial Language vs. Up: Introduction to Semantics Previous: The Purpose of


cs611@
Wed Sep 28 09:56:06 EDT 1994