Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hi, yes, I really like Prolog for providing the programming paradigm that is not normally available in a more conventional programming language: I can specify the facts and relations between them, and Prolog will search for a solution for me. That being said, I don't see this functionality to be particularly useful in the context of web programming. Do you have in mind good examples where Prolog will be obviously more powerful and useful than, for example, Ruby, Lisp, and Lua (which can represent HTML elements idiomatically as nested arrays (or classes), s-expressions, and tables, respectively)? Where do I win from using Prolog? (I think that the animal identification game in the linked page, while obviously neat, does not really look like a common web-programming task to me.)


> 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.


I 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?


Sorry, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: