6 ms·
Not everything that can be represented with s-expressions is a lisp. For example: (html (body (h1 "Hello, World!"))) This does not mean that HTML
by axblount 2y ago
Not everything that can be represented with s-expressions is a lisp. For example:
(html
(body
(h1 "Hello, World!")))
This does not mean that HTML is a lisp.
- anthk 2y agoWell: This webserver in Maclisp http://up.dfupdate.se/httpd%20html http://up.dfupdate.se/httpd%20html gave birth to this: http://up.dfupdate.se/ulml.html http://up.dfupdate.se/ulml.html
- anthk 2y agoAlso, more than Lisp, clips would be a really good choice there. Defining constraints to configure a system? That's basically what literally Clips does. https://www.clipsrules.net/ https://www.clipsrules.net/
- cess11 2y agoOK, but what about the homoiconicity and syntax macros?
- axblount 2y agoI don't know Ansible well enough to say for sure, but the macro example seems like more of a C preprocessor style "macro." I don't see how it's doing anything more than filling in a template.
- cess11 2y agoIt's executed at runtime, not before some compilation stage.
- simplify 2y ago"What is homoiconicity then? Typical definitions state that it is simply “code as data”, will point to a relationship between a program’s structure and syntax or note that the program source is expressed in a primitive data-type of the language. In the below, we will show that none of these definitions make much sense." https://www.expressionsofchange.org/dont-say-homoiconic/ https://www.expressionsofchange.org/dont-say-homoiconic/
- cess11 2y agoIn this context it seems to refer to programming in a language where the developer facing code is represented in terms of data structure literals within the language. It's a reasonable understanding of what is usually meant in a Lisp-like setting. The code is a list, so you can trivially construct and deconstruct executable lists, just like you can trivially construct data carrying lists. One could make clever quips that this isn't enough, you need quote/unquote as well to make it practical, and is that really implied by homoiconicity? Should we really use this word? Maybe we should pay someone to make up a new one?
- mepian 2y agoI agree, recently I shared here a great article by Hayley Patton on this exact topic: https://gist.github.com/no-defun-allowed/4f0a06e17b3ce74c6aeac514281f350f https://gist.github.com/no-defun-allowed/4f0a06e17b3ce74c6ae...
- saghm 2y agoYou'd think this would be more understood given that pretty much the whole point of lisp is to be pretty close to just representing an AST without relatively few frills. The idea that we can represent most languages with a tree-like structure isn't particularly novel.
- jimbokun 2y agoBut that can be perfectly valid Lisp. Lisp libraries producing HTML often look just like that.
- btilly 2y agoNot all of HTML can be represented with s-expressions. The following is perfectly valid. <b>Hello <i>World!</b> Greetings</i> Earthlings!
- MathMonkeyMan 2y agoI never noticed that, though "doesn't require a closing tag" and "requires that there is no closing tag" ought to have been hints for me.
- LegionMammal978 2y agoAnd yet it's semantically identical to <b>Hello <i>World!</></b><i> Greetings</i> Earthlings! You can see this by looking at the innerHTML, which is really just a serialized form of the DOM tree.
- ptx 2y agoIs it actually valid? W3C's HTML validator complains about invalid nesting. It might work because the HTML5 parsing algorithm produces well-defined results for broken HTML, but I'm not sure that's the same as "perfectly valid" – the spec calls such markup "misnested" and "erroneous" [0]. [0] https://html.spec.whatwg.org/#an-introduction-to-error-handling-and-strange-cases-in-the-parser https://html.spec.whatwg.org/#an-introduction-to-error-handl...
- btilly 2y agoIt certainly was valid according to the original specs. I first saw it as an example over 20 years ago in a debate about whether XHTML should replace HTML 4.0.