views:

1366

answers:

11

What is the added value for learning F# when you are already familiar with LISP?

+4  A: 

Given that LISP is dynamically typed and F# is statically typed, I find such comparisons strange.

sanxiyn
One reason you might want to learn F# is to learn what a statically typed functional language is like.
Nathan Sanders
+3  A: 

If I were switching from Lisp to F#, it would be solely because I had a task on my hands that hugely benefitted from some .NET-only library.

But I don't, so I'm not.

Matthias Benkard
You can also use .net in Common Lisp: http://weitz.de/rdnzl/
Thomas Danecker
A: 

With F# all .NET Framevork common type system is avaliable for you. If you use .NET in your work it would be wery helpfull. But actually .NET is not cross platfrom.

Vokinneberg
What is Mono then?
sanxiyn
+7  A: 

Comparing Lisp directly to F# isn't really fair, because at the end of the day with enough time you could write the same app in either language.

However, you should learn F# for the same reasons that a C# or Java developer should learn it - because it allows functional programming on the .NET platform. I'm not 100% familiar with Lisp, but I assume it has some of the same problems as OCaml in that there isn't stellar library support. How do you do Database access in Lisp? What about high-performance graphics?

If you want to learn more about 'Why .NET', check out this SO question.

Chris Smith
+12  A: 

A lot of these are relatively recent developments in the programming language world. This is something you'll see in F# that you won't in Lisp, especially Common Lisp, because the F# standard is still under development. As a result, you'll find there is a quite a bit to learn. Of course things like ADTs, pattern matching, monads and currying can be built as a library in Lisp, but it's nicer to learn how to use them in a language where they are conveniently built-in.

The biggest advantage of learning F# for real-world use is its integration with .NET.

Nathan Sanders
A: 

I'm not sure if you would? If you find F# interesting that would be a reason. If you work requires it, it would be a reason. If you think it would make you more productive or bring you added value over your current knowledge, that would be a reason.

But if you don't find F# interesting, your work doesn't require it and you don't think it would make you more productive or bring you added value, then why would you?

If the question on the other hand is what F# gives that lisp don't, then type inference, pattern matching and integration with the rest of the .NET framework should be considered.

mlarsen
+3  A: 

Money. F# code is already more valuable than Lisp code and this gap will widen very rapidly as F# sees widespread adoption.

In other words, you have a much better chance of earning a stable income using F# than using Lisp.

Cheers, Jon Harrop.

Jon Harrop
+1: the miser in me is pleased by this answer, but its also very practical. As long as we don't go down the road of "well, what language makes us the most money? I know, we'll use Java!" ;)
Juliet
A: 

Why not? It's pretty easy to pick up (I had it mostly figured out in under a day), about as powerful as LISP, and runs on the CLI.

TraumaPony
+1  A: 

F# is a very different language compared to most Lisp dialects. So F# gives you a very different angle of programming - an angle that you won't learn from Lisp. Most Lisp dialects are best used for incremental, interactive development of symbolic software. At the same time most Lisp dialects are not Functional Programming Languages, but more like multi-paradigm languages - with different dialects placing different weight on supporting FPL features (free of side effects, immutable data structures, algebraic data types, ...). Thus most Lisp dialects either lack static typing or don't put much emphasis on it.

So, if you know some Lisp dialect, then learning F# can make a lot of sense. Just don't think that much of your Lisp knowledge applies to F#, since F# is a very different language. As much as an imperative programming used to C or Java needs to unlearn some ideas when learning Lisp, one also needs to unlearn Lisp habits (no types, side effects, macros, ...) when using F#. F# is also driven by Microsoft and taking advantage of the .net framework.

Rainer Joswig
+5  A: 

If you knew F# and Lisp, you'd find this a rather strange question to ask.

As others have pointed out, Lisp is dynamically typed. More importantly, the unique feature of Lisp is that it's homoiconic: Lisp code is a fundamental Lisp data type (a list). The macro system takes advantage of that by letting you write code which executes at compile-time and modifies other code.

F# has nothing like this - it's a statically typed language which borrows a lot of ideas from ML and Haskell, and runs it on .NET

What you are asking is akin to "Why do I need to learn to use a spoon if I know how to use a fork?"

Andrey Fedorov
That is incorrect. F# has both quotations and full metaprogramming. For example, the F# code <@ 1 + 2 @>.Eval() is equivalent to the Lisp code (eval '(+ 1 2)).
Jon Harrop
Sure, but what is the notation for the data representing the AST of <@ 1 + 2 @>.Eval()? In Lisp, '(eval '(+ 1 2)) is the expression which evaluates to the AST that string parses into. The AST is a list with two elements - a function `eval' and a list with three elements - a function `+' and two arguments `1' and `2'.That's what it means that Lisp is homoiconic.
Andrey Fedorov
In other words, I have no idea what you're talking about. I didn't mention meta-programming (which, by your definition, JavaScript has). Neither did I mention "quotations", whatever you mean by that.
Andrey Fedorov
Quotations and metaprogramming in F# provide exactly the same functionality as QUOTE and EVAL in Lisp. Your statement that "F# has nothing like this" was incorrect.The Lisp code '(+ 1 2) that you wrote is an example of a quotation. Hence you used the quotation mark when you wrote it. That may be written equivalently in F# as <@ 1+2 @>.
Jon Harrop
A: 

F# has the benefit that .NET development (in general) is very widely adopted, easily available, and more mass market.

If you want to code F#, you can get Visual Studio, which many developers will already have...as opposed to getting the LISP environment up and running.

Additionally, existing .NET developers are much more likely to look at F# than LISP, if that means anything to you.

(This is coming from a .NET developer who coded, and loved, LISP, while in college).

pearcewg