GNU Astronomy Utilities


Next: , Previous: , Up: Developing   [Contents][Index]


11.2 Program design philosophy

The core processing functions of each program (and all libraries) are written mostly with the basic ISO C90 standard. We do make lots of use of the GNU additions to the C language in the GNU C library, but these additional functions are mainly used in the user interface functions (reading your inputs and preparing them prior to or after the analysis). The actual algorithms, which most scientists would be more interested in, are much more closer to ISO C90. For this reason, program source files that deal with user interface issues and those doing the actual processing are clearly separated, see Program source. If anything particular to the GNU C library is used in the processing functions, it is explained in the comments in between the code.

Similar to GNU Coreutils, all the Gnuastro programs provide very low level operations. This enables you to use shell scripting languages (for example GNU Bash) to operate on a large number of files or do very complex things through the creative combinations of these tools that the authors had never dreamed of. We have put a few simple examples in Tutorials.

For example all the analysis output can be saved as ASCII tables which can be fed into your favorite plotting program to inspect visually. Python’s Matplotlib is very useful for fast plotting of the tables to immediately check your results. If you want to include the plots in a document, you can use the PGFplots package within LaTeX, no attempt is made to include such operations in Gnuastro. In short, Bash can act as a glue to connect the inputs and outputs of all these various Gnuastro programs (and other programs) in any fashion you please. Of course, Gnuastro’s programs are just front-ends to the main workhorse (Gnuastro library), allowing a user to create their own programs (for example with BuildProgram). So once the functions within programs become mature enough, they will be moved within the libraries for more general applications.

The advantage of this architecture is that the programs become small and transparent: the starting and finishing point of every program is clearly demarcated. For nearly all operations on a modern computer, the read/write speed is very insignificant compared to the actual processing a program does. Therefore the complexity which arises from sharing memory in a large application is simply not worth the speed gain. Gnuastro’s design is heavily influenced from Eric Raymond’s “The Art of Unix Programming”149 which beautifully describes the design philosophy and practice which lead to the success of Unix-based operating systems150.


Footnotes

(149)

Eric S. Raymond, 2004, The Art of Unix Programming, Addison-Wesley Professional Computing Series.

(150)

KISS principle: Keep It Simple, Stupid!


Next: , Previous: , Up: Developing   [Contents][Index]