Simplify Web Application Development
Dot Star Programming Langauge
November 1, 2011Posted by on
If you want to merge a templating language with a programing language, there are basically two approaches – either you extend a templating language with programming construct, or extend programming language with templating features.
So far, all templating systems uses the first approach. For example, for JSP, you have JSTL, which contains various tags, such as if, forEach, etc. This approach is easier to implement and the end result is not very desirable. For a list of pain points, please refer to the post Calling for a New Templating Language. In short, you end up with a language that is awkward and very limiting. This result is not completely unexpected. Why? If you compare the feature and size between a templating language and a programming langauge, you will find that, a programming language is usually much more powerful and sophisticated than a templating langauge. Templating langauge is much much smaller. To extend something really small to include features that only a much larger system can properly support, there is no surprise you will end up with something awkward and limiting.
Option two requires extending templating features on top of a programming language. It is harder and nobody has successfully done it. Nevertheless, it is the approach that actually makes sense. The reason is simple: extending something really small on top of something much larger is easier and could result in a much better result. This approach will lead to a type of programming language that I would call “Dot Star” programming languages. What does Dot Star mean? If you are familiar with the parsing technology, you will recognize that “.*” is a pattern that matches any input. Dot Star programming language is a programming language which accepts arbitrary input program. It is dramatically different from all of the existing programming languages*, yet it can be done as an extension to the existing programming language technology.
Star Script is an experiment of the second approach. The end result is a simple and powerful templating programming language.
* I only consider a langauge as programming langauge when it is Turing Complete. Thus, I don’t consider HTML as a programming langauge.