News for hackers. Stuff that matters.
Re:Another Scala rant on HN by pron on Tuesday December 03, 2013 @10:56AM (#6840993)
I agree with most of what you say, and obviously, some people really like Scala, and not only as "a better Java". But I think there is still an objective measure here, which is bang for the buck. Scala does let you choose different styles, but while you pay in complexity for that choice (which some people like), you don't get the same benefit as you would in an ensemble of languages. Scala really is heavier than JavaScript, and Scala doesn't really give you most of Haskell's benefits (no true type safety because of casts, no control over side effects, and easy mutability). So you pay full price for "good" ADTs, but get just a taste of their benefits. Same goes for duck typing and macros.

So you do get choice, but it's more of a choice between a Paris-style and a New York-style Las Vegas hotels rather than between Paris and New York. Scala is Las Vegas, only it runs on the JVM which offers cheap supersonic flights between Paris and New York.

Also, the kind of team you describe can't really be a big one. I might see it working for 15 people; maybe 20 if they're really good. But 50 and up? I don't think it's going to work.

Re:Another Scala rant on HN by shadowfiend on Tuesday December 03, 2013 @11:14AM (#6841120)
All I can say is that I think you're completely mistaken.

I can count on one hand the number of times I've had to do casting in Scala over the course of writing four different web applications of various sizes in it. Fine-grained control over side effects is only a benefit if you consider it a benefit, and is IMO far from the greatest benefit you can get from a strong, flexible type system. Easy mutability has little to do with type safety—indeed, type safety makes mutability marginally safer by at least holding you to a basic promise when you make mutations. I can't deny Scala is heavier than JavaScript, I suppose, for some definition of heavier that I assume means “has more features”, or means something that ends up equating to same.

To argue that writing software in both Clojure and Java (or pick 2+ other languages that all run on the JVM, of course) will leave you with an objectively lower complexity:benefit ratio than using a single language is a dubious claim indeed. I don't guarantee that just using Scala will always result in a lower such ratio, but you'd have to make a much better quantitative argument to convince me that you can have a lower ratio consistently by using different languages instead.

To deal in increasingly-divergent analogies one more time: if your work is in Las Vegas, you may not care that there are cheap supersonic flights to other cities. They will never compare to being able to do all of your work in Las Vegas, even if it means switching hotels depending on your needs on a given day.

Re:Another Scala rant on HN by pron on Tuesday December 03, 2013 @11:36AM (#6841286)
Using two languages will give you a much better cost/benefit ratio, and here's why. In a team of 20 people, 18 will program in simple language A, while 2 will program in simple language B. The ones programming A know it well; those programming B know it well, and usually they would also know A well, as they would probably be your star programmers. The JVM makes integrating the two quite easy. You wouldn't need to discipline those 18 programmers to limit themselves to some subset of Scala, and they wouldn't be dumbfounded by its linked-list.

I've worked on projects that used C++, Ada and FORTRAN; on projects that used Java, C, and some homegrown DSL; on projects that used C++ and Scheme. In all circumstances, the integration of languages proved simpler than "disciplining" the C++ programmers, and on the JVM that integration is a lot simpler than what we had to put up with back then.

Also, bear in mind that team members change, as do team leaders. That proved to be a big problem for C++ projects as the discipline changed over the lifetime of the project.

Re:Another Scala rant on HN by pkolaczk on Tuesday December 03, 2013 @04:30PM (#6843334)
First, Scala is not C++. Second, you need good discipline in those simple languages, as well. I've seen too much terrible Java code to believe Java simplicity saves you from being disciplined.
Re:Another Scala rant on HN by platz on Tuesday December 03, 2013 @12:07PM (#6841546)
yeah, the polyglot approach is total in it's coverage, but I haven't experienced how polyglotism works on a team or set of teams.

If you look at Odersky's presentation "The Trouble with Types" [1] at Strage Loop 2013, he describes Scala as a "type it to the max language" like haskell, ocaml or F#. He seems to be aware of the complexity problem and proposes a few ways to reduce some of the type complexity.

[1] http://www.infoq.com/presentations/data-types-issues

Re:Another Scala rant on HN by pron on Tuesday December 03, 2013 @12:15PM (#6841604)
Yes, I have watched that talk, and Martin Odersky is clearly aware of Scala's problems. If he were to come up with a new language, I would certainly give it a try, but I think it's too late for Scala.

BTW, to reiterate some of what's been said in other comments, I am certainly not opposed to using Scala in "Ruby style" projects (though Clojure would be a better option for those, too, IMO); I do, however, think that it's a very bad alternative for large Java projects.

Re:Another Scala rant on HN by virtualwhys on Tuesday December 03, 2013 @01:15PM (#6842005)
He is actually exploring the development of a new language; see the DOT (Dependent Object Types) paper: http://www.cs.uwm.edu/~boyland/fool2012/papers/fool2012_subm...

It will be based on Scala, and similar enough that, if things work out, we could have Scala.next without a Python 2 to 3 glacial transition.

Of course, Scala 2.1.x branch is making great strides as is, and AFAIK, the DOT language is still a research project, so not likely that we'll be seeing Scala.next anytime soon.

Re:Another Scala rant on HN by trailfox on Tuesday December 03, 2013 @12:36PM (#6841764)
In our experience Scala has been a superb alternative for large Java projects. Practical experience vs. your opinion/speculation?
Re:Another Scala rant on HN by pron on Tuesday December 03, 2013 @12:51PM (#6841847)
Call it educated speculation based on years of experience with similar decisions.

How big is the team? How many years of maintenance have you had on those projects? I remember C++ looked pretty awesome for a while. It was certainly great for one-man projects or small team. Then the problems started piling up. Thing is, C++ didn't have any good alternatives (maybe now we'll have Rust); Scala does.

Re:Another Scala rant on HN by pkolaczk on Wednesday December 04, 2013 @04:01AM (#6845800)
Scala is not C++. Scala has much better features to keep complex pieces of code separated from the simple pieces. Also C++ design philosophy was totally different from that of Scala's - C++ values performance over everything else, while Scala's top priorities are correctness and type-safety.
Re:Another Scala rant on HN by laureny on Thursday December 05, 2013 @12:43AM (#6852887)
> Scala is not C++.

That was not the point. The comparison is that Scala is to Java what C++ is to C.

Powerful and flexible but with a lot of baggage that ends up making it impractical.

Re:Another Scala rant on HN by pkolaczk on Thursday December 05, 2013 @05:42AM (#6853690)
Nope. C++ is almost a superset of C (there are a few minor differences, but most C programs are correct C++ programs). Even the most basic Scala program is not a valid Java program. They are just two different languages targetting the same platform.

If making analogies, a much closer analogy would be to say Scala is to Java what D or Rust is to C++.

As of lots of baggage - can you elaborate? Only null comes to my mind and it is never an issue - it was left because Scala is practical. Sure, there are some limitations imposed by the target platform like lack of TCO, lack of efficient suport for tuples/value-types, or RTTI for generics being not powerful enough, but Java-the-language has nothing to do with it. The same limitations apply to Kotlin and Ceylon.

Re:Another Scala rant on HN by trailfox on Thursday December 05, 2013 @02:59AM (#6853176)
> The comparison is that Scala is to Java what C++ is to C.

Which is pure opinion/speculation.

Re:Another Scala rant on HN by trailfox on Wednesday December 04, 2013 @06:10AM (#6846182)
I think you're confusing Scala and C++.