|
Hehe. I started learning Prolog a few weeks ago - not sure why. Maybe after seeing one more story about it on here, and seeing it on lists of languages that're good to learn. But didn't know anything much at all.... What a surprise. I really like it. It's really sooo different from any other language I've tried (C, C++, Python, JS, SmallTalk, Lisp, bash, AWK etc etc) - Most programming consists of telling the computer how to go about doing something. None of that in Prolog. You 'just' describe how the solution will look.[0] And secondly, it's unexpectedly Functional - it's impossible to change variable values, or iterate.[1] Recursion only. 'Data' is same form as 'program', the program can change the data/program while running etc. And even Lispier than Lisp in some ways. I think I'll be regularly using it in an AWK-like way - and already have been - quickly writing programs of a couple of dozen lines or less to do things that would take longer to do otherwise. And there's something cute about it that AWK has too, maybe it's that it does well in its own unique world. Just starting that book on how Erlang was 'grown' using Prolog... I don't know why I wrote this. Prolog was just surprisingly FPish, and if I hadn't learnt about that stuff, I wouldn't have recognized it, or appreciated it. [0] Really, you need a new vocabulary to describe what it's doing. [1] Ok, not impossible. |
What book is that?