3 ms·
> Ruby, Lisp, and Lua (which can represent HTML elements idiomatically as nested arrays (or classes), s-expressions, and tables, respectively) Prolog can repre
by tom_mellior 6y ago
> Ruby, Lisp, and Lua (which can represent HTML elements idiomatically as nested arrays (or classes), s-expressions, and tables, respectively)
Prolog can represent HTML elements idiomatically as nested terms. Unlike in Ruby, Lisp, and Lua you can pattern match and manipulate these terms using unification. I'm surprised you don't acknowledge this as at least as powerful. In fact it's more powerful.
- a-nikolaev 6y agoI agree that unification is great, but can you suggest a concrete non-hypothetical example (or better several examples) where this functionality would be useful in the context of web programming?
- tom_mellior 6y agoSorry, I'm not a web programmer. I am a compiler developer, and I have used Prolog with great success in compiler code: Unification is great for matching patterns in tree-shaped structures like abstract syntax trees representing programs. It should be the same for the abstract syntax trees representing web pages. I understand if this is too hypothetical for you. The other point still stands, that Prolog's native data model allows you to represent tree-shaped (and DAG-shaped) documents just as naturally as Ruby, Lua, etc.