views:

2171

answers:

7
+8  Q: 

F# vs. Clojure

What are the most significant differencies between the F# and Clojure ?

Which constructs has F# which Clojure does not have and vice versa?

Does F# have macros?

+4  A: 

One key difference is that F# is a .NET language, whereas Clojure runs on a JVM. Thus the deployments and supported platforms will be different.

Note that F# is supported by mono, however.

As for macros, I think you're out of luck.

Brian Agnew
And AFAIK there exists no platform that would run .NET but wouldn't run JVM. The other way round, there are many cases. So, Clojure is more generic while F# is more or less Microsoft specific.
Joonas Pulakka
@mad-j Yeah well. Mono fills much of that multi-platform space for .NET. And, the vanilla JVM does not run on android, for example. So Java is more or less Sun-specific?
Kurt Schelfthout
Hardly. Common on Windows/Linux/Mac for instance.
Brian Agnew
+25  A: 

Most of the differences will stem from the fact that F# is descended from ML while clojure is descended from lisp.

So F# has a more ML/OCaml/Haskell feel with emphasis on:

  • static typing
  • type inference
  • pattern matching

While clojure has more of a Lisp feel with emphasis on:

  • s-expressions
  • macros
  • closures

Also as Brian noted, F# is a .Net language while clojure is a JVM language so each will have access to a vast but different set of libraries.

Aaron Maenpaa
There is ClojureCLR, in Clojure/contrib, but it's alpha at the moment.
Kurt Schelfthout
clojure supports some lazy stuff and F# is a strict language
nickik
Also, Clojure has a great STM implementation. F#'s computation expressions (for monadic syntax) and quotations overlap with macros a bit.
Jon Harrop
+1  A: 

F# really corresponds to Scala on JVM. The closest thing to Clojure on .NET platform is IronScheme.

Nemanja Trifunovic
ClojureCLR is still being worked on I believe.
Rayne
"F# really corresponds to Scala". Technically but not politically. Scala is an academic language whereas F# and Clojure are industrial languages.
Jon Harrop
+1  A: 

If you want macros, you can use it with Boo or Nemerle.

dotneter
Nemerle is pretty dead.
Rayne
+1  A: 

Clojure is a lisp, actualy lisp-1 family language. F# is practicaly OCaml adopted to .net platform.

Dev er dev
+2  A: 

It looks like there's some effort being put into running Clojure on the CLR. Looks very promising.

http://github.com/richhickey/clojure-clr

Alex Beynenson
+2  A: 

I would bet on F#. After the release of SQL Server 2008 R2 (increasing the scalability of SQL server), the price of the Enterprise Suite (including Business Intelligence which can be easily integrated with Silverlight via ADO.NET --> it's about $45,000 compared to Oracle with all the B.I. bells & whistles which is about $285,000), and the delivery of .NET to multiple platforms...It looks like .Net has all the resources for expansion while competitors will spread themselves too thin. This is not to suggest that Oracle/Sun are going to die off, I just don't see them finding an interest in investing in Java/JavaFX or Java related languages for much longer. I only see .NET getting stronger. Despite Apple's attempts to cut off Mono - I'd like to see how long their "culture" survives Silverlight as it's delivered to the much larger market share of phones that use Windows Mobile. Microsoft has momentum right now so long as they don't F up with the next Windows Mobile release. This may be far from the original question being asked, but learning a language is a serious time investment...so I think it's appropriate to step back for a minute and look at the larger picture because I don't really see it being addressed here except for Brian's comments....but hey this is just my opinion, if you have a strong feeling I'm wrong, start an open discussion about it... after all, I'm willing to convert if I'm wasting my time.

Jordan Lee Pollard
I'm a .NET developer, but I try to avoid personal bias and...well..I think it's time for an update! Oracle is suing Google over their commercial use of Java. Despite my feelings, from what I have read, it seems they have every right to do so under the terms of the GNU license agreement...probably why Google has been silent since the news broke (or maybe a gag order was issued?). There are a lot of Java developers out there with a vested interest. Clojure may be a key piece in keeping Java as one of if not the main contender after all (and perhaps for quite some time).
Jordan Lee Pollard