Code cartoon on memory management, concurrent programming in the browser

I love Lin Clark’s code cartoons, as much for her incredibly clear explanations as for her fearless choice of advanced and in-the-weeds topics. Her latest, a three part series delving into some new low level capabilities that will make concurrent and high performance programming more possible in the browser is no exception.

Read More …

MP3 Decoder Written in JavaScript

At firest I was a little puzzled by this story to which Slashdot linked last night. HTML5 includes natively capabilities for playing back audio though not all formats are supported equally by all browsers, for reasons similar to the much more visible debates over video formats. A JavaScript powered player on cursory inspection would seem to be yet another front end to this multimedia capability increasingly available in newer browser.

jsmad isn’t a front end, though. Digging into the story a bit more, it is actually a native decoder for several variations of the MP3 format that runs entirely in JavaScript. It has more in common, then, with the the recent x86 emulator and several game emulators that have been ported or written from scratch to execute in the browser without using any plugins or any special multimedia capabilities.

Porting notes

Obviously, porting low-level C code to Javascript isn’t an easy task. Some things had to be adapted pretty heavily. jsmad is not the result of an automatic translation – all 15K+ lines of code were translated by hand by @nddrylliog and @jensnockert during MusicHackDay Berlin. Then, @mgeorgi helped us a lot with the debugging process, and @antoinem did the design of the demo during MusicHackDay Barcelona.

It performs well enough to decode and play MP3s in realtime on Firefox on modern computers, although if you do lots of things at once, Firefox might forget at all about scheduled tasks and let the soundcard underflow. There is a rescue mechanism for that in the demo, which works most of the time.

There is a fully capable demo, written in a very brief amount of time as part of the Music Hackday. I ran into a couple of issues with playback but outside of that, the experience is entirely comparable with the usual Flash players.

If it is possible to run a fixed point, compute and data intensive decoder like this with nothing more than the browser’s JavaScript engine, I have to imagine it should also be possible to port many of the open formats, like Ogg Vorbis and Flac. As a podcaster, the possibilities here are very alluring. jsmad is free software, available under the GPL v2 so it isn’t unreasonable to expect as interest increases, so should performance, accuracy and stability.

JavaScript decoder lets MP3s play in Firefox without Flash, via Slashdot

feeds | grep links > Circumventing Chinese Censors on a Kindle, Open Flash Tool Now Closed, Faced Detection for Web Apps, and More

  • Kindle allowing bypass of Chinese censoring firewall
    Slashdot points to an interesting use for the otherwise not very freedom friendly device. Apparently, however the 3G service is provided locally in China, it isn’t being subjected to the same censorship as regular net access. I tend to agree with Professor Kwan’s interpretation, that those in charge of the firewall simply don’t realize the Kindle can be used for anything other than buying and reading books.
  • Adobe temporarily closes their Flex SDK
    According to a conversation with the product manager initiated by The Register, the public source code repository and patch submission for Flex will be closed for a couple of releases. This stems from the fact that while the tool itself, used for creating Flash and AIR apps, is open, the platform is closed. In order to build against the un-released new versions of closed platform components, it is necessary to also close Flex. This demonstrates one considerable risk of working with a set of tools that isn’t all open.
  • Face detection with HTML5 and JavaScript
    Klint Finley at ReadWriteWeb describes a new library that the developer sees as helping with automatically tagging photos online. Even if it doesn’t evolve from face detection to full on recognition, you could easily see how a distributed, in browser trick like this could be effectively coupled with crowd intelligence to allow web applications to offer almost as good identity based tags. I think it is far more interesting to consider how the library might open up compelling, novel interactions with web applications based on a user’s movements and orientation in space. That avenue of thought is less concerning from a privacy perspective, too.
  • Publisher sells DRM-free ebooks to libraries , BoingBoing
  • OpenBSD 4.8 released, Slashdot

feeds | grep links > Plans for Firefox Home, Review of “Get Lamp”, Open HDCP Software Implementation, and More

  • Contest to produce JavaScript demos no more than 1Kb
    Slashdot links to this now concluded contest that sort of reminds me of the demo scene in terms of the constraint to bum down code as much as possible. The results are a bit more diverse, including many interactive games as well as passive animations. More so than a lot of recent and fairly contrived “HTML5” demos, the finalists in JS1K really showcase what modern browsers can do.
  • Firefox Home adding more devices, social capabilities
    Chris Cameron at ReadWriteWeb shares news of Mozilla’s plans for their Sync client for iPhone. Personally, I cannot wait to get an Android powered replacement for my iPod Touch and start running Fennec, their full mobile browser, but in the interim I’m happy that Home is getting such attention from the lizard wranglers. I especially cannot wait for the password sync support planned for a future release.
  • Congress passes internet, smart phone accessibility bill, Washington Post
  • Update to private cloud-based file system, Tahoe-LAFS, BoingBoing
  • Android software piracy rampant, Slashdot
  • A Review of Jason Scott’s “Get Lamp”
    Text adventure games figured largely in my earliest experiences of computers. It was a no brainer for me to pick up a copy of Scott’s documentary on the subject. I enjoyed it immensely and am far from finished exploring all the material he has included in the two disc set. Jeremy Reimer at Ars Technica has a glowing review that resonates very strongly with my own experience of the work.
  • EFF, others, support Microsoft in case trying to make patent invalidation easier, EFF
  • Open HDCP software implementation released
    Ars Technica, among others, has news of researchers using the recently leaked HDCP keys to build an open source program capable of decrypting encoded digital video streams. Peter Bright questions the utility of the effort as it would still require some sort of hardware to connect into your home media ecosystem. I think the overlooks the very strong tradition of these sorts of proofs of concept developed by security researchers interested in the system more so than its applications.

Mozilla Releases JavaScript Engine Aimed at Research

As The Register explains, this JavaScript engine isn’t aimed at use but rather to make the process of researching the future of the language more inclusive. From Mozilla Labs Tom Austin:

“In programming language (PL) research, we like to write up fancy evaluation rules containing lots of Greek letters. Unfortunately, these rules tend to be inscrutable to anyone who isn’t a PL researcher. Even for PL researchers, there is something unsatisfying about seeing a bunch of rules on a piece of paper.”

Practical concerns rank on his list along side syntax and semantics. JavaScript, especially as implemented in browsers, is the target of a lot of programmers’ ire. Perhaps this effort will lead to more of those who complain the loudest contributing ideas and code. I believe self interest is a powerful motivator so it’s more than likely going to be a benefit of the Narcissus engine and its companion script look-up tool, Zaphod.

Mozilla Labs pops out JavaScript language tool for coders, The Register

feeds | grep links > Digital Census in Brazil, Ads that Stalk Surfers, Cyanogen Supports FroYo, and More

Following Up for the Week Ending 8/29/2010

jQuery Mobile Project

jQuery is one of the most popular of a class of libraries originally intended to ease the pain of working with JavaScript as implemented by a variety of web browsers. I’ve used jQuery for a couple of projects and other libraries for still others. I find that the API design in jQuery is simpler and more intuitive in terms how how consistently and thoroughly the core idioms are applied. These days, when I need to do any browser work and I have a free choice, I use jQuery.

More recently a rich ecosystem of third party plugins has evolved for jQuery. The quality of design and adherence to the core library’s idioms varies pretty widely but the ability to easily drop in bits that extend jQuery’s reach is attractive, even given the necessary trade-offs that often involves.

I was pretty thrilled, then, to see the H share the announcement that the jQuery developers are looking to do for mobile browsers what they have already done for desktop browsers.

According to jQuery creator John Resig, as part of the new mobile project, the core jQuery library is being improved to work across the various major mobile platforms and their browsers. Resig says that the developers are working to release “a complete, unified, mobile UI framework”. Current expectations are that this will be completed in late 2010.

As the H goes on to explain, the idea will be to ease the creation of touch based apps that degrade gracefully across the different capabilities provided by the combination of mobile browsers with particular mobile devices. jQuery is not the first project to tackling the mobile space, specifically for touch apps on mobile browsers. If they bring the same clean, simple design to the API and the amazing code quality as the original version, they should be able to produce a compelling, competitive offering despite perhaps arriving a little late.

jQuery itself is free software, available under a dual GPL or MIT license. Presumably the new mobile version will use the same licensing scheme which makes it pretty much a no brainer in terms of freedom to use with all kinds of applications. The H links to plenty more detail if you are curious, including a detailed grid of browser support.

jQuery Mobile Project announced, the H

feeds | grep links > Linux on the Desktop, Mobile and the Cloud, Clarifying Facebook’s Data Sharing, and Android’s JavaScript Crushes iOS’

  • Stormy Peters on the desktop, mobile and the cloud
    Another tease for OSCON at O’Reilly Radar, this time James Turner interviews Stormy Peters, executive director of the Gnome Foundation. I am glad to read a practical discussion of bring usability, convenience and freedom together. I don’t necessarily see the cloud as a terrifying bugbear threatening software freedom as RMS has made it out, but I do think we need to be asking for and building services that take user freedom and autonomy into account. I am heartened by how well Stormy hits these very points.
  • Clarifying how user data sharing and advertising works on Facebook
    Berin Szoka at TLF shares a video from Facebook CEO Sheryl Sandberg. This explanation certainly makes sense on its face and really should be the sort of aspect, as Berin notes, that services that rely on advertising explain at every opportunity. However, it still doesn’t excuse Facebook’s privacy gaffes and Zuckerberg’s mercurial stance about sharing personal information. It also doesn’t explain how the 3rd party partnering Facebook recently launched works, whether there are risks of exposure there or similar care has been taken to appropriately compartmentalize users’ data.
  • Android 2.2 crushes iOS in the arena of JavaScript performance