BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Lively Kernel: How Web Programming Should Have Been Done From the Beginning?

Lively Kernel: How Web Programming Should Have Been Done From the Beginning?

This item in japanese

Started as an experiment at Sun Labs, Lively Kernel aims at bringing the same kind of simplicity, generality and flexibility to web programming that we have known in desktop programming for thirty years and leverages the dynamic aspects of JavaScript to make it possible to create, modify and deploy applications on the fly, using tools built into the system itself.

In a Contrarian Minds article, the project lead Dan Ingalls, provides some background on how the project got started and expresses his views about the beginnings of web programming:

When people decided to do the Web, they started with a text markup language. This was a big step backwards. HTML took off because it had links. It took off and all of a sudden, that's the Web. The truth is there was plenty of computer science and graphical know-how to do that with text and graphics on nearly any computer, but the people doing the Web weren't into that frame of mind.

With time, people started to want more and things got more complex:

So you get a document object model on top, stylesheets added on top of that, and then JavaScript added on top of that to try and get some dynamic behavior -- and it all could have been done much simpler with just a dynamic language and a decent graphics model. It seemed to us that if you began with a dynamic language and structured graphics, like desktop systems of the 1980s, then even Web-based applications could be just as lively and interactive as the best desktop software.

From this, stems a key difference between Lively Kernel and other systems in the same area: the project's focus on uniformity. In contrast with many current client web frameworks that utilize a diverse array of technologies such as HTML, CSS, DOM, JavaScript and XML, Lively Kernel's goal is to build a platform using a minimum number of underlying technologies. Specifically, the chosen underlying technology was JavaScript due to its ubiquitous availability in web browsers and syntactic similarity to other popular languages such as C++ and Java. Thus, according to Ingalls, Lively Kernel provides a new option:

Everything you need is in the browser. There is a dynamic language there. It may not be your favorite, but it's not a bad one either. There is also a graphics system. Not the best, but pretty nice. Hook it all up with a simple user interface and you're having fun the way people should have fun with computing. I don't mean just fun for entertainment, but it's creatively inspiring. It makes you want to do cool stuff.

Lively Kernel's main features include:

  • Programmatic access to the user interface from JavaScript via the Morphic user interface framework. The user interface is built around an event-based programming model familiar to most browsers.
  • Small web programming environment and computing kernel allowing the platform to also function as an integrated development environment (IDE) and making the whole system self-contained and able to improve and extend itself on the fly.
  • Asynchronous networking through the use of asynchronous HTTP, similar to AJAX.

A foundational component of Lively Kernel, Morphic is a user interface framework that supports composable graphical objects, along with the machinery required to display and animate these objects, handle user inputs, and manage underlying system resources such as displays, fonts and color maps. Morphic was originally built in the Self programming system and later incorporated into the Squeak Smalltalk environment.

For the low level access to the browser's graphics engine, Lively Kernel relies upon the Scalable Vector Graphics (SVG) graphics language. SVG is a W3C specification supported by most browsers and its functionality can be accessed through HTML-like declarative syntax as well as programmatically from JavaScript. Internet Explorer implements graphics capabilities through the Vector Markup Language (VML) and as such Lively Kernel does not work with it yet, while Safari provides the best performance and experience with Lively Kernel applications.

As described in the project's FAQ page, the name "Kernel" was selected because the system:

  • Is still reasonably small - less than ten thousand lines of JavaScript code
  • Is intended to be self-contained and extensible - the system capabilities can be enhanced using only the system itself
  • Exhibits various operating system like qualities - such as the ability to run multiple applications simultaneously

The Lively Kernel does not require any installation or plug-ins and as soon as a link is clicked to start the system, all the Lively Kernel code is loaded into the browser and running. The source code is open sourced through a GPL license and is available for download. A disclaimer on the project's website specifies that Lively Kernel is still "an experiment and a research environment in its early stages, and at this point it is probably more appropriate for students, computing enthusiasts and even children than for, e.g., commercial web site designers."

Requiring the newer implemented SVG support in the browser, Lively Kernel would probably not have been able to deliver us in the past from some of the complexities of web programming but it is however an early promise to bring some technology consolidation and possible ease of use for web programmers. "Enter the Lively Kernel", take the Interactive Tutorial or find more information about the project here.

Rate this Article

Adoption
Style

BT