3 ms·
I’m not sure other languages can do “quasiquoting” very easily. Like, JS has template strings, but that’s not “quasiquoting” because the string content is unstr
by bvisness 3y ago
I’m not sure other languages can do “quasiquoting” very easily. Like, JS has template strings, but that’s not “quasiquoting” because the string content is unstructured. Lisp, though, can do this quite easily because it can still parse the unevaluated content with enough structure, and indeed can get you the same benefits I discuss in my article (like making wrapper component functions that directly access the list of children).
As for preferring to write XML directly in my code…95% of my goal is to just deliver XML to the browser. I’d rather just write XML. And honestly the way text nodes are handled in other DSLs seems quite bad to me. I’d much rather write `long paragraph, <strong>emphasis,</strong> long paragraph` than HEREDOC-style long strings that I have to start and end every time I want some inline formatting.
All the examples I see of HTML DSLs are heavy on structure but conspicuously lacking text. For me the text is _the whole point_. I don’t want to worry about string escaping when writing a blog post.