fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Happy Birthday FORTRAN, and its one-based array technology !

Happy Birthday FORTRAN, and its one-based array technology ! 1 year 7 months ago #3153

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
Hi guys,

Since I was recently talking about FORTRAN and its one-based arrays, and how I used it for scientific (Chemistry / Physics) use way back when, I thought you may be interested in this link I just got today :-

opensource.com/article/17/11/happy-60th-birthday-fortran

Looks like it won't be disappearing any time soon.

It interesting to see what it is used for today.

Regards,
Phil.

Please Log in or Create an account to join the conversation.

Happy Birthday FORTRAN, and its one-based array technology ! 1 year 7 months ago #3155

  Frank Maraite's Avatar Frank Maraite Offline Posts: 172
Hi Phil,

I used FORTRAN77 lastly when I did my diploma work 1984. Then I learned C and dBase and thought that FORTRAN is very outdated. I believe one reason why it is still there: people don't want to learn new things once they are familiar with a tool. And of course the non existing interoperability of those other languages. From my point of view there is nothing we cannot do in C and it's successors too but there are many things we cannot do in FORTRAN.

Maybe I'm wrong. There are so many languages out there ...

Frank

Please Log in or Create an account to join the conversation.

Happy Birthday FORTRAN, and its one-based array technology ! 1 year 7 months ago #3156

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
Hi Frank,

FORTRAN 77 was the last version I tried too :whistle:

However, if you read the Wikipedia entry for FORTRAN you will see that it has had quite a few updates and facelifts - AND - it was designed to be scientific - hence 'Formula Translator'.

I think you will find it good at what it is designed to do. Did you read the article and the code going into outer space etc., etc. ?

My point was that if it is so mathematical and science driven, one based arrays seems to have gone down well ;-0)

Chris is right in my opinion and zero base was forced by the C & C++ guys involved in the Microsoft development team. Microsoft were never that good at languages - that was Borland!

My 9 cents worth,
Cheers,
Phil.

Please Log in or Create an account to join the conversation.

Happy Birthday FORTRAN, and its one-based array technology ! 1 year 7 months ago #3157

  rjpajaron's Avatar rjpajaron Offline Posts: 191
I am Cobol guy: '87 no idea why!

Arrays on Cobol? I have no idea also.

Phil Hepburn wrote: Hi Frank,

FORTRAN 77 was the last version I tried too :whistle:

However, if you read the Wikipedia entry for FORTRAN you will see that it has had quite a few updates and facelifts - AND - it was designed to be scientific - hence 'Formula Translator'.

I think you will find it good at what it is designed to do. Did you read the article and the code going into outer space etc., etc. ?

My point was that if it is so mathematical and science driven, one based arrays seems to have gone down well ;-0)

Chris is right in my opinion and zero base was forced by the C & C++ guys involved in the Microsoft development team. Microsoft were never that good at languages - that was Borland!

My 9 cents worth,
Cheers,
Phil.

--

Rene Pajaron

Please Log in or Create an account to join the conversation.

Happy Birthday FORTRAN, and its one-based array technology ! 1 year 7 months ago #3158

  ArneOrtlinghaus's Avatar ArneOrtlinghaus Offline Posts: 126
I started my programmer career with Fortran 77. I am glad that I can use other programming languages now. But it depends on the task someone has to resolve. If it is more important to run long duration simulation programs on super computers it can still be convenient to do it in Fortran. I remember having worked with programs of few thousands of lines spending very much main frame time to do what I should do. And now? Now we have programs of some milions lines of code, but most of the code is used only for user I/O and not for heavy calculations.

What is regarding the zero based arrays:
I believe that it was the pointer approach in the 70s that fitted so nice to highly optimized C programs that introduced thinking zero based: The data pointer to an array is immediately the pointer to the first element using a 0 offset. And this will remain, it's the same why programmers still are using Fortran...

Arne

Please Log in or Create an account to join the conversation.

Happy Birthday FORTRAN, and its one-based array technology ! 1 year 7 months ago #3159

  FFF's Avatar FFF Offline Posts: 571

Arne Ortlinghaus wrote: The data pointer to an array is immediately the pointer to the first element using a 0 offset.

Yep. But the fundamental error was, the "thing" it points to is Thing #1, not #0 - counting starts with 1... So the problem was not a possible offset, but the way the index was semantically interpreted... Yes, you have to add a cycle for access to the first element, but, OTOH, if you use arrays there are more than one element ;)- and for all other you have to calculate anyway...
But, as you wrote, it will stay, like so many cemented things of the past, sadly.

Karl

Please Log in or Create an account to join the conversation.

Happy Birthday FORTRAN, and its one-based array technology ! 1 year 7 months ago #3160

  ArneOrtlinghaus's Avatar ArneOrtlinghaus Offline Posts: 126
Yeah,
but we have many similarities in our normal live:
If you are 0 years old, you are in your first live of year.
If you go to the first floor of a building, in reality you are in a building that has at least two floors. So the first upper floor should be the second "total" floor, especially if you think in one-based arrays...

Please Log in or Create an account to join the conversation.

Happy Birthday FORTRAN, and its one-based array technology ! 1 year 6 months ago #3164

  Karl-Heinz's Avatar Karl-Heinz Offline Posts: 258
I do not know if anyone ever had to work with VB 6.0 or VBA, but here are some examples of how VB handles arrays. The lower limit of the array is 0 by default, but may even be negative.

// 8-element array -> index 0 to 7
Dim a(7) As Integer

// 8-element array -> index 1 To 8
Dim a(1 To 8 ) As Integer

// 8-element array -> index -3 To 4
Dim a(-3 To 4 ) As Integer


ThereĀ“s even a setting - but that works on modul level only:

Option Base <nBase>

but MS itself recommends not to use this setting ;-)

regards
Karl-Heinz

Please Log in or Create an account to join the conversation.

Happy Birthday FORTRAN, and its one-based array technology ! 1 year 6 months ago #3165

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
Hi K-H,

That is indeed interesting - and, in my opinion more the way a high level language should be.

The convenience should be to the developer and his/her business solution code, NOT the convenience of the compiler writer. After all its just the use of an off-set or two.

If it is performance 'they' are after then make the default to the fast option, and give us programmer guys back some flexibility :dry:

Anyway such comments as these are now 'old hat' and 'past it', "moribund", since we have some wonderful Collection classes as well as LINQ to manage their data. Who needs arrays !?

Still, its a good topic for discussion and reflection I feel ;-0)

Best regards,
Phil.

Please Log in or Create an account to join the conversation.

Happy Birthday FORTRAN, and its one-based array technology ! 1 year 6 months ago #3166

  Frank Maraite's Avatar Frank Maraite Offline Posts: 172
Hi Karl-Heinz,

I think we should talk about compilers for professionals and not about toys for kids :-))

Frank
SCNR

Please Log in or Create an account to join the conversation.

Happy Birthday FORTRAN, and its one-based array technology ! 1 year 6 months ago #3167

  wriedmann's Avatar wriedmann Away Posts: 1549
Hi Frank,

I know about several very serious and large projects made in Visual Basic 6.0.

Neither VBA nor VB is a toy.

Personally, I hate Basic, but it is not correct to define these tools as toys. These are ages beyond the GWBasic that came with MS DOS.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Happy Birthday FORTRAN, and its one-based array technology ! 1 year 6 months ago #3168

  Frank Maraite's Avatar Frank Maraite Offline Posts: 172
Hi Wolfgang,

did you see my smily?

I know that. I use such a realy complex system to organize my work as a surveyor. I did BASIC from 1977 up to 1985.

The idea of having arrays with flexible upper and lower bounds seems very good on the first seight but also seem to have heavy cons too. Otherwise we had this in other languages too I think.

Frank

Please Log in or Create an account to join the conversation.

Happy Birthday FORTRAN, and its one-based array technology ! 1 year 6 months ago #3181

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
Hi K-H and any/all non-zero guys,

As an exercise in learning X# syntax etc., I have made a Generic class which is really just a wrapper which goes around a .NET System.Array object. Tested with Int and String so far.

So all I do really is to convert the start and end "one dimensional" index array values. I am adding more nice little features now that things seem to be working ;-0) Can't resist it !

A two dimensional version will come later when I have solved all the problems. Try this for an example of use :-



Plans are in progress to be able to 'Add' an element, as well as Filling a range from an input array. You know, the stuff we have in ArrayList and List<T>. I think I may also handle resizing in some nice and "easy to use" way.

PLEASE all note that this is done as a good way of learning X#, Generics, and feeling familiar with more complex syntax than just the usual 'bread and butter' stuff.

Now time for bed ;-0)
Cheers,
Phil.
Attachments:

Please Log in or Create an account to join the conversation.

  • Page:
  • 1