Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!usc!ucsd!ucbvax!agate!shelby!neon!pescadero.Stanford.EDU!philip From: philip@pescadero.Stanford.EDU (Philip Machanick) Newsgroups: comp.sys.mac.programmer Subject: Re: Pascal deficiency? Message-ID: <1990Dec18.215406.29735@Neon.Stanford.EDU> Date: 18 Dec 90 21:54:06 GMT References: Sender: news@Neon.Stanford.EDU (USENET News System) Reply-To: philip@pescadero.stanford.edu Organization: Computer Science Department, Stanford University Lines: 30 In article , sandy@snoopy.cs.umass.edu (& Wise) writes: |> The speed difference between the two depends on the quality of the |> optimizations, and context (e.g., in a FOR loop, Pascal's implicit |> increment can usually be done as part of the test and branch |> instruction, while in C the increment is an explicit statement, and |> the optimizer must catch it). Since we are in reading compiler output mode, would someone care to compare the code produced by the following Pascal: program test; var i:integer; begin for i:=1 to 10 do {something} end. and C: main() { int i; for (i=1; i<= 10; i++) /* do something */ ; } As with the ++ examples, there is no reason a _good_ compiler should do better or worse with either, but the C case is slightly more difficult, as noted above. -- Philip Machanick philip@pescadero.stanford.edu