Registered: Feb, 2003
Re: Java: Evolutionary Dead End
Posted: Jan 7, 2008 1:31 PM
> <p>Fundamental new features should be expressed in new
> languages, carefully designed as part of the ecosystem of
> a language, rather than being inserted as an afterthought.
> On my radar, the current best exit strategy for Java is
> Scala. I have even heard some fairly leading-edge
> programmers say that at this point they didn't care what
> happens to Java because they were just going to move on to
I have tried Scala, and I think the language has some problems of its own:
1. No metaprogramming facilities. This comes from ML, I suppose. But Ruby has it and many "old school" elegant languages have it (Lisp, Prolog). It is possible to be elegant (in fact I would contend that in many settings it is a requirement) with metaprogramming.
2. There seems to be some difference in the semantics between compiled and interpreted. I only compiled, but the interpreter could add new variables to its local scope (as it really needs it) but the compiler couldn't. While one might argue that that is excessive flexibility coming from the scripting languages camp, but I actually had to, on a compiled program, to create new classes which would include traits that would be dependent of need of the user, and this cannot be done. If one has many traits, it has to compile a priori all the trait mixins desired, they cannot be defined at run-time in a compiled environment (contrast this to JRuby or even JPython). This is actually metaprogramming lacking part 2.
3. Type inference: Scala type inference might seem clever, but, compared to CAML it is not. Sometimes the compiler is not able to infer the types and the user has to explicitly declare them. CAML was always capable (at least in my cases) of complete type inference.
4. Information sources are scarce. The mailing list is reasonable, but sometimes questions get unanswered and there is no other source (other than inspecting the source code). This will sort out if there are more people using it - and more books like the Artima ebook.
I think JRuby is actually a contender (JPython is not because it is too much behind CPython in implementation). I would prefer to have strong typing (and type inference is sweet), but, all in all, I am leaning towards JRuby. Decent metaprogramming in a compiled setting would be my main requirement, but in the current Scala status, one can only have it though the typical Java way: execute the compiler, link a jar, not elegant...