I'm disappointed they resorted to a one-way preprocessor. Is it really not feasible to make a first-class domain-specific language like this in Python?
The reason I made SHPAML a one-way preprocessor is that my use cases haven't yet given me a compelling reason to write a round tripper, and preprocessing is simple to automate. I do not know what your criteria are for judging a "first-class" DSL in Python, so I cannot comment on the feasibility. My goal was to create a simple markup language that maps well to HTML and plays nice with templates. SHPAML does that.
Beautiful mini language for outputing HTML in Python
71–74 of 74 posts
Re: Beautiful mini language for outputing HTML in Python
#72Earlier quoted context omitted.
How did Hoffman and Kernighan meet?
Pulling your leg. Hoffman, who had learned in the "method acting" schools, apparently stayed up all night to look properly harrowed for a scene. Laurence Olivier, playing opposite, is said to have told him something like "Why don't you try acting, my boy? It's so much simpler."
Re: Beautiful mini language for outputing HTML in Python
#73Earlier quoted context omitted.
The reason I made SHPAML a one-way preprocessor is that my use cases haven't yet given me a compelling reason to write a round tripper, and preprocessing is simple to automate. I do not know what your criteria are for judging a "first-class" DSL in Python, so I cannot comment on the feasibility. My goal was to create a simple markup language that maps well to HTML and plays nice with templates. SHPAML does that.
Sorry, I misread the title "Beautiful mini language for outputing HTML in Python" as a DSL to be embedded in Python code rather than a separate text file (which is actually language agnostic after the preprocessor is done).
Re: Beautiful mini language for outputing HTML in Python
#74Earlier quoted context omitted.
The difficulty of writing HTML is mostly having to type too much. Writing HTML isn't programming.
HTML isn't meant to be written directly. It's an output form, like Postscript or PDF.
I've started authoring websites in 1996 with just Notepad and I still hand-write my HTML on a daily basis.
The problem with HTML has been (and will be, for a long time) that there is no WYSIWYG editor that can offer quite the same quality as handwritten HTML.
In fact, if you're dealing with HTML from a WYSIWYG perspective, you're most likely ignorant of the language. The distinctions between divisions and paragraphs, between links and spans, are not something that is adequately reflected by an input editor purely concerned with visuals.
Just as the purpose of CleverCSS or it's Ruby predecessor is making it easier to write CSS by cutting down on the redundancy (and even by increasing the level of abstraction a fair bit), the purpose of SHPAML is making it easier to write HTML by cutting down on the redundancy of closing tags, angle brackets and the verbosity of divs, spans, ids and classes, thus letting you express more directly what you mean.
You don't have to like it. It's mostly a stylistic choice, but it means little overhead and can help HTML authors a lot by cutting down on the usual boilerplate. Just like frameworks and syntactic sugar make it easier for programmers (though the argument could easily be applied to them as well -- how dare they find it easier to code with less boilerplate if the actual writing is the smallest part in creating a functioning program).