Pics and Tritium: Different Approaches to Visual Programming
Visual programming, often aimed at simplifying software creation, takes on many forms. Two interesting examples, though perhaps lesser-known, are Pics and Tritium. While sharing the goal of making programming more accessible, they employ significantly different visual paradigms.
Pics: Concise Picture-Based Programming
Pics, developed by Brian Kernighan in the early 1990s, isn't a full-fledged programming language in the traditional sense. Instead, it's a language for creating technical diagrams and illustrations, particularly for use in documents formatted with Troff and Nroff. Its primary strength lies in its conciseness. Rather than writing lengthy textual descriptions of geometric shapes and their relationships, Pics allows users to define diagrams through a series of commands that describe graphical primitives.
The language uses a declarative approach. You describe *what* the diagram should look like, not *how* to draw it step-by-step. This is achieved by defining objects like boxes, circles, arrows, and lines, specifying their positions, sizes, and connections. Objects can be named and referenced, enabling complex diagrams to be built from reusable components. Simple arithmetic expressions are allowed to calculate positions and sizes dynamically, adding to Pics' flexibility. Crucially, Pics integrates seamlessly with text processing tools, allowing diagrams to be included within documents without cumbersome manual manipulation.
While Pics is not Turing-complete and doesn't support general-purpose programming, it excels in its niche. Its focus on clarity and minimal syntax makes it ideal for generating accurate and professional-looking technical illustrations directly from source code, eliminating the need for external drawing tools and potential inconsistencies.
Tritium: A Flow-Based Reactive System
Tritium, in contrast to Pics, offers a more interactive and dynamic visual programming environment. It focuses on creating reactive systems, where changes in input trigger corresponding changes in output. Unlike Pics' static diagrams, Tritium deals with constantly evolving data streams.
Tritium employs a flow-based visual paradigm. Programs are constructed by connecting computational "blocks" represented as nodes on a canvas. These blocks perform specific operations on incoming data, such as filtering, transforming, or displaying it. Data flows between these blocks along visual connections, resembling pipes carrying data streams. The connections visually represent data dependencies and the flow of execution.
The reactive nature of Tritium is particularly suited for applications like data visualization, interactive simulations, and controlling hardware devices. When input data changes, the affected blocks automatically re-execute, updating the output and triggering further changes downstream. This makes it easy to create systems that respond in real-time to external events.
While the visual nature of Tritium aims to simplify programming, complex systems can still become visually cluttered. Managing and understanding large flow diagrams can be challenging, requiring careful design and organization. Nevertheless, Tritium offers a powerful and intuitive way to build interactive systems, particularly for those who are not traditional programmers.
Two Paths to Visual Programming
Pics and Tritium, though both visual, address different programming challenges. Pics simplifies the creation of precise static diagrams, while Tritium facilitates the development of dynamic reactive systems. They demonstrate that "visual programming" is not a monolithic concept but encompasses a wide range of approaches, each tailored to specific application domains and target audiences.