54 points · by twelsonrossman · 14y ago · 80 comments
However, as much as it may surprise, most developers of this world, as much as they would like to work in a startup, work in a gray, corporate enterprise, write Java, Spring and Hibernate, or .NET, and have no clue about anything beyond that.
Scala does a wonderful thing, it allows enterprise developers to taste some of the goodies of Ruby / Python but stay in static Java land. which is great news for everyone.
There are many Enterprise developers who are amazing developers and architects, and can benefit any startup, the more they get close to newer "trends" the more likely the connection will happen.
Young startups will benefit, 40+ enterprise Java architects will benefit, and perhaps the talent wars will have a cease fire.
I'm pushing everyone I know to take a look at Scala, it's here to stay, and if you take a look at play framework, it's looking even more like the next big thing.
It all comes down to the community, if the ruby / rails community will be scala / play friendly, and endorse it as a "ok it's Java but we hate it less", it will help it take off.
As an enterprise developer, I really need something like scala / play to take off, as I won't be able to get ruby on rails / django in the same way I could get play / lift. as much as I think they are great frameworks, it's hard to sell to the enterprise crowd.
I don't understand what you've said here. The two terms are entirely orthogonal. There are functional langauges which are dynamically "typed", and there are functional languages which are statically typed. Lumping the two terms together is misleading and useless.
Static typing (done correctly) is just straight up better than dynamic typing. End sentence. I cannot count the number of times I have had errors at runtime working in python that simply would not have existed at all if I was using a statically typed language. With a sufficiently expressive type system, the types do not get in the way, but you still get compile-time enforced correct static semantics.
At some point I just got tired of seeing the same types of errors and wanted my tools to work a lot better. Python / PHP / Ruby aren't improved by lacking static types. How hard would it be to add static types into PHP, Ruby, or Python?
http://stackoverflow.com/questions/1365333/will-php-become-a...
A good static typed language that the only difference between it and Ruby / Python is the type system, has a good chance in being accepted by a larger audience of developers, both enterprise and startups.
People prefer dynamic as they don't like to compile, and it provides rapid code / refresh cycles, I don't think anyone would say no to less bugs and better refactoring, and to self explanatory APIs using content assist.
Scala is a great statically typed functional, object oriented language, which allows most people to enjoy both worlds.
(If the code does typecheck, then I have guaranteed a lot of static properties of my code, but it may still be incorrect in terms of dynamic semantics.)
I spent some time deciding if your first sentence was a parody (Look at us new vim mac users with functional languages and git and startups).
Very sorry that I am a C++ programmer, working in visual studio, as opposed to writing the latest to-do app in scala using vim.
No parody was intended, I have all respect to all developers where ever they are and what ever IDE / non-IDE they chose to work with.
I use IntelliJ IDEA with the Scala plugin and you get code-complete and type aware tooling.
In fact every developer I know that writes production Scala code uses an IDE.
I have fuckall of a clue what an IDE has to do with Scala except for some sort of lifestyle statement.
rpearl already made a similar objection, but I think you're confusing things a bit here. How much of Scala is influenced by Ruby and Python? Aren't the main goodies in Scala related to the type system?
Programmers using those "mainstream" dynamically typed languages don't have terribly much to be smug about, sure they're less verbose than Java, but I'd suggest they should also invest in learning a functional language or two, like Scala.
Groovy does the same thing with less friction and switching overhead.
Groovy is great to Websites and fast development they remove the code complexity and verbosity of java using type inference, some functional goodies like closures and add DSL capabilities,I use it everyday and it's a very nice tool.
Scala is another kind of tool, it also does type inference and add functional goodies and support DSL BUT it have a deep love to parallelism (actors and non mutable objects as an example) and is way closer to the functional paradigm than Groovy, but it's more complex.
So you gotta choose wisely so you don't end up with the hammer to a screw kind of problem.
My view:
Groovy is for fast development and WEB stuff mainly because of Grails which is an awesome tool as well.
Scala is more a backend tool when you need Horse Power, but that's because the lang is more complex, I don't like Play and Lift is not as easy to understand as Grails.
Again no Flamewars please.
"it (scala) allows enterprise developers to taste some of the goodies of Ruby / Python"
Groovy fits that bill far better than Scala if you're primarily looking for a taste, without having to adopt the complexity of a new worldview.
I believe Groovy also supports actor concurrency via gPars. That said, I still haven't seen anything like Akka on any other language, specifically its distributed processing p2p feature. To me Akka is Scala's 'killer app'. I agree I don't like the new Play framework. I didn't mind the magic being taken away but with taking the magic out, they also killed any form of convenience without providing a replacement.
He made the scala statement in 2009. He's certainly entitled to his opinion. But I find the title "Author" or "Creator" a little harsh to people like Guillaume Laforge and others who have really brought the project from beta to 2.0 in the 7 years since he quit.
Are you the same M.Kimsal who sells subscriptions to "groovymag" ?
Here is the actual paper: http://www.rz.uni-karlsruhe.de/~kb95/papers/pankratius-Scala...
Quote from the conclusion: With respect to effort, this study refutes the claim that Scala programs are faster to develop: in comparison to Java, Scala requires more effort, and especially more testing and debugging effort.
I guess everyone has encountered the C++ is 'C with better strings and arrays'-type of programmer who doesn't use RAII or the STL. Or the template-fanatic programmer that wants to drag in template meta-programming into every corner of the project. Or the STL fanatic that wants to replace every for-loop by a function in std::algorithm, even if there is no appropriate fit or it requires building a bunch of stateful function objects (thank god we have closures now). Etc.
If projects do not impose serious restrictions, such a broad language will quickly become an incomprehensible mess.
Being a recovering C++ fanatic myself, I believe more in smaller languages try to solve a particular problem now. For instance, take Prolog, it's a beautiful language for what it is aimed at: logic programming. All the weird object-oriented Prolog experiments have died out by now, and it's a language that you use when you want to solve a particular kind of problem.
There are also languages that do Hindley–Milner type inference (ML, Haskell) with good compile times.
1. Examples using outdated low level concurrency primitives such as wait and notify. Use of java.util.concurrent would have made the code much more terse and safe
2. Java performance affected by use of the outdated java.util.Stack class. It is well known that this class uses redundant synchronization. The docs recommend using a Deque implementation instead.
Even so, I run into the infuriating aspects of Java from time to time, and that's when Scala comes in. I see it to Java as Coffeescript is to Javascript.
Better: Why Language Developers Should Stop Making Languages on Top of the JVM.
Imagine if Ruby or Python were only available on top of the JVM... There may be a need for versions of a language that live in the JVM, but don't make the entire ecosystem dependent on it.
Some wikipedia: "JRuby supports interpreted mode, AOT mode, and JIT mode (the last two modes are available since version 1.1[19]). JRuby evolved from being several times slower than Ruby Reference implementation[32], to being several times faster.[33] [34]."
I learned a bit of Scala and I think it's a awesome lang, if you have time to learn it properly otherwise it might to pull your blanket, because it's a little trick at some things.
I would definetly like to work with it, in fact I plan use it in my next side project together with Backbone.js
The JVM is very fast and ubiquitous. Targeting the JVM allows the language developers to focus on the language rather than re-inventing a runtime (which is a monster project)
Which is part of why it's so mature despite being so young. Open-source languages that don't target a managed environment have historically needed a lot longer to marinate than Scala did.
Marination is generally a good thing. Things come out tastier. Same for new languages. The robust Python / Ruby / PHP ecosystems seem to be working just fine without the JVM.
Me too. After all, Scala's engineers weren't looking to create a whole new platform; they were just looking to create a new language. And a good engineer won't waste enormous amounts of time working on out-of-scope tangents unless there's a good reason to do so.
NIH doesn't count as a good reason.
the JVM is still here to stay, and many Ruby web apps move to JRuby when they need to scale, and this is a fact.
If we want to close the gap between enterprise and startups, Scala is a great way to go. and I'm sure it will have non JVM versions in the future, if not already.
My language of choice at the moment, I like Ruby and Python, but I like a static typed language, I got used to it.
If enough people care about Scala they'll make it work independently of the JVM. JVM-based Scala is perhaps a good way to bootstrap the language, but I don't see how it's a great long-term strategy.
Scala is not truly functional - like Java, it is object-oriented. It just so happens that, once you step outside the Java bastardization of that term and think about a more 'pure' OO, the result is fairly functional-looking. OO and FP aren't really competing paradigms; rather, OO is a more complex paradigm that can be constructed from a functional system. (The inverse is technically true too, but much uglier in practice).
(To give an example of what I mean, Scala supports first-class objects, and functions/methods are included in that statement. Scala does not support first-class, module-level functions (outside an object). That's not functional programming; it's object-oriented! But if you design your OO system well, you get something similar. Java does this badly, because methods aren't first-class objects - and unlike C, you can't really use pointers/references to fake the same behavior, so you get the worst of both worlds).
Of course, Scala has to deal with limitations of the JVM - that's their compromise to gain binary inter-compatibility - but the designs of the two languages are a night-and-day comparison.
Agreed - that's my whole point. It's better to think of object-oriented programming as a construction within FP. Of course, some (badly-designed) OO languages like Java sandbox you and restrict your access to some of the more powerful, higher-order concepts, which is why they seem to be 'in conflict', when in reality, one is just a more abstractly implemented, whereas the other's more specifically implemented.
> Scala is a perfect example of a language which is both.
No, it's not - for example, functions have to exist within an instantiation of a class (a singleton object counts). By providing true first-class objects (unlike Java), you get many of the same benefits as first-class functions, but it's fundamentally not the same thing.
Really, an easy way to create a language which supports both is to start with a very basic language with true first-class functions and closures (like Lisp) and then define a few closures that encapsulate state (objects), and then add a couple of basic macros that turn generic functions into bound methods (ie, automatically provide the implicit parameter instead of calling it explicitly).
...which is why I agree that they're not in conflict - a well-designed OO system can be easily implemented within a well-designed functional system!
(The reverse doesn't work so well because you can easily add an implicit parameter to generic functions, but you can't completely remove an implicit parameter from a bound method, even if you pretend it doesn't exist - ie, treat all methods as static methods).
Sure it does.
object f {
def apply(x: String) = s + " - foo"
}
Elsewhere: val t = f("bar")EDIT: Okay, I see the confusion. That seems like a 'top-level' function in the sense that it's not acting on any parameter that's not explicitly passed to it, but it is still bound to the singleton object 'f'. That would be analogous to the following Python code:
class F(object): def __init__(self): pass
def x(self, s):
return s + 'hi'
>> Foo().x('hey')
'heyhi'Just because you ignore the implicit parameter doesn't mean it doesn't exist. Scala handles the implicit parameter differently, but the function still very much needs to exist inside the namespace of another object.
http://www.infoworld.com/d/application-development/scala-the-android-programming-language-you-didnt-know-you-had-170999
...I didn't realise you could use Scala with Android's Dalvik.Admittedly, that's an article from 2011, and it's probably on hacker news somewhere already, but still...
This is why I tell folks to avoid Scala and pick one of two other great options which offer a fundamental change from Java:
* Groovy (dynamic lang, easy to pick up _and_ master) * Clojure (the power of LISP, steeper learning curve)
There's a bunch of stuff out there which explain why NOT Scala, so I won't regurgitate it here.
http://www.amazon.com/Scala-Depth-Joshua-Suereth-D/dp/193518...