Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If you already know LISP, why would you also want to learn F#?

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

like image 481
Michiel Borkent Avatar asked Sep 24 '08 12:09

Michiel Borkent


People also ask

Why you should learn LISP?

To me, what makes Lisp great is the fact how it generalizes the interaction between you and the machine. Basically everything that we as programmers do is to interact with data (programs being data for compilers), which Lisp makes almost indistinguishable from the code itself.

Is F# a lisp?

LISP is dynamically typed whereas F# is statically typed. LISP has macro's built in. F# does not.

Is lisp a functional language?

Lisp is a functional programming language with imperative features. By functional we mean that the overall style of the language is organized primarily around expressions and functions rather than statements and subroutines.


2 Answers

  • Static typing (with type inference)
  • Algebraic data types
  • Pattern matching
  • Extensible pattern matching with active patterns.
  • Currying (with a nice syntax)
  • Monadic programming, called 'workflows', provides a nice way to do asynchronous programming.

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.

like image 113
Nathan Shively-Sanders Avatar answered Oct 30 '22 23:10

Nathan Shively-Sanders


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.

like image 23
Chris Smith Avatar answered Oct 30 '22 22:10

Chris Smith