The primary implementation language of Sage is Python (see [Py]),
though code that must be fast is implemented in a compiled language.
Python has several advantages:
- Object saving is well-supported in Python. There is
extensive support in Python for saving (nearly) arbitrary
objects to disk files or a database.
- Excellent support for documentation of functions and
packages in the source code, including automatic extraction of
documentation and automatic testing of all examples. The examples
are automatically tested regularly and guaranteed to work as
indicated.
- Memory management: Python now has a well thought out and robust
memory manager and garbage collector that correctly deals with
circular references, and allows for local variables in files.
- Python has many packages available now that might be of
great interest to users of Sage: numerical analysis and linear
algebra, 2D and 3D visualization, networking (for distributed
computations and servers, e.g., via twisted), database support, etc.
- Portability: Python is easy
to compile from source on most platforms in minutes.
- Exception handling: Python has a sophisticated and well
thought out system of exception handling, whereby programs
gracefully recover even if errors occur in code they call.
- Debugger: Python includes a debugger, so when code fails
for some reason, the user can access an extensive stack
trace, inspect the state of all relevant variables, and move
up and down the stack.
- Profiler: There is a Python profiler, which runs code
and creates a report detailing how many times and for how long each
function was called.
- A Language: Instead of writing a new language for
mathematics as was done for Magma, Maple, Mathematica, Matlab,
GP/PARI, GAP, Macaulay 2, Simath, etc., we use the Python language,
which is a popular computer language that is
being actively developed and optimized by hundreds of skilled
software engineers. Python is a major open-source success story
with a mature development process (see [PyDev]).
See About this document... for information on suggesting changes.