Disclaimer:Some of this post arguments are inspired by the great talk by Guy Steele: Growing a Language.
I've noticed last year that the proposal was denied by all browser vendors, as you can see in the ECMAScript 4 progress spreadsheet created by John Resig, under the name of "Operator Overloading".
This is heartbreaking for me... let me explain you why.
Why Operator Overloading (in general)?
Operator Overloading is a special case of polymorphism, in which operators like +, /, *, ... can be overloaded by the user.
This is very useful in languages where the user can define special types (or classes), since it allows the developer to use notation that is closer to the target domain, and allows user types to look like types built into the language.
What Guy Steele said about Operator Overloading is that:
"If we grow the language in these few ways, then we will not need to grow it in a hundred other ways; the users can take on the rest of the task."
To see why, think about these structures:
2D, 3D Vectors
One thing all these structures have in common is that their sum and product operations have a different definition than the one we give to integers.
There's also an interesting fact about these structures: a lot of people use them, but a lot of people don't.
For example, Matrices might be used by OpenGL/Direct3D developers, but it's not very common to use this structure for manipulating the DOM or building AJAX applications.
However, each of these structures must be considered in any programming language.
Adding them all into some standard library might be too much. However, sooner or later, some developer will want to use them.
Here's the dilemma as exposed by Guy Steele:
"I might say yes to each one of these, but it is clear that I must say no to all of them!".
Operator Overloading solves this problem by giving the user the power to overload built-in operations and turn a non-domain specific language into a perfect tool for a developer's specific needs.
By using Operator Overloading a developer can define operations on any custom type and its use will blend perfectly well into the language.
Wouldn't be just beatifull if a and b beeing Complex Numbers, we could do this:
instead of this? :
The XMLHTTPRequest concept was first created by Microsoft, and wasn't part of the web standards. They first used it in the year 2000, but a couple of years later Mozilla, Safari and Opera were also implementing it.
The standards covered that topic a lot of time after it was already implemented in all major browsers, and AJAX was already in the wild.
Just as callbacks were added to respond to DOM Element's events, callbacks were used to handle server side answers. Although AJAX changed the way web applications were created, it did that by mantaining the event-driven programming paradigm.
Canvas is following the same trend the XMLHTTPRequest object followed. It has been adopted by most browsers (Opera, Gecko, Webkit) and despite Internet Explorer's efforts to not adopt this new feature, libraries already exist to make Canvas compatible with IE (to a certain point).
The number of Canvas related stories really grew at Ajaxian, and there were also new breakthroughs by Opera and Firefox on the implementation of Canvas 3D.
There is one caveat to this Canvas thing though, it doesn't use extensively the event-driven paradigm. Since all these Canvas implementations are related to Cairo and also take things from OpenGL and Direct3D (this is notably the case for the Canvas' 3D API), IMO these concepts are more related to a functional programming paradigm than anything else.
I mean, 2D/3D graphics are all about geometrical operations. And geometrical operations are mathematical functions. These concepts might be harder to grasp than the ""AJAX paradigm"", and that's why the adoption curve won't be as high as the AJAX one, but there's no doubt that Canvas developers are a niche.
And do you know which objects/types/classes are related to geometrical computation, Canvas, Canvas 3D, Cairo, OpenGL and Direct3D?
2D, 3D Vectors
For a last example, consider an interpolation function between two complex numbers