This is an early preview of the features provided by the prototype of Haskell Web Toolkit (HsWTK), a thin layer on top of DOM which provides basic HTML layout capabilities and simulates cooperative pseudo-threads. HTML widgets displayed are self-explanatory. This demo program is also a memory leak test: please load it into various browsers and notice if browser executable size increases as certain user actions are performed. In fact, there should be no serious leaks, periodic browser size increases were noticed in Microsoft Internet Explorer v6, but at certain moments size decreased due to proper garbage collection. Browser size may even get smaller if the demo program page is unloaded. Mozilla Firefox did not show any memory leaks.

Features:

Prototypic code of Haskell Web Toolkit:

Functions and combinators to describe appearance of a web form

Support for cooperative threads, events handling, message passing between threads

Widgets demonstrate interaction between HTML form elements

Programmable timer: while waiting, browser does not lock up

Some of these demo widgets are based on demo programs seen in Fudgets Thesis

Type any text in the input field provided, and see it echoed right above after Enter is pressed. Just for fun, type any decimal number and see it converted to a Roman number, and vice versa. For more fun, a timer is provided: measure how fast your browser runs Haskell ;)

Around March 20, 2007, handling of Unicode character properties was added to the Yhc/Javascript runtime. This implementation is based on the Unicode Character Database available from the Unicode Consortium. The database was compiled in Javascript and included in the output web page. This demo program is just recompilation of the same Echo source, but with the new runtime that supports Unicode. The Javascript Unicode Characters Database adds about 70k to the web page size.

Features:

Same as in the above demo program. Replacement of functions like toUpper, toLower, isAlpha etc. to direct Javascript implementations affects the timing shown by the program: in some browsers there may be some speedup, in other browsers there may be a slowdown.

Finally, the DOM framework has been implemented. IDL files provided by the Web Consortium were converted into set of Haskell modules using modified sources of H/Direct, mainly the OMG IDL parser. The DOM framework uses Continuation passing style (CPS) rather than monadic style: this is believed to make adoption of Fudgets easier as they use mainly CPS style in their internals. This demo web page looks similar to the previous Echo demo, and provides the same "functionality". This demo web page also uses unicode-enabled versions of character functions.

Features:

Utilization of the type-safe DOM Level1 interface:

Demonstration of the CPS style

No unsafe direct access to Javascript objects needed: a library is now available