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

Is using miniKanren the only way to solve the fish-puzzle? If no, which language will be most ergonomic and accessible to solve it?


Pascal and Common Lisp were employed in the old benchmark assessment [0]. So just about anything should be able to.

But I'd expect many solver languages to be able to make it easier, like Prolog, datalog, mercury.

[0] http://cse.unl.edu/~choueiry/Documents/Hybrid-Prosser.pdf


I think there'll be all manner of constraint and constraint-logic programming approaches that'd be amenable. I wish I had a great answer for you as "the best".

IMO, these "zebra puzzle"/"einstein puzzle" style problems are like a "hello world" for many related techniques. What's more, there are many languages that combine several of these techniques together so that you can easily pick and choose where appropriate.

If you were just wanting to compare against another related style, answer-set programming is one thing that comes to mind.


Like most things in programming, there is no "only way" to solve something, and certainly no one language (or DSL) to solve anything. You could solve it programmatically in C writing your own backtracker or state enumerator and a validation function for the rules (or block of code if you are like an old coworker that liked 10k SLOC C functions).

miniKanren, Prolog, and others let you write the rules more concisely (almost always) and clearly (most of the time, not everyone will write clear code and clarity is subjective) than that, though.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: