Brennan Spies's blog

ECMAScript 3.1 Final Draft Emerges

Tagged:  

Also known as ECMAScript 5th Edition, the new JavaScript standard has entered final draft stage. Among the goodies: a formal getter and setter syntax for object properties, language reflection features, support for the JSON data format, additional Array methods, and a strict mode that improves error checking.

Function.bind

Function.prototype.bind(self, args...). A bind function wraps a function in a closure, storing references to the context arguments from the surrounding scope. This is somewhat equivalent to the following:

Function.prototype.bind = function(context) {
  var fun = this;
  return function(){
    return fun.apply(context, arguments);
  };
};

Applications include partial application of arguments to a function and currying. Though you can custom-roll one today, a native bind function in 3.1 should outperform any equivalent user-defined function.

Array

The additional Array methods in ECMAScript 3.1 are identical to methods introduced in JavaScript 1.6-1.8, but were never present in any official ECMAScript specification. They are currently implemented in Firefox 3.x. Of course, having them in ECMAScript 3.1 means that now you will be able to actually use them (provided, of course, that all browsers implement the standard...). These methods are: indexOf, lastIndexOf, filter, forEach, every, map, some, reduce, and reduceRight. There's a good description of each method here.

ECMAScript 3.1, also known as JavaScript Harmony, is the less ambitious version of what was to be JavaScript 2/ECMAScript 4, a plan scuttled when some members of ECMA balked at the large additions to the language.

The new specification is available here.

Google Releases Eclipse Plugin

Tagged:  

Hot on the heels of the announcement that Java can now be used with the Google App Engine, the Google Plugin for Eclipse has been released, supporting both Google Web Toolkit and Google App Engine development.

GWT Features:

  • Recognition of inline JavaScript (JSNI): syntax highlighting, auto-indenting, Java Search and Refactoring integration
  • GWT compiler shortcuts and configuration UI
  • Wizards to create entry points, modules and HTML pages
  • Support for GWT JUnit tests

App Engine Features:

  • Easy deployment to App Engine
  • As-you-type validation ensures that your code is compatible with App Engine
  • Build projects and 'enhance' JDO classes automatically without the need for ANT

The user's manual for the plugin is here. The plugin works with both Eclipse 3.4 (update site) and 3.3 (update site).

Dojo Toolkit 1.3 Released

The 1.3 version of the Dojo toolkit is finally out. The main focus of this release has been browser compatibility (particularly IE 8 and Chrome) and speed. According to Dojo-reported numbers on the TaskSpeed benchmark, Dojo is the fastest JavaScript toolkit on common DOM operations, at least twice as fast as other JavaScript toolkits. Of course, all the usual caveats about micro-benchmarking apply, but the speed increase is nevertheless quite impressive.

Simultaneous with the Dojo 1.3 release is the release of the PlugD, a library allows Dojo developers to mimic some of the popular aspects of jQuery (method chaining, as well as many similarly-named convenience methods).

The full release notes can be found here. You can download the new release here.

Explorer Canvas Release 3

Tagged:  

Explorer Canvas, otherwise known as the little JavaScript library that allows you to use VML while still coding in HTML 5 Canvas (thank heaven), has released the third version of the library. The major reason for the release is compatibility with Internet Explorer 8, but there are numerous other bug fixes and improvements in the release. A comprehensive list of changes is here.

You can download the new release here.

New Clojure Release (3-20-2009)

Tagged:  

One of the most interesting new languages to emerge recently is Clojure, a dialect of LISP (a very old language) that runs on the JVM and contains an implementation of software transactional memory (STM) in the core of the language itself.

Hot off the presses (Rich Hickey hasn't even blogged about it yet) is a new release for 2009-03-20. Contained in the download zip are the release notes with all of the bug fixes since the previous release in December of last year.

Anyone who hasn't explored Clojure (or who thinks that LISP is when someone talks funny) should definitely check out Rich Hickey's screencasts over at blip.tv.

Internet Explorer 8 Released

Tagged:  

Microsoft has officially released Internet Explorer 8. New features in this release include:

  • Native support for JSON
  • Improved standards support
  • Faster than IE 7
  • Improved developer tools, including (finally) an integrated JavaScript debugger
  • The address bar also functions as a search bar, a la Google Chrome
  • Accelerators: mini-mashups for your browser
  • Web slices allows you to retrieve information from a web page without actively visiting it.
  • Private browsing, similar to Firefox and Chrome
  • The SmartScreen Filter, which helps to protect against malware, phishing, and cross-site scripting.

On the downside IE 8 is the only current browser that fails the Acid 3 test. It is also one of the slowest browsers out there.

Previous coverage on IE 8:

You can download it here, or wait for it to become available via the Windows Update service.

Ruby on Rails 2.3 Released

Tagged:  

The Rails team has released version 2.3 of its popular and ground-breaking web application framework for Ruby.

Features:

  • Support for Ruby 1.9.1. Caveat: not all the data adapters and plug-ins have moved to Ruby 1.9 yet, so migrator beware.
  • Templates: customize your default Rails skeleton with your favorite set of plug-ins, gems, initializers, etc.
  • Full Rack integration. CGI is now a thing of the (proxied) past.
  • ActiveRecord gets support for nested attributes, nested transactions, batch processing (find_in_batches), dynamic scopes, and more.
  • Action Controller gets smarter rendering, a file rename (application.rb to application_controller.rb), HTTP Digest Authentication Support, more efficient routing, and more.
  • Introduced Rails Metal, a way of bypassing the controller for speed (it is a subset of Rack middleware).
  • Renewed support for Rails Engines allows the sharing of re-usable application components.
  • Support for nested forms.

A full list of all the changes in 2.3.2 (the final version of 2.3) is here.

As usual, you can install via Gems: gem install rails

Chrome 2.0 Beta Released

Tagged:  

Google has released the 2.0 beta version of its Webkit-based browser, Chrome. The new release features:

  • 25-35% faster JavaScript performance for Google's V8 engine
  • Form autofill
  • Bookmark sorting
  • Autoscrolling
  • Full-screen mode
  • A new way to drag tabs in order to get a "side by side" view
  • Mouse gestures for resizing windows
  • Limited Greasemonkey support

Like its cousin Safari, the new Chrome browser should also be Acid 3 compliant since it is built using a much more recent version of Webkit (Chrome 1.x is not). You can download the new beta here.

UPDATE: Actually, Chrome 2 (build 2.0.169.1) scores 98/100 on Acid 3. Close, but not yet.

Safari 4 Beta Out

Tagged:  

Apple has quietly released the first public beta of the Safari 4 browser. With fast Webkit rendering, very fast JavaScript in Squirrelfish Extreme, the tag "World's Fastest Browser" may be more than just marketing hyperbole. But I'll wait for Safari's cousin, Chrome 2.0, to come out before I make that judgement.

Safari 4 is also 100% Acid 3 compliant, an important milestone passed by the Webkit team a few months ago.

You can download it here.

jQuery 1.3.2 Released

Tagged:  

The jQuery project has released its second update in the 1.3.x series, 1.3.2.

Notable changes:

  • Elements are returned in document order rather than the order of the selectors passed in. This is to comply with the Selectors API.
  • Improvements in the :hidden/:visible selectors to check the browser-reported offsetWidth and offsetHeight rather than the CSS visibility attribute. This works better with elements that have hidden ancestors, and improves performance.
  • Performance improvement in width() and height() methods.
  • Better selector peformance in IE.
  • The methods appendTo, prependTo, insertBefore, insertAfter, and replaceAll now return the set of inserted elements, instead of the original set of elements.

jQuery 1.3.2 can be downloaded from the main page.

Syndicate content