This project investigated new ways to take advantage of Ur/Web, a programming language specialized for building interactive Web sites (applications). In particular, Ur/Web is distinguished by more specialized features for accessing databases based on the popular SQL language. In a sense, the Ur/Web compiler "understands" how an application is using the database, where mainstream compilers and libraries lack any such understanding. As a result, the Ur/Web compiler can do a better job of checking programs for errors and making them run quickly.
One key outcome is the Ur/Web People Organizer (UPO), a production-ready code library written in Ur/Web. With UPO, applications can be assembled quickly by combining standard concepts like message forums and polls, where these standard concepts nontheless need to be customized to the application in subtle ways. Such a concept exists as a first-class module in UPO, with a formal specification of the dimensions of customization and of what functionality is offered in return. These specifications are type signatures, thus making them relatively accessible to programmers.
Another outcome is Sqlcache, a new compiler optimization that speeds up SQL-based Ur/Web programs without requiring any extra work by the programmer. From the same code that Ur/Web programmers would write anyway, Sqlcache infers opportunities to cache database results. That is, when a set of results is retrieved from the database, the program saves it in memory, so that the program can skip future executions of the same query. These caches are also used to save whole segments of generated web pages, some of which may depend on multiple different queries. The key challenge here is to also infer which invalidations are necessary: when the program makes database modifications, some of the old saved query results may no longer be up-to-date, so they must be removed from caches. The approach taken also scales to concurrent execution of Web applications, allowing many cache operations to execute simultaneously, in common workloads.
On the side of practice, the project has produced several artifacts that are usable for real-world programming today. The Ur/Web compiler is available as open source, including in popular package systems for Linux and Macintosh platforms. It compares favorably to alternative tools in dimensions like performance of compiled Web applications, as shown by a third-party initiative called the TechEmpower Web Framework Benchmarks, where Ur/Web places a close second out of 194 tool combinations used for the marquee benchmark. The UPO framework is also available as open source and has been used for a number of production Web applications within MIT, with a total of about 500 users between them.
Last Modified: 11/30/2016
Modified by: Adam J Chlipala