Performance Blasts Off
The introduction of Chrome was followed by renewed, concerted efforts toward full adoption of existing Web standards by browser vendors, and the creation of new standards. These efforts gained additional momentum through Apple's refusal to integrate either Flash or Java into its mobile products, and its aggressive promotion of standards-based alternatives.
Today's modern browsers support all of these standards. They include:
- HTML5. Introduces semantic markup, vastly increased capabilities for CSS, standardizes SVG for vector graphics, introduces the Canvas tag for dynamic raster graphics, adds audio and video elements, and includes other innovations.
- WebGL. Supports GPU-accelerated graphics.
- Web Components. Enables the creation of developer-defined HTML elements that behave nearly indistinguishably from native ones.
Perhaps the most important innovation introduced by Chrome was auto-update, a system now used by every modern browser. Long gone are the days when Web developers had to wait years before reliably deploying new features. The result was the long overdue death spiral of Internet Explorer, and a much deeper commitment to the timely implementation of standards among browser vendors.
The stability and standards-compliance of today's browsers makes them a much more useful platform on which to build the kinds of rich, graphically-intensive user interfaces required by chemistry.
Deployment Options Multiply
- Express, a fast and lightweight Web server.
- NoSQL databases including MongoDB and CouchDB.
- Electron, a framework for building native, cross-platform desktop applications.
- React Native, a framework for building native, cross-platform mobile applications.
These ever-increasing deployment options mean that code originally targeted for the Web browser can be re-purposed for completely different environments including native desktop and mobile applications, databases, and Web servers.
Chemistry applications often require sophisticated interactions with complex data structures such as molecular structures. In 2008, no software for doing so was available. However, a comment left on my original article was the first spark of a fire that continues to this day: cross-compilation.
Based on clearly-demonstrated need, a consortium of groups began work on the WebAssembly standard (aka "Wasm") in 2015. The Mozilla Developer Site describes WebAssembly as follows:
WebAssembly is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages with low-level memory models such as C++ and Rust with a compilation target so that they can run on the web. (Note that WebAssembly has the high-level goal of supporting languages with garbage-collected memory models in the future.)
The Language Evolves
- Destructuring. Greatly simplified syntax for manipulating the properties of both arrays and objects.
- Arrow Functions. Simplified function declaration syntax that clarifies the meaning of "this."
- Class Notation. Syntax overlay for generating class-like data structures (but see this caveat).
await replaces "Callback Hell" with notation that looks indistinguishable from traditional code save for two new keywords.
UI Tooling Proliferates
The noise around competing UI systems can be distracting, but fortunately most frameworks and toolkits are at this point are merely re-working the same handful of ideas. By far, the most influential of these is "Reactive Programming", which was popularized by React. A firm grounding in Reactive Programming will go far in building a fast, functional user interface.
Developer Tools Abound
Other advanced chemistry tools and applications have been released over the years. Noteworthy examples include:
- JSmol and several other 3D molecular visualization tools
- ChemDoodle Web Components
- Marvin JS
A Continuing Unmet Need
- distributed as a collection of ES modules for easy integration and minimum bloat
- fully unit tested for quality control
- ready to run in either Node.js or the browser
- accompanied by full, un-obfuscated source code
- permissive, non-reciprocal (i.e., non-copyleft) licensing
- minimal startup overhead for optimal user experience
- compact distribution enables use on resource-constrained devices
- a minimal, well-documented and supported build process
This gap hampers the future development of chemistry applications. Without robust, general-purpose cheminformatics tooling, each application will be forced to invent its own, a daunting prospect in any setting but even more so in the relatively constrained environment of the Web browser.
The Trouble with Foreign Code
- RDKit.js, compiled from RDKit
- InChI.js, cross-compiled from InChI
- Cheminfo-to-web, cross-compiled from Open Babel
- OpenChemLib JS cross-compiled from Openchemlib
If deploying to a browser, one of the most persistent problems with cross-compilation will be performance. In the case of InChI JS, I've noticed performance hit of between two and tenfold. For one-off functions, this is hardly a problem, but at scale, the performance gap can quickly make certain operations impractical. Fixing these problems requires an enormous amount of skill. Memory bugs can be virtually impossible to track down given the lack of good tooling.
WebAssembly appears able to mitigate the big blob problem through various optimization settings. Perhaps concerted efforts along these lines could bear fruit.
1. Incremental Innovation
The HTML5/ES platform is now very mature, with a vast installed base, a thriving developer community, and a fortress of implemented standards. Calls for stabilization and optimization will likely dominate discussions in working groups going forward. Laggards and fence-sitters will be jumping in with full force, further motivating a conservative approach to future API changes.
Following a now-familiar "backfill" pattern, new APIs are likely to be introduced only to facilitate those things already being done by many developers through add-on libraries and other workarounds.
2. WebAssembly is a Big Deal
WebAssembly's ability to run as a securely sandboxed alternative to native compile targets, together with its widespread deployment even at this early stage, hints at a future in which WebAssembly becomes a standard target for most compiled languages.
It seems obvious at this point that within the near-term many groups will attempt to compile critical computational chemistry libraries, many of which are written in Fortran and C, to WebAssembly. This will lead to an abundance of high-powered chemistry functionality with relatively little in the way of user interface to power it.
3. Performance Gains
4. Wither Desktop Software?
The dual forces of ever-better Web browser performance and relentless diffusion of the Web technology stack can be expected to exert a major influence on the way chemists use computers. It's still way too early proclaim the death of desktop software, but the time is rapidly approaching when chemists won't be able to tell the difference between using a website and running a thick client.
5. New Kinds of Applications
As browser applications begin to reach, and possibly exceed, performance parity with desktop applications, I expect new generes of chemistry software to appear. I don't know exactly what form they'll take or what problems they solve, but I suspect they'll inject an unprecedented level of collaboration and simplification into existing workflows.
Consider the case of SolidWorks vs. OnShape. SolidWorks has been the industry standard for 3D mechanical modeling for years. It's an extremely complicated, computationally-demanding application. In 2015 OnShape released the first public beta of its eponymously-titled browser-based alternative to SolidWorks. Not only does OnShape support the most useful core functionality of SolidWorks, but in most cases it does so far better through a streamlined, carefully constructed interface. Rendering performance is at least as good as that of SolidWorks. However, the biggest reason to use OnShape is not the smooth motion, streamlined interface, or sheer joy of flushing a convoluted, bug-riddled installation procedure. The best part is how OnShape brings collaboration and revision control to a product genre that previously treated it as an afterthought. Whereas teams used to struggle with how to collaborate on designs using SolidWorks, collaboration falls out as a natural consequence of using OnShape.