Why not just use Python instead of Fortran? (2024)

People often wonder why someone would use Fortran over Python for scientific stuff.

Fortran is often considered inept by proponents of “newer” languages (which are often scripting languages) because it first appeared in 1957, and is considered old. They think life with Python is easier because of the myriad of libraries, I mean with NumPy and SciPy you can do lots of number-crunching. Sure that’s true, but not all that glitters is gold. First of all Fortran is fast, nearly as fast as C in some cases, and sometimes even faster (things where Fortran has syntactical features that increase efficiency, e.g. arrays). Python is just not fast, not in any realistic sense of the term.

Secondly, Fortran has a lot of number-crunching libraries, some of which may be old, but here’s the thing with Fortran, it is backwards compatible. So it’s often easy to get a library written in 1981 to work. Now some modern languages are open source, e.g. Julia, and while that seems nice, it makes it hard to maintain a sense of stability, and backwards compatibility goes out the window. It’s one of the main reasons I stopped using Julia★. Languages like Fortran (and C), are more stable because language changes are made sparingly (there is a reason standardization exists, and why it takes 3-5 years to make changes – stability is a good thing). So anyone that writes software in Fortran can have confidence in any Fortran libraries they are using and in the longevity of their own code. This helps protect against code rot where code becomes usable due to dependency failures, or even changes in the implementation of the language.

It’s also hard to really compare Python against Fortran for number crunching ability. Python is a scripting language (and there isn’t anything wrong with that), and in reality isn’t that powerful. In addition, you can create stand-alone programs in Fortran – not something that any scripting language can do well or at all. Ironically some of the libraries used by Python are just wrappers around existing libraries written in, you guessed it, Fortran. A good example is MINPACK, used for solving systems of non-linear equations – NumbaMinpack is a Python wrapper to the MINPACK library written in Fortran 77. OR the some portion of the code in a Python library is written in another language (I would imagine the things that would run sub-optimally in Python). Why not rewrite these libraries in Python? Perhaps they wouldn’t be as efficient, or perhaps it’s just software reuse at play. So sure, Python is okay for proof-of-concept work, but honestly scaling up to industrial use has to be done using an established language, be it C, C++ or Fortran. Also Fortran is easy to learn, which is certainly a feather in its cap.

If we look at the TIOBE Programming Community Index, yes Python is on top (14.82%), with C second (12.08%), and Fortran is at 16th position at 1.02%. However lots of people use Python for a lot of things, it is very popular. Would I write a large scale climate model in it? Ahhh… no. Note that MATLAB is at 14th position at 1.27%, and Julia at 28th position, at 0.58% (November 2023).

★ I really saw a lot of potential in Julia, but the changes killed it for me. I don’t want to write a library and then in 6 months rewrite the library because the language spec has changed. I can write a library in Fortran, and it won’t change.

Why not just use Python instead of Fortran? (2024)
Top Articles
4-7-8 Breathing Technique
RIFT System Requirements - Can I Run It? - PCGameBenchmark
Cash4Life Maryland Winning Numbers
Amtrust Bank Cd Rates
My Boyfriend Has No Money And I Pay For Everything
Miss Carramello
Aces Fmc Charting
Hallelu-JaH - Psalm 119 - inleiding
Facebook Marketplace Charlottesville
Shreveport Active 911
978-0137606801
Conan Exiles Thrall Master Build: Best Attributes, Armor, Skills, More
Walmart End Table Lamps
Chic Lash Boutique Highland Village
Craigslist Edmond Oklahoma
Wisconsin Women's Volleyball Team Leaked Pictures
Craigslist Panama City Fl
Overton Funeral Home Waterloo Iowa
Air Force Chief Results
Keck Healthstream
Site : Storagealamogordo.com Easy Call
Nurse Logic 2.0 Testing And Remediation Advanced Test
Babbychula
Baja Boats For Sale On Craigslist
Xfinity Outage Map Fredericksburg Va
Lost Pizza Nutrition
Valic Eremit
Aspenx2 Newburyport
Beaufort 72 Hour
Hwy 57 Nursery Michie Tn
Duke University Transcript Request
Sitting Human Silhouette Demonologist
Gas Prices In Henderson Kentucky
Montrose Colorado Sheriff's Department
Aveda Caramel Toner Formula
Busch Gardens Wait Times
Fototour verlassener Fliegerhorst Schönwald [Lost Place Brandenburg]
Fetus Munchers 1 & 2
More News, Rumors and Opinions Tuesday PM 7-9-2024 — Dinar Recaps
Skyward Marshfield
Obituaries in Hagerstown, MD | The Herald-Mail
Craigslist/Nashville
Ehc Workspace Login
War Room Pandemic Rumble
Conan Exiles Colored Crystal
Ups Customer Center Locations
Boyfriends Extra Chapter 6
Is Chanel West Coast Pregnant Due Date
Craigslist Charles Town West Virginia
Definition of WMT
Home | General Store and Gas Station | Cressman's General Store | California
Billings City Landfill Hours
Latest Posts
Article information

Author: Jeremiah Abshire

Last Updated:

Views: 5935

Rating: 4.3 / 5 (54 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Jeremiah Abshire

Birthday: 1993-09-14

Address: Apt. 425 92748 Jannie Centers, Port Nikitaville, VT 82110

Phone: +8096210939894

Job: Lead Healthcare Manager

Hobby: Watching movies, Watching movies, Knapping, LARPing, Coffee roasting, Lacemaking, Gaming

Introduction: My name is Jeremiah Abshire, I am a outstanding, kind, clever, hilarious, curious, hilarious, outstanding person who loves writing and wants to share my knowledge and understanding with you.