An Intuitive Graphics-Oriented Domain-Specific Language
Description
This project centers around the design and implementation of a
domain-specific language. The design goals for this language are,
briefly:
- The primary output of a program in this language should be graphical. Language primitives should make it easy to render graphics, with an emphasis on operations that look "cool" or interesting, rather than, say, realism or precision modeling.
- The syntax of the language should be very simple. It should not take much effort to write a valid program which produces interesting output.
- The semantics of the language should be "intuitive"; a competent programmer should be able to "program by feel". Emphasis is on developing abstract semantics which can readily be mentally modeled, rather than appealing to existing physical intuitions in an unnatural, clunky way (see LOGO).
- The language should be capable of universal computation in a straightforward way. Systems (like some cellular automata) which produce interesting graphical output but are fantastically difficult to use for traditional programming would not be suitable.
Programming Language(s)
The domain-specific language will be implemented in Haskell. This may
include the development of a parser, either using a parser generator
like Happy, or a parser combinator library like Parsec.
External Libraries
Graphics output will likely be through OpenGL, using the HOpenGL
bindings. I have only limited experience with HOpenGL and with OpenGL
in general. If OpenGL is not suitable, another library will be used.
Risk Analysis
Major potential sources of trouble include:
- The design goals are very demanding and will be difficult to meet. This will be mitigated by compromising as necessary.
- Some of the graphical effects I'd like to use (such as Gaussian blurs) are very computationally demanding. This will be mitigated by taking advantage of hardware support, by standard optimization practice, or by selecting different effects.
- I'm unfamiliar with OpenGL/HOpenGL, as noted above. This will be mitigated by learning it. :)
Implementation Plan
The implementation steps are:
- Develop a basic, extensible language design
- Implement this core language (including the parser for the core syntax)
- Repeat:
- Add/modify features in language design
- Modify implementation accordingly
- Test new features for correct implementation; fix if necessary
- Test for usability; rework or discard modifications if necessary
I've decided to follow this plan because it seems unlikely that a
first language design will meet the design requirements as-is, whereas
it is easy to design a core language which can later be extended with
e.g. more graphics primitives.