Plugins in TySE

Page content

TySE is a complex piece of software. However, even the smartest designer of any software is unable to predict every context the software will be used in. The challenge to software engineers is to prepare their systems for the unexpected.

Dealing with the Unexpected

There are a couple of strategies to deal with this challenge. One of them is to make your system programmable by others. TySE follows this concept by allowing you to script it (in Moonscript and Lua). Yet oftentimes there are situations where scripting is not the best approach. To better understand these situations, we will take a look at two variants of “unexpectedness”.

Adaptability

TeX is used for all kinds of “documents.” Obviously, it has been created for scientific papers and books, possibly heavy on mathematics, but over the year TeX has found usages besides that as well: music notes, chemistry, school books, and others. This testifies the versatility gained by the TeX macro language.

Extensibility

The best software systems usually provide a means of extending their functionality. TeX does this by providing hooks which may be extended or overridden by macros. Examples are token registers like everypar or the page output routine. There is even a generic extension mechanism called specials, which can be used for all kinds of additional functionality.

Plugin Architecture

Plugins in TySE are separate pieces of software. They may be written in any programmig language and at runtime will live in their own OS process, one for each plugin.

Plugin Concept

TySE uses the Twirp framework, with either GOB-encoded messages (to Go plugins) or JSON-encoded messages (to plugins written in other programming languages). Some ideas are taken from Pingo.

Configuration Tool

As configuring environments can be tedious, TySE provides an accompanying program to interactively setup environments. It

  • writes and updates configuration files
  • locates and downloads resources