Monday, August 09, 2004

Why Java sucks.

Ok, so this could just have easily titled 'Why [C/C++/Ada/...] sucks', but I use Java more than either of these atm, so I went with Java. Back on lambda the 'Why types are interesting' thread continues unabated. However this post by Paul Snively grabbed my attention. It is definately worth reading in its entirety, but two paragraphs in particular stand out.

[Alan] Kay takes a hard opposite perspective to mine on the static typing vs. late binding question, saying, in summary (not a direct quote), "What to do until software engineering is invented... do late binding, which means being able to make the changes easily." Actually, perhaps it's not really opposite, since he could be interpreted to mean "either do software engineering if you can or make the cost of changes as low as possible, which is best done at the current state of the art with late binding." That is, get out of these tools that do neither software engineering nor dynamic change well (C, C++, Java...) and either head for software engineering (SML, O'Caml, Haskell, Concurrent Clean, Epigram, Alice...) or head for late binding (Common Lisp, Scheme, Smalltalk, Oz...). Formulated that way, I can't help but agree with him, and merely choose to focus on heading towards software engineering after spending decades in late binding.
At the end of the day, I want modern type theoretic ideas in my programming language so that, at compile time, I can:
  • Know that my code is deadlock-free.
  • Know that my code is race-condition free
  • Know that my code doesn't leak authority.
  • Know that my code is upgradable without violating encapsulation or leaking authority.
  • Will parallelize across multiple processors automagically when possible and serialize when it's not.
  • Will not throw an exception that will not be caught and handled.
  • Will have inferred all memory allocation and deallocation and do it automagically for me, letting me know if the dynamic characteristics of my code require the linking of a garbage collector.
  • Will let me know if I attempt to take the tail of an empty list. :-)
In case anyone dosn't realise, all the above points are already possible, although AFAIK not yet demonstrated possible at the same time.

No comments: