3 ms·
> Template languages have evolved for a long time to include all the things you will probably need. Which is what turned them into Turing-complete languages th
by TeMPOraL 9y ago
> Template languages have evolved for a long time to include all the things you will probably need.
Which is what turned them into Turing-complete languages that try to pretend they're not.
> For example, imagine if you want to test some HTML code in a browser. Browser doesn't understand Lisp so you have to write it in HTML. And then you have to convert it to Lisp to use as a template. What a waste of time.
Not much time is wasted, especially that s-exps are faster to write than HTML (especially with editor support). Browsers don't understand templates either, so in both cases you have to do some conversions. I'll give a point to HTML-ish template languages here, but I don't believe the time spent on manually converting large chunks of template code into browser-edible HTML and back is anywhere near the critical path on the project.
> This can be easily solved by validating HTML code.
That's validating vs. making it literally impossible to emit invalid HTML.
> I guess in Lisp you cannot even write user.getName() because it doesn't have objects.
Haha. Right. No, Lisp actually has objects. You'd write it as (get-name user), since the syntax for function calls in Lisp is consistent.