Jump to content

Talk:Scala (programming language)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Jonhanson (talk | contribs) at 12:23, 11 August 2009 (Added Scala is a (not) Functional Language section). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

This page is a copy of the "Scala programming language" page linked at the bottom, almost word-for-word.

Promotion.

Seems to me that this article is a bit too promoting of the Scala language. A more neutral p-o-w would be in place.

Which parts specifically do you think should be changed? -- Phouk


12.27.255.133 21:51, 27 September 2007 (UTC) The Scala homepage doesn't say anything about .Net, just the JVM...[reply]

See point 5.2 in the faq (http://www.scala-lang.org/docu/faq.html#id2244551): Q: Does Scala work on .NET? A: There are plans for Scala to run on .NET, and the previous version of Scala ran on .NET, but the current version does not. While .NET has many similarities to Java, it has enough idiosyncrasies that the port is non-trivial. -- Phouk

As of May 6, 2008, supporting the .NET backend is a current focus of the Scala team. This feature did languish for a while. —Preceding unsigned comment added by 128.197.41.105 (talk) 16:29, 7 May 2008 (UTC)[reply]

Quick sort example

I propose the following variant of quick sort, which uses List.partition and does a slightly simpler concatenation. I think it is easier to understand.

 def qsort(l: List[Int]): List[Int] = {
   l match {
       case Nil => l
       case pivot :: tail =>
       {
         val (lt, gte) = tail.partition(_ < pivot)
         qsort(lt) ::: pivot :: qsort(gte)
       }
   }
 }

Opinions?

--DavidBiesack (talk) 22:17, 7 February 2008 (UTC)[reply]

Just my opinion: the existing example is meant to be a direct translation of the Erlang example, and allowing the reader to compare the syntax on the same code is important. For me the current example is quite easy to understand and has a more "functional" style. And yep, the point is that in functional programs one line of code can express much more than in imperative ones, so they're too short for the imperative programmer to understand, but that's the coding style I've seen used by experienced programmers most of the time, so IMHO one just has to get used, and I'd keep this.
I have studied Scheme and Haskell at a university course (and a bit more of Haskell), and I still remember that feeling (I mean, I never got really used to functional programming, unfortunately), so I'm arguing this even if I'm no expert. And all my previous contact with Scala was a paper with examples in Scala, explained to our class in less than one hour.

So, the only good point of your version is that it should be slightly faster since it uses List.partition and does just one pass on the list, but that's not relevant for an introductory article, IMHO. --Blaisorblade (talk) 03:17, 7 January 2009 (UTC)[reply]

polymorphic methods.

The article currently contains a reference to 'Polymorphic methods' which cross links to Polymorphism (computer science) which is a redirect to Type polymorphism. Is there a better page to link to? Regards, Ben Aveling 09:11, 7 September 2008 (UTC)[reply]

Add performance discussion?

No discussion about the performance cost of advanced Scala features is present. I have reasons to believe their support for advanced features has some cost, some discussion about that is present here: http://wiki.jvmlangsummit.com/ScalaOptimization, since a "future works" section is present. Could someone add a mention of that? --Blaisorblade (talk) 03:30, 7 January 2009 (UTC)[reply]

Further, there is an associated published workshop paper which we can cite:
— Matt Crypto 10:18, 7 January 2009 (UTC)[reply]

Pronunciation of Scala

The given pronunciation doesn't seem right. The main author of Scala (Odersky) pronounces it (in the podcast referenced by the article, for example) as the Italian word (meaning stairs, stairway, ladder etc.). Something like /'ska:la/ in fake IPA. I'm not sure how to show both pronunciations in Wiki but I'd be even happier with just the one correct pronunciation. —Preceding unsigned comment added by 92.234.33.124 (talk) 20:09, 11 February 2009 (UTC)[reply]

See also: http://scala.sygneca.com/faqs/general#how-is-scala-pronounced 92.234.33.124 (talk) 20:21, 11 February 2009 (UTC)[reply]

Scala is a (not) Functional Language

The statement "Scala is also a functional language in the sense that functions may be used as values." uses an incorrect and rather vague definition of what constitutes a Functional (Programming) Language. C++ could be considered to also allow functions to be used as values in certain contexts yet it is clearly not an FPL. The FL link in that article sentence takes you to a page which more accurately defines FP as "a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data." Scala does not satisfy that definition - the fundamental model of computation is Imperative. It may have features taken from FPL's however that doesn't make it an FPL.

It would be more accurate to state that "Scala allows a functional style of programming ...", or perhaps "Scala has features taken from functional languages ...", though i'm not sure how to square either with the remainder "in the sense that functions may be used as values". I think perhaps this phrase is not particularly useful - it's vague for a start. The more classic phrase is "In XXX functions are first class citizens" (http://en.wikipedia.org/wiki/First-class_object) though i'm not sure this applies to Scala or not. If it does then i think it would be more informative and helps draw a distinction against PL's like C++ in which functions are not 1st class.

I know there's been a recent heated discussion over this topic on some blogs (e.g. http://enfranchisedmind.com/blog/posts/scala-not-functional), however i don't think those discussions are relevant here as they appeared to be centred around an arbitrary straw-man definition of an FPL.

BTW, the offending sentence appears to have been adapted from the opening sentence of the "Scala is Functional" section of the Artima Scala book, and consequently smacks of marketing speak. I.e. i agree with the Promotion section at the top of this page.

jon (talk) 12:23, 11 August 2009 (UTC)[reply]