Rob Williams is a probabilistic Lean coder of Java and Objective-C. Rob is a DZone MVB and is not an employee of DZone and has posted 170 posts at DZone. You can read more from them at their website. View Full User Profile

A Few Minor Musings on Languages

  • submit to reddit

Cedric had a tweet last week about how Scala is poised to take over the world, just not this year. It was a link to another dude. It is here I bit and found, through his post, that I really did not know that much about Scala. I had heard it was a functional language, which generally makes my brain turn off immediately. People who just could never get their heads around objects are helming the Viking ship back to the frozen land of procedural goo. How exciting. Procedures are out of gas at ~50K LOC and I am quite happy with OO, though, like, um everything, it‘s not perfect.

What the above post made me realize is that Scala is actually a multi-paradigm language. Having been a huge fan of James Coplien's book Advanced C++ I only discovered his book on multi paradigm C++ a few years ago and I really enjoyed it. Multi-paradigm is not a retro reassertion of grumpy nerd stupidity like 'functional' (read: procedural) is. In fact, one of the paradigms that is part of the 'multi' moniker is one of my favorites: agent-based programming. I predict that Agents will end up dominating designs in the coming years. The rise of Hadoop has shown that interop scenarios in the cloud are wide open. For my tastes, Hadoop is too data-oriented. The beautiful part about agents is that they will not fall into this trap, and hence, I think they will offer a better means of achieving reuse in cloud-interop (another post).

Now, having poked my head into the Scala tent, I did see a lot of things I thought were great, e.g. Traits. I will have to look some more though, because what I saw so far seemed to indicate that there were some well-meaning people trying to rectify language wrongs of the past (e.g. multiple inheritance), but that maybe some of the ways of doing so would not be really appealing to me long term. I definitely buy one of the article‘s core arguments though: the community, and happened to have blogged about that not long ago, saying how the C++ community of yore was more serious and engaging than the Java community. I think ultimately, internecine stupidity is high on the list of flesh eating bacterial cultures that threaten Java. Which brings me to my last language musing: I looked a bit at Ceylon and thought I was missing something the whole time. It seemed to me like it had inadequate heft to warrant a new language, and that it‘s chosen targets were all things that could be easily improved in the existing one. The war that broke out between Gavin and the Scala guys was amazing though. Seriously, don‘t these people have anything better to do? Gavin‘s characterization of it as pig wrestling was an insult to swine.

Actually, one final thought: I had my mind blown by the E. T. Jaynes book on Probability a few years ago. To me, the biggest problem with languages today is insufficient accounting for indeterminacy and its role in complexity. Is that too vague? Every language on earth right now requires that each attribute of each thing be known before it might be manipulated. This has served adequately (though painfully) the Age of Simple Simulations, but that age is ending now. What are you working on? A site that stores resumes? one that lets people chat? that shows the price of a stock? borrrrrrrrriinnnnnnng. These are all facile simulations of things that already exist in the world. Applications are going to have to incorporate the abilities to learn and reason. And doing so with fixed attribute mappings, be they db (SQL), static (C-family) or dynamic (Smalltalk et al), is going to require some fundamental rethinking..



Published at DZone with permission of Rob Williams, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)



Bruce Fancher replied on Wed, 2011/06/08 - 5:04pm

Skip Scala and check out Clojure instead.

Liam Knox replied on Thu, 2011/06/09 - 10:00pm in response to: Bruce Fancher

Yeah ok ;-) Clojure that won't happen.

Scala has a small chance though looking at the latest TIOBE language index it really doesn't look positive. At 48! below Go ( Go must only, by any rights, be used by Google employees )

What annoys me is that in all that Scala has to offer they have really missed the basics. Listen to the Java Posse round up on Scala adoption. It is a very sad episode.

If the language designers can't ensure backward compatibility, have mad ideas of cross compilation class loaders, have syntax with infinite ways to express the same thing, can't provide an IDE, what hope do we have?

My bet is Java 8 buys us more time before some other idea starts tackling multi-core and persistence concerns in a better way, though probably still running on the JVM.

Ofer Ron replied on Mon, 2011/06/13 - 2:01pm

It's quite nice that you've decided to bash functional languages,plainly showing that you have no idea what those are, all the while claiming that the guys pushing functional languages just couldn't grasp objects. Somewhat of a pot kettle situation.
But seriously folks, functional languages couldn't be further than procedural languages if they tried, since you're essentially comparing imperative languages to declarative languages. Since procedural languages rely on control structures for program flow, while functional languages rely on small compact composable functions for the same purpose, this is a flawed comparison.
Also, it could be nice if the die hard OOP folks finally admit what the rest of us have been seeing for years. OOP is nice in the lab, but not all real life problems can be reduced to the OOP model, and any codebase large enough will inevitable have hierarchies which in no way resemble their original purpose, since no one could possibly forsee all possible uses of the code 3 years down the road. We could ignore all that, and pretend that we have no classes throwing unsupported operation exceptions, or we can admit that OOP is not perfect. There's a reason why "Favor composition, not inheritance" is so prevalent this days, and it's not because everyone "can't get" OOP, but because inheritance is extremely fragile the minute it escapes the package scope, and that the expression problem, for example, has almost no good OOP solutions (have fun writing a message handling system for messages generated by an external library, without resulting to a chain checking "instance of" or some sort of map from classes to handlers, which is not really OOP).
Now, FP is far from perfect also, but what Scala does quite nicely is blend OOP and FP concepts, and where i can write quite traditional and powerful OOP code, but where I can also use type classes and pattern matching, together with implicit parameters, to solve impedance mismatches between old legacy code, and external libraries, while writing easily maintainable code. Have fun doing that in traditional OOP languages.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.