Wednesday, September 17, 2014

Towards Reviving the Garnet Source Tree

I've begun developing a fork of Garnet Lisp. Corresponding with the fork, I've also begun developing a few items of documentation, within a journal for the corresponding Genizee Project.

Focusing on the Garnet Lisp fork, this morning I've endeavored to make a git rebase of the garnetlisp branch, such that that branch would be denoted as it  having a head revision proceeding somehow from the last revision of the cvsgarnetlisp branch of the fork. This seems to have resulted in a substantial number of merge conflicts within the local source tree -- a few hundred such conflicts, in fact, which I must now manually merge, to continue with this development task. Towards that effect, I'd begun by using SourceGear DiffMerge as the Git merge tool. For the most part, I've simply been using DiffMerge to set the "local" copy, in the conflict, as it being the preferred copy, in the marge -- though having to do so, manually. Courtesy of an article by Nick Quaranto at git ready, I've been able to determine that it will be possible to automate this process, namely using the shell command "git checkout --ours".

On a related note, the the "git status --shortcommand can be used within a conflicting merge -- as in the following example --  to display which files are in conflict, after a number of manual merge resolutions, in the merge:

gimbal@granite:garnet$ git status --short | grep '^AA'
AA src/contrib/plotxy.lisp
AA src/contrib/pmop-class-browser.lisp
AA src/contrib/ritter-labeled-box.lisp
AA src/debug/debug-compiler.lisp
AA src/debug/debug-fns.lisp
AA src/debug/debug-loader.lisp
AA src/debug/inspector.lisp
AA src/demos/demo-angle.lisp
AA src/demos/demo-animator.lisp
AA src/demos/demo-arith.lisp
AA src/demos/demo-clock.lisp
AA src/demos/demo-editor.lisp
AA src/demos/demo-gesture.lisp
AA src/demos/demo-graph.lisp
AA src/demos/demo-pixmap.lisp
AA src/demos/demo-schema-browser.lisp
AA src/demos/demo-scrollbar.lisp
AA src/demos/demo-truck.lisp
AA src/demos/demo-unistrokes.lisp
AA src/demos/demo-virtual-agg.lisp
AA src/demos/demo-xasperate.lisp
AA src/demos/demos-compiler.lisp
AA src/demos/demos-controller.lisp
AA src/demos/demos-loader.lisp
AA src/demos/garnet-calculator.lisp
AA src/demos/garnetdraw.lisp
AA src/demos/tour.lisp
AA src/gadgets/GAD-scroll-parts.lisp
AA src/gadgets/arrow-line-loader.lisp
AA src/gadgets/browser-gadget-loader.lisp
AA src/gadgets/error-gadget-loader.lisp
AA src/gadgets/gadgets-compiler.lisp
AA src/gadgets/gadgets-loader.lisp
AA src/gadgets/gauge-loader.lisp
AA src/gadgets/gauge.lisp
AA src/gadgets/graphics-loader.lisp
AA src/gadgets/h-scroll-bar.lisp
AA src/gadgets/h-scroll-loader.lisp
AA src/gadgets/h-slider-loader.lisp
AA src/gadgets/h-slider.lisp
AA src/gadgets/labeled-box-loader.lisp
AA src/gadgets/menu-loader.lisp
AA src/gadgets/menubar-loader.lisp
AA src/gadgets/motif-check-buttons-loader.lisp
AA src/gadgets/motif-error-gadget-loader.lisp
AA src/gadgets/motif-gauge-loader.lisp
AA src/gadgets/motif-gauge.lisp
AA src/gadgets/motif-h-scroll-bar.lisp
AA src/gadgets/motif-h-scroll-loader.lisp
AA src/gadgets/motif-menu-loader.lisp
AA src/gadgets/motif-menu.lisp
AA src/gadgets/motif-menubar-loader.lisp
AA src/gadgets/motif-option-button-loader.lisp
AA src/gadgets/motif-parts.lisp
AA src/gadgets/motif-prop-sheet-win-loader.lisp
AA src/gadgets/motif-radio-buttons-loader.lisp
AA src/gadgets/motif-scrolling-labeled-box.lisp
AA src/gadgets/motif-scrolling-menu-loader.lisp
AA src/gadgets/motif-scrolling-window-loader.lisp
AA src/gadgets/motif-scrolling-window.lisp
AA src/gadgets/motif-slider-loader.lisp
AA src/gadgets/motif-text-buttons-loader.lisp
AA src/gadgets/motif-trill-device-loader.lisp
AA src/gadgets/motif-trill-device.lisp
AA src/gadgets/motif-v-scroll-bar.lisp
AA src/gadgets/motif-v-scroll-loader.lisp
AA src/gadgets/mouseline-loader.lisp
AA src/gadgets/multi-selection-loader.lisp
AA src/gadgets/multifont-gadget-loader.lisp
AA src/gadgets/option-button-loader.lisp
AA src/gadgets/polyline-creator-loader.lisp
AA src/gadgets/popup-menu-button-loader.lisp
AA src/gadgets/popup-menu-button.lisp
AA src/gadgets/prop-sheet-loader.lisp
AA src/gadgets/prop-sheet-win-loader.lisp
AA src/gadgets/prop-value-gadgets.lisp
AA src/gadgets/prop-value-loader.lisp
AA src/gadgets/radio-buttons-loader.lisp
AA src/gadgets/radio-buttons.lisp
AA src/gadgets/save-load-functions.lisp
AA src/gadgets/scrolling-menu-loader.lisp
AA src/gadgets/scrolling-string-loader.lisp
AA src/gadgets/scrolling-unlabeled-box.lisp
AA src/gadgets/scrolling-window-loader.lisp
AA src/gadgets/scrolling-window.lisp
AA src/gadgets/standard-edit-loader.lisp
AA src/gadgets/text-buttons-loader.lisp
AA src/gadgets/trill-device-loader.lisp
AA src/gadgets/v-scroll-bar.lisp
AA src/gadgets/v-scroll-loader.lisp
AA src/gadgets/v-slider-loader.lisp
AA src/gadgets/v-slider.lisp
AA src/gadgets/x-buttons-loader.lisp
AA src/gem/define-methods.lisp
AA src/gem/gem-compiler.lisp
AA src/gem/gem-loader.lisp
AA src/gem/gem.lisp
AA src/gesture/agate.lisp
AA src/gesture/gesture-compiler.lisp
AA src/gesture/gesture-loader.lisp
AA src/gesture/gestureinter.lisp
AA src/gesture/train.lisp
AA src/gilt/filter-functions-loader.lisp
AA src/gilt/gilt-compiler.lisp
AA src/gilt/gilt-functions-loader.lisp
AA src/gilt/gilt-gadget-utils.lisp
AA src/gilt/gilt-gadgets.lisp
AA src/gilt/gilt-loader.lisp
AA src/gilt/gilt.lisp
AA src/gilt/motif-gilt-gadgets.lisp
AA src/gilt/path-functions-loader.lisp
AA src/inter/accelerators.lisp
AA src/inter/angleinter.lisp
AA src/inter/animation-process.lisp
AA src/inter/animatorinter.lisp
AA src/inter/buttoninter.lisp
AA src/inter/define-mouse-keys.lisp
AA src/inter/find-key-symbols.lisp
AA src/inter/focus-multifont-textinter.lisp
AA src/inter/garnet-keytrans.lisp
AA src/inter/i-windows.lisp
AA src/inter/inter-compiler.lisp
AA src/inter/inter-loader.lisp
AA src/inter/interactors.lisp
AA src/inter/lispkeyhandling.lisp
AA src/inter/menuinter.lisp
AA src/inter/movegrowinter.lisp
AA src/inter/multifont-textinter.lisp
AA src/inter/selection-interactor.lisp
AA src/inter/x-define-keys.lisp
AA src/inter/x-inter.lisp
AA src/kr/constraints.lisp
AA src/kr/kr-compiler.lisp
AA src/kr/kr-doc.lisp
AA src/kr/kr-loader.lisp
AA src/kr/kr-macros.lisp
AA src/kr/kr.lisp
AA src/lapidary/constraint-gadget-compiler.lisp
AA src/lapidary/constraint-gadget-loader.lisp
AA src/lapidary/custom.lisp
AA src/lapidary/dialog-parts2.lisp
AA src/lapidary/lap-draw.lisp
AA src/lapidary/lapidary-compiler.lisp
AA src/lapidary/lapidary-loader.lisp
AA src/lapidary/move-grow-box.lisp
AA src/lapidary/new-editor.lisp
AA src/lapidary/query.lisp
AA src/lapidary/save-restore.lisp
AA src/opal/basics.lisp
AA src/opal/clean-up.lisp
AA src/opal/create-instances.lisp
AA src/opal/create-instances2.lisp
AA src/opal/defs.lisp
AA src/opal/fast-redraw.lisp
AA src/opal/halftones.lisp
AA src/opal/macros.lisp
AA src/opal/multifont-loader.lisp
AA src/opal/multifont.lisp
AA src/opal/new-defs.lisp
AA src/opal/objects.lisp
AA src/opal/opal-compiler.lisp
AA src/opal/opal-loader.lisp
AA src/opal/open-and-close.lisp
AA src/opal/pixmaps.lisp
AA src/opal/process.lisp
AA src/opal/roundtangles.lisp
AA src/opal/text-fonts.lisp
AA src/opal/text.lisp
AA src/opal/types.lisp
AA src/opal/update-basics.lisp
AA src/opal/update-constants.lisp
AA src/opal/update-window.lisp
AA src/opal/update.lisp
AA src/opal/utils.lisp
AA src/opal/windows.lisp
AA src/protected-eval/error.lisp
AA src/protected-eval/garnet-errors.lisp
AA src/protected-eval/prompter.lisp
AA src/protected-eval/protected-eval-compiler.lisp
AA src/protected-eval/protected-eval-loader.lisp
AA src/protected-eval/protected-eval.lisp
AA src/protected-eval/protected-process.lisp
AA src/ps/ps-compiler.lisp
AA src/ps/ps-loader.lisp
AA src/utils/general.lisp
AA src/utils/mouse-keys.lisp
AA src/utils/utils-compiler.lisp
AA src/utils/utils-loader.lisp
Together with "awk",there is the following shell command, such that would ensure that every local file would be used 'as is' in completing the merge. Note: This will overwrite any manual changes made to the merge-conflict files, during the merge.
FILES=$(git status --short | grep '^AA' | awk '{print $2}') 
git checkout --ours $FILES
git add $FILES
Note: That short script can also be of use when merging conflicting patches during 'git rebase'

It seems that many of the conflicts are due to changes within the structure and formatting of comments, within the files, as well as the addition of the RCS/CVS '$Id$' tag. I presume that those changes may've been made around the time of the 3.3 branch of the canonical  Garnet Lisp.

As another observation that I'd like to make note of, from during the merge -- as a sidebar to the tedious task of resolving the conflicts in the files: Garnet originally had included support expressly for one Coral Common Lisp (circa 1987-1989) such that is denoted as CCL in the CVS edition of the Garnet source tree. (Web view) (Info).

Reportedly, Coral Common Lisp was part of the origins of Apple's Macintosh Common Lisp (MCL) [BG2013] such that is a part of the development history of Clozure Common Lisp (i.e. contemporary CCL) [Wikipedia]. Evidently, Garnet's support for the original CCL  was removed from the Garnet codebase -- perhaps, sometime around the time of the Garnet 3.3 branch. The original CCL support for Garnet would still be available in the history of the CVS branch, however -- as now mirrored in the cvsgarnetlisp branch of the MetaCommunity fork of Garnet.

Pending a successful merge in the source tree on my laptop -- considering that this merge will be leaving out most of the support made expressly for the original CCL -- then I should try out the Garnet demos, to see how they'll run with the new CCL.

I've made a merged tree of each of the canonical CVS and SVN Garnet source code repositories. That merged tree is published in the branch mergetree, within the MetaCommunity Garnet repository at GitHub.

Presently (19 Sept 2014) I'm developing a set of ASDF system definitions for Garnet -- along with a few corresponding changes in the source tree, as with regards to system dependency resolution -- publishing those in the garnetlisp branch.

For writing the ASDF system definitions for Garnet, largely I've been referencing the original garnet-foo-loader.lisp files. Though tedious, this has been fairly trivial to "Work out". The effort has met with a "Hitch," however, as towards determining how to transpose the files and dependencies from garnet-gadgets.loader.lisp, in avoiding the circular dependency that would result between the derived gadgets and aggregadgets systems, if without moving files from the gadgets system, into the aggregadgets system.

At some point in the revision history of the files in the gadgets system, the source code was revised so as to depend largely on the definition of the opal:aggregadget schema -- thus, making those files and any files depending on those files, in effect, dependent on the aggregadgets system, though contained directly within the gadgets system. Considering that the gadgets system is expressly a dependency of the aggregadgets system, in effect this creates a circular dependency, such that may be observed when the corresponding system definitions are loaded "So far as to that point" with ASDF. There are so many files in the gadgets system, moreover, such that are dependent on the definition of opal:aggregadget, it may effectively seem to require that the gadgets and aggregadgets systems should be merged. However, such a merge would serve to adversely affect the alignment of the Garnet documentation onto both of the gadgets and aggregadgets systems, "As is".

Fortunately, it would not require a revision with regards to the Common Lisp packages in which the respective gadgets are defined, as they are all defined uniformly within the 'opal' package. It would serve to require, however, that the files from the original gadgets system would be annotated, within the resulting aggregadgets system definition, as for the origins of those files in the original 'gadgets' system -- therefore, corresponding to the Garnet Gadgets user manual. Optionally, those files may be annotated, as such, by simply containing all of those files within a unique module in the resulting aggregadgets system definition, the "Gg" module. The majority of the aggregadgets source files could then be contained within a corresponding "Agg" module. "Gg" would then depend on the single source file defining the opal:aggregadget KR schema, and the "Agg" module would then depend on the "Gg" module.