“What to demand from a Scientific Computing Language”
posted Wed 9 Sep 2009 by Michael Galloy under IDL, PythonPeter Norvig, Director of Research at Google, gave the keynote at SciPy 2009, “What to demand from a Scientific Computing Language—Even if you don’t care about computing or languages”, a conference about scientific programming in Python. His requirements were:
- Batteries included means the standard distribution of the language gives all the tools to do standard things. Here’s where IDL beats Python hands down because the standard distribution of Python is not geared to scientific analysis at all. There are 3rd party distributions such as Python(x,y) or the Enthought Toolkit, but these still need to make progress on ease of install, cross-platform availability, and matching all the functionality of IDL. Of course, Python comes with much greater non-scientific functionality and it is free (as in beer and as in speech).
- Expressions, not statements means the syntax of the language mimics the syntax of mathematics. The vectorized operations of IDL and NumPy in Python go along way here. The garbage collection in Python makes it a bit easier to create objects within expressions instead of creating a variable to contain them so that they can be freed later.
- Parallelize is the ability to use multiple cores. IDL actually uses multiple cores fairly well for many of its core operations, unlike Python.
- Documentation, examples, unit tests, tutorials, mentoring is a mixed bag for both Python and IDL. I think the API documentation for IDL is better than for Python’s scientific routines, but Python has a more active online community (even for just the scientific routines). There are many more resources for core Python.
Norvig worked at NASA Ames and brings his experience of the needs of scientific computing to the talk.
September 9th, 2009 at 3:34 pm
Despite working with IDL a lot, and using it to get a lot of things done. I would disagree with your take on #2. Syntactically, I would characterize IDL as painful to work with, whereas I would characterize Python as extremely pleasant.
There are just some sorts of mathematical statements that end up terribly klugy when writen using vectorized array operations, but which are beautiful when expressed using a little bit of lambda.
September 9th, 2009 at 3:54 pm
I would agree that Python’s syntax is much more pleasant in general than IDL’s. I think they are basically equivalent for basic mathematical expressions. Being able to say
2. * sin(3. * x)
even ifx
is an array is nice (in either IDL or NumPy). I was not talking about more complicated things where Python has great features to use.