Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

F77/C++

Name: Deadpool 2010-05-10 4:12

I read this paper:
http://www.uop.edu.jo/download/PdfCourses/Cplus/cppf77.pdf

And it was published TIME ago, so i was wondering, is there any point in using FORTRAN for the complex math in a program? (for example in a physics engine or a graphics modeller)

Opinions please chaps, and anyone mixed anything else with C++?

Name: Anonymous 2010-05-10 4:29

Seems pointless and overcomplicated. He says right in the intro there are plenty of interfaces for C and F77, so he should have just extern "C"'d some wrappers and called it a day. Representing F77 types as C++ classes is fucking useless and pointless.

And it was published TIME ago, so i was wondering, is there any point in using FORTRAN for the complex math in a program? (for example in a physics engine or a graphics modeller)
I spent a lot of time working on a physics package in F77. The only reason anyone uses it is because existing code they need is already written in F77 (and there is a massive amount of it), and because it took a long fucking time for C compilers to support complex numbers and for C++ compilers to not suck. This is also why this guy spent so much time grafting F77 onto C++, because new physics software like that at the LHC is all C++ now.

Name: Anonymous 2010-05-10 7:47

>>2
If it's possible in C, isn't it equally as possible in C++? I thought C++ was an extention of the C language (adding classes etc)

Spoiler: I am a D programmer and have only dabled in C/C++

Name: Anonymous 2010-05-10 10:11

>>3
C++ is an extension of the C language in the same way that OS/2 is an extension of Windows 7.

Name: Anonymous 2010-05-10 10:11

The usual reason given why numerical code is written in FORTRAN is that the language rules lets the compiler perform better and more aggressive optimizations than C/C++ (something about arrays and pointers, I don't know I don't even work here).

Name: Anonymous 2010-05-10 10:47

>>3
C++ is not C with OO bolted on, C++ is a fundamentally different language that happens to use compatible syntax with C. As an example, Java copied about 98% of its syntax from C++, but that does not make Java a subset of C++. In fact it would be possible to change syntax differences in Java to be exactly like C++ so that C++ code could run in Java, that still would not make Java a subset of C++.

Name: Anonymous 2010-05-10 11:34

>>6
I'm torn between my desire to let that stand because it's a negative comment against Sepples and Jaev, and to call you out on your obvious bullshit.

Name: Anonymous 2010-05-10 12:04

>>7
Are you the shitposter who likes to turn every thread into an argument?
``Obvious bullshit'' is the cornerstone of /prog/, without it this board suck an anus, like 4-ch /code/.

Name: Anonymous 2010-05-10 12:30

>>8
I'd say troll in training. He doesn't have much to offer so I'd rate him 3/10.

Name: Anonymous 2010-05-11 2:17

>>3
Of course it's possible, the guy in the linked paper did it. That's what he wrote about.

I said it was pointless, precisely because it's already possible with C, so he should have just used that interface in C++.

>>5
Easily solvable with restrict.

>>6-10
Idiots.

Name: Anonymous 2010-05-11 10:53

Name: Deadpool 2010-05-11 11:10

So, basically it IS a good idea to use FORTRAN for the calcs, just using the C API in C++, which is totally possible.. yeah?

Name: Anonymous 2010-05-11 11:24

Hi, this thread is all about fortran, REAL FORTRAN.  This thread is awesome.    My name is Robert and I can't stop thinking about fortran.  This language is cool; and by cool, I mean totally sweet.

Facts:

1.    Fortran is a language.
2.    Fortran solves problems ALL the time.
3.    The purpose of fortran is to flip out and perform complex math.

Name: Anonymous 2010-05-11 13:08

>>11
I mostly agreed with those comments until I hit the last part:
  f) FORTRAN is designed to make numerical computation easy, robust
    and well-defined:

       1) The order of evaluation of arithmetical expressions
         is defined precisely, and can be controlled with
          parentheses.

Oh-kay.

       2) The implicit type declaration feature saves time/typing
          (however it makes your program vulnerable to annoying
          and hard to detect bugs).

Mhm.

       3) Case insensitivity eliminates bugs due to 'miscased'
          identifiers.

What?

       4) The lack of reserved words in the language gives the
          programmer complete freedom to choose identifiers.         

Oh boy. This get's better and better.

       5) The one statement per line principle (of course
          continuation lines are allowed with a special syntax)
          makes programs more robust.

Keeps getting better and better...

       6) Added blanks (space characters) are insignificant
          (except in character constants) this also contributes
          to the robustness of FORTRAN programs.

Wait till my boss hears this. I shudder when I imagine the resulting coding style guidelines.

       7) Linking with the mathematical library doesn't require
          any compiler option (in C you to have to use "-lm").

Fuck this shit.

This part completely destroyed any semblance of credibility of this guy's drivel.

Name: Anonymous 2010-05-11 14:03

>>13
I think you mean REAL ULTIMATE FORMULA TRANSLATION.

Name: Anonymous 2010-05-11 14:12

>>14
If that drivel was written in (say) 1977 it would be quite acceptable. Originally it probably was (many of those were great and valid points at the time... others were naive truisms of the age), with a few hastily made modifications in response to, I'm guessing, C89.

Point 7. is neither something you should complain about nor anything worth mentioning in the first place: of course it doesn't need to explicitly link a math library, it's fucking FORTRAN.

Name: Anonymous 2010-05-12 6:13

>>12
So, basically it IS a good idea to use FORTRAN for the calcs, just using the C API in C++, which is totally possible.. yeah?
No, it's just a good idea to link to the existing code (which happens to be written in fortran) rather than rewriting it all. Seriously, in physics there are millions and millions of lines of this shit.

Name: Deadpool 2010-05-12 6:48

>>17
So here's a situation:
i need to equate the light(sparks) created from hitting two swords together & the heat of said light.

Would i be able to find something in FORTRAN to do so? i have looked but i'm not really sure what i'm looking for..

Name: Anonymous 2010-05-12 9:04

>>18
You haven't specified the relative forces, velocities, angle, duration of contact, materials, ambient conditions, phase of the moon, mood of the deity or even the last time you had a physical. How do you expect to get a meaningful answer?

Name: Anonymous 2010-05-12 9:57

>>19
They're all part of the equation, silly.

Name: Anonymous 2010-05-12 10:00

>>19
you retard.

>>18
first you need to figure out what equation best suits the situation, (i would personally use a few different one and have flags determine which to use) then you need to find a function for the parts of the equation in FORTRAN.

Name: Anonymous 2010-05-12 10:00

I haven't actually seen a good question on /prog/ for a while, well done OP.

>Deadpool
But bad choice in comic books, mainstreamfag.

Name: Anonymous 2010-05-13 6:38

>>21
bump for this

Name: Anonymous 2010-05-13 9:18

>>23
That really wouldn't have occurred to you on your own?

Name: Anonymous 2010-05-13 9:54

>>23
hurr de durr >.<

Name: Anonymous 2010-12-22 7:01


Don't change these.
Name: Email:
Entire Thread Thread List