Fresh Off The Block


Apr
14
2011

Google native code browser plug-in gets tickled

This story was originally posted by Cade Metz in San Francisco for The Register; and originally appeared on http://www.theregister.co.uk/2011/04/14/tcl_on_native_client/. Full attribution rights have been given to the original author.

The Tcl scripting language has been plugged into Google’s Native Client, allowing Tcl code to run inside the Google Chrome browser in much the same way that JavaScript does.

Using Native Client – a Google-created plug-in for securely running native code inside the browser – Tcl now has direct access to the Chrome DOM. “The net effect for the Tcl developer is that now he can read and write to the DOM, and be notified of GUI or network events, just like any JavaScript programmer,” developer Alexandre Ferrieux tells The Register. “And like for JavaScript, this happens on the client side, which is a game-changer for us Tclers, who are accustomed to being trapped on the server side. [You get] interactive speed regardless of the connectivity.”

Ferrieux, the man who moved the language to Native Client, provides a demonstration of Tcl directly accessing the HTML5 canvas element.

Some have claimed that this is the first scripting language running on Native Client, but other languages have made the move as well, including OCaml and Lua. But this is the first language that fits so nicely with Google’s wonderfully geeky naming conventions. Some have called this NaTcl. From sodium chloride to, well, sodium tetrachloride.

In February, Google released the first official version of the Native Client SDK. Native Client is designed to speed the performance of web applications, allowing apps coded in, say, C or C++ to be securely transferred over the web and executed inside the browser. The idea is to work around the speed limitations of JavaScript.

“While the [Chrome] team has made JavaScript tremendously faster over the last two years, there’s a lot of applications out there that have existing audiences that are [written in native code, such as C and C++], and there are a few that are specialized applications that need every last bit of performance the hardware can offer,” Google engineering director Linus Upson told us in December. “Native Client is a way of addressing both those issues.”

At one point, Google built a Native Client compiler for Go, its New Age programming language that provides extreme concurrency while running at speeds similar to C. But Go co-creator Rob Pike tells us that the Native Client Go work is now on hold, due to the rapid changes the Native Client team were making to the plug-in.

Originally developed in the late ’80s at the University of California Berkeley as the Tool Command Language, Tcl is essentially a scrubbed and enhanced Unix shell. “It dwells in the same area as Lisp and Scheme, in that it has an extremely simple and regular syntax, with next to zero reserved keywords, very few special characters, and a very simple semantics based on a never-violated principle: ‘Everything Is a String’,” Ferrieux says. “That allows humans to reason about programs with certainty without any knowledge of the implementation details.”

Now that Tcl – pronounced “tickle” – is up and running on Native Client, Ferrieux intends to move the accompanying Tk graphical user interface tool kit to the platform as well. “Another important thing from the standpoint of a Tcler with a Tk background, is that thanks to the exquisite flexibility of the language, there’s very little more to learn [to make the switch to Native Client],” he says. “Indeed, the complete emulation of Tk’s most useful idioms at a syntactic level is possible, and will be completed shortly.”

Well, you do have to learn your HTML5.

What Our Visitors are Talking About


Latest CommentsOn Twitter Right Now
  • “Unlock” Dialogue for Clone System tool in Aomei Backupper 2.5 by William Sims
  • Microsoft gets 561 million euro fine for missing browser ballot “oversight” by Gamer Repulic's Dorthea
  • Microsoft gets 561 million euro fine for missing browser ballot “oversight” by Sherman Moya
  • Microsoft gets 561 million euro fine for missing browser ballot “oversight” by Microsoft gets 561 million euro fine for missing browser ballot “oversight” | The Sanitarium.FM
  • Valve’s Steam Gaming Computer: What we know so far by Valve's Steam Gaming Computer: What we know so far | The Sanitarium.FM
  • Tweet to @TMWeb to have your comments appear here!

    Previous Articles


    Feb
    10
    2011

    10 GMail labs projects you really should use – and one that’s just for fun :)

    One of the cool things about Gmail is that it is incredibly extensible. This is especially true if you turn on support for Labs features. GMail Labs is a huge set of experimental features you can enable to add new functionality to your regular online email service. For example, you can easily translate emails, you can optimize Gmail for the wide-screen, get a preview of what’s in your box before it even loads, and much more!

    Here’s a couple of GMail Labs projects that I personally use, which I feel deserve a wider look from every user of GMail or Google Mail. Since some GMail Labs projects are specific to certain countries, I have tried to go only for ones I believe are both available and serve a useful role to global GMail users.

    1. Undo Send

    Have you ever sent an email to someone, that you instantly regretted? Save yourself the pain and undo the send! Although it won’t actually delete already-sent emails off other people’s accounts, Undo Send will keep every email you send un-sent for up to half a minute – allowing you enough of a grace period to cancel it if you instantly regret it.

    After enabling the feature and sending an email, you’ll be told that the message has been sent–and that you can cancel it. Note that by default, the grace period is only five seconds, but you can increase it to a maximum of thirty in the usual Settings page after enabling the feature.

    Message: "Your Message has been sent. Undo - View Message" Continue reading to see the rest of the bunch!