A quick recap of JavaScript history: For a long time, ECMAScript 4 was a really feature-rich proposal for a next generation JavaScript. It even included optional typing! Sadly, the involved parties prevented this proposal from ever becoming a standard. Instead ECMAScript “Harmony” was proposed that changed very little so that everyone could agree on it. In order to avoid confusion that proposal was called ECMAScript 5.
In the video “ECMA Harmony and the Future of JavaScript”, Brendan Eich talks about ECMAScript 5 history and possible future features. And this is where it gets interesting. Among the features that might make it are catchalls (functions that supervise how an object is accessed), classes as object facories, concurrency, iterators (to abstract iteration), generators, runtime type-like guards, versioning. Modules are being worked on at commonjs.org, as a library. More on the proposed features can be found at the ECMAScript wiki.
2009-11-24
2009-11-22
Java’s missing features
The following is a list of the language features I miss most when programming Java:
- Closures: are useful for implementing abstractions that involve behavior. Smalltalk provides ample proof that functions and object-orientation go together well. Instead of giving Java functions as objects, its creators decided to support the encapsulation of behavior via inner classes. At long last, it looks like Java 7 will have closures. They are essentially functions with built-in compatibility with single-method interfaces. Not perfect, but certainly very useful.
- Modules: are also coming to Java 7. Reinier Zwitserloot has a nice write-up of the rationale and current state of Jigsaw, Java’s module system. It is interesting that one requirement was that module have to cross-cut packages so that the core of Java can be properly modularized.
- Generators: let one repeatedly invoke a method. The method does not return a value, it yields it. A yielded value is passed to the caller in the same manner as with a return statement. But, the next time the method is invoked, execution continues after the last yield. Thus, a yield suspends method execution, and an invocation resumes it. This helps whenever data has to be computed lazily, on demand and in a piecemeal fashion: (The beginning of) an infinite list can be iterated over by writing a generator with an infinite loop. Tree iterators become trivial to write; one uses a generator and recursion. And so on... Astonishingly, generators are already in an experimental version of the JVM.
- Mix-ins: are class fragments that can be added to (mixed in) any given class, while defining it. The effect is similar to multiple inheritance, but results in a chain of classes (and not a tree, as with true multiple inheritance). Mix-ins are also sometimes called abstract subclasses, because they are classes whose superclass is left to be filled in. While it doesn’t look like mix-ins will be added to Java anytime soon, they could be simulated by tools as interfaces with implementations: If one attaches method implementations to special mix-in interfaces, those implementations could be automatically added to classes implementing such interfaces. While the compiled code will contain redundancies, the source code won’t and subtyping will work as expected. The attaching could be done by letting an annotation refer to a class.
- Post-hoc interfaces: Wouldn’t it be nice if one could let a class implement an interface after it has already been defined? After all, one can add new leaves to the inheritance tree, why not new inner nodes? This would give one many of the benefits of duck typing, while keeping compile-time checking.
2009-11-19
Java 7 will have closures!
These pages have the details:
- “Closures after all?” is continually updated with new links and information.
- Gafter’s “Closures for Java” has been updated with the new syntax which closely resembles FCM. Thus, the new closures use FCM syntax and (a simplified version of) Gafter’s type system. Correction: Gafter’s spec was written 2 weeks before Devoxx, as an attempt at a compromise between the competing proposals.
- Reinier Zwitserloot has more background on how everything came about.
- Update 2009-11-22: Stephen Colebourne gives an overview of the current situation.
2009-11-14
Mac OS: dim other displays while playing a movie
The scenario is obvious: You occasionally connect a projector to your Mac (be it a notebook or a desktop machine). While projecting a movie, the display of the Mac should be dimmed, in order to not distract from the projection. Luckily, the three most important applications for playing movies now support this feature. They allow one to dim when going into full screen mode:
- DVD Player: Preferences → Full Screen → Dim other displays while playing
- QuickTime Player: Preferences → Full Screen → Background Color → Show on all displays
- VLC: Preferences → Video → Black screens in Fullscreen mode
2009-11-09
FRITZ!Box: get call notifications on a Mac
The FRITZ!Box DSL modem also connects telephones to an analog line. In such a setting, the nifty Frizzix can be used to receive call notifications on a Mac. All you need to do is install Growl and then run Frizzix. The following image shows a Growl notification being displayed in the lower right corner of the screen. Note that in this case, “Axel Rauschmayer” is the caller (as I’ve called myself with my cell phone).
2009-10-25
What does a multi-touch desktop GUI look like?
R. Clayton Miller’s 10/GUI is an interesting look at what multi-touch desktop GUIs might look like. Obstacles are that it's difficult to position large desktop monitors so that one can comfortably touch-use them for extended periods of time; and that using hands to manipulate on-screen objects tends to obstruct the view to them. 10/GUI has two main ideas: First, to use a giant multi-touch track-pad. Second to rethink the window manager. The first idea makes perfect sense. The second idea is neat, but can probably still improved upon. The idea is still that an application should fill out most of the screen. Splitting a screen in half, vertically should work, but more than two partitions don't seem possible. My personal bet would be on 2.5-dimensional zooming user interfaces that restrict navigational movements (to improve usability). Fingers should work well to quickly organize files, documents, windows, etc. Bumptop solves this one aspect neatly. Windows 1, Eclipse, and Windows 7 have some intriguing ideas about how to split screen space between windows.
Interestingly, Apple's notebooks and their multi-touch trackpads are well positioned to implement something similar to 10/GUI. Already, multi-touch gestures for scrolling and zooming make some GUI widgets inefficient and unnecessary.
Interestingly, Apple's notebooks and their multi-touch trackpads are well positioned to implement something similar to 10/GUI. Already, multi-touch gestures for scrolling and zooming make some GUI widgets inefficient and unnecessary.
2009-09-29
Canvas-based game: Ajax has come far
The online game “Berts Breakdown” is fun and there is no Flash involved! It is all done via JavaScript and the HTML5 canvas tag. Quite impressive. Warning: Canvas means that this game won’t run on Internet Explorer, only on Firefox and Safari (and possibly on Opera). [Source: Ajaxian]
Subscribe to:
Posts (Atom)
