The Buzzword Pinnacle

Properly realized, Lethe will use a constraints solver similar to that found in packaging systems to plan complex operations like file type conversions and batch processing with reduced user intervention. A software marketer from the 20th century might call this a user agent, or an expert system. The key concept is that it uses the derivations encoded in an algebraic type system as its ontology of legal operations, then selects an optimal path based on security (avoid low-trust steps) and efficiency (use as few steps as possible).

Once you get used to it, a system that automatically finds paths becomes a glaring absence from Smalltalk and Objective-C. Without a discovery mechanism, message-passing is just syntactic sugar.

Function Attributes

A function in /type has the following globally-indexed attributes:

In some cases, multiple wrappers for a function may exist with different levels of trust or derived types, but the same backend.

The purpose of the /type system is to allow the user to build (either manually or automatically) pipelines of functions that accomplish a complex task. These are stored as Shar scripts but could be edited with a visual programming approach such as a flowchart or a node graph architecture.

Function Examples

(Given for illustrative purposes only—not conformant to any specific syntax.)

Window<TextFile> text-editor.OpenFile (TextFile)
Trust level: 6

BitmapImage Window.screenshot (Window self)
Trust level: 6

File<BitmapImage> BitmapImage.write (BitmapImage self)
Trust level: 6

File<FileType T> http.file.download-anything (FileURL<FileType T>)
Trust level: 0

File<FileType T> http.file.download-from-package-server (FileURL<FileType T>)
Trust level: 4

File<ArchiveFileType T> archiver.compress (ArchiveFileType T, Directory)
Trust level: 6

VersionNumber<Package P> Package.get-version-number (Package P self, File<PackageList>)
Trust level: 4

VersionNumber<Package P> Package.installed-version (Package P self)
Trust level: 6

Path Resolution

The overall trust level of a process is that of its least-trusted step. When automatically building a solution, the solver tries to find the path with the highest trust possible. If there is a tie, it selects the shortest path.

Examples of Use

Much like modern Linux distributions can suggest packages to install if the user types a command for something that isn't available, Lethe indexes the function signatures of type operations provided by available packages.

The typical use is the handling of files under type constraints.

Consider a file that arrives in an unfamiliar format. The user attempts to open it, and the OS responds that no suitable program is currently installed, but a package is available that can handle it. The user accepts this solution and the OS installs the package (and any prerequisites), then opens the file.

Next, consider an upload form that requires submission of files in an archive format. The user attempts to upload an uncompressed file; the OS detects the mismatch and offers to compress it. The user accepts this solution, and the OS compresses the file and submits the resulting archive. If necessary the OS may even install a compressor program that is able to satisfy the form's format requirements.

Perhaps more dramatically, what if the user tries to upload a complex document to a web form that only accepts images? Assuming the user does not have the document's program installed, the OS could conceivably recommend a procedure that involves:

  1. Installing the document viewer
  2. Opening the file in the document viewer
  3. Taking a screenshot of the window
  4. Saving the screenshot to disk
  5. Uploading the screenshot

Similarly, the OS may determine that the viewer is outdated and needs to be updated to open the document, or that a newer version of the viewer has an export-to-image function built into it that would avoid the need to take a screenshot.

Although the examples above fixate on uploading documents to some other service, automated multi-step conversions might also be useful offline as well. For example, when embedding graphics into a rich document, it may be necessary to wrap a raster image in an encapsulated PostScript container; to add a MIDI file to a multi-track sound editor, it may be necessary to render it into audio; and so on.

Precedent

As mentioned, several Linux systems include a cnf (command not found) utility for searching package indices for similarly-named commands.

Perhaps the most rudimentary type-to-action system is the file association, which originated on the Alto or Lisa, and correlated file name extensions with opening them in programs. Windows 95 includes some other actions, like printing and compressing files, within the same type hierarchy, but in general these actions have no defined output types, making them of limited use to automation.

Not far ahead is the Clipboard as it exists on Windows, which can contain a wide range of different datatypes, but the conversions to and from the Clipboard formats are limited to the voluntary participation of programs. Consequently, a PNG image copied from the latest version of Mozilla Firefox still cannot be pasted into the latest version of Adobe Photoshop without losing its alpha channel, despite both programs having had Windows versions with PNG support for around 20 years.

Slightly more flexible, yet no less constrained, is the NeXT 'Services' menu, which allows any installed application to register object-message pairs to be activated at the user's convenience. Services might include inserting a diagram into a document, or opening a URL in a web browser, or compressing a file--tasks more in-line with the Buzzword Pinnacle concept. However, as implemented, these are limited to dealing with selections (or creating objects at input points) and do not understand much about the underlying data, other than whether it is a file or text context. This paucity--along with the frequent neglect the feature receives even on the newest Macs--makes it hard to imagine any sort of planning system built around it that accomplishes useful work without meticulous user involvement.

Probably the most successful example of classical planning algorithms in widespread deployment (not counting actual spatial pathfinding, such as in games and traffic control) is the constraints-based solving algorithm used by modern package systems, which works not only to find and install dependencies, but to determine combinations of version numbers that avoid compatibility conflicts with the requirements of other extant software. While the capabilities of these systems are impressive (some can solve Sudoku puzzles) they are a solution to a social problem (obsolete packages dependent on obsolete interfaces) and are of questionable necessity (Docker-based solutions and Windows both simply silo the obsolete dependencies in adjacent containers.) As a new OS, Lethe should aim to avoid unstable software interfaces, of course, but conceivably a system of adapters (allowing old clients to access new servers) could ameliorate this problem.

Finally, there is on-going research (as of 2024) to make large language models perform general agentive activities, as systems like GPT-4 are capable of tool use. Predictably, these projects fixate on the age-old user agent system goals of comparative price shopping and making restaurant reservations. It seems unlikely that the parties responsible would pivot to consider the comparatively mundane philosophy of simply building out an ontology usable by the extremely unflashy auspices of a classical planner.