Archive for the ‘Programming’ Category

Google’s New ‘Dart’ Language to Get a Starring Role in Chrome

Google has released an experimental version of the Chromium web browser with support for the company’s new Dart programming language. Dart, which is Google’s attempt to improve on JavaScript, has thus far not enjoyed much support outside of Google, but the company continues to push forward with its own efforts.

The new development preview version of the Chromium browser, the open source version of Google’s Chrome browser, contains the Dart Virtual Machine. This release, which Google is calling “Dartium,” can be downloaded from the Dart language website. At the moment it’s available only for Mac OS X and Linux. Google says a Windows version is “coming soon.” Keep in mind that this is a preview release and intended for developer testing, not everyday use.

Google originally created Dart to address the shortcomings of JavaScript and ostensibly speed up the development of complex, large-scale web applications.

While there is much programmers might like about Dart, it is, like Microsoft’s VBScript before it, a nonstandard language from a single vendor created without any regard for the existing web standards process. The new Dartium release is the first browser to include a Dart Virtual Machine and, based on the response from other browser makers to the initial release of Dart, likely the only browser that will ever ship with a Dart VM. For its part Google says it plans to incorporate the experimental Dart VM into Chrome proper in the future.

The company also has a plan for all those browsers that aren’t jumping on the Dart bandwagon — a compiler that translates Dart to good old JavaScript. In this scenario Dart ends up somewhat like CoffeeScript, a JavaScript abstraction that makes more sense to some programmers.

For more details on the new Dartium browser and the latest improvements to the Dart VM, be sure to check out the Google Code Blog announcement.

Video: Inventing on Principle

We just had a moment similar to the time we first saw content-aware scaling in action, but this time it’s even better — we’ve seen the future of programming tools and it looks awesome.

Check out the video above of Bret Victor‘s recent talk, “Inventing on Principle.” Victor has worked on experimental UI concepts at Apple and also created the interactive data graphics for Al Gore’s book, Our Choice. The video above of Victor’s keynote at the Canadian University Software Engineering Conference, captures a wonderful talk on living your life based on principles, but for many developers what’s most arresting are the software development tools demoed.

Do your current tools suddenly feel incredibly outdated? Perhaps you thought you were using a well-tuned coding machine but suddenly realize you’re really just hitting two stones together? Thought so. Sadly, the apps demoed in the video aren’t available. That’s all right, though; it just means someone needs to build them. Be sure to let us know if you do.

File Under: Humor, Programming

Jokes for Nerds: Wat Moments in Programming

If you ever doubt your nerdery, head on over to Destroy All Software and watch the video of programmer Gary Bernhardt’s Wat talk. If you find yourself laughing, rest assured, you’re a nerd.

The talk comes from CodeMash 2012, where Bernhardt took a few moments to highlight a few WAT? (link NSFW) moments in some of the web’s favorite languages like Ruby and JavaScript.

Seriously JavaScript, what’s up with this:

> [] + {}
[object Object]
> {} + []
0

Protest SOPA: Black Out Your Website the Google-Friendly Way

On Wednesday Jan. 18, Reddit, Wikipedia and many other websites will black out their content in protest of the Stop Online Piracy Act (SOPA), the Protect Intellectual Property Act (PIPA) and the Online Protection and Enforcement of Digital Trade Act (OPEN). Organizers of the SOPA Strike are asking interested sites to black out their content for 12 hours and display a message encouraging users to contact their congressional representatives and urge them to oppose the legislation.

Although it was rumored that Google might join in the protest, that does not appear to be the case. The search giant does, however, have some advice for anyone who would like to black out their site and ensure that doing so doesn’t harm their Google search rank or indexed content. [Update: It appears Google will be participating in some fashion. A Google spokesperson tells Ars Technica that "tomorrow [Google] will be joining many other tech companies to highlight this issue on our U.S. home page.” WordPress and Scribd will also be participating. You can read the full story on Ars Technica.]

Writing on Google+, Google’s Pierre Far offers some practical tips in a post entitled, “Website Outages and Blackouts the Right Way.” The advice mirrors Google’s previous best practices for planned downtime, but warrants a closer look from anyone thinking of taking their site offline to protest the SOPA/PIPA/OPEN legislation.

Far’s main advice is to make sure that any URLs participating in the blackout return a HTTP 503 header. The 503 header will tell Google’s crawlers that your site is temporarily unavailable. That way your protest and blacked out website won’t affect your Google ranking nor will any protest content be indexed as part of your site. If you use Google’s Webmaster tools you will see crawler errors, but that’s what you want — your site to be unavailable, causing an error.

Implementing a 503 header page isn’t too difficult, though the details will vary according to which technologies power your site. If you’re using WordPress there’s a SOPA Blackout plugin available that can handle the blackout for you. It’s also pretty easy to create a 503 redirect at the server level. If you use Apache ensure that you have the Rewrite module installed and then add something like the following code to your root .htaccess file:

    RewriteRule .* /path/to/file/myerror503page.php

That will redirect your entire website to the 503 error page. Now just make sure that your myerror503page.php page returns a 503 error. Assuming you’re using PHP, something like this will do the trick:

    header('HTTP/1.1 503 Service Temporarily Unavailable');
    header('Retry-After: Thu, 19 Jan 2012 00:00:00 GMT');

For more details, be sure to read up on the HTTP 503 header and see the rest of Far’s Google+ post to learn how to handle robots.txt and a few things you should definitely not do (like change your robots.txt file to block Google for the day, which could mean Google will stay away for far more than just a day). Even if you aren’t planning to participate in the anti-SOPA blackout tomorrow, Far’s advice holds true any time you need to take some or all of your site offline — whether it’s routine server maintenance, rolling out an upgrade or as part of a political protest.

[Image by SOPAStrike.com]

File Under: Programming

Help NASA Code Its Way Through Space

If you’d like to work on software projects that might one day send your code to Mars or on a deep space mission, NASA has some code for you to hack on. The Space Agency recently unveiled a new website, code.nasa.gov, to provide a home for NASA’s various open source software projects.

The new website isn’t the first open source effort from NASA, in fact the increasingly popular OpenStack cloud software stack grew out of a NASA project. If you go further back into history, the Beowulf cluster — forerunner of most of today’s Linux clusters — was also a NASA project.

Unfortunately for outside developers NASA’s past open source efforts have not been very well organized, nor has there been an easy way to contribute code to the various projects. The new code website is designed to change that. According to its homepage the site’s mission is to “surface existing projects, provide a forum for discussing projects and processes, and guide internal and external groups in open development, release, and contribution.”

For the initial release the focus seems to be primarily on the first item in the list, while the forums and discussion aspects are still listed as “coming soon.”

While the community aspects may still be in the works, NASA has already made it considerably easier for developers to contribute by hosting its code at GitHub. So far there are five projects on GitHub (licensed under NASA’s Open Source Agreement).

Not all of the projects involve space, but if you’d like to try your hand at some code that tweaks images from Mars rovers or creates 3D interactive worlds, head on over to Github and grab a copy of NASA’s code.

File Under: Browsers, Programming

An Overview of Firefox’s Coming Developer Tools

Using the 3-D Page Inspector tool, coming soon to a Firefox near you.

Firefox is poised to deliver some new tools for web developers. When Firefox 10 is released in early 2012 it will add HTML and CSS inspectors designed to help web developers inspect and debug their code. Later releases will add more features, like a 3-D page inspector and even a built-in code editor.

Eventually Mozilla believes the built-in tools will replace the popular Firebug extension for most users, though it will likely be some time before that happens. In the meantime, if you’d like to see the new built-in developer panel in action, grab a copy of the Nightly builds, which all have the new tools in various stages of completion.

It’s worth noting from the start that these tools are not intended to replace the popular Firebug extension for those that need Firebug’s power user features. As Mozilla’s Kevin Dangoor wrote when the project was first announced: “we think Firebug is awesome… that’s why we invest so heavily in it already, more so than for any other add-on. We also want to explore new approaches to developer tools.” In other words devoted Firebug fans need not fret, the popular extension isn’t going away. The coming built-in developer tools are designed to supplement, not replace Firebug for the power user.

That said, the new developer tools will provide many of the basic features web developers require and will likely make Firebug unnecessary for many users.

Although they aren’t yet nicely integrated into a single panel like Firebug offers, by the time Firefox 12 hits prime time the browser will offer a web console, an element inspector with HTML and CSS info, Scratchpad for JavaScript development, a CSS style editor and an error console. Firefox’s view source will also add line numbers, closing a seven-year-old feature request.

The newest of these features is the page element inspector, which is now available in the beta channel. The basic layout of Firefox’s element inspector is a little different than what you’ll find in Chrome or Opera.

When you select “inspect element” Firefox will bring up a breadcrumb-style menu bar at the bottom of the page. To see the actual HTML or CSS applied to that element you need to click the corresponding buttons in the toolbar (or use the keyboard shortcuts). It’s an unusual design decision given that inspecting the element generally means seeing the HTML (at least that’s how every other browser does it), and it means there’s an extra click necessary to get to the same information that’s just one click away in WebKit and Opera.

The element inspector also dims out everything but the currently selected element — the visual opposite of what you’ll find in other browser’s inspectors, which color the currently selected element and leave the rest of the page as is. It’s not a deal breaker by any means, but it can be somewhat jarring when you’re used to opposite look.

On the plus side Mozilla has started work that will integrate the very handy Tilt add-on, which we reviewed a while back, into the inspect panel. The integrated Tilt option is only available in the Nightly channel at the moment, though of course you can just install the Tilt add-on if you want to use it today.

Look for the 3D inspector tools to arrive in Firefox 12 if all goes according to plan. Mozilla also plans to add a themeable Code Editor (so you can edit CSS files, or write JavaScript right in the browser).

While Firefox’s new developer tools are improving (and will be much more useful when the element inspector arrives in Firefox 10), there are still plenty of reasons to prefer Firebug or the WebKit tools. For example, if you open Firefox’s HTML inspector, style inspector and web console all at the same time there’s almost no screen space left for the actual page content. Firebug, WebKit and Opera all save considerable screen real estate by consolidating their tools into a single tabbed panel.

For more details on the new Page Inspector coming in Firefox 10, here’s Mozilla’s screencast overview:

Archive Your Social-Network Life With ThinkUp 1.0

A few of the things ThinkUp can do for your social-network life

ThinkUp, the web-based data-liberation and analytics application from former Lifehacker editor Gina Trapani, has just released version 1.0.

Social networking is often very ephemeral: You post something, a few people respond, and then the conversation just evaporates, disappearing into the ether. One of ThinkUp’s goals is the give your social-network posts a longer life and ensure that you’ll have a way to refer back to those conversations years later.

ThinkUp is a web-based app that pulls your data out of social silos like Facebook or Twitter and stores it on your own server. You control your own data, and have a record of your conversations potentially long after Facebook, Twitter and the rest have become mere footnotes in the history of the web.

“The conversations you have online are worth capturing, keeping, and referring back to over time,” writes Trapani on her Smarterware blog. “In fact, the things you share and the conversations you have about them gain weight, perspective, and importance over time, not just the moment you post them.”

The backup and archiving features alone would make ThinkUp a worthwhile app to have, but the real analytical power of ThinkUp comes after it has a local copy of your data. That’s when ThinkUp starts slicing, dicing and pulling together your data to reveal things about your online activity that you’ve never considered before.

For example ThinkUp can pull conversations together, plot them on a map, reveal which of your posts are the most popular, which are the most replied to and even track all the links your friends have ever sent you.

We took a detailed look at the software back when the beta was first released. Now ThinkUp is out of beta and ready for prime time with a 1.0 release.

The first step to using ThinkUp is installing the app on your server. The requirements are modest and installation is automated — if you can install WordPress, you can install ThinkUp. Of course not everyone is comfortable installing WordPress so ThinkUp takes a page from Dave Winer and offers a ThinkUp instance running on Amazon EC2. Just follow the link, sign in to your Amazon account and you’ll have ThinkUp running in no time (the first year is free for new EC2 users, $15/ month for the rest).

Once ThinkUp is installed you need to point it to your accounts. I tested it with Twitter and Google+ and had no problems importing data. One nice touch that’s been added since the beta release is a secret RSS feed for running the ThinkUp updater. Sure, you can add a cron job if you know what you’re doing, but for novice users the RSS feed is an ingenious tool — just add it to your favorite RSS reader (for example, Google Reader) and the reader will periodically scrape the feed, triggering the update.

The Twitter Dashboard in ThinkUp

Because ThinkUp pulls in your raw data it can show you useful stuff you won’t find on the social networks themselves. This is particularly noticeable with Twitter, which really shows very little beyond the most recent few tweets from your friends. ThinkUp takes the same data Twitter has and actually puts it to good use, showing, for example, your most replied-to posts, your most re-tweeted posts and, my personal favorite, conversations you have with other Twitter users. It also tracks everything your followers do as well. For example, ThinkUp catalogs all the links your followers have posted, displaying them all in one place. There’s also an excellent search function for tracking down old tweets.

While ThinkUp puts a tremendous amount of data at your fingertips, it manages to keep the interface simple enough that the data is never overwhelming.

ThinkUp also now makes it possible to host your conversations at a permalink on your site. It’s a feature that’s particularly useful if you frequently ask your Twitter followers for advice or suggestions. For example, here’s a page where Trapani asks her followers which iPad apps they recommend.

ThinkUp is already in use on several popular Twitter accounts, like, for example The White House (Steve Martin is also a fan) and in my testing it worked without a hitch. If you’re comfortable setting up basic software like WordPress, installing ThinkUp should be a snap and if you’re not confident around a server there’s always the Amazon-based version.

If you’d like to see more of what ThinkUp has to offer, check out the video below:

See Also:

Adobe Puts Flex Out to Open Source Pasture

If you needed further proof that even Adobe is done with Flash, look no further than the company’s recent announcement that it will open source the Flash-based Flex SDK. Adobe plans to turn over its Flex SDK to the Apache Software Foundation.

Flex is the company’s development framework for building cross-platform applications using Adobe Flash and ActionScript. The SDK’s focus on data-driven apps made Flex a popular choice with Adobe’s enterprise customers, many of whom are no doubt feeling a bit let down to see Adobe walking away from Flex.

Much of the Flex codebase is already open source; what’s changing with the move to the Apache Software Foundation is the governance of Flex. Adobe is no longer the sole guiding force behind Flex.

Ordinarily, when a company opens up a project like Flex it’s good news for developers, but in this case it feels more like Adobe’s exit strategy. The community of Flex developers may have gained some more control over Flex’s future, but that future looks pretty bleak.

Adobe has already made it clear that the company plans to refocus its efforts on HTML5, and, while it says it intends to continue supporting Flex, it also says, “in the long-term, we believe HTML5 will be the best technology for enterprise application development.”

In fact the initial message about the future of Flex was dire enough that Adobe felt the need to update its FAQ to specifically address concerns that it is abandoning Flex. “Absolutely not,” says Adobe in the updated statement, adding that the company is “incredibly proud of what we’ve achieved with Flex.”

While the updated statement is intended to reassure Flex developers, it’s hard to miss the use of the past participle in reference to Flex, which doesn’t bode well for developers looking to the future. It’s also hard to miss the reiterated commitment to HTML5. “In time,” says Adobe, “we believe HTML5 could support the majority of use cases where Flex is used today.” The company puts the timeframe for most applications in the three- to five-year range. In other words, Adobe believes Flex is only a good bet for the immediate future, developers interested in building something with more long term viability would do well to consider the web and HTML5.

For more details on the future of Flex and Flash, be sure to read through Adobe’s updated FAQ on the subject.

See Also:

File Under: HTML5, Programming

Gate One Puts a Terminal Emulator in Your Web Browser

If you’ve ever needed to connect to a remote server without installing any desktop software or doing anything other than opening a new browser window, then you need to check out Gate One. Gate One is a web-based terminal emulator and SSH client that will work in any modern web browser.

The brainchild of developer Dan McDougall, Gate One is the result of nine months of coding. While Gate One may not be the first project to put a terminal emulator in your browser — existing options include Shell in a Box and Ajaxterm among others — it has quite a few features that go well beyond the basics found in other emulators. For example, Gate One uses WebSockets rather than traditional polling so it’s able to keep SSH connections open without spiking your CPU and grinding the browser to a standstill. Gate One also has the ability to resume sessions after being disconnected.

Throw in multiple simultaneous terminal sessions, a way to save SSH bookmarks, a plugin architecture and the ability to play back, save and share terminal sessions and you’ve got a pretty respectable replacement for Putty and its ilk. Not that Gate One is intended to replace a desktop SSH client, but for situations where you can’t run a desktop app Gate One just might be the emulator you’ve been looking for.

The front end of Gate One is written entirely in HTML5 and JavaScript, which means it will work in any modern browser. Behind the scenes Gate One uses HTML5 WebSockets to connect to a Python-based SSH server.

Gate One is available from GitHub and is dual-licensed under either the AGPLv3 or a proprietary license.

See Also:

Google Throws New ‘Dart’ Programming Language at the Web

It’s not every day that someone tries to add a new programming language to the web. There’s a good reason for that. The great trinity of web development — HTML, CSS and JavaScript — while not perfect, has proved itself highly flexible and capable of adapting as it evolves, which, in the end, might be more important than perfection.

But, regardless of how well those three have served the web thus far, they are not enough for Google, which is hoping the web will now embrace Dart, Google’s brand-new programming language for “structured web programming.”

The first hint of Dart surfaced about a month ago when an internal Google memo was leaked onto the web (the memo itself dates from 2010). In it Google claims that “JavaScript has fundamental flaws that cannot be fixed merely by evolving the language.” The answer, for Google, was to go off and create its own homebrewed solution.

That solution is Dart, a “class-based optionally typed programming language for building web applications.”

Lars Bak, a software engineer working on Dart, says the language is designed to work with every thing from “a one-person project without much structure to a large-scale project needing formal types in the code to state programmer intent.”

In other words, Dart is aiming to be a one-size-fits-all solution for writing apps on the web. Dart has been built from the ground up with this goal in mind. Indeed Dart offers some interesting tools, including optional types and the ability to declare private methods via an underscore. Unfortunately for Dart, a couple of novelties don’t seem to be winning over programmers. The Hacker News discussion thread on Dart is full of rather barbed critiques with hardly a supportive voice to be heard.

Dart on the web

Appealing to programmers is only half of what Dart needs to succeed; it also has to work well on the open web. For that Google has two solutions.

The first and ideal solution will be to execute Dart code in a browser-native virtual machine (very similar to how JavaScript is handled today). Of course that means the rest of the browser makers need to join Google in supporting Dart. Because that isn’t likely to happen any time soon, nor will it ever happen for legacy web browsers, Google has a fallback plan — a compiler that translates Dart code to JavaScript.

While the JavaScript compiler solution will mean slower web apps, it also means that Dart apps would always be able to run, regardless of the browser in question. That’s good for older browsers, but it also raises some questions about where Google plans to go with Dart.

Essentially, Google has set up a two-tier system for running Dart in the browser, and that is where Dart might run afoul of the open web.

Prior Dart Art

How Standards Proliferate by XKCD

The leaked Google memo that appeared on the web last month created a tempest in the web standards community teacup. The idea that Google had a secret project designed “to replace JavaScript as the lingua franca of web development” did not sit well with those who support open web standards.

The company appears to have backed off that stance somewhat for the official release. In fact, Google hardly mentions JavaScript in its Dart announcement and Lars Bak tells CNet that Dart is “not going to replace JavaScript…. JavaScript is a cornerstone of the web today, and it will continue to be for a long, long time.”

That message may be too little, too late. Publicly, Google may now be pushing the message that Dart is complimentary to JavaScript, but the blunter language and goals outlined in the leaked memo are already out there, fresh in developers’ minds. That, combined with Google’s less than stellar track record with its “open” projects may make it difficult for Dart to find supporters.

While Dart is open source and available for anyone to use, Google does not have a strong record of fostering open projects; that is, projects where the community can not just download and compile code (Andy Rubin’s “definition of open“) but can actually have a hand in creating features and guiding the direction of the project.

Until the latter component is well established, don’t expect other browser makers to adopt Dart. So long as Google controls the strings it’s unlikely its arch rivals like Microsoft and Apple will support Dart.

Without that support, Dart won’t be running in a virtual machine; instead it will fall back to running as JavaScript. That effectively means that, while Dart will run in any browser, it will likely have subpar performance in any browser lacking the virtual machine.

What standards proponents fear is a web where only Google’s Chrome browser ever fully supports Dart. That would mean that, while Dart apps would work everywhere, they’d be significantly faster in Chrome. That would send the web back to the bad old days of “works best in Internet Explorer” websites, only this time around it would be “works best in Google Chrome.”

Future Dart

It’s possible that Google will use Dart to finally create a true community-driven project. The company has already said it plans to eventually submit Dart for standardization, which would certainly help.

It’s too early to write off Dart, but it’s also too early to say it will be anything more than a novelty Google uses in its own apps (like WebP or even SPDY). Even if Dart can convince both developers and browser makers to jump on board, don’t look for Dart to become the “lingua franca of web development” any time soon.

See Also: