Scala is a general purpose programming language principally targeting the Java Virtual Machine. Designed to express common programming patterns in a concise, elegant, and type-safe way, it fuses both imperative and functional programming styles.

learn more… | top users | synonyms

5
votes
1answer
316 views

Why do generics in Scala have erased types, and are not reifiable?

Why do generics in Scala have erased types, and are not reifiable? Is it due to lack of support from the JVM or for compatibility with Java libraries? What are the advantages in general of having ...
6
votes
5answers
2k views

What is a good use case for scala? [closed]

In a current project we have setup the build so that we could mix Java and Scala. I would like to use more Scala in our code base to make the code more readable and concise. In the process also learn ...
2
votes
1answer
2k views

Play 2 with Scala or Java? [closed]

I want to develop a big personal project using Play 2 Framework. I am expert with Java language but it seems, with the few articles I read that Play 2 works perfectly and especially with Scala. I've ...
6
votes
3answers
387 views

Functional Methods on Collections

I'm learning Scala and am a little bewildered by all the methods (higher-order functions) available on the collections. Which ones produce more results than the original collection, which ones ...
5
votes
1answer
456 views

Can Scala be considered a functional superset of Java?

Apart from the differences in syntax, can Scala be considered a superset of Java that adds the functional paradigm to the object-oriented paradigm? Or are there any major features in Java for which ...
3
votes
1answer
341 views

Constraints while designing the Java generics

Java generics look quite different from those available in Scala, although both were designed by Martin Odersky. From my point of view, the design of generics in Java is worse, for instance: there ...
6
votes
1answer
1k views

Why does Scala require functions to have explicit return type?

I recently began learning to program in Scala, and it's been fun so far. I really like the ability to declare functions within another function which just seems to intuitive thing to do. One pet ...
3
votes
1answer
186 views

How to read Scala code with lots of implicits?

Consider the following code fragment (adapted from http://stackoverflow.com/a/12265946/1333025): // Using scalaz 6 import scalaz._, Scalaz._ object Example extends App { case class Container(i: ...
8
votes
9answers
2k views

OS choice for functional developing

I'm mainly a .NET developer so I normaly use Windows/VisualStudio (that means: I'm spoiled) but I'm enjoying Haskell and other (mostly functional) languagues in my spare time. Now for Haskell the ...
2
votes
2answers
274 views

Case Class naming convention

In my recent adventures in Scala, I've found case classes to be a really nice alternative to enums when I need to include a bit of logic or several values with them. I often find myself writing ...
23
votes
6answers
2k views

How do you encode Algebraic Data Types in a C#- or Java-like language?

There are some problems which are easily solved by Algebraic Data Types, for example a List type can be very succinctly expressed as: data ConsList a = Empty | ConsCell a (ConsList a) consmap f ...
24
votes
4answers
3k views

What limitations does the JVM impose on tail-call optimization

Clojure does not perform tail call optimization on its own: when you have a tail recursive function and you want to have it optimized, you have to use the special form recur. Similarly, if you have ...
1
vote
2answers
809 views

Performance of concurrent software on multicore processors [closed]

Recently I have often read that, since the trend is to build processors with multiple cores, it will be increasingly important to have programming languages that support concurrent and parallel ...
7
votes
1answer
2k views

Play or Lift: which one is more explicit? [closed]

I am going to investigate web development with Scala, and the choice is between learning Lift or Play: probably I will not have enough time to try both, at least at first. Now, many comparisons ...
8
votes
4answers
683 views

scalablity of Scala over Java

I read an article that says Scala handles concurrency better than Java. http://www.theserverside.com/feature/Solving-the-Scalability-Paradox-with-Scala-Clojure-and-Groovy ...the scalability ...
12
votes
3answers
398 views

Historical origins of Scala implicits

Scala has been called complex with its rich feature set by many of my colleagues and some even blamed all those new features of it. While most programmers are aware of the OO-features, and at least ...
11
votes
3answers
1k views

Scala or Clojure Functional Programming best practices

I did a lot of self-study coding, got some experience with Parallel Programming Models: Actors, Software Transactional Memory, Data Flow. When I am trying to apply these architectures to real life - ...
2
votes
1answer
1k views

A sample build.sbt to allow me easily specify source dirs and libraries?

I recently started learning Android development and I decided to follow the following development processes: Preinstall Scala in emulator Edit source files in IntelliJ IDEA 11 Compile the project ...
5
votes
6answers
356 views

Do non-pure interpreters still make the guarantees of functional programming?

I am assuming the implementations/compilers/generated C code (referred to hereinafter as generic, 'interpreter') for most functional programming languages are written in non-pure functional languages. ...
7
votes
3answers
2k views

Actor library / framework for C++ [closed]

In the C++ project I am working on, we have an application consisting of several processes deployed on different machines. This network of processes is dynamic since processes (clients or background ...
8
votes
4answers
592 views

Design in “mixed” languages: object oriented design or functional programming?

In the past few years, the languages I like to use are becoming more and more "functional". I now use languages that are a sort of "hybrid": C#, F#, Scala. I like to design my application using ...
5
votes
2answers
2k views

Migrating from Python to Scala wise when a lot of work is already done in Python?

Me and my friend are developing a web-app in Python + Flask + PostgreSQL. We have been working on it for the past few months and have developed a lot of schema/use-cases specific to Python + Flask + ...
1
vote
1answer
388 views

What are the benefits of using both Scalate and Jade?

I recently did a little "tool roundup": If I were to program a website in Scala and Coffeescript, what frameworks would I go for? I came across this great presentation: ...
2
votes
2answers
643 views

What's the best practice for async APIs that return futures on Scala?

I have started a project to write an async PostgreSQL driver on Scala and to be async, I need to accept callbacks and use futures, but then accepting a callback and a future makes the code cumbersome ...
7
votes
6answers
550 views

Built in Scala library slow?

I found this question and accepted answer on StackOverflow. It's related to the slow JSON parser in the standard Scala library. The consensus as it were, is that the build-in JSON library is slow, ...
31
votes
5answers
2k views

Re-inventing system design for Scala

Many, many, moons ago, I did my masters in Object Orientated Software Engineering. I covered everything: project initiation, requirements, analysis, design, architecture, development, etc, etc. My ...
12
votes
2answers
1k views

What is the ideal learning path to building Android apps with Scala, without prior Java experience

Unfortunately, there are not currently any books on the subject of 'Learn Android Development with Scala', which would be the ideal solution. I'm guessing that I'll need to pick up at least 3 books ...
28
votes
5answers
12k views

Performance of Scala compared to Java

First of all I would like to make it clear that this is not a language-X-versus-language-Y question to determine which is better. I have been using Java for a long time and I intend to keep using it. ...
8
votes
3answers
3k views

Functional Programming approach for a simplified game using Scala and LWJGL

I, a Java imperative programmer, would like to understand how to generate a simple version of Space Invaders based on Functional Programming design principles (in particular Referential Transparency). ...
4
votes
1answer
770 views

How is Scala scalable? [duplicate]

Possible Duplicate: Why is Scala more scalable than other languages? The Wikipedia page on Scala says: The name Scala is a portmanteau of "scalable" and "language", signifying that it ...
4
votes
1answer
408 views

Resources relating to Java EE and Scala [closed]

Are there any good sites / blogs / books / articles on using Java EE together with Scala? Or indeed articles saying that it should not be done. Many Scala resources talk about using Akka and Lift. ...
3
votes
2answers
226 views

Cross “Machine” Code?

Some languages (mostly ones made in the last 2 decades or so) can now not only run (after some compilation step or directly) on several platforms, but also can be compiled to run on several virtual ...
2
votes
5answers
587 views

Programming language with native concurrency support for large graphs?

I'm currently looking for a new programming language to learn (currently working through some C++, know some C and Python), specifically one that has built-in concurrency support? I want to try to ...
13
votes
4answers
854 views

Unit testing statically typed functional code

I wanted to ask you people, in which cases it makes sense to unit test statically typed functional code, as written in haskell, scala, ocaml, nemerle, f# or haXe (the last is what I am really ...
13
votes
2answers
2k views

Do you need to know Java before trying Scala

I'm interested in learning Scala. I've been reading a lot about it, but a lot of people value it because it has an actor model which is better for concurrency, it handles xml in a much better way, ...
20
votes
6answers
3k views

Why these attempts to water down Scala with Xtend and Kotlin? [closed]

So now Eclipse has offered Xtend and JetBrains is offering Kotlin - both of which seem to be watered down versions of Scala. My question is why? I've played with Scala a bit and it's not that hard. ...
10
votes
1answer
624 views

(Dis-)advantages of structural typing

I’ve just watched this talk by Daniel Spiewak where he talks about the advantages of structural typing as compared to Scala’s ans Java’s nominal typing. One example for this difference would be the ...
4
votes
4answers
746 views

what is the object oriented counterpart to haskell / coq

I have detailed information on the latest developments in functional programming. I think haskell is quite an advanced and high level programming language. With coq and agda this gets even more ...
3
votes
3answers
728 views

Developing a Project in a Statically Typed Language Entirely in VIM

I've recently started taking Scala to heart (sweet Python, I still love you, but your collections just can't match Scala's), and in doing so am now using IntelliJ IDEA almost entirely for development. ...
3
votes
2answers
454 views

Are there any good Java/JVM libraries for my Expression Tree architecture?

My team and I are developing an enterprise-level application and I have devised an architecture for it that's best described as an "Expression Tree". The basic idea is that the leaf nodes of the tree ...
8
votes
4answers
3k views

Would scala be a good choice instead of Java?

We will be starting a new project which will involve training all the .net developers in Java (frameworks/ECO system etc). We have a lot of code written in C# and it seems that all of this will be ...
4
votes
2answers
375 views

What has been learned about making variance part of the type?

In Java, the variance of parameterized types is indicated depending on how it's used: <A extends B,B> void store(ArrayList<B> list, A elem) { list.add(elem); } Whereas in Scala it ...
27
votes
3answers
1k views

What are the benefits and disadvantages in the approaches of C#, Java and Scala to Closures/Lambdas/…?

I wonder what the technical implementation differences between C# and Scala are and how both solutions compare to the implementation ideas and concerns voiced in the email Peek Past lambda by Brian ...
0
votes
1answer
553 views

restful web development in scala

I ve been a php developer for the past 4 years and worked in OO PHP and almost all sorts of PHP mvc frameworks. Ive joined a new company now and here we use scala for web development. We have a ...
2
votes
1answer
159 views

What is a domain of automatic testing tools such as ScalaCheck?

I've seen not so many examples of testing with automatic tools, i.e. serializing/deserializing of JSON (which was paired in the following way: val actual = deserialize(serialize(string))), checking ...
26
votes
5answers
11k views

Is Groovy going away? [closed]

I am sure this question has been asked many times. However, I like to ask it again with the intention of what is the future of these languages. I was first introduced to Groovy and really liked it. I ...
4
votes
1answer
399 views

How do I view Scala code without all the syntactic sugar?

I have been studying Scala, but what I keep running into is the optimization of syntax. I'm sure that will be great when I am an expert, but until then.. Not so much. Is there a command or a program ...
6
votes
5answers
688 views

Help me deal with higher level languages [closed]

I'm trying to learn Scala (I have previously glanced at Erlang, Haskell, Ruby and had similar issues). I do enjoy it, but I feel bad about some things it does and I wonder if that's just due to all ...
2
votes
3answers
705 views

difference between passing a value vs passing a function as a parameter in scala

I often hear that scala has a ability to pass function as a parameter to another function. I would like to know the difference between passing a value as a parameter vs passing function itself as the ...
20
votes
4answers
3k views

Is Clojure, Scala and other restrained by the JVM vs CLR

The Java implementors seem slow to adopt language improvements, for example compare C# with full closures, expression trees, LINQ etc.. to Java, and even the push back of some stuff to Java 8 will ...