Text Based Installer Project » Text Installer Programming Language
en

Text Installer Programming Language

Python vs. C for the Text Installer 

Definitions

Note that there are differences between curses, nCurses, and the curses Python module:
- curses and libcurses: An old C library that simplifies interacting with the terminal.
- nCurses and libncurses: A newer, updated version of libcurses. Delivers the same functionality as curses. Has fewer bugs and some additional features over curses.
- curses (Python) module: A Python module providing the functionality delivered by curses/ncurses. This module can theoretically link against libcurses or libncurses.

Reasons to use Python:

  • Code is more readable
  • Code is quicker to write
  • The curses/nCurses code is nearly identical between C and Python. There is little to gain in that area. 
  • Other areas, such as input validation, should be much easier in Python.
  • Code is more maintainable
  • Significantly better error handling
  • No memory management
  • Easier to debug

Reasons to use C:

  • No need to recompile Python. Python 2.4 delivers a curses module which is partially broken - certain functions related to color and clean-up in particular do not work as specified, and there may be other broken functionality. The Python curses module is also linked against the outdated libcurses. The easiest method for fixing this involves re-compiling and linking against libncurses.
  • Able to more directly use CSM prototype and GUI install as a REFERENCE (as they are written in C)
  • Significantly more sample code for using thumb_downcurses in C
  • No need to create and maintain bridges. Using Python would require a bridge between Text Installer code and libtd. 

TBD:
 How do we get SUNWPython packages linked against libncurses?

  • Python 2.4 or Python 2.6?

RECOMMENDATION: Use Python, but only if linked with libncurses rather than libcurses and appropriate support exists for the curses Python module

Tags:
Created by admin on 2009/10/26 12:12
Last modified by admin on 2009/10/26 12:12

Collectives

Project caiman Pages


XWiki Enterprise 2.7.1.34853 - Documentation