Why I hate IDL

Stuart Mumford

The University of Sheffield

Disclaimer 1: IDL Can Be Useful

Legacy code, years of experience, other people in your group using it etc.

Disclaimer 2: I am a Solar Physicist

This talk is primarily from my experience in Solar Physics, YMMV.

What is IDL?

IDL is the Interactive Data Language.

  • First released in 1977
  • Vector Orientated Language
  • Designed to be good at array manipulation
  • Dynamically typed

Reason 0:

IDL is a Terrible Programming Language

I mean:


IDL> arr = [1, 2, 3, 4]
IDL> arr(2)
       3
IDL> arr[2]
       3

IDL> systime(1)
       1450114318.8865399
IDL> dingbat(1)
% Variable is undefined: DINGBAT.
% Execution halted at: $MAIN$

There is More


IDL> 30000 + 30000
   -5536

IDL> i = 1000
IDL> help, i
I               INT       =     1000
IDL> i = 40000
IDL> help, i
I               LONG      =        40000

Save the best for last:


IDL> if 0 then print, "True" else print, "False"
False
IDL> if 1 then print, "True" else print, "False"
True

IDL> if 2 then print, "True" else print, "False"
False
IDL> if 3 then print, "True" else print, "False"
True

Gratefully borrowed from PHP Manual Masterpeices - http://tinyurl.com/idlsucks

The Real Reason

SolarSoft - The Legacy IDL Code Base

Some Statistics

  • 16 GB
  • 4,543 Directories
  • 138,192 Files
  • 24,383 IDL .pro files containing 3,982,599 lines.
  • 133 C (.c) files containing 119,976 lines.
  • 5,473,955 Million LOC
  • Linux kernel 2.6.0 (Dec 2003) - 5,929,913 lines of code

Files by Extension

  1. 'genx': 30525
  2. '.pro': 24383
  3. '.dat': 19437
  4. '.fts': 11657
  5. '.log': 10885
  6. '.sav': 6579

Facts about SSW

  • Distributed via Perl download (FTP) scripts or rsync.
  • 'gen' tree is managed by people at GSFC.
  • Other trees are managed by other groups, with varying quality control.
  • 'SolarSoft' came into existence around the launch of the SOHO satellite (20 years ago).

The Future is Bright

SunPy

  • Python
  • https://github.com/sunpy
  • 847 tests, with CI.
  • Thriving community.
  • Collaboration with Astropy.
  • Lots of functionality.

Welcome to the Future