Subj : Re: Do all programming languages use files? To : comp.programming From : Ed Prochak Date : Wed Aug 31 2005 02:59 pm Richard Heathfield wrote: > Ed Prochak said: > > > > > Richard Heathfield wrote: > >> gswork@mailcity.com said: > >> > >> > it may be more interesting to ask if there is anything that *all > >> > programming languages* have in common* > >> > >> My three cents: Sequence, selection, and iteration. > >> > > > > Iteration is not necessarily common to ALL languages. > > I'd be amazed to hear of a /programming/ language that doesn't support > iteration in some form or another. I never really used it but does FORTH have iteration loops? It's so stack oriented, that it's my first guess at a non-loop language. > > > Obviously iteration can be done in a language with just Sequence, > > selection, and GOTO. > > Right. > > top: > INC x > FOO x > CMP x, y > JNE top > > > > And there is the less obvious language with Sequence, selection, and > > functions (as long as recursion is allowed, iteration can be > > implemented via recursion). > > Then the language has a rather strange form of iteration. It might be a > nuisance to do, but it's still iteration. Recursion and iteration are not the same thing. Most of the time in procedural languages like C, we try to remove the recursion and replace it by iteration. Given proper hardware support in the CPU, it might even be better to use recursion. (If I was right about no loops in FORTH, then the FORTH processor must have the right hardware support.) > > > and How about languages with only sequence and selection (The loops are > > implied in nonprocedural languages like SQL.) > > I don't really think of SQL as a programming language. It's more of a fairly > portable database API. Depends on the scope of what ia a language. The deveopers thought it was a language. It is after all the Structured (or Standard) Query Language. Maybe its power obscures its usefulness. A simple SQL script can do a LOT of processing (stuff that would take a procedural language kilolines of code). I consider it a programming language. > > -- > Richard Heathfield > "Usenet is a strange place" - dmr 29 July 1999 > http://www.cpax.org.uk > Email rjh at the above domain So on the topic, SQL I'd say does not support files. (gets back to the "what is a file?" question, doesn't it.) Does FORTH have file operators? ed .