MacPython Logo from __future__ import *

buy music albums Silver Apples buy mp3 albums Tarrus Riley buy tracks mp3 Kravits buy Reaper albums mp3 buy Kravits albums music buy music Evita CD online albums mp3 Silver Apples download Madonna CD music buy tracks music Kravits download music albums Silver Apples

2005-11-18

Firefox, get with it.

Filed under: AJAX, javascript — bob @ 12:41 am

The JavaScript engine in Firefox has some really asinine warnings, here's the one that annoys me most:

deprecated with statement usage:

with ({stuff: "here"}) { eval("alert(stuff)"); }

Ok, now this is just lame. with is clearly in the ECMA standard and all JavaScript implementations, is definitely useful, and it can't go away while still maintaining backwards compatibility. It provides functionality that simply can't be offered any other way since you don't have access to the namespace objects from the script side of the interpreter.

Now I can hypothesize the reasoning for wanting to deprecate this syntax, but it's not necessary. I imagine that someone decided that with is slowing the whole language down since usage of it or eval basically requires a hash table (or equivalent) implementation of the function local namespace. Sure, that's true, but on a per-function basis.

If we assume that eval becomes a keyword at some point, they could simply mark functions that use either with or eval as needing a dynamic namespace. Everything else could use an optimized locals implementation (like Python's). The majority of JavaScript code can have a theoretically faster implementation, the rest stays the same speed, and nothing breaks. While you're at it, let us introspect local namespaces like Python allows with locals() so we can put together our own debugger without hacking the interpreter; Venkman is obnoxious.

2005-11-15

MochiKit 1.1 Intro Screencast

Filed under: AJAX, MochiKit, javascript — bob @ 8:34 pm

I just put together the first MochiKit screencast! Check it out: MochiKit_Intro-1.mov [13:24 23M H.264 AAC QuickTime 640x480] (raw transcript, archive.org entry). The screencast is confirmed playable with QuickTime 7 and VLC 0.8.2.

MochiKit_Intro-1.mov thumbnail

This screencast is an introduction to MochiKit 1.1, using the interactive interpreter example as a conduit for showing off concepts from each MochiKit module.

MochiKit is a lightweight javascript library that brings in rich agile language features expected to users of Python and other such languages, with AJAX and DOM facilities for rapid web application development.

2005-11-14

MochiKit 1.1

Filed under: AJAX, MochiKit, javascript — bob @ 4:35 pm

MochiKit 1.1 is now available [download]. This release contains a bunch of bug fixes, performance enhancements, cross-referenced and bookmarkable documentation, and some convenient new APIs.

Also make sure to check out the new MochiKit 1.1 Intro Screencast!

MochiKit is still quite lightweight, the entire library is just shy of 90k (up from 89k in the 1.0 release). Comparatively, this is the same size as the AJAX edition of Dojo Toolkit 1.0.

MochiKit.DOM.currentWindow and currentDocument allow you to change the global window and/or document object used by all MochiKit.DOM functions, which allows you to use mock DOM objects (great for testing), deal in a separate window, frame, or XML document's objects, etc.

MochiKit.Async.Deferred.prototype.addCallback, addErrback, and addBoth now accept additional arguments, which will create a partial function.

MochiKit.Async.doSimpleXMLHttpRequest will now use additional arguments to build a query string, via MochiKit.Base.queryString and/or MochiKit.DOM.formContents depending on the arguments given.

There's a new MochiKit.Async.DeferredLock object to use for synchronizing Deferred instances.

For a full list of changes, see Version History.

2005-11-11

MochiKit documentation overhaul

Filed under: AJAX, MochiKit, docutils, javascript, python — bob @ 10:40 pm

In preparation for MochiKit's 1.1 release, I've thrown together a pair of custom docutils roles for the MochiKit documentation so that I can throw named anchors on each function.

For example:
http://mochikit.com/doc/html/MochiKit/Async.html#fn-deferred

Now the documentation is cross-referenced rather nicely and it should be relatively easy to scrape out some metadata, perhaps for use by the interpreter, making a function index, search, etc.

Powered by WordPress