Xref: utzoo comp.lang.misc:3805 comp.lang.c:24858 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!hp4nl!philapd!ssp11!roelof From: roelof@idca.tds.PHILIPS.nl (R. Vuurboom) Newsgroups: comp.lang.misc,comp.lang.c Subject: Re: The Fundamental Concept of Programming language X Keywords: programming languages, abstractions Message-ID: <585@ssp11.idca.tds.philips.nl> Date: 3 Jan 90 14:50:57 GMT References: <1470@mdbs.UUCP> <1782@aipna.ed.ac.uk> Organization: Philips Telecommunication and Data Systems, The Netherlands Lines: 98 In article <1782@aipna.ed.ac.uk> sean@aipna.ed.ac.uk (Sean Matthews) writes: [A number of interesting points a few of which I would like to look at.] | |Take first some of the the sorts of models that we have for computers: | |1. the Von Neumann stored program/ processor machine. |2. the lambda calculus. |2a. combinatory logic |3. communicating processes of various sorts. |4. proof search (e.g. sequent calculus) | 1 is obviously a computer model, 3 could be used as a computer model. But 2 2a and 4? Looks a lot more like language models to me. | |The Von Neumann machine, which is a sort of sophisticated Turing |machine, comes to us in all sorts of forms, and has had a decisive |influence (necessarily, probably) on the way computers have been built |up to now, and (unfortunately, definitely) on the way computer |scientists have been educated up to now. | Imo the von Neumann machine is a sort of sophisticated Turing machine in the same way an integer variable is a sort of sophisticated bit box. You can emulate a computer with a Turing machine. You can emulate an integer with a bit box. What you don't do is conceptualize an integer as a bit box and you (at least I don't) _conceptualize_ a computer as a Turing machine - the difference in levels of sophistication and complexity are just too great (at least for me :-). As I see it, a Turing machine is no longer used by computer scientists as a computer paradigm (except for some admitedly interesting theoretical results). |It has produced languages such as Fortran, Algol{58,60,68,W}, COBOL, |C, PL/1 Sumula, Pascal, Modula{2}, C, BCPL, Ada, Mesa, BASIC etc. | Agreed: The von Neumann machine has produced assignment (imperative programming) and this is a backbone of all the above languages. A futher separation into stack-based and non-stack based is possible as you noted. | |The second model that I have listed is the Lambda calculus. Which is a |much nicer theoretical (and practical) model than load and store. As always it depends what your practice is as to whether or not its practical... |In fact, ML is an interesting case, since it started out with pure |typed lambda calulus and then added as much as was necessary of |imperative structures as was needed (it turns out to be very little), |and got a programming language, that, for complex tasks, does not need |to be much less efficient than C. | Maybe this is a little too simplistic, if you're using C to develop a model which can be naturally implemented in ML you're probably right. Vice verse you could lose out. | |So what are the advantages that Lambda calculus gives us? Higher |order functions, powerful typing systems, no side effects (except when |we want them) compact code, more abstraction. The elimination of the |Von Neumann bottleneck, both in the programmer, and in the machine; we |no longer have to think in terms of one thing at a time. | And let's not forget the disadvantages: its next to impossible to model any number of real world situations with it. |What about paradigm three? Well here there is the notion of Hoare's |CSP (yes and Milner's CCS, but let us not complicate things) which is |best seen in occam (no capitals), which is a load store language that |has been heavily modified to remove the Von Neumann bottleneck |mentioned above. Agreed. | |paradigm four is maybe the least obvious to the typical programmer. |Prolog is the most obvious implimentation of this sort of thing. I am |not sure what we learn from it (I think it---i.e. prolog, and more |generally, logic programming---is overrated as a programming |technique) but it does at least give some good ideas about what can be |done with pattern matching and non-determinism, and it does give a new |set of intellectual tools with which to approach any problem. | I would consider pattern matching and non-determinism to be more mechanisms than policies (viewpoints,paradigms). The paradigm is not pattern matching and non-determinism, the paradigm is descriptive programming vs procedural programming. I find prolog a little clumsy in its form of expression (syntax) but where relevant it offers in my view a higher (and better) form of abstraction than does lamda calculus (functional programming) or procedural programming. | |the important thing is to realise that the real differences are not of |the sorts of data that programming languages deal with, but the way |that they allow you to approach what you are doing. | Can't agree more.