From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,baaf5f793d03d420 X-Google-Attributes: gid109fba,public X-Google-Thread: fc89c,97188312486d4578 X-Google-Attributes: gidfc89c,public X-Google-Thread: 103376,97188312486d4578 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,6154de2e240de72a X-Google-Attributes: gid1014db,public From: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) Subject: Re: What's the best language to start with? [was: Re: Should I learn C or Pascal?] Date: 1996/08/20 Message-ID: <4vbbf6$g0a@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 175241133 references: <31FBC584.4188@ivic.qc.ca> <01bb83f5$923391e0$87ee6fce@timpent.airshields.com> <4uah1k$b2o@solutions.solon.com> <01bb853b$ca4c8e00$87ee6fce@timpent.airshields.com> <4udb2o$7io@solutions.solon.com> <01bb8569$9910dca0$87ee6fce@timpent.airshields.com> <4urqam$r9u@goanna.cs.rmit.edu.au> <01bb8b84$200baa80$87ee6fce@timpent.airshields.com> organization: Comp Sci, RMIT, Melbourne, Australia newsgroups: comp.lang.c,comp.lang.c++,comp.unix.programmer,comp.lang.ada nntp-posting-user: ok Date: 1996-08-20T00:00:00+00:00 List-Id: "Tim Behrendsen" writes: >Yes, but you can use the "get a better compiler" argument to >justify anything. Real programs run on real computers using >real compilers. The "Super-Duper Ivory Tower 9000 Compiler" >just doesn't exist. This is a bogus argument, because the better compilers *I* was talking about ACTUALLY EXIST. As a particular example, GCC does self-tail-call optimisation and SPARCompiler C 4.0 does general tail-call optimisation. Compilers for other languages doing very well indeed with procedures include Mercury and Stalin. It does nobody any good to pretend that good compilers do not exist. >> Interestingly enough, the APL sorting primitive DOESN'T move the data >> at all. It returns a permutation vector. The APL idiom for sorting is >> X[.GradeUP X] >> where the necessary movement is quite visible. >But the reality is *not* visible. What has the student really >learned? Scuse please? WHAT reality? The reality in this case is that you can in fact in just about any reasonable programming language sort data WITHOUT moving it. Indeed, for a number of statistical and numeric calculations, the permutation vector is more useful than moving the data would be. The reality could well be a sorting network made of comparators and wires. On the machine I'm posting from, sorting _could_ be done using parallel processes (not concurrent, parallel; the machine has more than one CPU). And of course there have been at least two machines built that directly executed APL; APL _was_ their assembly language. In the case of APL, the student has learned to express his/her intent in a concise notation with a clear mathematical semantics (this applies to APL primitives only, alas; the rest of APL is rather murkier) which permits effective reasoning at a much higher level. "Mathematical skills" came into it somewhere. Consider the insertion sort and bubble sort procedures posted in comp.lang.ada recently. I think it is easier to see the potential optimisation in X .IN A[.GRADE_UP A] (written as 6 characters) than to see the potential optimisation in subtype Element is Float; subtype Index is Integer range 1..N; type Vector is array (Index) of Element; A : Vector := ...; X : Element := ...; I : Index; procedure Sort is new Insertion_Sort; function Find is new Linear_Search; begin Sort(A); I := Find(A, X); This does not establish the superiority of APL over Ada as a general programming language, only that it makes a much better *design* language for some (but important) parts of some (but important) applications. The ability to do "algebraic" reasoning about a program is quite as important as the ability to do assembly level thinking (which I agree is important). When you really need big improvements in performance, you get it from the high level thinking. -- Australian citizen since 14 August 1996. *Now* I can vote the xxxs out! Richard A. O'Keefe; http://www.cs.rmit.edu.au/~ok; RMIT Comp.Sci.