Surface syntax is overrated
Many applications are specified in terms of surface syntax, for
example:
-
Typesetting and documentation systems such as TeX, LaTeX, Texinfo,
etc.
-
Assemblers such as GAS or NASM.
-
Parser generators such as YACC or Bison.
Other applications are specified in terms of the interaction
gestures that they accept, for example:
-
Word processors such as Word or the Libre Office word processor.
-
Spreadsheet programs such as Excel or the Libre Office spreadsheet
program.
We believe that this emphasis on superficial characteristics is
suboptimal, for many reasons:
-
People have very strong opinions about surface syntax and
interaction gestures. A program can be very good, but will still
be rejected by users because of these superficial
characteristics.
-
If input to such a program is generated by another program as
opposed to an end-user, the data must be unparsed and then parsed
again, which is unnecessary work. A typical example would be an
assembler used as a backend for a compiler.
-
Customizing the core logic of such programs is hard or impossible,
simply because the way they work internally is not specified or
documented.
-
Frequently, concentrating on superficial characteristics in the
design process can lead to badly designed data structures for the
core logic.
-
Designing a good surface syntax or a set of good interaction
gestures is very hard.
As an alternative, we propose that programs such as those in the
examples should first be specified in terms of the data structures
they manipulate, and in terms of the ways that these data structures
can be manipulated.
By concentrating on the core logic and specifying it, we can obtain
several advantages:
-
We automatically obtain an interchange format in the form
of a serialized version of the graph that makes up the objects of
the application.
-
Customization is easier because the format of the data is clearly
specified in a way that can be directly manipulated by the custom
code.
-
Several different applications using different surface syntax or
different input gestures can co-exist for a single version of the
core data structures, thus allowing easier collaboration between
users with different preferences.
robert.strandh@gmail.com