Tuesday, 3 January 2012

Epilogue - Prolog Day 3

Ok, I'm feeling really lazy and I've not done any of this book for ages, so I decided to wap through the last chapter to get it out of the way. Once again I'm left feeling more like it falls short of being something that I'd consider to be a full language due to its incredibly tight focus on the realms of logic, similar to how SQL is a very focussed language for data manipulation. Pretty much the definition of a DSL I suppose. Infact, I think I'd appreciate it a lot more if there was any indication that you could run Prolog to query it from a general purpose language like we do with SQL databases, but if that's possible (without some nasty techniques of shelling out an instance and fiddling with text manipulation on the command line) there was no instruction on how to do it.

The chapter dug deeper into handling complex logic problems with a few game-based puzzles, solving 8 queens (where you need to place 8 queens on a chess board with none in the same row, column or diagonal) and a sudoku solver. The relative simplicity with which a sudoku could be solved, simply by expressing the rules of the game shows how powerful Prolog can be, but with the language's limited scope, interacting with it continues to be clunky, and again I want to see how to harness a Prolog back end from an app written in Ruby or something to get the best of both worlds.

I glanced over the tasks for the day, but I'm ashamed to say that I didn't attempt them. I gave a little thought to what might need to be done, but I can't shake the feeling that Prolog doesn't offer me anything that I can use, so I skipped out on it.

Next up is Scala which seems to be approximately the Java/JVM equivalent of F# in .Net land. I've done a little twiddling with F# and use C#'s functional abilities quite regularly (mmmm, lambdas) so I'm quite looking forward to this one. Fingers crossed I'll get on with all the remaining languages a bit better than these last two. After Scala we have Erlang which I've heard interesting things about, then Clojure which is Uncle Bob's current language of choice which is always a good recommendation, and finishing with Haskell which takes the functional paradigm further.

No comments:

Post a Comment