Overview How to run Vital via the web What's new Short tutorial Description Reference manual How to install Vital About the Vital project
|
Overview of VitalThe main features of the Vital approach are:
Document-centered approach
A Haskell program consists of a collection of modules (some written by the user, others imported
from a library). A module consists of a collection of items (declarations, expressions
and comments) and is displayed as
a document. The user constructs a document by placing (in a free-format layout) items
on it. The system evaluates the declarations and expressions, and
displays their values alongside them.
The system is 'live' in the sense that (as with a spreadsheet) changing any part of a document causes
an immediate update of all dependent values.
A simple document is shown here. It consists of a comment, a declaration ( Demand-driven evaluation
Haskell has a non-strict semantics: expressions are evaluated only to the minimal extent necessary.
In Vital, evaluation is demand-driven by the need to display the result.
For instance, in the list comprehension expression shown here, evaluation of
the infinite list [n * n | n <- [0 ..]]
proceeds only far enough to reach the edge of the viewport through which
the document is viewed.
Styles
Haskell values may be displayed either textually or diagrammatically.
The way that a Haskell value is displayed is determined by an associated style (itself
an ordinary Haskell value).
For example, a style can be defined to display a list diagrammatically, with a vertical orientation and
with each of its elements boxed.
The declarations for a collection of styles may be
gathered together as a stylesheet, itself an ordinary Haskell module.
Typically, whenever a user declares a new datatype (concrete or abstract) he will also
specify (by defining an appropriate instance of the Styles are also used to define the way that comments are displayed and, in particular, to attach hyperlinks to them, facilitating navigation amongst the set of documents making up a complete program.
Graphics
Pictures (elements of a predefined Picture datatype) may also be displayed
and manipulated. A picture may consist not only of simple geometric elements
(lines, rectangles, etc.) but also of picture-valued functions. This allows both
simple animations (for example, a scrolling waveform) and more complex interactive
pictures (such as a mouse-controlled arcade game).
Images (as bitmaps of a predefined type Image) may also be included
as components of pictures.
Direct manipulation of data structuresVital allows a user to select (by mouse) a component of a data structure and then to use Copy and Paste operations to modify or move it. This gives the user a high-level, graphical means of constructing complex literal data structures.
Direct manipulation of ADT valuesA user-defined set of operations can be associated with any datatype (concrete or abstract). For example, a user dealing with a problem involving binary relations can introduce an ADT for binary relations, and then (by defining an instance of theEdit type class,
specify how a binary relation should be displayed graphically and specify a set of operations on
and between binary relations.
A menu of these operations is presented to the user on right-clicking on a binary relation.
Selecting one of these operations updates the source text of the declaration/expression
and thus (indirectly) the displayed value.
Typically, in any particular domain (engineering, economics, etc.) an expert user would be
called up to identify and implement a library of relevant ADTs. Thereafter, an end user
will be able to put together documents expressed largely in terms of these high-level, domain-specific
abstractions and defining particular instances of them (such as the binary relation illustrated
here) by simple point-and-click operations on pictorial representations.
PersistenceA documents developed in Vital may be saved to file and later restored in an identical state. It is saved as an ordinary Haskell program (with layout and style information embedded as comments, and any stylesheet imported as an ordinary Haskell module). This means that a Haskell program can be developed interactively using Vital and any literal data edited into its data structures, and then (if required) it can be run on an offline Haskell system.
|