Do as I say, not as I do. Trev's Blog

Monday Jun 09, 2008

"Many sites, one API", says Google.  For those that don't know, OpenSocial is an exciting new set of APIs for social software applications. It aims to provide a unified mechanism for accessing core data and functions on any networking site that implements the OpenSocial SPI, which will hopefully soon be the universal standard.  This is revolutionary because now instead of having to write five different versions of the same app, social network developers can just focus on making one high-quality, cross-platform app.  The project is an open-source, Google-born collaboration that is based on XML, Javascript, and the powerful Google Data APIs.  OpenSocial apps can also leverage much of the Google Gadgets infrastructure. 

This is a gift from heaven for vendors such as iLike, giving access to much broader network of potential users.  Many social network giants such as hi5, MySpace, and LinkedIn have already implemented the OpenSocial standards, and many others are in the process.  You will not see Facebook on the list however.  They have taken the Microsoft approach with their Facebook Platform, defining and supporting only their own proprietary API. 

As the browser and desktop grow closer together, people begin to speculate about the race to a "web operating system", a common virtual desktop that would be the crown of distributed network computing.  While there are products out there that literally emulate a desktop, Google is the undeniable leader and innovator in this space (that is, redefining the relationship between the desktop and the browser); they've closed the gap considerably with tools like Google Gears, Google Apps, GWT, and now, OpenSocial

Sun is well aware of the world's social media trends, and as Jonathan notes in his blog, nearly half the world's population resides in the developing countries of Brazil, Russia, India, China, and Africa (BRICA).  These are the economies most embracing of open source software and standards, and represent a fast-growing sector for technology firms.  From the business model perspective, these are the next several million people that social networks and content developers will try to reach.  Look for OpenSocial to be the foundation for much of that movement.

Sunday Apr 13, 2008

It's been a year already since Sun first announced JavaFX, the new rich interface scripting language that would be built into the Java runtime.  Now, finally, we are on the brink of a first release; the latest speculation is that a stable developer preview will be out in May and then v1.0 shortly thereafter.  It's good timing, considering Silverlight and Flex are trying to compete in this ripe market as well.  But I'd argue that Sun is wise to take its time and do it right. 

Remember my previous post about building a flight planner application with GWT?  Well, unfortunately back in the design phase we changed our minds and decided to go with Silverlight.  What a painful mistake!  We should have known that in Microsoft's hasty attempt to ride the coattails of Flash, time to market would win over completeness of implementation.  Even in what they call the 2.0 release, basic functionality is missing... how the heck is there no combobox control in an RIA framework???

Anyway, Flex is promising, but not yet up to par in terms of speed.  One of the JavaFX architects comments on this in his blog, about how it's complicated to benchmark performance between rich web user interfaces.  He notes that they use this site called Bubblemark, which contains implementations of a simple animation program in several different technologies, including basic DHTML, Silverlight (Javascript and CLR versions), Flex, Java (Swing and JavaFX versions), as well as others.  The findings are amazing: both the JavaFX and Swing versions run 3 to 4 times faster (in fps) than Flex.  He also points out that the graphics layer in JavaFX is built on what is still an un-optimized library. "...we are focusing on bug fixes and correctness right now, not optimization, so it's not as fast as it could be."  Awesome.  They haven't even tried to optimize yet, and still it's faster.  We'll see who wins this battle in the end.

Tuesday Mar 04, 2008

Another interesting article about how web developers have "never had it so good", thanks to Sun and MySQL joining forces.  Check it out.

 

..."Sun Microsystems has hired high-profile Python programmers Ted Leung and Frank Wierzbicki, stepping up its bet on open source and scripting languages."  Full story here.

Another strategic move from Sun, right on the heels of the exciting MySQL acquisition; they have really taken this open source movement to the next level.  Netbeans is already "the only IDE you need", but soon there will be support for Python, among other dynamic languages.  And this support will no doubt make its way into the JVM as well.  Someday it will be the only VM you need.
 

Thursday Feb 28, 2008

We got word today that the Texas Advanced Computing Center has officially unveiled "Ranger", the world's largest general-purpose supercomputer.

"Ranger is funded by the U.S. Government's National Science Foundation (NSF) as part of a multi-track effort to improve the computing capability available to scientists. Developed by Sun in conjunction with TACC, it is the most powerful computing cluster used for open science research in the world -- capable of an astonishing 504 trillion floating point operations per second."  Sweeeet.

As I was reading about this, one thing that I noticed is that Ranger is based on the Lustre File System.  All I really have to say is, who comes up with this stuff?  Well okay, Lustre came up with it, but really...  a node/object-based cluster system with capacity for billions of files with such astonishing reliability... HPC has come so far.  The scalability potential here is crazy; I just need a personal server so I can play with stuff like this.

Note that there are already 500+ projects at work on Ranger already, and more are being added all the time.  It's "optimized for science", so scientists: have at it.

Saturday Feb 09, 2008

Back in January I did a demo on JavaFX, Sun's declarative scripting language for creating rich media and content for user interfaces.  I want to take a few minutes and tell you what I like and what I don't like from what I've seen so far.  First of all, integration with existing Java libraries and the Java language itself is seamless.  Everything works just like a normal Java object, and you can make any API call you need to just as you would in a standard Java project.  In fact, you can have all your business logic be normal Java classes and just write you UI in JavaFX.  Awesome!  Secondly, static typing.  I think it's cool to have a script-like language with static typing, because it better enforces the principles of design by contract.  And again, this obviously resembles the Java language itself.  Thirdly, the language constructs are designed to make building a UI much faster and easier.  For example, anything you put inside a Do loop automatically gets executed in a background worker thread.  You mean I don't have to create a custom override of SwingWorker? Yep, that's right.  There are dozens of these nifty little language constructs and conventions that make life easier as a developer.  Take the declarative syntax, much like the XAML model for the Windows Presentation Foundation:  Instead of defining user interface properties and binding back-end data objects to components via a sequence of method calls, JavaFX script allows the programmer to declare the existence of a user interface component (and any subcomponents) via an easy syntax and then declare that component's value be bound to some back-end object property just using the keyword bindFrom that point on, the UI component property and the back-end object property are fully two-way bound; when one changes, the other changes right along with it.

Ok, so what do I not like?  Well, since in the declarative world program execution is not sequential, debugging support is more or less out of the question.  This means we're left with trial-and-error to find out if our code works (or looks, I should say) as intended.   However, your UI itself should not have a lot of complex code to it, so this is not a big deal.  Another thing you will see is that a lot of the example and demo programs are partial recreations of flash websites, and the look really good, but they have to be run on the desktop.  As of now, there's no way to compile this cool stuff into something the browser will understand.  The best alternative at this point is to compile your FX app into a Java Web Start application.  Unfortunately, we're still limited to HTML, javascript, and css to make things run in the browser.  My understanding, though, is that JavaFX will become like applets.  You'll write your UI in JavaFX, and embed it into HTML, much like the way flash applications work.  It will run in the browser but hook into the consumer JRE for its true power.  The proliferation of the standard JRE is quite impressive, and although this is all just speculation, I bet we'll see more examples like this in the near future. 

Wednesday Dec 12, 2007

As a campus evangelist, one of the most common complaints I hear about Netbeans is that it hogs memory.  While it is true that the IDE does have a moderate memory requirement, I think there are several underlying issues that affect this misconception.    Unfortunately, most students do their development on a laptop, usually with a gig or less of physical RAM.  This in itself is not a problem, unless you have too many other processes running.  From java-tips.org:

"If your Java process requires more memory than underlying OS can provide it can cause swapping of pages from/to disk. This results in significantly degraded performance.  It is sometimes useful to increase amount of memory available to the application to allow it manage memory more effectively and this can reduce the time spent during garbage collection cycles." 

Netbeans does not "hog" memory; it uses what it needs, and sometimes the OS isn't able to provide that.  I run Netbeans 6.0 on a Vista laptop with an Intel 2.0 GHz chip and 1GB RAM.  Fairly good specs, although these days one gig of RAM isn't that much.  I do notice increased memory consumption when running Netbeans, but only experience performance issues when building web apps and running Glassfish, usually.  Why?  Well let's start at the bottom.  Windows Vista and the Aero desktop consumes a large amount of memory in and of itself.  Now run the most comprehensive IDE in the world AND an application server AND the JavaDB database server, all on a laptop.  It shouldn't surprise you if things get a bit sluggish.    

Another issue: I/O operations.  From java-tips.org:

"During some tasks the IDE is performing many I/O operations. With a slow device this can cause slowdown of the whole application. Typical examples are resources accessed on network drives or plugable drives like USB disk, storages using compression or encryption and anti-virus applications guarding all accesses to files.  Notebooks running on batteries have slower I/O too."

It's also important to realize that Java's memory footprint is lower than you might think.  It's not as simple as adding up the numbers for all the javaw.exe processes in Task Manager.  You have to account for shared bytes; a lot of memory is shared between multiple processes, but the "Mem Usage" field adds that shared space to every process that uses it.  More on this here.