<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><link title="Cyrus Omar" href="https://web.eecs.umich.edu/~comar/news.xml" rel="self"/><icon>https://web.eecs.umich.edu/~comar/assets/favicon.ico</icon><author><email>comar@umich.edu</email><uri>https://web.eecs.umich.edu/~comar/</uri><name>Cyrus Omar</name></author><id>https://web.eecs.umich.edu/~comar/news.xml</id><title type="text">Cyrus Omar's feed</title><updated>2026-10-31T00:00:00-00:00</updated><entry><published>2026-10-31T00:00:00-00:00</published><link title="Lively typed tables in Hazel" href="https://web.eecs.umich.edu/~comar/notes/lively-typed-tables" rel="self"/><content xml:base="https://web.eecs.umich.edu/~comar/" type="html">&lt;p&gt;Most data analysis happens in dynamic languages like &lt;strong&gt;Python&lt;/strong&gt;, &lt;strong&gt;R&lt;/strong&gt;, &lt;strong&gt;MATLAB&lt;/strong&gt;, and &lt;strong&gt;Julia&lt;/strong&gt;
using computational notebook interfaces like &lt;strong&gt;Jupyter&lt;/strong&gt; and &lt;strong&gt;R Studio&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;These are flexible systems, but dynamic checking leaves critical information about
&lt;em&gt;table schemas&lt;/em&gt;, i.e. a table's column names and corresponding types,
completely latent in the operations that are performed.&lt;/p&gt;
&lt;p&gt;Knowing the schema of a table generated during a calculation is useful for
several reasons. It allows your editor (even when used by an AI) to provide more accurate autocomplete and
error localization, often before you waste your time running an expensive
but incorrect computation.&lt;/p&gt;
&lt;p&gt;Making schemas explicit, e.g. at function and module boundaries, is also critical to
interoperability and reuse, key concerns as scientific
work scales up to planetary scale (see our &lt;a href=&quot;/papers/2025-fair-commons-propl&quot;&gt;FAIR case for a live computational commons&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Shifting to a statically typed approach could help matters, with table schemas tracked as types.
However, there is &lt;strong&gt;a major problem with statically typed systems for working with tables&lt;/strong&gt;: they struggle with
&lt;strong&gt;data-dependent operations&lt;/strong&gt; where the schema of a function's output depends on the values in its input.&lt;/p&gt;
&lt;p&gt;For example,
unstacking a long table into a wide one like in the example below produces a table whose column names and types
depend
on the values (here, in the &amp;quot;element&amp;quot; column) of the input! No ordinary static type checker can encode the type of this kind of operation
precisely.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/notes/lively-typed-tables-unstack.png&quot; alt=&quot;%c&quot; title=&quot;Unstacking a table of weather observations. The new columns come from the data, so there is no tmean column; live typing flags the access.&quot; &gt;&lt;/p&gt;
&lt;p&gt;In &lt;a href=&quot;/papers/2026-typed-tables-oopsla&quot;&gt;Interactive Data Analysis with Lively Typed Tables&lt;/a&gt;,
which &lt;a href=&quot;https://bandukwala.me/&quot;&gt;Alexander Bandukwala&lt;/a&gt; presented at OOPSLA 2026, we take a different
approach in &lt;a href=&quot;/projects/hazel&quot;&gt;Hazel&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Tables are semantically just lists of labeled tuples&lt;/strong&gt;, with a few gradually typed
operations (where the type is left statically unknown) for working with columns as strings.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Live typing&lt;/strong&gt; feeds the types Hazel observes while running your program back
into the static type checker. Because Hazel is live and keeps running programs even when they
have holes and errors, it can report that a column produced by an unstack
doesn't exist right where you access it, before you edit (or evaluate) further (e.g. in the example above, there is an error on the incorrect projection of &lt;code&gt;tmean&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is a straightforward approach, but it works beautifully!&lt;/p&gt;
&lt;p&gt;Going further, we build a number of &lt;em&gt;direct manipulation editing&lt;/em&gt; tools for working with tables directly into Hazel as well, so you can do exploratory data analysis directly in Hazel and, unlike in tools like spreadsheets, encode the manipulations you performed as reusable and modifiable code.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/notes/lively-typed-tables-rich-probe.png&quot; alt=&quot;%c&quot; title=&quot;Rich table probes. (a) The column header menu for Year suggests type conversions based on the live type of the table. (b) Each choice is written back into the program as code.&quot; &gt;&lt;/p&gt;
&lt;p&gt;The paper evaluates the overall Hazel design against the &lt;a href=&quot;https://github.com/brownplt/B2T2&quot;&gt;Brown Benchmark for Table Types&lt;/a&gt;,
where Hazel expresses every example, and in a lab study with seven
participants doing data cleaning and analysis. People liked it!&lt;/p&gt;
&lt;p&gt;You can try tables in Hazel
today (see the tables tutorial from the dropdown at the top, and the Tables page in the documentation at
&lt;a href=&quot;https://hazel.org/build/dev/&quot;&gt;hazel.org/build/dev&lt;/a&gt;). There is a
&lt;a href=&quot;https://www.youtube.com/watch?v=aCbrzAnBEbM&quot;&gt;recording of the talk (14m)&lt;/a&gt; where Alexander gives several nice live demos of these ideas.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;During my sabbatical in Cambridge&lt;/strong&gt;, I hope to try porting more sophisticated data analyses from folks working in climate modeling of all sorts
into this system and continue scaling it up until the point where Hazel really is a better tool overall for this kind of work than existing
systems. We've got a ways to go with performance but based on our lab study, we think we're quite close on the UI and semantics front!&lt;/p&gt;
</content><category term="oopsla"/><category term="hazel"/><id>https://web.eecs.umich.edu/~comar/notes/lively-typed-tables</id><title type="text">Lively typed tables in Hazel</title><updated>2026-10-31T00:00:00-00:00</updated><author><email>comar@umich.edu</email><uri>https://web.eecs.umich.edu/~comar/</uri><name>Cyrus Omar</name></author></entry></feed>