Welcome to the.gregor.institute, academic home of Gregor Richards.
I teach at the University of Waterloo School of Computer Science. My
office is DC2508. When applicable, my office hours are listed on the
course web page of the course I am currently teaching. Students are
advised to look there.
Feel free to email me at .
Teaching
In the winter of 2019 I am teaching CS842: Virtual Machines for Dynamic Languages.
My research is in programming language and virtual machine design, in
particular dynamic and gradually-typed languages. I am interested in
designing a gradually-typed superset of JavaScript which
preserves the dynamic power of JavaScript,
provides static assurance for a reasonable subset of the
language,
makes the boundaries which cause performance problems in
gradually-typed systems clear,
integrates both conventional static types and C-like memory types,
and
allows for truly-harmless type evolution (adding types with no
effect on dynamic code).
My current projects are
Using type system techniques to improve foreign function
interfaces: FFI's typically wrap values from C, with the effect that
accessing deeply nested data structures can have a significant
performance impact, as well as defying all semantic reasoning. We are
developing a type system and implementation which reflects C's types
into the host language, thus achieving predictable, performant
behavior.
VM support for gradual typing: Conventional gradually typed
languages use wrappers to enforce contracts. Our modified VM,
HiggsCheck, avoids these wrappers by modifying object shapes. This
allows HiggsCheck to implement gradual typing much faster—in some
cases, hundreds of times faster—than existing solutions.
Locus Types: A new way of writing types that minimizes syntactic
overheads. Locus types reify the concept of "object created here" as a
type, where the structure of that type is determined by the
statically-testable facts about the changes to the object made in a
particular function. Put simply, to declare a type, the programmer
simply annotates which function makes objects of that type. Under the
covers this uses TypeScript plus flow-based type inference.
Low-Level Gradual Typing: C interfaces in dynamic languages usually
involve a fairly expensive "thunk" layer which translates all dynamic
accesses into simple memory accesses, and involves allocating dynamic
objects to wrap each C object. Without a type system this is
unavoidable, but with a (gradual) type system it should be unnecessary.
We're implementing a variety of Lua that will eliminate this extra
baggage for accessing C objects.
Other possible projects: These are things I have on the docket but
are not primary projects. A user study of the maintenance effects of
gradual typing. Software engineering tools to suggest where gradual
typing could be most beneficial, and equivalent dynamic analysis tools
to eliminate gradual checks if they hinder performance.
Reasoning About Foreign Function Interfaces Without Modelling the Foreign Language.
ECOOP 2019. Alexi Turcotte, Ellen Arteca and Gregor Richards.
The VM Already Knew That: Leveraging Compile-Time Knowledge to Optimize Gradual Typing.
OOPSLA 2017. Gregor Richards, Ellen Arteca and Alexi Turcotte. [pdf]
Concrete Types for TypeScript
ECOOP 2015. Gregor Richards, Francesco Zappa Nardelli and Jan Vitek.
My PhD dissertation, titled Refinement of Web Software Motivated by Real-World Patterns derives from my previous work below, and additionally describes a gradual type system for JavaScript.
Flexible Access Control for JavaScript
OOPSLA 2013. Gregor Richards, Christian Hammer, Francesco Zappa Nardelli, Suresh Jagannathan and Jan Vitek. [pdf]
One VM to Rule Them All
Onward! 2013. Thomas Würthinger, Christian Wimmer, Andreas Wöß, Lukas Stadler, Gilles Duboscq, Christian Humer, Gregor Richards, Doug Simon and Mario Wolczko. [pdf]
Eval Begone!: Automated Removal of Eval from JavaScript Programs
OOPSLA 2012. Fadi Meawad, Gregor Richards and Jan Vitek. [pdf]
Automated Construction of JavaScript Benchmarks
OOPSLA 2011. Gregor Richards, Andreas Gal, Brendan Eich and Jan Vitek. [pdf]
The Eval that Men Do — A Large-scale Study of the Use of Eval in JavaScript Applications
ECOOP 2011. Gregor Richards, Christian Hammer, Brian Burg and Jan Vitek. [pdf]
An Analysis of the Dynamic Behavior of JavaScript Programs
PLDI 2010. Gregor Richards, Sylvain Lebresne, Brian Burg and Jan Vitek. [pdf]
Thorn — Robust, Concurrent, Extensible Scripting on the JVM OOPSLA 2009. Tobias Wrigstad, Johan Östlund, Gregor Richards, Jan Vitek, Bard Bloom, John Field, Nathaniel Nystrom and Rok Strnisa. [pdf]
Understanding the Dynamics of JavaScript STOP 2009. Sylvain Lebresne, Gregor Richards, Johan Östlund, Tobias Wrigstad and Jan Vitek.
Miscellaneous
Interested in my hat collection? You can decide which one I'll wear!