programming-languagesf#lispcompare-contrast

How is Lisp related to F#, and is learning Lisp a useful leg up to F#?


This is the situation : I mostly program C# and have written types in it I don't want to lose. At the same time I would like to learn functional programming. The obvious answer of course is F#.

But for everything apart from C# I use emacs as an editor, and I really would like to learn Lisp too. (Learn your editors/IDE's language you know, that's why I know a bit VB to write my VS-macro's in it) And it's not just emacs, Lisp is something I really want to learn.

As for F#, I could mingle it with C# without any interop problem, have a great GUI (WPF) and a lot of other .NET goodies. But it is, of course, not as mature as Lisp.

If I am realistic I know if I want to smuggle a functional language into my professional life it has to be F#. Since learning two whole languages seems a bit much, I was hoping that Lisp would be a great way to learn functional programming, and if I start out F# later, It would be very easy....

Is this true? Or are the two languages not comparable at all?


Solution

  • Lisp is a large family of languages and implementations. Scheme for example is a Lisp dialect with probably more than one hundred implementations (about ten of them mildly popular). Common Lisp is another dialect with about ten currently maintained implementations. Scheme and Common Lisp both have written standards that implementations try to implement.

    F# is both a language and implementation. From Microsoft. It was mostly derived from OCAML and belongs to the family of ML languages.

    Lisp was a very early language supporting functional programming (Lisp 1.5 in the 60s). Lots of the early experiments with functional programming was done in Lisp. In the 70s in the Lisp community there was a movement to the roots of functional programming and the result was Scheme. Then especially in the 80s and 90s of the last century new functional languages appeared (ML, Miranda, FP, SML, Haskell, Clean, ...) that were/are quite different from the usual Lisp dialects. There is still some heritage, but mostly they developed in different directions (static typing, type inference, module systems, batch languages, algebraic data types, lazy evaluation, purity, and more). The Scheme community still has lots of contacts to the FP community. But that's mostly it.

    There are some basic FP ideas that can be learned independent from a particular FP language, but generally F# is very different from most Lisp dialects. The other feature, that F# supports the .net ecosystem (especially since it is a Microsoft creation) is not that well supported by Lisp dialects.

    I would also not expect much benefit from knowing a restricted Lisp dialect like Emacs Lisp for learning F#.