Jump to content

Talk:Scala (programming language): Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
Adding WikiProject Java assessments per request (Mistake?) using AWB
Asked about imperative programming
Line 63: Line 63:
See also: http://scala.sygneca.com/faqs/general#how-is-scala-pronounced
See also: http://scala.sygneca.com/faqs/general#how-is-scala-pronounced
[[Special:Contributions/92.234.33.124|92.234.33.124]] ([[User talk:92.234.33.124|talk]]) 20:21, 11 February 2009 (UTC)
[[Special:Contributions/92.234.33.124|92.234.33.124]] ([[User talk:92.234.33.124|talk]]) 20:21, 11 February 2009 (UTC)

== Imperative programming in Scala? ==

This article does not say whether Scala allows imperative (non-functional) programming style. Please ammend the article with an answer on the question whether Scala is a purely functional, mostly functional, or both functional and imperative language. [[Special:Contributions/77.127.45.42|77.127.45.42]] ([[User talk:77.127.45.42|talk]]) 00:29, 14 November 2009 (UTC)

Revision as of 00:29, 14 November 2009

WikiProject iconJava Unassessed
WikiProject iconThis article is within the scope of WikiProject Java, a collaborative effort to improve the coverage of Java on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
???This article has not yet received a rating on Wikipedia's content assessment scale.
???This article has not yet received a rating on the project's importance scale.

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]

Maybe I'm wrong, but I think the example has a bug: What happens if the pivot element is in the list more than once? For example: "2, 2, 3" In this case, the result of sorting would be "2, 3", because every element with the same value as the pivot element is filtered out, but only one element with the value of the pivot element is reinserted. To correct it, I would replace "tail.filter(_ >= pivot)" with "tail.filter(_ > pivot)" and not insert the pivot element manually. --84.177.151.15 (talk) 21:39, 22 September 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]

Imperative programming in Scala?

This article does not say whether Scala allows imperative (non-functional) programming style. Please ammend the article with an answer on the question whether Scala is a purely functional, mostly functional, or both functional and imperative language. 77.127.45.42 (talk) 00:29, 14 November 2009 (UTC)[reply]