Hello,
I have a question. I hope you might be able to help me out. The question
can be broadly phrased, "what can be done about the JVM situation?", but
what do I mean by this?
I have some strong opinions that influence any potential answer I might
have. Maybe you don't quite agree and so it changes the question up a
bit, but here they are anyway:
On Scala:
1) Scala is the best available programming language for the JVM.
2) Scala does not do Java (legacy library) inter-operability very well.
3) Scala is not a well-designed language, but is at least better than
other not-so-well-designed JVM languages.
4) Scala is unlikely to be influenced into adhering to better language
design principles. That is, the poor design is likely to continue into
the future.
5) The Scala compiler cannot be worked on easily. Specifically, if
language improvements were to come into consideration, it would be
difficult to implement them with the current compiler.
On "the JVM situation":
5) The so-called library support offered by the JVM is often over-stated
in its utility.
6) The JVM is a platform that is best avoided if possible e.g. a new
project without any commitment would be best served by avoiding the JVM
due to all of its penalties and almost zero benefits.
There exist projects that cannot avoid using the JVM. This situation is
what I will call the JVM situation.
It has been argued to me that the extent to which the JVM cannot be
avoided is often over-stated. That is to say, a project participant may
claim, "but I cannot avoid the JVM!" to which an appropriate response to
such a hasty remark is, "bullshit, think harder." I do not hold a strong
position on this argument and I would like others' opinions on whether
it has merit.
Supposing that the argument fails, we are left with a not-so-rare
situation of having to use the JVM. However, Scala is not very well
designed. What to do about this? Assuming you had a lot of time to
address this problem, I see a number of possibilities:
a) Construct a JVM language that is well-designed with good legacy
library interoperability.
b) Construct a Scala-compliant compiler with extensions to accommodate
language improvements and optimisations. This would also address the
speed issue with scalac as a consequence. It would also offer better
external tool support that integrates into the compiler.
c) Concede the aforementioned argument. You are not bound to the JVM as
much as you formerly claimed. Use a language like Haskell or O'Caml and
reap the benefits.
d) Concede that you are simply doing the best you can with available
tools. Use Scala -- at least you're doing better than the guy down the
road using Java or "Scala as if it were Java."
There are possibly others options I have not thought of. Each of these
has some amount of required effort ranging from nothing to "lots." This
is important to providing an answer. In other words, which response to
the JVM situation would you consider is the best use of effort?
Thank you for any insights you might have.
--
Tony Morris
http://tmorris.net/