4 ms·
It’s cool that you can express this sort of structure in Lisp without any change to the language. This contrasts to extensions to other languages that allow an
by MarkSweep 5y ago
It’s cool that you can express this sort of structure in Lisp without any change to the language. This contrasts to extensions to other languages that allow an XML-like syntax. For example JSX for JavaScript [1], XHP for PHP [2], and XML Literals for VB.NET[3].
[1]: https://reactjs.org/docs/introducing-jsx.html https://reactjs.org/docs/introducing-jsx.html
[2]: https://github.com/phplang/xhp https://github.com/phplang/xhp
[3]: https://docs.microsoft.com/dotnet/visual-basic/programming-guide/language-features/xml/xml-literals-overview https://docs.microsoft.com/dotnet/visual-basic/programming-g...
- foldr 5y agoYou could use exactly the same encoding in Javascript with just a little more syntactic overhead (and strings instead of symbols). The syntactic overhead could easily be reduced by defining some functions and constants. This sort of approach to HTML generation is popular in the Lisp community, but it doesn't really rely on any features unique to Lisp.
- User23 5y agoLisp has served as an inspiration to so many programming language designs, Javascript included, that saying a language feature isn't really unique to Lisp is a bit like saying that The Lord of the Rings is just a bunch of fantasy clichés. It's true in some sense, but it also conveys a deeply flawed understanding. Here[1] is a fun example of what's possible with a Common Lisp library that would be difficult to do in many other languages without language changes or essentially just giving up and dumping the C style code in a string and calling some sort of eval on it. That is very much not the same thing. [1] https://github.com/y2q-actionman/with-c-syntax/ https://github.com/y2q-actionman/with-c-syntax/
- foldr 5y agoWhat you link to is an example of something that you can only really do in Lisp, yes. However, using nested lists to represent an HTML document - which is what I was actually talking about - is not something that you can only do in Lisp. In the version of English that I speak, “features unique to Lisp” does not mean “features that no language had prior to Lisp” or “features that were inspired by Lisp” but rather “features that no language other than Lisp has”.
- User23 5y agoIn the English that you speak is that set of features non-empty? It’s empty in the English that I speak, given that there is no feature in Lisp that some language or other hasn’t included by now. I’m trying to steelman and failing here, maybe you can help me out? I don’t want to be left thinking that you’re less than intellectually honest.
- foldr 5y agoLots of languages have nested lists that can be used to represent the structure of an HTML document. This feature is not unique to Lisp. That’s all my original post said. It’s unclear to me which part of this you disagree with.