Marty's Software Dairy

Table of Contents

1 Software diary

These things don't fit in a ~/.diary file or calendar. It's a chronicle of my software progress. As part of my commonplace book project, I felt it proper to include a software diary.

This paper is online at http://mcgowans.org/pubs/marty3/commonplace/software/swdiary.html

Along the lines of my family diary, this is focused solely on my software exploits of the moment. For now, it's devoted largely to my shell functions, leading to updates for my book.

Notably, I'm collecting (harvesting, really) the better parts of the journey in a late section: 1.

1.1 Objectives

First some objectives:

  1. separating my personal and technical (principally shell function) notes. Or more appropriately giving the right public exposure, and how to do it
  2. the technical challenge for the public face - if not the private - is connecting disparate source streams, and linking them where appropriate. this will require standards for storage, placement on my server, on a public page, and the underlying tools to manage the task.
  3. journaling my daily progress – with two machines I'm working on, I'm both leaving a daily trail of functions I've written that day, and a version history of my function libraries What's needed are the words behind the action.
  4. since I've recently added org-mode it seems appropriate to bring it in to this process.
  5. a Big question as I work is the tug-of-war between Emacs on one hand and the shell command line on the other. Since the base-plate of my shell functions method is the command line, history and its editing, this should make Emacs less useful. I'm writing this (original source text) with Bill Joy's next editor: cat. But, I'll likely edit this with Emacs well before I'm finished.
  6. and the thing to capture is some sense of the flow of ideas as functions are born and join a library (or two), the libraries grow and divide, and subsequently mature into applications. the challenge here is both the building, distributing and learning how to manage the collection.

So, on to the current history.

1.2 lessons   markdown tiddlywiki

reading backwards thru the diary. what still works

1.3 awk brevity

is broken when the awk script is:

  • more than two blocks: a BEGIN, per-line, per-condition, … END
  • more than N lines, N is To Be Determined
  • a dedicated application, not sufficiently general, e.g. uses in one directory

1.4 emacs

replacing (o) a number of tools, adding (*) others.

  • OrgMode, (started on 4/4/15), which lead to replace.
    • MarkApp & Markdown, last gasp on (2/17/15)
    • Evernote – oops, I've found it useful on the iPad for note-taking
    • todo, my own version
    • include " , and it's back, see tangling.
    • tiddlywiki – sorry boys, more elsewhere
  • ispell
  • settled on GNU-emacs after struggles with ispell, since Aquamacs worked, except the point size control didn't seem wasn't so consistent as GNU. See 2/25/15

1.5 trace

1.6 backup

this one is Gold, I've restored the simple version where the backups are pushed down the ./.bak/.bak/ … directory path.

1.7 report_

these functions "regularize" the function interface, giving the shell programmer a means of asserting:

  • number of arguments
  • an argument is a function, or not
  • an argument is a file, directory, or not
  • an argument is executable, or stdin is on a pipe
  • and user-definable conditions,

for example, in the latter case, for my personal expense management, answer the question, is this argument an account or not. See (2/23/15)

1.8 a function template

using the report_ mechanisms, followed by a use(s) of the set -- idiom

1.9 fbdy

the F*unction *B*o*DY, distinguishing bash and ksh formats; more work is required here. (2/12/15)

1.10 an idea separate COMMANDs

where library functions are any used by other functions. A command function is only used from the command-line. The trace_call function tests the call-depth to see if the function is on the command line, among other attributes. (1/31/15)

1.11 app_fun

which feeds the next function. with a number of function arguments, produce a list, through recursive descent, of all called functions.

1.12 callgraph

motivated by OrgMode's tangle feature,

function callgraph_eg
{ 
    in=~/tmp/callgraph.in;
    out=~/tmp/callgraph.out;
    report_needcount 1 $# function ... && return 1; 
    foreach fun_call $* | tee $in | callgraph | (callgraph)
      egrep -v '(comment|trace_)' | tee $out;
    comment in: $in;
    comment out: $out
}
function my_callgraph
{ 
    file=~/tmp/callgraph.out;
    trace_call $file : $*;
    newest $file $* || { 
        for f in $*;
        do
            . $f;
        done;
        callgraph_eg $(functions $*)
    };
    ( orgheader;
    echo;
    fbdy my_callgraph callgraph_eg;
    cat $file ) > $1.org
}

the guts of the work are the callgraph command, a short python program to produce the OrgMode indented calling structure, which shows every called function, and each caller's tree the first time it appears in descent order.

1.13 a function index

this has not materialized along lines I envisaged (1/31/15), but I'm expecting OrgMode to supply the means as I learn more

1.14 fam_iam

This was called om_iam, which stood for I AM an Object Method, stiff in comparison to fam_iam for family.

2 The years

3 References

3.1 bitmeld – needs an updated reference

3.2 dropbox

3.3 git

3.4 SHELF

Author: Marty McGowan

Created: 2019-06-14 Fri 08:21

Validate