Sunday, May 31, 2009

Scala really is a "better Java"

I have been so busy this year that I have slacked off on fully getting up to speed on Scala (and Haskell, for that mater). A few people have been working on a Sinatra clone in Scala. (Sinatra is a very nice minimalist Ruby web framework that I like a lot.) I grabbed a version of the Step project off the web today and I just had some time to play with it.

You could not really write something like Step in Java without writing an interpreter. With Scala, you can add syntactic sugar similarly to Ruby. Step nicely emulates parts of Sinatra; here is a code block wrapped to handle an HTTP GET request mapped to the route "/form":
  get("/form") {"Step: Form Post Example",
<form action='/post' method='POST'>
Your name: <input name='name' type='text'/>
<input type='submit'/>
<pre>Route: /form</pre>)
With Scala's ability to define operators and deal with code blocks, and native XML support, Step was defined in less than 100 lines of Scala code. Very nice.

Friday, May 29, 2009

Google's Wave platform

Yes, I should have gone to the Google I/O conference: I would have a sandbox Wave developers account right now. Oh well. It almost gives me a headache thinking about the server resources that will be required to support a world wide deployment and large scale adoption of applications built on Wave, end users of the basic Wave platform, etc. That said, I don't have to worry about how Google implements AppEngine, Wave, etc., and the details of how Amazon implements AWS. That is the point:

Cloud resources place an abstraction barrier between developers and deployment concerns.

As someone who actually enjoys dealing with server deployment issues, this is still a very good thing. Anything that lowers cost and makes development faster is a good thing, even when we have to leave doing some fun work behind us.

I like that there are already two other companies besides Google that are implementing Wave protocols and services (I want access to that Emacs Wave client :-) Open source implementations and multiple service vendors make the platform a safer technology choice. I liked the bit in the demo video on privacy and security (related: see Amazon's white paper on dealing with HIPAA privacy laws in EC2 hosted systems).

I'll obviously wait until I get a Wave developer's account and spend a 100 hours (or so) to kick the tires (some good documentation is already becoming available), but I might decide to write a short book on the Wave platform. I usually just write about things that I already use in my work, but since using resources like Amazon EC2, AppEngine, and Wave will be so important to my work and businesses in the future, time spent on Wave should be a good investment. BTW, I am working on a DevX article right now on the Google Java AppEngine. My APress book Scripting Intelligence: Web 3.0 Information, Gathering and Processing (should be in print in about 4 weeks) has some material on Amazon's EC2, S3, and Elastic MapReduce.

Saturday, May 16, 2009

Google's (eventual) support for RDFa

I am glad to see this because it will encourage more web developers to add semantic markup. The last appendix in my new book (APress: "Intelligent Scripting for Web 3.0) briefly covers RDFa. In principle I prefer publishing separate RDF feeds but with support in Drupal for RDFa (and, I hope, other CMS systems like Plone) RDFa may become commonly used - a good thing if it happens.

Sunday, May 03, 2009

My Ubuntu/OS X MacBook

I continue to be happy with my decision to set up a "work only" Ubuntu Linux partition on my MacBook. I have been using Linux since I downloaded a mini-Slackware distro in 1992 over a 2400 baud modem. Desktop Linux has come a long way! I did a few things to make my working environment nicer:
  • Set the CAPS LOCK key to another control key
  • Installed Google Desktop and set the instant search popup hot keys to "Hyper space" (command space, same as popup search on OS X)
  • Set up IntelliJ/RubyMine/Eclipse for Ruby, Java, Scala, and App Engine development
I did not even install the developer tools on my new OS X partition. I am just using OS X for video editing, photos, and video conferencing with my family.

Friday, May 01, 2009

I just switched my MacBook over to Ubuntu

I made three image backups of the hard disk on my MacBook (yeah, I am careful like that) and just used BootCamp to set up a small OS X partition and an Ubuntu 9.04 partition. This worked for me, but I make no guarantees for you (<grin>):
  • Boot with OS X install DVD, wipe the disk, and installed to the entire disk
  • Without doing anything else, I ran BootCamp and grabbed about half the disk for "Windows"
  • I inserted a Ubuntu install CDR, and chose "advanced" partitioning. I deleted the fat partition on /dev/sd3 and made it a bootable ext3 partition with "/" as the mount point
  • When I boot my Mac, I hold down the option key to switch between OS X and "Windows" (ha!).
  • This is really non-optimal, but I had a false start: the first time I ran the Ubuntu installer, it recognized OS X and offered an express install. Anyway, I ended up with a small 2 gig partition /dev/sda4 that BootCamp boots the first Ubuntu install. I simply edited the /boot/grub/menu.lst file to set /dev/sd3 as the boot disk.
  • Now I can "option key choose my OS
  • Now that both operating systems work fine, I took the time to install all security updates for both operating systems
I would have liked to go through these steps again, leaving out the first false-step Ubuntu install, but I need to install my dev tools on Ubuntu and get back to work.