Programming paradigms and programming languages
Posted by: Edward in: Intro/ConceptsNow, before I get myself horribly confused, better to get some things straight. To start off, programming languages are different from programming paradigms. A programming language can, however, have more than one programming paradigm. In learning and using the language, the programmer decides which one of or a combination of paradigms he or she might use in order to create a program. I can imagine that this is operational at the syntax level of programming. At the semantics level, we focus on how the programming paradigm reflects how the programmer thinks of the program, whether for example as a collection of interacting objects in object-oriented programming or as a sequence of stateless mathematical function evaluations in functional programming or as a series of computational procedures that may be called at any point during a program’s execution in procedural programming (also often referred to as imperative programming - like the imperative mood in natural language that express commands to take action).
As for Prolog, which uses mathematical logic for computer programming, the use of logic as both a declarative and procedural representation language is what interests me especially when I try to draw relationships between that and the different ways of representating / creating / defining knowledge.
The programmer is responsible, not only for ensuring the truth of programs, but also for ensuring their efficiency. In many cases, to achieve efficiency, the programmer needs to be aware of and to exploit the problem-solving behavior of the theorem-prover. In this respect, logic programming is like conventional imperative programming, using programs to control the behaviour of a program executor. However, unlike imperative programs, which have only a procedural interpretation, logic programs also have a declarative, logical interpretation, which helps to ensure their correctness. Moreover, such programs, being declarative, are at a higher conceptual level than purely imperative programs; and their program executers, being theorem-provers, operate at a higher conceptual level than conventional compilers and interpreters. – From the Wikipedia entry on logic programming
And so this gets me curious about imperative programs.
My caregiver has an old book on Turbo Pascal (4.0/5.0) by W. Savitch which caught my interest. Being an imperative programming language and an excellent tool for learning structured programming, I thought that I could take up Turbo Pascal alongside Prolog just to get a feel for the differences and similarities between various programming paradigms.
I am also very interested in the idea that all programming languages have a syntax describing how the words in the language may be combined (a grammar perhaps?), and a semantics describing how sentences in the language correspond to a program’s output. I imagine that program semantics correlates to the computation cycle of the program. This is really interesting because it somehow tries to describe how the human mind operates.
(Or fails to operate!)
Anyway, my caregiver’s partner has been awefully grumpy lately. He doesn’t quite like the idea of me waking him up in the early morning. Hmph!

October 11th, 2007 at 10:31 pm
Actually, I suspect that there are two (main?) types of “programming paradigms”: One type which is embedded in the language itself -providing the basic charaterisics of that language (i.e. “imperative” or “declarative” language types, string based or object based, etc) -and secondly, a more “subjective” type of paradigm which is rooted in the way the individual programmer actually implements the language on a practical and personal level (perhaps producing a personal “style” or “technique”).
In “So What is Media Art?” there is a more detailed discussion of related (isomorphic) concepts -in the context of “media”. It is claimed that each medium has a similar kind of double nature: One which is “hard wired” by the nature of the medium itself and the other one “softwired” by the artist in their personal preferential use of the medium. Presumably.such a correlation between “medium” and “language” is to be expected -IF one accepts the paradigm that “medium” is a specific, concrete, manifestation of the abstract concept of “language.
Indeed, there is probably much fascinating work to be done in studying the relationships (and possible interactions) between the different paradigms (on various levels): As Edward suggested earlier, in order to be implemented on a computer -each language requires a “translator” or “implementor” (iether a compiler, that translate the programme into machine code that can later be run on the computer in question -or an “interpreter” that translates in real-time so the the programme can be run in interactive mode).
This makes the issue of “paradigm” somewhat complicated -because presumably, a single computer can be used to implement different languages which are implemented on the basis of different paradigms (on various levels). If two different users run programmes written in two different languages (say java and lisp) on the same machine -then presumably both languages will have been translated into the (same) machine language that underlies the nature of the machine involved (i.e, Intel processor, Motorola, PowerPC, etc.)….. Similarly, the interpreters also need to be written in the same machine language as that used by the machine -in order to function.
Perhaps even more interesting is the conceptual puzzel that is created when one decides to use one language to write the compiler/interpreter of another….. I believe there is a Lisp interpreter available which is written in java -and I suspect that a java complier written in lisp would not be impossible……
So, it seems that a situation can arise where Java defines the nature of Lisp and Lisp defines the nature of java….. In computer science -this is related to “bootstrapping” -which is a standard procedure where more complex systems are built using simple, more basic, ones….. Interestingly, in Anglo-Saxon languages “a “self-made man” is concidered to have “pulled himself up by his own bootstraps”. However in the Germanic (literary) tradition Baron Munchausen is a figure of ridicule -because he claimed to have pulled himself out of quicksand in a similar fashion.