[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

1405.0. "choice of language for numerical software" by SMAUG::ABBASI () Tue Mar 26 1991 04:21

    Hi all,
    Assume that your about to start development of large numerical
    software, and had the choice of using one of these langauges,
    which one will you use, and what's the reasons?
    Fortran 77, Fortran 90 (When it comes out), C, C++, ADA, or
    pascal.
    from your experience, may be you could also rank these langauges
    for this task.
    to start things , these are my 2 cents worth:
    I think ADA ranks high, although it doesnt have double precession
    but it has exception handling (which is better way of reporting
    numerical abnormalities than status values as in fortran), C and C++
    start arrays at zero index , instead of at 1, and I find that
    starting at 1 is more 'natural', but this could easily be solved
    by offsetting backword by one (as shown in num' recipes).
    C++ looks good too, since it has exception handling also.
    Pascal is fair, it is easier to read than C. but you'd have
    to declare array types for each size ( i think.. havent used pascal
    for a while)
    Fortran (offcourse) is the most used langauge for numerical software
    and it has lots of built in functions etc.. 
    
    your comments are welcom,,
    /naser
    
T.RTitleUserPersonal
Name
DateLines
1405.1I vote for FORTRAN, nowCIVAGE::LYNNLynn Yarbrough @WNP DTN 427-5663Tue Mar 26 1991 13:258
Right at the moment I think the overwhelming choice is FORTRAN.  My main 
reason for saying this is that if you want to use the parallel/vector
capabilities of DEC systems right now, the FORTRAN/HPO compiler is the best 
available tool to use.

There is also no compelling reason NOT to use FORTRAN in this problem space.
The CS features of more modern languages (recursion, dynamic storage
allocation, etc) are, for the most part, not needed. 
1405.2ALLVAX::JROTHI know he moves along the piersTue Mar 26 1991 13:4223
    FORTRAN has a big plus in my book because it has complex arithmetic
    and there is a lot of high quality software already available.
    Our FORTRAN generates code for H precision (if you need that),
    and excellent vectorized code.

    However, the lack of flexible data structures is a drawback
    in FORTRAN - in particular we are increasingly seeing numerical
    algorithms that require a sophistication beyond linear arrays,
    equivalences, common blocks and non-recursive procedures.  It can and is
    still done the "old way", by simulating these things, but it is not very
    good in this day and age.

    C is a crock in some respects for numerical processing.  You have
    no complex arithmetic, no eponentiation operator, you have to play
    games to pass conformant arrays, etc.  (I have a bias to
    languages that have complex because of my interest in electrical
    engineering, doing time harmonic electromagnetic field calculations,
    network analysis, physical calculations and so on.  This is far easier
    with a complex data type.)  C++ addresses some of this.

    I guess for hardcore number crunching, FORTRAN is still viable.

    - Jim
1405.3GUESS::DERAMODan D'EramoTue Mar 26 1991 15:424
        There's also LISP.  It has complex numbers, arrays, etc.,
        and I think it even does recursion. :-)
        
        Dan
1405.4Fortran and the calling standardCSSE::NEILSENWally Neilsen-SteinhardtTue Mar 26 1991 16:3218
If your target is an operating system with a calling standard (like VMS), then
you can program in Fortran (being a little careful about your call inteface)
and be secure in the knowledge that programmers in other languages can call you.

Which brings me to my question on 

.2>    However, the lack of flexible data structures is a drawback
>    in FORTRAN - in particular we are increasingly seeing numerical
>    algorithms that require a sophistication beyond linear arrays,
>    equivalences, common blocks and non-recursive procedures.  It can and is
>    still done the "old way", by simulating these things, but it is not very
>    good in this day and age.

Are you saying that the algorithms themselves use complex data structures, as
opposed to applying algorithms to data embedded in complex structures?

Can you give an example or two?  Things must have changed since I went to 
school.
1405.5Another vote for FORTRAN (-77)VMSDEV::HALLYBThe Smart Money was on GoliathTue Mar 26 1991 16:574
> Can you give an example or two?  Things must have changed since I went to 
> school.
    
    Yes.  We have computers now.  :-)
1405.6in-putVICE::JANZENTom 223-5140 MLO23-4/E10Mon Apr 08 1991 16:0024
	What OS are you using?  
	Ada doesn't have double?  What is double?  G_Float and D_Float are
	allowed.  cf. VAX Ada Language Reference Manual 3.5.7a.  It looks
	like H float is allowed as well but that's just from skimming.
	I have written packages for complex arithmetic and matrix operations
	in Ada (cf. ada_toolshed) and it worked fine.
	C++ allows overloading of operators.  This would allow complex
	numbers (once you wrote a library) to be added like
	A = B + C.
	How can you say C has no complex numbers?  I have written a 
	library of complex arithmetic in VAXC and posted it somewhere.
	I used it to make smith charts to analyze transmission lines.
	But I couldn't overload operators; I had to use regular calls
	(e.g. AddCD(A,B) for add complex to double).
	Also I wrote a matrix ops library for VAXC.
	C is flexible; you can buy or write your own libraries.
	Also don't forget the language doesn't matter anyway because a 
	more complete librayr is now a product:
	Digital Extended Math Library (DXML) for VMS (I saw it in Bookreader).
	it does everything.  Must have VMS 5.4, and a vector VAX helps
	but is not necessary.  Vector operation on a scalar VAX requires
	VVIEF (Vector Instruction Emulator Facility).
	It handles real, complex, scalar, vector, and matrix operations.
	Tom