The Mknew Project SourceForge

The Mknew Project is an investigation of how to build simple Unix shell scripts to manage common development and administrative tasks. The emphasis is on using languages and tools that already exist and are in common use rather than inventing something new.

The project also focuses on exploring the functional programming nature of the bash shell.

The project developers are Martin J. McGowan, III, and William L. Anderson. They have been exploring how to use the full power of the Bourne, Korn, and now Bash, shells for more than two decades.

Mknew Programming Style

The Mknew project is an exploration of a functional, building-block approach to software tool development. And part of this exploration is the investigation of shell programming style principles and guidelines. One programming principle is to use, as often as is practicable, one-line functions that carry out specific tasks with a minimum of side effects. Writing simple and easy to read one-line functions is based on using three coding guidelines (N.B., these guidelines exploit specific capabilities of the bash shell and Unix-like operating systems.):
  1. Avoid shell variables; generate values inline and try functional composition first.
  2. Replace "if, then, else" with "&&" or "||" operators (thanks to John R. Levine for this insight).
  3. Avoid temp files where stdin, stdout, and stderr are still available.
A second programming style principle is to build scripts as a series of function calls that have a minimum of syntax. This is accomplished by using the bash function capability, and the "$(" ")"syntax to delay function execution, in mknew libraries. This allows building scripts that have a Lisp-like function syntax.

Capturing and factoring the syntax of procedure details into bash funtions permits shell scripts to be written as a series of function calls with minimal syntax.

A common syntactical pattern in mknew scripts is

verb	noun	noun	noun ...
or, somewhat more precisely,
function	argument1	argument2	...

Mknew Roadmap

The goal of mknew is to provide a way to specify make procedures of heterogeneous components in a bash script. These components can include

mknew supports the integration of software build procedures with other software development administration procedures, such as unit, integration, and systems testing; distribution; and installation. In addition to the mknew function library, these "make" procedures rely only on tools provided by the bash shell, and common Unix command line utilities.

The development plan for mknew is to first provide a simple example of shell-based software installation procedures.

The first useful result of the project is the mknew package. The mknew package delivers a library of bash functions, mklib and a shell procedure called mk. mk works by reading the library of functions and a simple, easy to read, shell file, called mkd that contains a series of function calls.

The first release of mknew will simply install its library mklib and scripts mk and mkd in a standard directory structure in the user's "$HOME" directory.

Subsequent releases of mknew will support specification of a software package in terms of its PRIMARY source and shared INPUT components (other packages or libraries), and the TOOLS and process elements required to produce the target OUTPUT elements. For example, a common makefile template, such as:

   target:  depends ...
            process depends ... > target
will be specified in the mkd shell as
   newest target depends ...  || process depends ... > target

Here newest is a shell function that returns FALSE if any element in the depends list is newer than the specified target.

The benefits of the mknew library include:

  1. readable build specifications (shell functions provide literate specification of elements; e.g., "cprogram", "shellfile", "manpage", ...);
  2. consistent build specifications and procedures for any language or environment;
  3. a build process that works on any platform that provides a bash (version 2.0 or newer) shell and common Unix command line tools.

Simply put, one mknew objective is to support standardization of build process specification across a variety of software development and deployment platforms using existing shell tools.

Mknew Releases

As mknew evolves, a number of releases will be supported. At this writing, the target is three, with these capabilities:
  1. The first releases -- minimum functionality; basically the libraries simply install themselves. They demonstrate a "make install" procedure.
  2. Early modifications -- when compared to the first release, they will show how to add functionality to existing mknew libraries.
  3. The proverbial latest and greatest.
These links will be active when the relevant available software is available for download.
$Id: MknewProject.html 91 2006-09-20 16:26:17Z $

The Mknew Project is hosted by SourceForge Logo