The Shapes language
— project web —
This is the homepage of Shapes, a powerful functional drawing language with LaTeX support.
Shapes is under development, and will in the end be a high level graphics language which compiles to pdf
, just like MetaPost
is used to produce PostScript. The language design is inspired by many existing languages, including pdf
and MetaPost. Another language to be mentioned here is Asymptote
, which has been developed during the same years and provides similar functionality to Shapes.
The highlights of Shapes include
- Application-specific constructs make Shapes superior to general-purpose languages when it comes to drawing.
- Abstractions and scoping make programming scale, compared to more primitive languages (such as pdf) and GUI-based tools.
- The output does not require post-processing for stand-alone images (compare with MetaPost output). Neither is there a need for graphics conversions before use with pdfLaTeX.
- Functional programming in the sense of one-assignment.
- Sequential construction, a construct that allows some imperative-style techniques to be used under the one-assignment constraint.
- 3d drawing that is well integrated with the 2d end media.
- Continuation passing style evaluation.
- Lazy evaluation where appropriate.
- Flexible memory management (no need to ask a wizard to increase the heap size).
It should also mentioned what Shapes is not:
- Shapes may not be the easiest way to produce a few simple pictures for somebody who does not know the language. The choice to use Shapes should be based both on concerns to produce high quality end results, and concerns regarding how the result is produced; by careful modeling with this functional language, the logics of the illustration will be captured in the source, resulting in an exceptionally high degree of maintainability.
- Shapes does not yet allow for user-defined types.
- Shapes does not have macro facilities at the moment, although hygienic macros like those in Scheme would be nice.
- Shapes is not MetaPost. Although some syntax, concepts and the task is borrowed, Shapes is built fundamentally different from the ground up. Differences range all the way from the big picture's functional programming versus imperative style macro-programming, down to the semantics of the path-stroking primitive.
The name of the game
For more than a year — when the Shapes embryo was just a one man's pet project — the working name was MetaPDF
, clearly inspired by MetaPost. However, as was pointed out by the local TeX
-guru (who is now a co-developer of Shapes), the name MetaPDF
inevitably suggests a direct continuation of the MetaFont to MetaPost development. Shapes isn't so the name had to be changed. Then, I came up with the idea Drawl
, the most natural name of a drawing language. However, that had been in use since the 1960's, and with the last version that I am aware of being Drawl 70
. Now, Drool
not only sounded similar, but is also what people are expected to do when they see nice shapes
, and gave name to this project for many months. Obviously, the name had to change again, this time because Drool
turned out also to be the abbreviation used for Dave's recycled OO language
People and thanks
Credit is due to a lot of people. As an open source project, relying heavily on free software components and tools, the list of people who have more or less directly contributed to this project is endless, and a warm thanks goes to everybody on this long list. Here, a few persons deserving being mentioned for having contributed directly Shapes, will be listed.
These are the people having contributed to the project with code:
Henrik Tidefelt — language design, maintainer, author of the bulk of code and documentation.
Gustaf Hendeby — mainly build mechanisms, portability, and distribution, but also some language features.
Tobias Gerdin — support for Shapes in Emacs.
Thanks goes to the following people for being willing to try out Shapes and provide feedback (excluding contributors):
Special thanks goes to:
and Torkel Glad
— for allowing an early version of Shapes to be used for many illustrations in their book Reglerteknik
, a basic book on automatic control.