Next: , Previous: , Up: Layouts and Rendering in GNU Artanis   [Contents]

11.2 Templating for Pythoners

If you’re familiar with Django, which implemented a DSL(Domain Specific Language) to express presentation rather than program logic. You may realize that the templating of GNU Artanis has different philosophy.

In templating of GNU Artanis, it’s simply embedded Scheme code into HTML. Why? Because of the philosophy of FP(Functional Programming), everything could be a function. So obviously, (filesizeformat size) is enough for understanding, and it’s just simple function calling in prefix-notation. There’s no need to implement DSL like size|filesizeformat to increase the complexity of code. Let alone the syntax is very different from Python.

The syntax like size|filesizeformat is postfix-notation used in stack-based languages, say Forth. Such a language used to delegate another programming paradigm named concatenative programming. It’s very different from the paradigm of Scheme (functional programming), and the paradigm of Python (imperative programming).

The philosophy of GNU Artanis templating is to bring it into correspondence with the paradigm of the language. And reduce the unnecessary complexities. KISS.