This page is no longer maintained — Please continue to the home page at www.scala-lang.org

F# vs. Scala

5 replies
kolotyluk
Joined: 2010-06-04,
User offline. Last seen 5 weeks 15 hours ago.

Not to imply the title means there is any competition between F# and
Scala, but out of curiosity, could some of the more knowledgeable people
be able to contrast the two languages. I have not studied F# very much,
so I was wondering what major features distinguish the two languages.

Just as C# was Microsoft's response to Java, is F# Microsoft's response
to Scala?

Looking recently at the Tiobe Index, F# is rated 23 while Scala is rated
50 - just over twice as many users of F# as Scala (0.512%/0.209%). Do
people think that is because F# is bundled in with the Visual Studio
release while Scala is not bundled in with either Java or Eclipse, or is
there some other reason? Would it help if Scala simply became part of
the Eclipse release, sort of the way Maven and other technologies have?

Cheers, Eric

James Black
Joined: 2010-02-01,
User offline. Last seen 42 years 45 weeks ago.
Re: F# vs. Scala
The fact that F# is part of VS2010 helps to get more users.
They are both hybrid functional/object-oriented languages, but whereas Scala seems to be a new language, F# started off largely as a .NET version of OCaml, with some differences (http://stackoverflow.com/questions/179492/f-and-ocaml).  
This question is 3 years old, but is at least a good starting point, to answer your question.http://stackoverflow.com/questions/168428/f-and-scala-comparison
Both of them achieve the goal of trying to bring functional programming more to the forefront, to help developers to better solve some problems.
I think trying to compare them, or look at the differences is the wrong approach, that leads to an us-them way of thinking.
Both are tools, look at what you are trying to do, and determine the best tool to help solve the problem.  For example, if you want to do all your development in Visual Studio, then F#/C# blending may make more sense, but if you feel comfortable with using different languages and IDEs then you can use C#/Scala.
If you need parser combinators then Scala has them as part of the design, whereas F# has a way to do this by using something external (http://www.quanttec.com/fparsec/).
In my experience the main difference for me was the fact that F# requires that you use something after it was defined, and this can lead to problems when you have circular references, whereas the class-based approach of Scala allows you to define a function anywhere, as long as it is in scope, and it is useable.  
The implicits in Scala are also very useful, but in F# I haven't seen this (http://stackoverflow.com/questions/1686895/is-there-an-equivalent-to-creating-a-c-implicit-operator-in-f). 
On Sat, Sep 17, 2011 at 12:07 PM, Eric Kolotyluk <eric [dot] kolotyluk [at] gmail [dot] com> wrote:
Not to imply the title means there is any competition between F# and Scala, but out of curiosity, could some of the more knowledgeable people be able to contrast the two languages. I have not studied F# very much, so I was wondering what major features distinguish the two languages.

Just as C# was Microsoft's response to Java, is F# Microsoft's response to Scala?

Looking recently at the Tiobe Index, F# is rated 23 while Scala is rated 50 - just over twice as many users of F# as Scala (0.512%/0.209%). Do people think that is because F# is bundled in with the Visual Studio release while Scala is not bundled in with either Java or Eclipse, or is there some other reason? Would it help if Scala simply became part of the Eclipse release, sort of the way Maven and other technologies have?

Cheers, Eric



--
"I know that you believe you understand what you think I said, but I'm not sure you realize that what you heard is not what I meant."
- Robert McCloskey
Kevin Wright 2
Joined: 2010-05-30,
User offline. Last seen 26 weeks 4 days ago.
Re: F# vs. Scala


On 17 September 2011 17:07, Eric Kolotyluk <eric [dot] kolotyluk [at] gmail [dot] com> wrote:
Not to imply the title means there is any competition between F# and Scala, but out of curiosity, could some of the more knowledgeable people be able to contrast the two languages. I have not studied F# very much, so I was wondering what major features distinguish the two languages.

Just as C# was Microsoft's response to Java, is F# Microsoft's response to Scala?


Not really, the shift towards FP in the face of rising core counts and massive data sets is an industry-wide trend.
 
Looking recently at the Tiobe Index, F# is rated 23 while Scala is rated 50 - just over twice as many users of F# as Scala (0.512%/0.209%). Do people think that is because F# is bundled in with the Visual Studio release while Scala is not bundled in with either Java or Eclipse, or is there some other reason? Would it help if Scala simply became part of the Eclipse release, sort of the way Maven and other technologies have?

Cheers, Eric

Tiobe has some very questionable metrics, and is largely ignored by most people I know.  For example...their main test is the number of Google hits for the "<language> programming" query, so every passing mention of F# on the MSDN website is going to bump that count, you can be sure that Microsoft have taken advantage of this and optimised the site for a higher Tiobe ranking.
If you were to count the number of distinct sites and blogs that mention the languages, I'm sure you get a very different result.
Or how about Google's list of the 1000 most visited websites? http://www.google.com/adplanner/static/top1000/ Start scanning down the list, the only entries you'll find using .NET are all Microsoft's, and I doubt that any of them use F#On the other hand, Scala seems well represented by diverse groups, 5 out of the top 40 are organisations using Scala in *some* capacity:
#6 wikipedia.org (used for the dbpedia extractor)#15 twitter.com (in the backend, the site is still ruby) #24 amazon.com#26 ebay.com #29 linkedin.com


Michael Stal
Joined: 2011-01-29,
User offline. Last seen 42 years 45 weeks ago.
Re: F# vs. Scala
F# and Scala have some interesting commonalities, but they are from different roots. While F# follows the ML, OCAML root, Scala  was also inspired by ML but also by various other languages. Concepts like traits are not available in F#. As far as I remember Don Syme developed F# even before Scala. Both languages are excellent. It is more a matter of taste what you prefer. And there is not really a competition, as they originally targeted different platforms. I don't think Microsoft does or will compete with Scala. And Scala on .Net will be welcomed by many developers.Regarding the TIOBE index: This index is a mess. You simply can't judge the distribution of a language by  adding Web site hits. Maybe this works statistically correct for languages like C#, C++, Java, etc, but definitely not for F# and Scala. For example languages like Cobol and Fortran are still in frequent use, but you won't find Web sites mentioning them
- Michael

Sent from my iPad
On 17.09.2011, at 18:51, Kevin Wright <kev [dot] lee [dot] wright [at] gmail [dot] com> wrote:



On 17 September 2011 17:07, Eric Kolotyluk <eric [dot] kolotyluk [at] gmail [dot] com (eric [dot] kolotyluk [at] gmail [dot] com" rel="nofollow">eric [dot] kolotyluk [at] gmail [dot] com)> wrote:
Not to imply the title means there is any competition between F# and Scala, but out of curiosity, could some of the more knowledgeable people be able to contrast the two languages. I have not studied F# very much, so I was wondering what major features distinguish the two languages.

Just as C# was Microsoft's response to Java, is F# Microsoft's response to Scala?


Not really, the shift towards FP in the face of rising core counts and massive data sets is an industry-wide trend.
 
Looking recently at the Tiobe Index, F# is rated 23 while Scala is rated 50 - just over twice as many users of F# as Scala (0.512%/0.209%). Do people think that is because F# is bundled in with the Visual Studio release while Scala is not bundled in with either Java or Eclipse, or is there some other reason? Would it help if Scala simply became part of the Eclipse release, sort of the way Maven and other technologies have?

Cheers, Eric

Tiobe has some very questionable metrics, and is largely ignored by most people I know.  For example...their main test is the number of Google hits for the "<language> programming" query, so every passing mention of F# on the MSDN website is going to bump that count, you can be sure that Microsoft have taken advantage of this and optimised the site for a higher Tiobe ranking.
If you were to count the number of distinct sites and blogs that mention the languages, I'm sure you get a very different result.
Or how about Google's list of the 1000 most visited websites? http://www.google.com/adplanner/static/top1000/ Start scanning down the list, the only entries you'll find using .NET are all Microsoft's, and I doubt that any of them use F#On the other hand, Scala seems well represented by diverse groups, 5 out of the top 40 are organisations using Scala in *some* capacity:
#6 wikipedia.org (used for the dbpedia extractor)#15 twitter.com (in the backend, the site is still ruby) #24 amazon.com#26 ebay.com #29 linkedin.com


Philippe Lhoste
Joined: 2010-09-02,
User offline. Last seen 42 years 45 weeks ago.
Re: F# vs. Scala

On 17/09/2011 18:07, Eric Kolotyluk wrote:
> Not to imply the title means there is any competition between F# and
> Scala, but out of curiosity, could some of the more knowledgeable people
> be able to contrast the two languages. I have not studied F# very much,
> so I was wondering what major features distinguish the two languages.

Neither me, I just had a look when I saw that Martin Odersky said he
would have chosen F# if he hadn't created Scala...
Interesting language, with some nice ideas, and others that I like less.

> Just as C# was Microsoft's response to Java, is F# Microsoft's response
> to Scala?

I doubt it, but I can be wrong... Scala has not (and even less at the
time of release of F#) the same impact/popularity than Java.

> Looking recently at the Tiobe Index, F# is rated 23 while Scala is rated
> 50 - just over twice as many users of F# as Scala (0.512%/0.209%). Do
> people think that is because F# is bundled in with the Visual Studio
> release while Scala is not bundled in with either Java or Eclipse, or is
> there some other reason? Would it help if Scala simply became part of
> the Eclipse release, sort of the way Maven and other technologies have?

Scala isn't really a "technology" in the sense of tools. It isn't Maven
nor SVN. Eclipse is kind of neutral toward languages, with the obvious
exception for Java, so it is unlikely it will be shipped with native
support for another language: providing their support via plugins is
more flexible and more neutral.

missingfaktor
Joined: 2010-04-13,
User offline. Last seen 1 year 3 days ago.
Re: Re: F# vs. Scala
This stackoverflow thread compares the approaches taken by the two languages to unify the OO and FP: http://stackoverflow.com/questions/2905081/scala-versus-f-question-how-do-they-unify-oo-and-fp-paradigms

On Sat, Sep 17, 2011 at 11:14 PM, Philippe Lhoste <PhiLho [at] gmx [dot] net> wrote:
On 17/09/2011 18:07, Eric Kolotyluk wrote:
Not to imply the title means there is any competition between F# and
Scala, but out of curiosity, could some of the more knowledgeable people
be able to contrast the two languages. I have not studied F# very much,
so I was wondering what major features distinguish the two languages.

Neither me, I just had a look when I saw that Martin Odersky said he would have chosen F# if he hadn't created Scala...
Interesting language, with some nice ideas, and others that I like less.

Just as C# was Microsoft's response to Java, is F# Microsoft's response
to Scala?

I doubt it, but I can be wrong... Scala has not (and even less at the time of release of F#) the same impact/popularity than Java.

Looking recently at the Tiobe Index, F# is rated 23 while Scala is rated
50 - just over twice as many users of F# as Scala (0.512%/0.209%). Do
people think that is because F# is bundled in with the Visual Studio
release while Scala is not bundled in with either Java or Eclipse, or is
there some other reason? Would it help if Scala simply became part of
the Eclipse release, sort of the way Maven and other technologies have?

Scala isn't really a "technology" in the sense of tools. It isn't Maven nor SVN. Eclipse is kind of neutral toward languages, with the obvious exception for Java, so it is unlikely it will be shipped with native support for another language: providing their support via plugins is more flexible and more neutral.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland