Wt is a freely available library and application server (www.webtoolkit.eu/wt) that lets C++ programmers write modern web applications using a familiar C++ GUI programming style. Wt then renders the C++ applications to the web browser. Figure 1, for instance, is a running Wt applicationa functional look-alike of the GMail composer, fully AJAX enabled, and written entirely in C++ using CSS for the markup.
From a programmer's perspective, the Wt API is similar to those offered by libraries such as Qt, Gtk, wxWindows, and the like. However, instead of rendering widgets to Windows/X11/ windows, Wt incrementally renders the widgets in web browsers. Wt completely hides the underlying web technologies (HTML, AJAX, XML, CGI, JavaScript, and DHTML), chooses a rendering and session-management strategy depending on browser capabilities, and deals with browser dialects.
Browser-side events such as button clicks, mouse movements, and drag-and-drop events are transparently converted into server-side events using Wt's signal/slot mechanism. Wt comes with a dynamic C++-to-JavaScript translation mechanism to avoid the high-latency server roundtrip for simple visual updates, while sticking to a single C++ specification of the event-handling code. While Wt's rendering engine preferably uses AJAX for incremental rendering of updates made to the widget tree, Wt applications also work when AJAX or JavaScript are not available (or disabled). By exposing only a widget-level API, the library can guarantee protection against the most common cross-site scripting (XSS) attacks, by built-in and automatic filtering of displayed strings for malicious tags.
Figure 1: A running Wt application.
Being a native C++ library, web applications developed with Wt typically enjoy greater efficiency and a smaller footprint than Java or Ruby solutions. As such, Wt lends itself to devices where efficiency and footprint matters, like in embedded applications.