6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri May 03, 2024 8:04 pm

All times are UTC




Post new topic Reply to topic  [ 43 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: No love for FORTRAN?
PostPosted: Tue Oct 02, 2018 8:43 pm 
Offline

Joined: Fri Apr 06, 2018 4:20 pm
Posts: 94
When I worked at IBM my group wrote parallel scientific subroutines in FORTRAN for IBM's multi-processor systems. It is still used very extensively in HPC. Every new generation of supercomputer requires fine tuning of the core algorithms (BLAS, DEGEM, etc.), which are still in FORTRAN.

The shift toward neural network loads may finally displace FORTAN in several sub-areas of HPC. For years competitors like Julia nipped at its heels, but FORTRAN has endured.


Top
 Profile  
Reply with quote  
 Post subject: Re: No love for FORTRAN?
PostPosted: Tue Oct 02, 2018 9:27 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
My first encounter with Fortran, I'm pretty sure, was A Fortran Coloring Book which I got on inter-library loan from the town library. I think there was some bemusement when I ordered it, but it turned up and it was great. I had no way to compile or run Fortran, but I could at least get an idea of what it was about! I think I might have heard of the book in Scientific American which I'd sometimes see a copy of.

Image


Top
 Profile  
Reply with quote  
 Post subject: Re: No love for FORTRAN?
PostPosted: Tue Oct 02, 2018 9:57 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1401
Location: Scotland
So further to my earlier post, old, hazy (or horrid?) memories trickling in... In the late 80's/early 90's I worked for a UK supercomputer company - one thing we'd hear a lot was along the lines of: "I have this 30 year old FORTRAN program, make it go faster" ... So rather than them re-write it to utilise parallel processing/whatever, they just wanted us to make it faster - that's where the standard libraries shone - make sure they were using those libraries (e.g. linpack, etc.), then re-write them to fast on the new hardware then their ancient code magically went faster - well, that was one trick, anyway - the compilers were really key there.

The other thing - at uni, (1980+) I was exposed to Primos - something I'm not sure I'll recover from. early versions of Primos were written in FORTRAN. Imagine writing a multi-user OS today in FORTRAN...

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
 Post subject: Re: No love for FORTRAN?
PostPosted: Wed Oct 03, 2018 9:55 am 
Offline

Joined: Sun Apr 10, 2011 8:29 am
Posts: 597
Location: Norway/Japan
The Norsk Data operating system was SINTRAN-III and was written in NPL, but the first version (called SINTRAN-I retrospectively) was written in FORTRAN. The name is a combination of SINTEF and FORTRAN - the research institute that wrote the OS, and the language the OS was written in. The name was kept even if the implementation was new.
Quote:
Imagine writing a multi-user OS today in FORTRAN...
So it's been done, more than once (but SINTRAN-III was written in something entlrely different)

I just had a look through my old FORTRAN (and Fortran) programs from old times - there are a lot of various tools that I wrote in FORTRAN. Terminal emulation, an implementation of xmodem, remote transfer server tool, a tool to do DMA transfer to an imaging system, etc.
Very versatile language.


Top
 Profile  
Reply with quote  
 Post subject: Re: No love for FORTRAN?
PostPosted: Wed Oct 03, 2018 12:33 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1207
Location: Soddy-Daisy, TN USA
Wow. I didn't expect to see so many responses! I guess there is some love for FORTRAN after all. :-)

I have an old FORTRAN book I got for free at my local thrift store. With my love of all things "vintage electronics", it really seems like a great language to learn. Another one is Pascal. In fact, I think Pascal was more popular on 8 bit machines, yet, I see more FORTRAN ads in the vintage Byte magazines.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
 Post subject: Re: No love for FORTRAN?
PostPosted: Wed Oct 03, 2018 7:47 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
Well, as mentioned by the comment above about Fortran on the PC.

As the PC encroached upon the engineering space (vs the business space, where I think early micros were much more popular), then demand for doing things in FORTAN simply to save time running on the expensive mainframes would be more important.

A PC running FORTRAN could be a great productivity booster for someone who relies upon centralized computing resources.

Not necessarily to actually run the applications, especially early one before the math co-processors became more and more widely available. But simply empowering development of the programs. Being able to edit, compile, and test your code on "PC" time before uploading it to the mainframe had to be just an incalculable benefit.


Top
 Profile  
Reply with quote  
 Post subject: Re: No love for FORTRAN?
PostPosted: Wed Oct 03, 2018 10:22 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1000
Location: Canada
On the subject of implied types, FORTRAN was specifically designed to code math equations for automated calculation. In math the usual variables used for indices are i, j, k, l, m, n and are assumed to be integers. Physicists and engineers, the biggest users of FORTRAN back when I was a physics student in university, didn't necessarily want to be nuanced computer scientists, they wanted to get their models in and running, so having the implied types for indices was never a bother at all. We used Cray FORTRAN (Cray X-MP) so it was a little different than FORTRAN-77 but only in its platform specific extensions. Those we were interested in as they allowed for optimizing speed.

Now, Pascal or Modula-II, they seemed to get the computer science folks all of a dither.

_________________
Bill


Top
 Profile  
Reply with quote  
 Post subject: Re: No love for FORTRAN?
PostPosted: Thu Oct 04, 2018 8:45 am 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1401
Location: Scotland
whartung wrote:
A PC running FORTRAN could be a great productivity booster for someone who relies upon centralized computing resources.

Not necessarily to actually run the applications, especially early one before the math co-processors became more and more widely available. But simply empowering development of the programs. Being able to edit, compile, and test your code on "PC" time before uploading it to the mainframe had to be just an incalculable benefit.


At school I started on a desktop HP 9830A, then dial-up via tty 33 then Apple II (early '78), I went to uni in 1980 and after 2 years of computer on my desk, it was like going back to the dark ages - they still embraced a more commercial/banking type of computing - (although there was a tiny comp sci dept. with a pdp11!) we had to submit our programs on coding sheets for the girls to type in, the programs were batch run and we got the printouts at the end of the day - if we were lucky. Latterly, we were allowed into the terminal room and I don't think my ears have recovered from 2 dozen tty33's connected to the Prime mini they had at the time - grossly underpowered and frustrating for us new people who already knew how to type and had prior experience to micros. Waiting 24 hours for a batch job (e.g. cobol) to complete was not uncommon.

During my uni time, I had a summer job in a local hospital (mostly re-writing a FORTRAN program into Apple/ucsd Pascal!), and in the department I was based, they had some big ICL thing to do blood reports on - and a traditional hierarchy with the senior analyst programmer and the programmers and operators - which I found mildly amusing, but not alien due to the uni experience - one task I had was to update a program written 20 years ago on an Elliot 903 which I took to readily - which none of these others would touch. It was a funny old time.

So you can see why at that time, the "personal" desktop was a boon to scientists and engineers - even if it were relatively slow - the ability to get results quicker, interactively was great. I don't think the university I went to recovered from our generation of new students then.

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
 Post subject: Re: No love for FORTRAN?
PostPosted: Thu Oct 04, 2018 10:42 am 
Offline

Joined: Sun Apr 10, 2011 8:29 am
Posts: 597
Location: Norway/Japan
Ah, yes.. I had almost forgotten. As soon as people started to get computers at home there was a rush to prepare programs when at home, with some variant of (typically) Pascal or Fortran, and only after that would they bring the code to work/uni and massage it into its final form. That reason alone was more than enough for people to want Fortran compilers on their PCs. Wouldn't matter that much if it was slow. And soon enough it was good enough to do the actual job too.


Top
 Profile  
Reply with quote  
 Post subject: Re: No love for FORTRAN?
PostPosted: Thu Oct 04, 2018 6:17 pm 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8430
Location: Southern California
That was my first experience with computers too.  It was with Fortran IV at school, and you'd write your program by hand, take it to the computer lab and sit down to the punch-card machines, punch, stack, rubber-band, put the stack in a cubby with the account number, and come back a couple of hours later in hopes the operator had run your program, only to find a long printout with all the reasons it wouldn't run :lol: .  I got myself a programmable calculator, and although it couldn't do such huge programs, it could do ones at least as long as the stuff we did for class, and with maybe a few seconds' wait, rather than hours, and the printer paper was only 2.5" wide.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: No love for FORTRAN?
PostPosted: Thu Oct 04, 2018 7:49 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1000
Location: Canada
Yeah, I remember the cards. At first ours were pencil marked and we'd have to send them off to and outside place to have them run. No idea what kind of system they ran on. 3 days response time - minimum. Needless to say editing was a painful process. That was in high school - early 70's. We used BASIC back then.

The good ol' days.

_________________
Bill


Top
 Profile  
Reply with quote  
 Post subject: Re: No love for FORTRAN?
PostPosted: Mon Apr 22, 2024 9:51 pm 
Offline

Joined: Mon Apr 22, 2024 6:02 am
Posts: 9
Location: Germany
I would like to write programs in Fortran77 for my 6502 SBC with 32k RAM and 16K EEPROM (design by Grant Searle).

Small programs I write in 6502 assembly but I am unhappy that I can not easily save X or Y on the stack and can not access any function parameter on the stack with stack relative addressing. (I don't use the 65C02 or the 65816.)
A friend of mine is using the Elektor Junior with 32KB DRAM expansion + keyboard + video card and we write some software together.

In my opinion Fortran77 would be a good match for the 6502, better than C or Pascal because they are using a stack.

Does anyone know a Fortran77 compiler for 6502? I would prefer cross compiling on Windows, if possible - because my SBC does not have a floppy drive, hard disk or SD card.

I consider Fortran90 too modern and Fortran66 too ancient for me on the 6502.


Top
 Profile  
Reply with quote  
 Post subject: Re: No love for FORTRAN?
PostPosted: Tue Apr 23, 2024 1:39 am 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8430
Location: Southern California
Hermes wrote:
Small programs I write in 6502 assembly but I am unhappy that I can not easily save X or Y on the stack and can not access any function parameter on the stack with stack relative addressing. (I don't use the 65C02 or the 65816.)

Welcome.  It's a little off-topic, but since the topic is more than five years old and hasn't had any recent posts, one could say it has run its course, and it's ok to veer a little bit.  Are you just referring to the NMOS 6502's need to involve the accumulator when transferring X or Y to or from the stack?  As for stack-relative addressing, see the treatise on 6502 stacks (stacks plural, not just the page-1 hardware stack) at http://wilsonminesco.com/stacks/, specifically chapter 5, on stack addressing, at http://wilsonminesco.com/stacks/stackaddressing.html, starting about 40% of the way down the page.  You can definitely do stack-relative addressing, in the hardware stack and also in a ZP data stack.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: No love for FORTRAN?
PostPosted: Tue Apr 23, 2024 4:39 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8172
Location: Midwestern USA
Hermes wrote:
(I don't use the 65C02 or the 65816.)

Why not use the 65C02?  There is nothing about 65C02 hardware that prevents it from being retrofitted to a unit running an NMOS 6502.

Some limitations of the NMOS 6502 got addressed in the 65C02, especially with being able to push and pull the index registers.  Plus some new addressing modes are available that can streamline code and often make it run faster.  Not to be overlooked is that errata, such as JMP ($xxFF), was fixed.  While the 65C02 doesn’t have any stack-relative addressing modes (you’d need the 65C816 for such features), Garth’s stack articles can be quite helpful in that regard.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Last edited by BigDumbDinosaur on Tue Apr 23, 2024 5:48 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: No love for FORTRAN?
PostPosted: Tue Apr 23, 2024 5:05 am 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 677
Location: Potsdam, DE
BigDumbDinosaur wrote:

Why not use the 65C02?  There is nothing about 65C02 hardware that prevents it from being retrofitted to a unit running an NMOS 6502.


You may need to pull the BE pin high; depends what the original designer did with that pin.

Neil


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 43 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: