Brennan Spies's blog

Google's Native Client: Faster RIA?

Tagged:  

Hot on the heels of the JavaFX release, Google has released a beta version (of course, what else?) of its own browser plug-in for--get this--running native x86 code inside your browser. It's called, appropriately enough, Native Client. If your security alarm bells are going off, take some comfort: the code is sandboxed in order to prevent untrusted code from freely accessing your computer. How effective the "static analysis" that the sandbox performs is an open question, but Google for its part seems to have thought through the problem: code is disassembled and run through a rigorous analysis to detect unwanted interactions, e.g. file I/O. Nevertheless, it is unlikely to ever be as secure as running code inside a VM.

While Java aficionados may scoff at the idea of running non-portable code inside the browser, one has to admit that x86 clients are nearly universal, at least on the desktop. In the mobile arena that's anything but the case so Native Client has a very specific target audience: desktops that need absolute performance. If this fits the requirements of your browser-based application, Native Client may just be the ticket.

Sizzle

Tagged:  

In August of 2008, John Resig started the Sizzle project, a new JavaScript CSS selector engine, with the goal of providing a small (about 4k) and fast core that could be leveraged by jQuery as well as other libraries (such as Dojo, MooTools, etc.). According to Resig, the new library is about 4 times faster than other selector engines in all major browsers. Resig has also been active in courting other framework designers, asking them to adopt Sizzle in their libraries.

While some have many have expressed great excitement at the idea of having a common selector engine, not all are enthusiastic about the idea. Valerio Proietti from the MooTools project has written a blog detailing why he won't be using Sizzle, and even going so far as to say it discourage competition in the JavaScript framework arena.

I’m not saying that John Resig seeks a monopoly over CSS selector engines, but that’s sure what it looks like. Competition and innovation will stop if everyone uses the same piece of code. Yes, competition and innovation[...]

So, if using one shared selector engine is ok, where do we draw the line? Is it ok to use a shared DOM manipulation library, or a shared event library? What makes our framework ours? If we start replacing core parts by outsourcing them to Dojo, our frameworks will just be a dull layer for code we didn’t even write, and we will lose credibility.

While one has to respect Valerio's decision to stick to his own code, I think that he misses some of the potential benefits of having a common selector core across multiple frameworks: elimination of code duplication, consistency of behavior, and robustness (if multiple libraries use a common core, bugs get squashed quicker). After over a decade, JavaScript is finally "growing up" as a language: frameworks like Dojo, Prototype, and jQuery have been a big part of this, allowing developers to get much more done in a much faster time frame than was possible before. It is only natural during this process that common pieces of infra-structure get built to allow framework designers to focus on other things.

If Resig does a great job with Sizzle, why should a new JavaScript library re-invent the wheel? Claiming Resig is somehow seeking a "monopoly" over JavaScript selector engines seems a bit silly and far-fetched. I think the real issue is an (understandable) pride is his own code, and a reluctance to throw it away in favor of someone else's...

RedHat releases JBoss AS 5.0

Tagged:  

JBoss has released version 5.0 of its popular Java application server, completing a 3 year odyssey to redesign its microkernel architecture (the JBoss Microcontainer). JBoss AS 5 is designed around the concept of a "Virtual Deployment Framework", an AOP-based design that analyzes deployments and produces metadata to be consumed by the container itself, which in turn instantiates and wires together the various pieces of a deployment, controlling their lifecycle and dependencies. The server also integrates other projects from the JBoss umbrella, including JBoss Cache and JBoss WS.

JBoss AS 5.0 is a fully JEE 5.0 compliant application server. It can be run on both Java 5 and 6. After this release, the JBoss team now moves on to JEE 6.0.

It can be downloaded here.

JavaFX 1.0 Released

Tagged:  

Sun has just released the JavaFX platform, consisting of 3 major pieces: the JavaFX SDK, the Netbeans 6.5 IDE with JavaFX, and the JavaFX Production Suite (formerly Project Nile), a set of tools to allow designers the ability to import digital assets from design tools such as Photoshop and Illustrator.

All are available for download on the JavaFX site, which was redesigned (thankfully) for the launch.

As noted in the Sun blogs, JavaFX Mobile is currently in beta and expected to be released in February.

Java 6 Update 11

Tagged:  

Sun has released Java 6 Update 11, which contains the JavaFX runtime. The official release of the JavaFX SDK will be tomorrow (12/4/2008). The JRE itself is also available from Sun's auto-update site.

Ruby on Rails 2.2 Released

Tagged:  

The web application framework that broke the mold (and made Ruby famous in the process) has released version 2.2.

Key features in the update include:

  • Ruby 1.9 compatibility. Among the key features that Ruby 1.9 brings (at least for users of the "main" C-based implementation) is a single native thread for every Ruby thread. Finally. Now Rails applications can run with much less memory consumption and better processor utilization. Will you miss all those extra Mongrel instances? Probably not.
  • Thread safety. Important updates to the framework have been made to ensure thread safety. This will be a big boon to JRuby users (who have been dreaming of this for a long time), but C Ruby users will have to wait for certain dependencies to be updated before they can really enjoy its benefits (most notably those--ahem--with large amounts of C code). To enable mutli-threading, add config.threadsafe! to your config/environments/production.rb. (Note, however that this will disable automatic loading by ActiveSupport::Dependencies.) Plan on becoming more familiar with Mutex.
  • Internationalization. i18n has been baked into the framework, making localization of your application much easier.
  • ActiveRecord now has a proper connection pool.

The release notes are here.

Rails 2.2 now requires RubyGems 1.3.1, so you'll want to make sure to update it (gem update --system) first. To install the new version, do something like the following:

gem install rails
rake rails:update

Arun Gupta from Sun also gives a nice overview of how to run Rails 2.2 on GlassFish v3 Prelude and JRuby 1.1.5.

Netbeans 6.5 Released

Tagged:  

In the tradition of "Release early, release often", the Netbeans team has released version 6.5, continuing the rapid release cycle the project set with 5.5, 6.0, and 6.1. There many new features, most notably support for Groovy /Grails and PHP. Here's a short list of the other "new and notables":

  • A new "Compile and Deploy on Save" feature for Java applications.
  • Support for the Nimbus look and feel in the Swing GUI builder (Matisse)
  • Big improvements in the JavaScript support, particularly in the area of debugging.
  • Support for Ruby on Rails 2.1 (JRuby 1.1.4 is bundled)
  • Improved SQL support, including SQL history and editor auto-completion.

There is also an early access release of Python support in Netbeans that is available as a separate download.

Get Netbeans 6.5 here.

I Want My Type Information (Back)

Tagged:  

As Neal Gafter explained a while ago, there is a backdoor in Java's generic type erasure:

getClass().getGenericSuperclass()

Google Guice makes use of this backdoor to enable the construction of a generic type literal (or Super Type Token): its TypeLiteral class. Now (the soon to be released) Guice 2.0 goes a step further: it can inject a TypeLiteral into your class, thereby reifying your generic types (well, sort of). All the details of the changes to com.google.inject.InjectorImpl are here.

As Neal Gafter also explained, java.lang.reflect.Type really should be retrofitted. Until then, Guice offers you a little help.

Merb 1.0 Released

After two years of development, the first serious contender to challenge Ruby on Rails in the area of Ruby web application frameworks has reached 1.0 status: Merb. Created by Ezra Zugmuntowicz, Merb is built to be lightweight, less monolithic than Rails--i.e., you have your own choice of ORM, JavaScript, and templating frameworks--as well as thread-safe (which Rails, prior to the upcoming version 2.2 at least, was not).

You can get the gem from RubyForge with (something like) the following :

$ sudo gem install merb --include-dependencies

(Alternative site: —source http://edge.merbivore.com)

You can then generate your first Merb project and run it with the following:

$ merb-gen app my_application
$ cd my_application
$ merb

Then, of course, you'll want to read the documentation.

Google Guice 2.0 in Beta

Tagged:  

For those following dependency injection frameworks in Java, Google Guice has released its beta snapshot (stamped 2008-10-16) for Guice 2.0.

What's coming in Guice 2.0?

  • A tree-like structure for Injectors, i.e., an Injector can have children that inherit all of its bindings.
  • An introspection API: like reflection but for Guice bindings.
  • The ability to inject members of sets and maps using Multibinder and MapBinder respectively.
  • Private modules.
  • Pluggable type converters that convert constant string bindings to other types, i.e., Dates, URLs, etc.
  • And more...

The official word is now that Guice 2.0 will be released in Fall 2008. (The Id Software release schedule: it'll be done when it's done!)

Syndicate content