Pages

Wednesday, October 27, 2010

Computer Language Fragmentation in Physics Knows No End.

As a graduate student I have written papers where, in order to collaborate, I had to write code in: C, C++, FORTRAN (77 and 90), IDL, Jython, Matlab, Python and have just been told for my next project I need to modify hundreds of lines of Perl scripts.  Furthermore, UCI did their numerical methods course in Java as they thought that was a good intermediate language. (And I have had to design web pages in html if that in any way counts.)

So, just to get real world physics done this non-CS guy has had to master ~8-10 languages enough to get papers out the door with different collaborators.  Does the computer language fragmentation in physics know no end?  Fortunately, once you have learned 2-3 languages the rest are pretty much straight forward provided you have good documentation.

You all know I love Python.  If people could just write everything in Python except the speed critical parts I would be happy. (And if you must use FORTRAN do not use 77!!!)

Sorry this is not the most profound post but I just needed to vent.

17 comments:

  1. Tower of Babel, young man!

    You left out Excel Macros and VBE!

    ReplyDelete
  2. The right tool for the right job.

    ReplyDelete
  3. One of the blessings/curses of astrophysics is that pretty much everyone uses IDL for data analysis, which means that one doesn't have to learn half a dozen languages but one does have to use an inferior piece of software to something like Matlab/python.

    ReplyDelete
  4. I remember having a conversation with a med-school student about how hard his courses were, and then he asked about my classes... At the time I was in a class where the professor was requiring us to use IDL (IDL and only IDL, we were NOT to use Matlab. She told us "You have to learn IDL because you will be using for research in the future, so you might as well learn it now." I haven't used IDL since that class and I honestly don't think I will ever use it again.). So I had to spend 2 quick weeks learning IDL so I could do my homework. So I mentioned to the med-school student that in my classes I had 2 weeks to learn a whole new language, and that all of my assignments were to be done in the new language. The med student about fainted when I said that, and then muttered something about how he was grateful that he never had to take physics again. He never complained to me again about how hard his classes were.

    ReplyDelete
  5. From what I know about you there is a blog which could be interesting : this is the "Bethel Philosophy Blog" .

    ReplyDelete
  6. Wow, I'm in the dark on this one. What the heck is IDL? The only IDL I'm familiar with is "Interface Description Language" which is a mechanism for using CORBA in distributed systems (we used this at LLNL).

    ReplyDelete
  7. IDL is *so* bad. Think about it Nick or anyone else who uses it: It is proprietary, expensive and theoretically designed for scientists and engineers and yet it doesn't have functionality to *add a legend to a plot* if it wasn't for astronomers writing some 3rd party routine.

    Or lets say you want to your curve to be red, in matlab or python this is just:

    plot(x,y,'r-')

    But in IDL, you have to add extra lines telling IDL you want your printing device to allow for color, then another line to load some obscure color-table which is some number you have to memorize, then to plot the color you have to memorize essentially the RGB value for your color since it doesn't understand things like "color = 'red'", and after ~8=10 lines of code you *might* actually get a simple plot with a red curve.

    And it's not just plotting, those are just things I think everyone can relate to. I could go on, and on and on... Like with everything else Astronomers are forced to used like IRAF which is both impossible to install or use unless you are a zen master, ...

    IDL is basically the assembly language of "simple" dynamical languages that is propriety, expensive and would be unusable if it weren't for astronomers writing wrapper libraries around the obscure assembly-language type garbage you have to deal with.

    ReplyDelete
  8. Like I already said, the only people who still use IDL are the people who use it because they think that everybody else is using it, so they have to use it. Here at UNC we did not even have a site license for IDL until a new professor showed up and was "shocked" that the astronomers here were not using IDL. She then purchased site licenses for our department and insists that everyone (astronomers) should use it ("Hey we are paying for it so you might as well use it, because everyone else is using it."). So now the only reason people use IDL here is not because they like it or want to, but because they feel obligated because "everyone else is using it" (by the way, this is the same professor that made me do my homework in IDL, "because you will have to use it in the future").

    Oh and compiling IDL is about the worst thing in the world. There are simple things that compilers started doing years ago like checking for bad syntax (i.e. you forgot to close a comment/parentheses). IDL doesn't do that, it just runs the compiler, you run the program and it will either crash or just run forever. Basically EVERY SINGLE bad quality that you could possibly have in a language is found in IDL. Some day IDL will be replaced by Matlab among astronomers, but it will take many years, and will die a very slow painful and excruciating death with many casualties along the way.

    ReplyDelete
  9. I agree with everything you've said about IDL - it's slow, clunky, hard to use, and expensive - and with the idea that people only use it because that's what people have used in the past. It's even worse for us because the guy that wrote IDL did so while working for my adviser in the mid 70's. The only reason I use it is because all of our analysis code is written in IDL and to re-write all of it would require several person-years worth of effort, therefore we all keep using it.

    ReplyDelete
  10. One more note on IDL - Joe's point on plotting is really a great metaphor for the language as a whole. Everything has to be done via the command-line so if you want to add a legend to a plot you can do so, however let's say you want to change the font size or location of your legend. That's going to require you re-running the dozen or so lines of code you've already run, tweaking the value of some arcane parameter until you get it right. And heaven help you if you actually want to save one of your plots as an image file - that requires another half dozen lines of code.

    ReplyDelete
  11. AAAAAAAHHHHHHHHHH!!!!!!!!!!!! NICK YOU MENTIONED THE ABSOLUTE WORST PART OF IDL! saving image files....

    Just thinking about that makes me so depressed... I may not recover for weeks... must eat chocolate...

    ReplyDelete
  12. P.-S. 2 : There is something about Stephen Hawking and God somewhere on this blog.

    ReplyDelete
  13. On the contrary. This is an extremely profound post. It's an implicit statment about the computational nature of reality and the fundamental nature of computational theory.

    ReplyDelete
  14. I'm glad I missed this post until today -- I might have used words I shouldn't when describing my hatred for IDL. I can't wait to graduate and have like a month of time between then and starting a post-doc. I'll be translating everything out of IDL into a real language (C++ in my case, or maybe python if I get around to learning it).

    I found it very frustrating coming from BYU where everything was matlab or maple, and then no astronomer in our department uses either. Let's all agree on three things in astronomy:

    1. IDL is of the devil
    2. FORTRAN was great in its day, but STOP using it already people. Don't try to cross compile C and F77 codes. I'd rather re-write the whole Fortran part into assembly code than deal with the headaches.
    3. IRAF is IDL's secret spawn with Hecate.

    ReplyDelete

To add a link to text:
<a href="URL">Text</a>