Path: utzoo!attcan!uunet!husc6!cmcl2!nrl-cmf!ames!ll-xn!mit-eddie!uw-beaver!microsoft!bobal From: bobal@microsoft.UUCP (Bob Allison) Newsgroups: comp.lang.fortran Subject: Re: Should I convert FORTRAN code to C? Summary: who cares Keywords: FORTRAN, c, well-trained apes, religion, motherhood, apple pie Message-ID: <1544@microsoft.UUCP> Date: 22 Jun 88 16:13:40 GMT References: <2742@utastro.UUCP> <20008@beta.UUCP> <224@raunvis.UUCP> <29697@cca.CCA.COM> <741@naucse.UUCP> Reply-To: bobal@microsoft (Bob Allison) Organization: Microsoft Corporation, Redmond, WA Lines: 49 In article <741@naucse.UUCP> rrr@naucse.UUCP (Bob Rose ) writes: >Sooo, the question again is is there any fortran constructs that cannot >be translated into fortran through a brute force kludge. You know, >something that a well trained ape couldn't do. I would like to see it. >Please no complex numbers, these well just be function call (and if >you are worried about speed, get a compiler that well do inline function >calls.) > -bob Much as I hate to get embroiled in this my-language-can-do-anything-your- language-can-do-better issue, reading this article I did manage to come up with a feature which is fairly difficult to implement in C: assigned gotos. I don't believe C can take the address of a label, which is the way a "well-trained ape" would do it. Otherwise, you could (I suppose) assign each label as it appears a monotonically ascending number and then in place of the "ASSIGN 10 TO L" statement, assign the assigned number of the label to L, then in place of the "GOTO L" statement do a case statement and branch to the appropriate label based on the value in L. Frankly, this stinks. This is clearly a contrived example (I'm not suggesting we all use FORTRAN so we can do assigned GOTOs), but I think that it is obvious that there are things which C can do easily which FORTRAN can't and things which FORTRAN can do easily which C can't, and let's just live with it. (I love it, soon we'll be having lawsuits about discrimination and equal opportunity for programming languages). A very sensible comment: > Offhand, my feeling is that I wouldn't use any of these schemes. >C isn't fortran and vice versa. C doesn't allow > > foo(m,n,a) > int m,n; > double a[m][n]; > {....} > >and that's the way it is. Cute tricks to simulate this just make the >code obscure. > > Richard Harter, SMDS Inc. Of course, it is just as easy to construct a C program which is difficult to write in FORTRAN. Bob Allison (It seems this debate comes up every six months. The basic response is "Who cares? Let people use whatever language they like. It's their life." Why do even mundane things like programming language selection need to be turned into religious issues?)