Hacker News new | past | comments | ask | show | jobs | submit login

> I don't understand what lambda calculus is that functional programming isn't or vice versa.

It's a bit like wondering what part of procedural programming is using a turing machine and which part isn't. :) The theory is theory and the practice is practice; in the end, what you're using is pretty far from it but it retains some of the flavor.

The flavor of lambda calculus is one of substitution and reduction. Expressions are evaluated, values replaced, variables bound. Even something like Scheme is pretty far from it, but it is close enough that if you want to study one the other will help.

The basic lambda calculus you hear about is usually the original untyped lambda calculus. The typed lambda calculus isn't much more worse, but bears a stronger resemblance to ML and so forth.

I have not found the absence of a background in lambda calculus to be much of an impediment to learning and applying functional programming. Presence of the word "calculus" tends to make us think something is grand and mystifying. In this particular case my impression is that it is an interesting theoretical diversion and that's about all one needs to know.

> I thought I saw that Erlang is influenced by some concepts from that

Well... Erlang was originally implemented in Prolog. And the syntax borrows from Prolog in many places. However, Erlang is absolutely not a logic programming language because there is no unification happening within it. It is really cool in its own right though.

The world of logic programming continues to be dominated by Prolog, which is an amazing, somewhat practical and beautiful language, but also warty old hog at the same time. Mercury gets brought up from time to time, and it should be amazing, but lacking a repl it leaves me cold. Apart from these two there are a handful of multiparadigm languages that have some constraint handling, such as Oz or one of the embedded Prologs for Lisp (Allegro has a good one), and then there's things like CLIPS or Jess or JBoss Drools, but for dedicated logic languages it's still essentially just Prolog.

I'm a huge fan of Prolog, by the way! I don't think it helps much with learning functional programming but it definitely will blow your mind, and probably more than FP would too. If you wind up trying it out and getting stuck, drop me a line or ask a question on SO. I frequently leave huge answers there and the community is very friendly.




This sounds great. I've had a side curiosity in the subject (logic programming) for a while (mostly just limited to experimentation in Drools so far) so I'll keep your username in mind. Thanks!


No problem. :)




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

Search: