Link to home
Start Free TrialLog in
Avatar of Hugh David
Hugh David

asked on

Software updating

I have two large batches of programs - several years work - in QuickBasic and Fortran IV .
I need to update these to a more modern language (Python?).
Are there any automatic translators?
where would I find them?
Avatar of Dr. Klahn
Dr. Klahn

Presumably you are doing this for support reasons.  Let me give an opinion:

FORTRAN has been around for 60 years and is still widely used, BASIC has been around for 50 years, but Python has not been around very long and there is no assurance that it will be in the future.

If you run these programs through a translator, the original structure will be unintelligible coming out the other end and the code will be unattractive.  That makes the translated code difficult to support, which nullifies the reason for doing the translation.

FORTRAN is compiled, BASIC can be compiled, Python generates byte code which runs in an interpreter.  "Python is an interpreted object-oriented programming language with many adherents on the Net."  Both FORTRAN and BASIC win over Python on size, speed and efficiency.
Avatar of Hugh David

ASKER

Unfortunately FORTRAN IV is very different from current versions of FORTRAN.
QuickBASIC was supported by Microsoft, up to windows XP. It requires DOS, which is not available on later versions of windows A games oriented simulator (DOSBox)  works ,more or less with QuickBasic, but lacks file handling facilities and fails with 64 bit versions of Windows..
Although FOPRTRAN and BASIC may win over Python, it is not much use if neither can actually be run on contemporary systems.
Is there a contemporary non-object oriented language that anyone can recommend?
PureBasic Windows

PureBasic is an "high level" programming language based on established BASIC rules. It is similar to any other BASIC compiler you may have used, whether for the Amiga, PC, MacOS X or Linux. Learning PureBasic is very easy! PureBasic has been created for the beginner and expert alike. Compilation time is really fast. This software has been developed for the Windows operating system. We have put a lot of effort into its realization to produce a fast, reliable and system friendly language.
I am trying PureBASIC - having some difficulties But should solve the quickbasic problem.
however I still have 26 Programs 50 subrtines and about 230K lines of FORTRAN IV to convert
Any Suggestions?
Intel Fortran
The Intel® Fortran Compiler builds high-performance applications by generating optimized code for Intel® Xeon® Scalable processors and Intel® Core™ processors. Its features allow you to:
  • Boost Single Instruction Multiple Data (SIMD) vectorization and threading capabilities (including for Intel® Advanced Vector Extensions 512 instructions) using the latest OpenMP* parallel programming model
  • Take advantage of more cores and increased vector register width available in Intel® Xeon® processors
  • Comply with open standards such as Fortran and OpenMP
  • Work with a familiar set of tools on your preferred platform: Windows*, Linux*, or macOS*
This looks promising - I will follow it up.
thank you for your assistance.
Honestly if you are going to Migrate to modern language....it would seem to make sense to build out use cases from the old code and then do a rewrite.   Design principles in this languages have changed and even if you get the code converted...is it going to be code you can truly stand by.

I think the extra work on a rewrite pays off in the future.
I fear you are right. I'll probably have to give up.
FORTRAN is available in GCC (the GNU Compiler Collection) albeit F77 but F4 code should compile.
If you install Cygwin you will have access to all of GCC
Thank you - again this may solve my FORTRAN problem. I will follow it up .
Translators do exist:
https://dl.acm.org/citation.cfm?id=130979   (Fortan IV -> QuickBasic)

Fable a Fortan to C++ converter... written in Python it doesn't mention Fortran IV specifically so YMMV. (Not sure how Fortran IV specific your code is).
http://cci.lbl.gov/fable/
At least the converter can be adjusted...

f2c: open source project:
http://www.netlib.org/f2c


Commercial Tool: for2c:
http://www.mpsinc.com/For2c.html

Also some claims to have a Fortra 2 Python converter...
https://objexx.com/Fortran_to_Python.html

Now i have my doubts..., Fortran IV esp. uses GOTO statements.  Python is one of those langages which completely lack any method of using a Goto....
So this might give some interesting results. (I guess Fortran 77 would be the starting point for this).
Depending on how clean the FTN IV code really is.
Thank you NOCI   .   I will look into some of these convertors.
however . on reflection, I think I will have to revise the human-computer interface of these fortran programs in any case.
Most of the calculation modules should be relatively easy to convert. (I am afraid much of this is spaghetti code - mea culpa.)
As for the quickBasic, I am trying to get PUREBASIC to work - I think it should do the trick.
I may combine the useful bits of the old FORTRAN Package with the revised PUREBASIC to simplify the whole package.
ASKER CERTIFIED SOLUTION
Avatar of noci
noci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial