Jason Sando

Sunday, February 10, 2008

Java 7 Language Enhancements

There's a lot of discussion about closures in Java 7, and there are quite a few well-thought objections to them as well (see http://weblogs.java.net/blog/kirillcool/archive/2008/02/evolving_the_la.html).

I think Ruby, Groovy, Python, and Scala have a lot of the new and interesting features already, and I'd like to see the IDE's catch up with support for these languages, rather than start to drain resources implementing "me too" features in Java.

And while I'm on the subject of alternate languages ... the above list all target the JVM, and some other environments as well:
  • Ruby has JRuby, MRI (Native) Ruby, and now IronRuby (.net DLR)
  • Python has Jython and the native python
  • Scala and Groovy are both JVM-only. Groovy (and probably Scala) can apparently be run on the .Net CLR using ikvm.
I've read books, looked at lots of code, and tried my hand at writing code in the above languages, and here's my take:
  • Ruby has a nice syntax and some outstanding frameworks (like Rails), and the JRuby implementation is terrific! However it may be a little alien to Java/C# developers. I think it should be learned however as an alternate, scripting language that can now be used on almost any platform.
  • Python is easy to learn and has terrific libraries. However, the syntax again will be a little strange to someone coming from a C-style language. It has heavy reliance on native libraries making it harder to port and run under jython, which is lagging behind the main native interpreter. If you're going to learn one other language besides Java/C#, I would make it Ruby at this point. But if you use software written in Python (mailman, trac), it is well worth the learning investment.
  • Scala ... has great features on paper. I get so excited reading all the articles about them all. But then I look at the code and ... I'm not really sure what I'm looking at. It is VERY foreign for C-style afficionados.
  • Groovy gets you many of the features of all of these languages, with a C-style syntax ... so very usable for that crowd (and me). Plus it features almost total compatibility with Java, so you can copy/paste Java code and then line-by-line 'upgrade' to less verbose Groovy code. Also it is designed for the Java platform (as is Scala), so leverages the vast Java runtime API's in a natural way (versus ruby and python that are ... 'bolted on' to the jvm).
I'm very surprised by Groovy, as I had written it off as a toy over a year ago. The binary packaging is very good.

I would rather see effort invested in the Groovy parser, and Groovy's code generation (and maybe even a new name for it :) than the same features be forced into Java 7.


Friday, February 01, 2008

Making WSDL more ... relaxing.

I have a new proof-of-concept project over at google-code to try to take the grunt work out of creating standards-compliant WSDL. The project is at http://code.google.com/p/relax-ws/

I started with RelaxNG Compact schema, as I feel it is important to use the XSD type library for maximum compatability (rather than making a DSL in some other language). The remaining syntax came out of a desire to have a consistent syntax.

It is a proof of concept, but we've already been using it at work to begin new WSDL's for some of our .Net development (therefore I know it works with wsdl.exe). To me, success is measured by when I don't use the tool for a week, and can then launch a text editor and just start typing. There's no way I could ever do that with WSDL!

Let me know what you think!