Article View: comp.lang.java
Article #109Re: Will Java kill C++?
From: Matt Austern
Date: Thu, 04 Apr 1996 18:27
Date: Thu, 04 Apr 1996 18:27
35 lines
2377 bytes
2377 bytes
In article <3162FD33.61F7@uh.edu> Jeff M Younker <jeff@uh.edu> writes: > Value types are really cool from a conceptual point of view, but > I am not so sure that they are necessary to achieve fast numerical > code. If my understanding is correct, Fortran 77 (the premiere > language of high speed code) treats integers, floats and complex > numbers as references. I have yet to hear anyone complain about > the speed of Fortran code. Yes and no. In Fortran 77, all objects are what C calls "automatic" or "static" [*], and what Eiffel calls "expanded". That is, if x and y are of type REAL*8, then the expression x = y assigns the value of y to x. Variables are allocated on the stack or in static storage, rather than being dynamically allocated, and you're manipulating values rather than not pointers. In other words, all Fortran 77 objects are value types. What is true is that parameters in Fortran 77 subroutines are passed by reference rather than by value: you can, for example, modify the values of the arguments you're passed. Fortran 77 imposes very strong constraints, though (such as no aliasing or recursion), so the semantics of Fortran subroutine calls really doesn't have much in common with an all-pointer language like Java or Smalltalk. --------------------------- [*] One interesting bit of trivia: a lot of people, including a lot of Fortran programmers, think that the Fortran 77 standard guarantees that variables are static. That's false; it just happens that many implementations do that, and many programmers have written incorrect code that relies on such behavior. -- Matt Austern SGI: MTI Compilers Group austern@isolde.mti.sgi.com
Technical Details
Message-ID:
<AUSTERN.96Apr4102705@isolde.mti.sgi.com>Path:
arc1-ca.pugleaf.net!fido.asd.sgi.com!newsReferences:
<Dp5J6n.F2K@news.hawaii.edu> <4jno9v$css@newsbf02.news.aol.com> <Dp7DKD.1nt@news.hawaii.edu> <4jr7gf$dc6@nyheter.chalmers.se> <4jrlou$l8a@netope.harvard.edu> <ROGOFF.96Apr2130820@sccm.Stanford.EDU> <3162FD33.61F7@uh.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!fido.asd.sgi.com!news From: austern@isolde.mti.sgi.com (Matt Austern) Newsgroups: comp.lang.java,comp.lang.c++,comp.lang.smalltalk Subject: Re: Will Java kill C++? Date: 04 Apr 1996 18:27:05 GMT Organization: SGI Message-ID: <AUSTERN.96Apr4102705@isolde.mti.sgi.com> References: <Dp5J6n.F2K@news.hawaii.edu> <4jno9v$css@newsbf02.news.aol.com> <Dp7DKD.1nt@news.hawaii.edu> <4jr7gf$dc6@nyheter.chalmers.se> <4jrlou$l8a@netope.harvard.edu> <ROGOFF.96Apr2130820@sccm.Stanford.EDU> <3162FD33.61F7@uh.edu> Reply-To: austern@mti.sgi.com NNTP-Posting-Host: isolde.mti.sgi.com In-reply-to: Jeff M Younker's message of Wed, 03 Apr 1996 16:35:31 -0600