Scala as long-term replacement for Java
macstrac.blogspot.com
macstrac.blogspot.com
I got out of my funk by attending absolutely ever session on Scala I could find, and it really did lift my spirits (I swear I didn't intend the pun). I've been learning Ruby (and I'll stay on that path for a while), but the Scala talks gave me what I ultimately go to conferences for - the opportunity to get excited about the future again.
I do have some questions about its concurrency abilities though (not rhetorical ones, real ones): I know that Erlang deals really well with concurrency, because of its internal scheduler. It's fairly difficult to completely wedge Erlang, in other words. How does Scala work out from that point of view?
Stealing some of the great ideas of Erlang and re-implementing them in Scala.
http://www.infoq.com/news/2008/06/scala-vs-erlang http://yarivsblog.com/articles/2008/05/18/erlang-vs-scala/
-m
No peculiar opinion about any of them either, btw.
BTW, in terms of noting points, high end phone systems having N nines uptime is definitely a point for Erlang:-)
Did anyone else go wtf?
In particular, GC and a great standard library for C++, and file-based and more performant (yes, yes, hotspot is based on a smalltalk derived vm, blah blah, the numbers still grossly favor java) and a more conventional interaction with the host system over smalltalk. The last is bizarre as java still absurdly sandboxes away the CRT. Oh well. Less of an advancement on Smalltalk, more of a more palatable branch of evolution, maybe.
It seems now at least the JVM, or the best bits of it will spawn other branches.
As for the java language (which is probably what pg was referring to?) - I agree it is probably a dead end. Except in some shallow basic syntactic sense - javascript and so on (the continuation of the "curly braces") - not sure if that means anything though. In any cases, certainly the lessons learned will continue (what worked well, what didn't) into a whole lot of other languages and has been.
"No wacky monkey patching involved, or doubting of who added a method, when and how - which is great for large projects with lots of folks working on the same code over long periods of time."
This may be why he didn't even mention Clojure; too open, not enough B&D for his taste.
Or at least the parts of the world that doesn't bill by the hour/LOC..
Some people just like taking things to extremes and seeing things in completely polarized viewpoints - good vs evil - rather than recognizing that both are great in different circumstances.
It's a lot less tiring (and more productive) to use whatever tool fits the job best, rather than whatever tool is currently in fashion IMHO.
I think it's overloading (punning on static type of the same function, operator, or method name) that makes explicit type declarations more often necessary in Scala than in Haskell or ML.
Assuming you consider something JVM-based an eligible tool for a job, you have a wide variety of programming languages on a common platform to pick from. While it's probably not a good idea to apply them all in a project, it's nice to know that in the future the probability of you being able to reuse code in disparate languages increases.
- immutable types - lambdas and closures - tail recursion optimization - first order functions
... Sounds a lot like an FPL to me!
It's no wonder it's more polished.
* Upgrading code while it's running. In Erlang, this works because all program state is explicitly passed as parameters to a tail-recursive main loop, so there's a clear place where one version of the code can cleanly take over the state from a previous version. This won't work in a language with singletons, and mutable objects that mix code and data.
* Modularizing a program into tens or even thousands of lightweight shared-nothing processes. Erlang can do this efficiently because of key properties of the language and VM. For example, the entire language and all of its libraries use persistent or copy-on-write data structures, so that processes can share memory without sharing mutable state. This won't work in a language that's interoperating with Java libraries, and whose own data structures aren't 100% immutable.
-m
What does this say for Groovy (the language) that one of its co-creators is out advocating Scala?
Despite that (or perhaps because of it) my experience has indicated it's in wider use than either, and it has some enterprise-y backing (SpringSource) so I expect it's not going away.
Both Scala and Clojure are attracting people who weren't originally on the JVM though, which (again anecdotally) I don't think you can say of Groovy.
Caveat: some of these jobs might be talking about how groovy they are. On the first two pages of http://www.indeed.com/q-groovy-jobs.html there were 19 groovy-lang jobs and one false positive.
I don't think there's anything necessarily wrong with Groovy. I don't personally care for it; but as far as I'm concerned the more languages the better when it comes to the JVM.
-m
For example, Ruby goes for the "English" approach. E.g. the "foo.double.addOne" means "take foo, double it, then add one". You can sort of use the parts of your brain that parse natural language to read the code.
Other languages are based on various mathematical construct, such as the more functional languages where a function application is done in the opposite order of natural reading, e.g. in "1 + (2 * foo)" the "1 + " application is actually the last thing you evaluate, though it is the first thing you read. This requires you to store a lot of scope information in your mind as you parse complex expressions.
However, if you have a very strong functional language I believe it can be quite pretty in its own right as you start to think in terms of higher-order operations. For example, point-free function composition frees you from having to read additional and lengthy function declarations with their own variables and scope and lets you simply see that this composition is just a way of applying multiple functions to obtain a higher-order operation.
In short, I think it's largely about how comfortable you are to think with various mathematical abstractions that determine how ugly a language is. Note that it's possible to write ugly code in any language.