Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!laura From: laura@utzoo.UUCP (Laura Creighton) Newsgroups: net.lang Subject: Re: levelheight Message-ID: <4890@utzoo.UUCP> Date: Tue, 8-Jan-85 16:13:58 EST Article-I.D.: utzoo.4890 Posted: Tue Jan 8 16:13:58 1985 Date-Received: Tue, 8-Jan-85 16:13:58 EST References: <2673@dartvax.UUCP> Organization: U of Toronto Zoology Lines: 81 What a fun discussion! I get back from vacation and look what I get! Thanks folks. Okay, what do we have here? First of all, we are agreed that there are certain things which are ``low level''. Programs written in turing machine ``move the tape X spaces to down, read tape'' instructions would qualify. They are often provable (at least that's what the CS courses said: ``write a program in turing machine code that does X. Now prove X''). Machine language is also low level. Then there are higher level things like assemblers. Then there are all the languages which are portable to more than one piece of hardware. (Actually, i know a lot of machines that have OS 360 assembler interpreters - this definition could stand some work.) Now what one wants to do is rank these languages. Naturally, one wants one's favourite languages to score well and the ones that one hates to score badly. (Why not? One must have a reason to hate the languages that one hates.) There may be an ``apples and oranges'' problem here. The way I think when I think in Lisp is very different from the way that I think when I think in C. (Someday i am going to have to get my hands on APL and raise my consciousness more.) Comparing C and Lisp may be a mistake, though comparing Pascal and C seems appropriate. Okay, barring the ``apples and oranges'' types of questions, I think I can come up with a working definition of ``high level''. The ``highness of level'' is a measure of how little you have to think about something other than the problem you want to solve. Machine code scores very poorly on this test: you have to do your own character encoding and mostly that is what you are thinking of. Assembler does somewhat better, but you still think about hardware a lot. The interesting thing is that C does not score poorly on this. Arguments such as ``well the ++ instruction was clearly designed for the pdp11, therefore C is low level'' do not wash -- once you have used C a fair bit, typing i++ is as natural (and unthought) as typing i + 1. Which brings up another point: only people who have used the languages being compared are actual experts on how ``high level'' a language is. The Basic user who has been programming in C for a week is going to find C a very low level language for a while: most of his effort will be in learning a new syntax and new constructs. The Pascal afficionado who has overdosed on Wirth for a week may be unable to see the value of variable length strings in his passion. Neither of these sorts are going to be very useful judges of how ``high level'' C is. So how about some heuristics for the design of (yet another! gasp, just what computer science really needs!) a high level language. 1. Line numbers and GOTOs make for a low level language. If I have to think about ``is it goto 100 or goto 110'' then I am wasting valuable thinking time on crud. 2. all high level languages have a variety of types, including a string type. 3. all high level languages have a way of defining types and let you use them conveniently. 4. all high level languages have a way of ``hiding'' information. Here I am thinking of procedures and functions, but this can include modules as well. Can anybody come up with any other heuristics? So far, my favourite of the ``block structured'' types of languages is Algol 68 -- though I am told that Simula is rather nice as well. For sheer joy of writing code I would rather be writing in Lisp, but I don't think that Lisp is ``higher level'' than Algol: I just have a severe case of Hofstadter's disease (all the world is recursive, and hence wonderful) which I am entirely uninterested in curing... Laura Creighton utzoo!laura