InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Embed Python, Ruby, and XAML directly into your HTML with Gestalt

Posted by Jonathan Allen on Oct 15, 2009

Sections
Enterprise Architecture,
Architecture & Design,
Development
Topics
IronRuby ,
IronPython ,
Ruby ,
Dynamic Languages ,
.NET Languages ,
Python ,
XAML ,
.NET ,
Languages ,
Web 2.0 ,
Programming ,
Gestalt ,
Enterprise Architecture ,
Browsers

JavaScript is a language that is showing its age. A lot of developers now prefer to work with languages like Ruby or Python, falling back on JavaScript only for the browser. Sure there were attempts to support other languages in the browser like VBScript, but they never really took off.

Meanwhile, HTML is a rather poor languages for interactive applications. Sure there are Scalable Vector Graphics, but without support in Internet Explorer they are just as useless as VBScript. This has lead to the domination of component technologies like Flash, which are referenced by HTML but not used within it.

Gestalt is a JavaScript library that changes all that. Combined with Silverlight, Gestalt allows web developers to directly embed Python and Ruby code in their HTML. When you view the source of a site, you will see something very familiar:

<script language="python">

That, and an include at the top of the page, is all you need to start writing your code in Python. The include file pipes the inline Python or Ruby code to the Silverlight runtime, which leverages the Dynamic Language Runtime.

Gestalt, which is still just a demo, also allows you to embed XAML directly into the HTML. The XAML code is wrapped in an XML tag with the class attribute set to “xaml”.

According to Harry Pierson of Microsoft, this model of directly embedding Silverlight-compatible code in HTML is the eventual goal of the IronPython and IronRuby projects.

Qualify that statement by Derek Kastner Posted
Re: Qualify that statement by Thom Nichols Posted
Re: Qualify that statement by Michael Neale Posted
Active work in IronRuby/IronPython space by Kevin Radcliffe Posted
I wish Microsoft would just open source the mini-CLR by Dan Tines Posted
  1. Back to top

    Qualify that statement

    by Derek Kastner

    How is JavaScript showing its age? Performance has increased as browsers improve their JavaScript engines. It supports some functional concepts and prototype style objects, and I'd say it's pretty close to parity with Ruby and Python in those regards.

  2. Back to top

    Active work in IronRuby/IronPython space

    by Kevin Radcliffe

    Be sure to check out Jimmy Schementi's mailing list post detailing some of the work being done. He has some demos already posted, as well as some very useful documentation

  3. Back to top

    Re: Qualify that statement

    by Thom Nichols

    I think the author means "age" in terms of language features rather than performance (as people have said Java and C/C++ are showing their "age").

    Things like class/ inheritance model... String interpolation anyone? I would say "threading" but that's more an API thing.

    Whatever happened to Google's "native code in the browser" concept that presumably would allow most JIT languages as well?

  4. Back to top

    Re: Qualify that statement

    by Michael Neale

    Also - its not really adding scripts to the browser, but to the silverlight plugin (which presumably lets you get at the dom). There have been lots of ways of doing that in the past but none have reached ubiquity.

  5. Back to top

    I wish Microsoft would just open source the mini-CLR

    by Dan Tines

    HTML 5 looks nice and all, but there's issues with "just javascript".