# Python for Fortran programmers

**URL:** <https://rubytalk.org/t/python-for-fortran-programmers/25286>\
**Category:** ruby-talk\
**Created:** [28 February 2006 12:08 UTC](https://rubytalk.org/t/python-for-fortran-programmers/25286 "2006-02-28T12:08:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claird1](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Claird1](https://rubytalk.org/u/Claird1)\
**Post date:** [28 February 2006 12:08 UTC](https://rubytalk.org/t/python-for-fortran-programmers/25286/1 "2006-02-28T12:08:35Z")

</div>

In article \<y7QIf.39$9r.6@mencken.net.nih.gov\>,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.

> Ruby should be a better fit for the typical Fortran programmer. I am  
> surprised Ruby is not more the standard scripting language for  
> scientists. At least some people who know both say that Ruby is better  
> even though Python is (at least for now) more popular.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.  
Please help me understand what you're writing here. I \*think\*  
you're saying that Ruby is easier for Fortraneers to learn at  
the syntactic level than Python. I can well imagine that.

There's a distinct meaning of "better fit", though, that I want  
to highlight. I propose that Python has established its "fitness"  
through the record of successful projects implemented as  
Python-Fortran \*collaborations\*. There are several aspects to  
these realizations of partnerships between a couple of different  
languages:  
A. It might well be that two languages need a little  
&nbsp;&nbsp;&nbsp;&nbsp;distance between themselves syntactically to  
&nbsp;&nbsp;&nbsp;&nbsp;"marry" well; if they're too similar at this level,  
&nbsp;&nbsp;&nbsp;&nbsp;there's no gain to a division of labor between  
&nbsp;&nbsp;&nbsp;&nbsp;them.  
B. Python has a strong tradition of "playing nicely"  
&nbsp;&nbsp;&nbsp;&nbsp;with outside resources. It was one of Python's  
&nbsp;&nbsp;&nbsp;&nbsp;prominent initial goals, back at its invention in  
&nbsp;&nbsp;&nbsp;&nbsp;the late '80s. Ruby also aims to do better at  
&nbsp;&nbsp;&nbsp;&nbsp;this than, for example, Perl, but, as near as I  
&nbsp;&nbsp;&nbsp;&nbsp;can tell, the Ruby community has never emphasized  
&nbsp;&nbsp;&nbsp;&nbsp;cooperation with other languages as much as have  
&nbsp;&nbsp;&nbsp;&nbsp;Pythonistas.  
C. At a technical level, I believe it remains easier  
&nbsp;&nbsp;&nbsp;&nbsp;to bind Python and Fortran than to do so with Ruby  
&nbsp;&nbsp;&nbsp;&nbsp;and Fortran.

My conclusion: there are valid reasons, beyond "popularity", to  
fit Python and Fortran together.

> **···**
>
> Joe Krahn \<krahn@niehs.nih.gov\> wrote:

---

<div class="post-metadata">

**Author:** ![Ptkwt](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Ptkwt](https://rubytalk.org/u/Ptkwt)\
**Post date:** [1 March 2006 01:59 UTC](https://rubytalk.org/t/python-for-fortran-programmers/25286/2 "2006-03-01T01:59:05Z")

</div>

> In article \<y7QIf.39$9r.6@mencken.net.nih.gov\>,  
> &nbsp;&nbsp;&nbsp;&nbsp;.  
> &nbsp;&nbsp;&nbsp;&nbsp;.  
> &nbsp;&nbsp;&nbsp;&nbsp;.
> 
> > Ruby should be a better fit for the typical Fortran programmer. I am  
> > surprised Ruby is not more the standard scripting language for  
> > scientists. At least some people who know both say that Ruby is better  
> > even though Python is (at least for now) more popular.
> 
> &nbsp;&nbsp;&nbsp;&nbsp;.  
> &nbsp;&nbsp;&nbsp;&nbsp;.  
> &nbsp;&nbsp;&nbsp;&nbsp;.  
> Please help me understand what you're writing here. I \*think\*  
> you're saying that Ruby is easier for Fortraneers to learn at  
> the syntactic level than Python. I can well imagine that.
> 
> There's a distinct meaning of "better fit", though, that I want  
> to highlight. I propose that Python has established its "fitness"  
> through the record of successful projects implemented as  
> Python-Fortran \*collaborations\*.

This is because Python was there earlier.

> There are several aspects to  
> these realizations of partnerships between a couple of different  
> languages:  
> A. It might well be that two languages need a little  
> &nbsp;&nbsp;&nbsp;distance between themselves syntactically to  
> &nbsp;&nbsp;&nbsp;"marry" well; if they're too similar at this level,  
> &nbsp;&nbsp;&nbsp;there's no gain to a division of labor between  
> &nbsp;&nbsp;&nbsp;them.

Maybe so, but I don't see how Ruby is anymore Fortran-like than Python 😉

> B. Python has a strong tradition of "playing nicely"  
> &nbsp;&nbsp;&nbsp;with outside resources. It was one of Python's  
> &nbsp;&nbsp;&nbsp;prominent initial goals, back at its invention in  
> &nbsp;&nbsp;&nbsp;the late '80s. Ruby also aims to do better at  
> &nbsp;&nbsp;&nbsp;this than, for example, Perl, but, as near as I  
> &nbsp;&nbsp;&nbsp;can tell, the Ruby community has never emphasized  
> &nbsp;&nbsp;&nbsp;cooperation with other languages as much as have  
> &nbsp;&nbsp;&nbsp;Pythonistas.  
> C. At a technical level, I believe it remains easier  
> &nbsp;&nbsp;&nbsp;to bind Python and Fortran than to do so with Ruby  
> &nbsp;&nbsp;&nbsp;and Fortran.

There are lots of tools like the dl library, Inline::C (Inline::Fortran  
coming?) available in Ruby as well. I forget the details, but didn't someone  
earlier in this thread successfully create a Ruby\<-\>Fortran bridge ?

Phil

> **···**
>
> In article \<b3qdd3-dfr.ln1@lairds.us\>, Cameron Laird \<claird@lairds.us\> wrote:
> 
> > Joe Krahn \<krahn@niehs.nih.gov\> wrote:
