Technology Choices: Python

This is the first in a short series of posts about which other technologies will sit underneath Ancho.

Ancho will be implemented in Python.  I'll admit that I did not look at a lot of alternatives for a core programming language to use in Ancho.  Python is my go-to language for most coding tasks.  Still, for anyone who's not familiar with Python, I'm going to go over all the reasons that I think Python is a good fit here.

Language Type

As you may recall from my earlier post There Are Always Possibilities, I believe that Monte Carlo systems' requirement for users to learn a domain-specific programming language is one of the reasons that these methods aren't in more widespread use.  If someone knows programming at all, they are much more likely to know a general-purpose programming language like Python than a math-specific one such as R or MATLAB.

Python is also a "high-level language," which basically means that it hides a lot of details of how computer hardware works.  You generally don't need to think about memory management, pointers and a lot of the other junk that people do need to think about when programming in a language like C.

Some people think of Python as a scripting language since it is often used for this purpose, but it's quite commonly used for larger projects at organizations such as NASA, Google, Yahoo and Industrial Light & Magic.  They run large portions of their operations on programs written in Python.

Availability & Ease of Use

Python is open source, free to download and use, and is available on virtually any platform anyone is likely to use.  Windows, Mac OS X, various flavors of Linux and UN*X, IBM mainframe operating systems, Nintendo DSes -- you name it, Python runs on it.  I have a version of Python running on my iPhone.

Python's design philosophy discourages cleverness and "magic" that is often encouraged in other languages like Perl.  Instead, it encourages obviousness and readability.  One of the early Python design documents said "there should be one -- preferably only one -- obvious way to do it."

A variety of free tutorials are available online: Learn Python, Dive into Python, How to Think Like a Computer Scientist (Python Version).  There are also good printed tutorials such as various O'Reilly books.  The key will be to find one that starts out assuming the level of knowledge of programming languages that you currently possess.  Learning a new language, once you already know how to program, is a different prospect than learning to program in the first place.

Supporting Libraries

Python has a large standard library, and a very large optional package index.  It is normally easy to install extra packages that you need with a single command, like:

pip install numpy

It is Python's extra packages that separate it from the pack of other high-level, relatively-widely-used languages for Ancho's purposes.  NumPy and SciPy are numeric and scientific computing libraries for Python.  They are very fast and are used by serious people.  They are constantly being improved.  And they are free.  These libraries are what will make it possible to write Ancho without knowing much more about mathematics and statistics than I currently do.