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

I always wanted to try logic programming, but I felt like I never understood how to use it effectively.

For my own personal coding projects, 99% of the time I am either writing a CLI tool or a daemon/server of some kind. I've attempted to learn Prolog in the past, but I never got to the point where I felt like I could actually write a complete program that interacts with the world in a meaningful way. So I pretty much gave up before ever getting as far as checking out something like Mercury... and I couldn't even figure out how to use miniKanren at all.

I can certainly see the utility of logic programming as an embedded DSL, but I have no idea how to write a "complete" program in a logic language.

Am I missing something? Is there a specific book or guide I should follow? Are there examples of open source programs that use logic programming I should look at?



Here's a full example I wrote in Prolog for doing small scale sysadmin: https://github.com/larsyencken/marelle

It mixes logic programming as imperative programming, with more logicky features like facts and rules.


Thanks!




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

Search: