Friday, June 25, 2021

Another CABOOSE Controller Feature - Code Generation Again

Team. Just a "short" note. While considering the future direction of this project, it was realized that a set of "rational rose-like" method stubs could be generated from the description of the middle-ware logic found in the architectural control language (ACL) file, "directory.scsv". 

This might expedite "standing-up" an web application. This would be the second-case of "simple-minded" code generation used in this software pattern for a general-purpose controller. It most likely also would be facilitated with a "batch script" generating an initial instant of the "cab.py" file in the case of a Python implementation.

Our goal was producing instances of this controller in the "fourteen" chosen web languages; however, it is most probably the case that we will fully "flesh-out" the CABOOSE pattern in Python and then render it in the other languages such as PERL, PHP, C#, C, JAVA, Node.js, TypeScript, Clojure, Ruby, Groovy, and etcetera.

Monday, January 25, 2021

Goofy Orientation

Team. Could you please help me find the right and left sides of the screen? Is the LHS and RHS, left-hand side and right-hand side, of a production in a context-free grammar inverted. In other words, what are the left and right sides of:

public static String aSimpleStringLiteral = "More backward than Aksarben."';

Could this be corrected? Or, is it the case that computing genius baffles "common sense".


When you "left-align" a paragraph in Microsoft Word or another online editor, what side of the page and screen does it align with? Are you saying, "Flush? On what side? Is that right-alignment?"

Just a reminder. Always keep this straight and remember that bolts tighten when they are turnt clockwise and loosen when they are turnt counter-clockwise. Common-sense is a nascent gift; but, it can be lost in this backwards world. Right? Or, is that Left?

And, if you think that it does not matter. Try this "natural" orientation for a year. And, see if life looks different.

Please Forgive the Rhetorical Nature of this Passage,

The Author Resolving Confusion. 

Free E-Book | A Synopsis of Programming Fundamentals

 Team. Last week the author of this weblog drafted a short book covering some the concepts in computing which he has learnt within the past three decades of learning. He has a couple of post-baccalaureates in science and engineering. One is in computer science; the other is in engineering. And, the text does contain some religious content and references from the perspective of a Protestant Christian. So, if one would not find such offensive reading while seeing another man's perspective on computing, enjoy the reading. It is a "free" (*.pdf) that you can share with your friends.


Remember Hunt, Peck, and Think. It is the "Best" Programming Approach.

Sunday, January 17, 2021

The Nature of the Controller - Idempotency - Apache CABOOSE

Team. It is the case that the term "program", of which a controller is a subclass, has many synonyms. Some of those are module, routine, operation, and function. It is the case that functions have many forms. We call one of these types idempotent. This class of function remains unchanged in behavior when it is composed with itself. For instance the identity function, f(x) = x shows idempotency when it is composed with itself. 

if f(x) = x, show f(f(x)) = x.

f(f(x)) is f(x) by substitution of f(x) = x.

f(x) is x, by the antecedent.

So, f(f(x)) is x, by transitivity.

In general, f(f(...f(x)...)) = x. So, one might compose an idempotent function with itself an arbitrary number of times, and its results will be the same.

So, if a controller is described by a relationship, C(I) = O, where I and O are vectors of zero of more inputs and outputs, respectively, one can take advantage of its idempotence. If one combines this pattern for a general-purpose controller, CABOOSE, with a traditional web-server which is a special-purpose controller, he might produce a "structured" web server. Such a primary process would interact with a bipartite model of page templates and behaviors. And, one might use representational state transfer (REST)-style resource locator for interacting with the controller. The "caboose,py" executable would be invoked implicitly and not be part of the locator string which would list the requested view followed by the input vector.

This is the power of idempotency.

 

Wednesday, January 13, 2021

The Big WORM | Write-Once Run Many

Team. With the "advent" of JAVA technology plus the modern generation of "universal" virtual-machine languages and platforms during the early-1990s, the acronym "WORM" became a common computerese "buzz-word". "WORM" is a statement of one of the most obvious principles of the modern software industry and computing. 

When a software engineering team at a Microsoft or an Oracle creates a new product, they build a logical model of a real world process. This logical model is "ephemeral"; and, it is eventually rendered in the physical form of "high" and "low" electronic signals on a secondary storage device. Yet, once person-hours are spent producing the first verified and validated instance of the software, replicating it becomes rather easy. This is the first of a pair of "bi-stable" concepts in the philosophy of WORM as used in JAVA parlance. The second is the most commonly spoken concept associated with "universal" virtual machine use. One can "write" a singular instance of a program in a modern high-level language like JAVA, compile it producing a object file, and "run" duplicates of that object on numerous computing nodes, wherever the appropriate "virtual" machine is available.

So, WORM is a notion closely and intricately linked with the language translation process, compilation and interpretation. And, in a sense it is a byproduct of the "bootstrapping" of modern compilers which occurred decades ago. One compiler was produced in a "base" language that permitted the production of new language translation tools for "new" languages from that "first" compiler produced in that "primitive" computing dialect.

And, it is unthinkable in this modern era that one should "write" a compiler each time that one is need in a software development process. Such would be costly and error-prone. The use of "well-designed", "formally-verified and -validated" compilers ensures uniformity among the object files produced and helps guarantee the reliability and robustness of these files when they are generated from a "correct" source file. In other words, a language translation tool was written once and checked for fidelity. Then, it was widely used.

Contrast this with the modern era of web-development which sprouted up in the mid-1990s. The generation of software development has yet fully blossomed. Much of the "core" functionality found in common gateway processes was frequently rewritten for each instance of a web-process needed. This counters a few fundamental principles of  programming learnt by many college freshman and high school students studying computing. That "basic" rules is this, "If one writes a module once and well, he can place it in a single place within his system and reuse it often. This promotes the concept of a singular place of modification. Which enhances testability and product maintenance tasks." 

So, why rewrite the same behavioral characteristics found within the "process" control mechanism commonly used throughout web development?

Hence, the modern era of "pre-written" controllers surfaced in the late-1990s with products like Struts and Spring for the JAVA Enterprise Edition and, in recent years, Laravel for PHP. Also, Microsoft and Oracle at a couple of large software corporation that offer a standard, reusable Model-View-Controller product.

Yet, these avatars of control are found in every software product, including those "hokey toy" examples written for introductory programming fundamental courses. They are found among the "old" text-based, menu-driven systems that were commonplace from the late-1970s, throughout the 1980s, and in the early-1990s. They are found among JAVA's Swing and FX applications plus those created with packages like Tkinter found in Python and other graphical user interface (GUI) libraries.

Although simplistic, this model of development, that uses storyboard templates which represent a description of the output views and a module of behaviors that fill-in hotspots on the "stencil" which describes the view in conjunction with a "pre-written" instance of this controller pattern, provides a WORM-like component.

It is extensible through the module of "bespoke" behaviors which supports the "general-purpose" controller and is a pattern which can be used throughout computing without the need for "recreating this wheel" each time. 

Below is our diagram of interactions found among a system which uses the CABOOSE pattern and a general-purpose controller (GPC). This diagram is from the JAVA implementation which does not "currently" include an ICEMODE global with a "IceMode.java" file produced from an "Icy,java" code generator.

In our Python instance, the directory file that contains the architectural control language (ACL) does not use an eXtensible Markup Language (XML) format. Instead, it uses a sectional comma separated values file (SCSV). And, our behaviors are not part of Python classes. They are simply "user-defined" functions. 

And, of course, overseeing it all is Boonie, our mascot!

Although one can spin his own controller in a few person-hours, it is this author's sincere hope that this pattern of development becomes as ubiquitous a modern language translation tools, compiler and interpreters.

It also supports the templating of "client-side" scripts and web components which also might hold replaceable "hotspots".



Monday, January 4, 2021

Python ICE : The Reader's Digest's Version

Team. An instance of the CABOOSE System written in Python can be found on GitHub. It should be said that the version on GitHub has an simple optimization which the code found on Google Drive does not.

Friday, December 18, 2020

Python ICE | A "Full" Python In CABOOSE Prototype [ Just Below The Surface ]



Not a ZeroC Production

Team. Hopefully, the Gang's all here. This deliverable date has long since passed by. The realization of the "fifth" phase of this multilingual project is extremely overdue. It initially was scheduled for November 15, 2020. With the completion of the final phase projected near this time or mid-January 2021. 

Seeing that this architectural software pattern will not be woven in each of the fourteen languages chosen by then, one of the "simpler" implementations was chosen as a "deliverable" concession and completed "proof of concept". The implementation language was Guido von Rossum's Python. 

Since this past year has offered the author teaching opportunities in computer programming fundamentals, in particular, Python, he knew that "finalizing" the vision of a general-purpose controller which supported dynamic invocation would be quite simple in that language. 

So, he set aside a "vacation day" before the Winter holidays in America and spun the product. Between running errands and three meetings, including an academic interview, he found time for it on a Friday. It was about 4.0 person hours (PH) worth of effort. It is nearly a (0.5) KLOC coding effort with some repeated segments of code and ample comments, not including the generated "icemode.py" file which is produced by "icy.py" and of varying length. 

It includes a "simple-minded" and "non-optimal" code-generator that renders a "hard-coded" version of the logic file with a batch file called "iceman.bat"

The primary script "caboose.py" will run using dynamic invocation for activating behaviors described in the CABOOSE logic file if the ICEMODE global in it is assigned a value of "False". If it is given a value of "True", then the script uses hard-coded logic in the "icemode.py" file generated by "iceman.bat" and ultimately "icy.py"

It goes without saying that a Python 3 hybrid-interpreter must be installed and part of your system's PATH variable before this can run from the command prompt. 

Python ICE for Windows development is available on online. This is not the product from https://zeroc.com/products/ice with a similar moniker. That product is a framework for "microservices" based upon remote procedure call (RPC) and is architected and coded much like Oracle's Ozark controller product. This is called ICE for a different bi-fold reason. Firstly, ICE is an acronym for In CaboosE

CABOOSE is a very simple pattern for a controller which one can "spin" himself using a number of languages in a day or so each. Secondly, this product uses an architectural control file (ACL) whose mapping between page concerns and those methods which satisfies them can be "iced" or "frozen" in a programmatic "switching" structure for static invocation versus the default dynamic invocation. It is more of a "template-driven" system with a model of the view in a storyboard and behaviors that render each view in a "cab.py" file. 

Unlike ZeroC's product, this product version is not object-oriented, although it could be. 

And like the JAVA in CABOOSE project which integrates well with Oracle's Ozark, this ICE product likely will mate up well with ZeroC's ICE project. But, that is intuition with the different ICEs and not experience talking. 

And, it just so happens that the JAVA in CABOOSE project was considered by Oracle's JAVA Community Process (JCP) for adoption a full-year before the development of Ozark after it was pitched as a potential JAVA Specification Request (JSR). It was determined that Oracle had enough "view technologies" with servlets and JAVA Server Pages (JSP).

So, please do not get caught up in labels. These are different types of ICE, like "nilak" and "siku" for the Inuktitut of the Alaskan coastline. Certainly there is more than one Bill Joy, James Gosling, Mary Fitzsimmons, and Tom Johnson in this world. And, it is the case that more things in this life than Irishmen come with the same name. But, if one looks closely, they can easily see the differences between the products with the same "name".

This prototype of the controller runs from the command line, but can be easily adapted for "web-use". It can be invoked from the DOS prompt with "run [view_name]". Three templated HTML views exist in the StoryBoard model: home, landing, and error.

So, for instance, if one types "run home" at the prompt, then the populated HTML template for the homepage prints on the terminal. If one types "run foobar", then the error page prints since foobar is not a registered view in the CABOOSE logic file, directory.scsv

The HTML view templates are populated by functions found in "cab.py". This Python script must be created and customized for each Python ICE (Python In CABOOSE) application which one creates. If a non-existent view is requested, then the error view is returned as was the case with "foobar".

The CABOOSE Logic file "directory.scsv" unites all of this. It drive "caboose.py" which does not need modification, outside of the ICEMODE global which might be best housed in a the "cab.py" file.

A similar, yet not fully ICE'd version for JAVA is described in JAVA in CABOOSE by Abraham Vati James found on Amazon. This only is one of the pennames under which this author has worked in past years. Take it, tweak it, turn some web gears with it. It is under a MIT License for Open Source.

Hopefully, this shows how simple spinning and weaving the tapestry of a modern general-purpose controller is. It is the author's goal that he provide implementations in the other programming dialects of this multilingual project within a few month. PHP and PERL for the LAMP stack should be an easy task such a Python. This ease of development is driven by each of their individual mechanisms for dynamic invocation. Also, the Node.js and Typescript implementations each permit use of a function for statement evaluation. 

This greatly simplifies dynamic invocation in comparison with JAVA's Reflection tools and function pointers in C/C++. And, these tasks in C#, Rust, Clojure, Groovy, and Ruby will be a "new" undertaking for the author. But, this should not be an impossible task.

Upon taking his first computer fundamentals course at Vanderbilt during the Spring of 1989, he wondered about controllers in a model-view-controller architecture and whether a general-purpose one could be built with a means of "programming it" with a secondary "architectural control language".

This is what is found in the sectioned comma separated values (*.scsv) file which holds the CABOOSE logic.

The realization of this "trivial" project arises from the culmination of many years of learning and work. And, it should be said that such a revelation was quite novel at the time when print SPOOLing was new and revolutionary. In some ways, its time has passed; in others, it has not.

This could be a means of creating the "old" text-based and menu-driven command-line interface systems from which the author first harvested the abstractions of layered and model-view-controller architectures. Based upon his training in Pascal, he wondered if he could generate the "switch-case" or "if-then-else" ladder needed for logical processing of such a controller-based system. But, he knew little about lexical analyzers, interpreters, compilers, or code generators, at the time, other than what they did. He was far from understanding parse trees and the likes of grammars. These concepts still are not his strong points, seeing that he never took a course in compiler construction. In many ways, this might be considered a "kludge".

Yet, over the years, before the advent of markup languages and eXtensible Markup Language (XML) processors, work on mainframes with "on-lines" and a bespoke in-house system called integrated scripting produced by Jack Sprouse, a knowledge of International Business Machine's Customer Information Control System (CICS), and undergraduate study suggested that such a system with a "simple-minded" code generation step driven by a architectural control language (ACL) would be worthwhile. Life's circumstances did not allow for its production until now. 

But, the author kept it simple (KIS), plus he used the bird-foraging technique (hunting, pecking, and thinking) along with copying and pasting lines of code. And, Python ICE is likely the first nearly "full" rendering of this vision. It is a extremely simple "cold fusion" of sorts, since it connects view technology standards (markup) and a popular high-level language (Python) with some elements of fourth generation languages (code generators)

It is a mezzanine generation for languages in this fifth generation, those running atop machine emulators, such as Python and JAVA. Using a mixture of declarative markup and imperative or functional languages, it is a generation 3 1/2 system when integrated with a third-generation language such as C/C++ and a 5 1/2 when combined with a modern fifth generation virtual machine dialect.

Occasionally, limitations on what one knows helps him develop simpler solutions. At times, one can "overthink" what he is doing and build a duplicate of Dr. Who's Tardis when all one needs in a Ruby Pearl Tercel DX or, better yet, a push cart.

The construction of an ICE system virtually permits for the abstraction of the C, controller, out of the MVC processing equation. So, ultimately, we now have a (model-view) MV architecture which is "best" described as (view-model) VM based upon the top-down layering

This, when run atop a virtual machine, produces a VM * VM system which experiences a magnification of its combined power and desirable engineering traits as emergent behaviors arise. And thus, one might call it a "VM-squared" or , basically s "VM^2", architecture.

The author fully knows that VM-squared or the equivalent VM-MV systems have been defined as something different in past years. Yet, it is quite true that few know where the anacronyms originated. It was in the author's college-ruled red Mead notebook which was originally purposed for his ENGL104W Prose Fiction course taught by Robert Bacon at Vanderbilt University during the Spring of 1989. 

Yet, it is oft said that “Truth is stranger than fiction, but it is because fiction is obliged to stick to possibilities; Truth isn't.” ― Mark Twain, Following the Equator: A Journey Around the World.

 And, although this misuse of personal academic notes was a violation of Vanderbilt's Honor Code, the  convolution of Flannery O'Connor's words in the phrase "everything which converges must rise." brings much comfort in this world of "360-degree" good fortune. 

"What goes around comes back around again..." - Grand Puba