Thomas Denney

Theses

Although I graduated two years ago, I’d previously never made my bachelor’s or master’s theses public, although the code has always been available. I’ve not touched either project since, but the theses both provide missing context.

  • MicroJIT: A JIT compiler for the BBC micro:bit (2018; thesis; code). The micro:bit features a low-powered Cortex M0 processor. At the time the primary programming model for the micro:bit was to transfer a binary over USB and reboot the device. My approach instead allowed new programs, encoded in a stack machine-based bytecode format, to be transferred over serial and JIT-compiled to ARM assembly on device.

  • Stannel and Statick: A parallel embedded processor and a concurrent concatenative programming language (2019; thesis; code). Stannel was a low-powered processor that I design to run on Lattice Semiconductor’s FPGAs, modelled loosely on the Transputers of the 1980s. It was complemented by a custom assembly language and assembler.

    Statick, a concatenative language with dependent, affine types, was arguably the more innovative part of the project. It’s concurrency primitives were based on CSP, but used the type system to restrict and prove operations on them. For instance, a channel could be restricted at compile time to “must use N times,” and the compiler would then statically prove it’s used received and sent on N times before the program terminates (the compiler itself doesn’t prove the program won’t deadlock, but eliminates the need to manage the memory associated with the channel).

    The thesis won the “Microsoft Prize for best Computer Science Project” the year I graduated.

Thanks to some tight editing to get them under the 10,000 word limit, both theses came to exactly 9,989 words.

With two years since removed, I’m able to reflect on these projects a little more critically. MicroJIT wasn’t innovative as a JIT, and beyond function inlining, bounds check elimination, tail call optimisation, and register allocation it didn’t do much beyond basic assembly (although packing all that onto the micro:bit was a challenge). However, it built a solid grounding in ARM assembly and exposed me to a little more compiler implementation than we’d done as part of our courses.

I’m more proud of Statick (the programming language) than Stannel (the processor). Statick is a fun blend of ideas from a whole host of programming languages (Occam, Haskell, Rust, Forth, Cat, Kitten). Nobody should be writing large programs in it, but it serves as a pleasant proof that it’s possible to build a (quirky) programming language with these ideas assembled into it.

Stannel was my first foray into an intermediate-sized project in Verilog. There’s a lot that I’d do differently now, and would’ve done differently given a bit more time (make it register based, not stack based, fix the memory controller, deepen the pipeline). Regardless, working on Statick and Stannel was a pretty good set up for hacking on compilers for large, parallel architectures (which just so happens to be my day job now).

Most of my peers’ projects tended to be more theoretical, so I was glad I had the chance to marry a little bit of theory and practice (mostly thanks to Alex Rogers, my supervisor).

I’d argue combinatorial projects (like my master’s) are a good approach for most CS students. There’s a tendency at many universities for bachelor’s theses to take the form of “I implemented algorithm X in programming language Y and found Z”, but often X is just from one of their supervisor’s papers, Y is whatever the learned the previous year, and Z isn’t too surprising.1 Turning X into a set forcibly exposes students to a wider set of ideas, and may ensure they’re building something genuinely new. By going off the beaten track they’ll learn a little more too. It’d reduce the duplication amongst submitted theses and better mirror the reality of modern research.


  1. Sadly, Y is usually Java. My own bachelor’s thesis fits this box too.↩︎

Visiting the EU

For the last year international travel has been all but impossible. Travel anywhere, for that matter: I last left London 9 months ago. I’ve missed exploring. Adventure. I haven’t been to the EU since the UK left last year, but the pandemic couldn’t stop me visiting the EU

I start the day early. The streets in St John’s Wood are empty — it’s a bank holiday in the UK — and Regent’s Park is too. Here I notice the first problem of the day. Although the sky is grey and unthreatening, the wind is my concern. It’s stripping the trees of their blossom. Pollen is soon in my face and catching on my clothes. I took an antihistamine before I set off; I hope it’ll be enough to see me through.

I reach the Latvian Embassy first and immediately deviate from the route I planned (it would’ve been number 3). The idea and the route for this run emerged months ago. I put it off: I knew that jogging to every EU embassy in London would be close to a half marathon. 27 stops, with navigation between them, was going to take its toll too.

From Latvia I make quick progress: Croatia, Poland, and Sweden are all in north Marylebone. I also stop at Switzerland, because even though it’s not a member state, I still miss it.

Mayfair and Marylebone are built on a grid around squares created by wealthy landowners in the Georgian era. Navigation is easy and it takes me no effort to find Italy in Grovesnor Square. I often jog around this corner of the West End. Malta and Cyprus aren’t far. I jog around St James’s Park to Slovenia.

Lithuania is on Vauxhaul Bridge Road. Not counting my warm-up jog I’ve already covered 10km but I’ve not even covered half the embassies. The road is the busiest yet and the pollution is getting to me.

Ireland is round the back of Buckingham Palace. I hit my stride as a few streets in Belgravia get me to Ireland, Belgium, Romania, Luxembourg, Portugal, Austria, Germany, Spain, Norway (bonus), and Hungary.

In Belgravia a grammar emerges. Each EU embassy flies the EU’s flag and the country’s own flag too (except for Ireland with flag poles but no flags today). The embassies are deceptively large: I discover entrances around street corner that reveal the site must occupy more houses than the front entrance alone. If cars are parked out front, they’re uniformly black and German. Some embassies — or ambassadors themselves, perhaps — opt for short personalised number plates. It’s a nice touch.

Denmark is my favourite. The building, which also houses the Icelandic embassy, starkly contrasts with just about everything else on Sloane Street. Almost all other Belgravia embassies are white houses with pillared porches. Its size surprises me: Denmark has a population of less than 6 million. Other larger countries have much smaller embassies.

I jog past Harrods. Influencers pose for identikit photos all along the street. I’m guilty too, I think to myself: I’ve been taking poorly framed selfies in front of flags all morning.

By the time I reach France I’m flagging. I keep my eyes peeled for a Pret, or anywhere that could serve up a snack. To my slight surprise the bank holiday has kept them closed. I catch my reflection in a shop window: my posture is poor.

I run out of podcasts to listen to; my mind wonders. Many of the embassies are closed, either due to the bank holiday or London’s lockdown measures. Some hadn’t opened in months, according to signs outside. As I document my journey, CCTV cameras outside the embassies do too. Who is watching this? Hidden deep in the embassy are there security officers? Spies?

I jog north through Kensington to Estonia, Bulgaria, and the Netherlands. A Dutch guard notices me, but he’s disinterested. I navigate to Greece through Holland Park using my phone and the printed maps I have with me. The embassy is at the top of the hill. I’m not happy, but I am forgiving: I’m close to the end now.

Surprisingly, it’s not until the Czech Republic that anyone asks me what I’m up to. I explain to the guard, he’s bemused. He’s wearing a white mask with a Czech crest. He tells me there are more embassies in Notting Hill. I know, I tell him. I know.

I finish at Slovakia. For obvious-in-retrospect reasons it shares a building with the Czech Republic.

I’m exhausted. I still have 5km to jog home but I stop twice to grab snacks. A gingerbread man from the Starbucks at Marble Arch gives me a sugar rush but leaves a strong ginger aftertaste in my throat.

Over the morning I ran just over 30KM, 20 of which were between the embassies. My Apple Watch reports that I’ve completed my move ring 720%. I wonder if I needn’t move for the rest of the week.

The morning made for a curious and tiring adventure. This wasn’t really an exploration of Europe at all, just west London. I jogged down streets I’ve never come across before, and perhaps never will again. At times I knew precisely where I was. At times I was lost. I learned a little but saw a lot. As travel restrictions, perhaps I’ll see much more. Perhaps.

New Year's nudges

It is a truth universally acknowledged that New Year’s resolutions do not work. Each year as January rolls around we set ourselves noble goals to exercise more, lose weight, eat more healthily, smoke less, or sleep more. Yet 88% of these resolutions are doomed to fail.

As much as our intentions may be good, New Year’s resolutions mostly fail through poor goal setting: all of the above are much to vague for a start. Plenty has already been written in favour of using SMART goals but I think we should approach resolutions differently.

The above study found that about half the participants even expected their resolutions to fail. That’s pretty poor, but falls well within our cultural experience of New Year’s resolutions: often our resolutions are just something we come up with off the cuff at a New Year’s Eve party or around the water cooler in early January.1 We might stick with them for a few days, but beyond that there’s not much hope.

Instead, let’s find goals that are easy to implement, and that if implemented are likely to succeed. Most traditional New Year’s resolutions seek to maximise the effect of their change, without taking into account its probability of succeeding. If we instead seek to maximise the expected outcome of the change, we can look at maximising the probability of success. In loose Bayesian terms we might write:

P(success) = P(succcess | implementation) * P(implementation)
E(change)  = effect of change * P(success)

If we’re looking for easy, small changes then nudge theory can serve us well: nudges are changes that alter behaviour in a predictable way, but must be cheap, easy to implement, and not forbid other choices. Sounds perfect! Most nudge literature is written for “choice architects” designing for other people’s decision making, but we can readily apply many of the techniques to ourselves.

Good defaults are essential to nudging: if we automatically fall down “the right path” then we’re maximising P(success | implementation) because we don’t need to do anything differently once we’ve implemented the change. By making the change easy, we maximise P(implementation).

A classic example from nudge theory finds that moving healthy snacks, such as fruit, to eye level and making unhealthier snacks less accessible increases healthy snack sales.2 If we’d like to be healthier then eating more fruit is a good start. Here we can take advantage of behavioural shifts from the last year: many of us now buy groceries online rather than in store, and most supermarket sites allow you to create a “default basket” for essentials. Adding more fruit to this, and then placing it where you’d usually put snacks, could be an easy way to get started.

Alternatively, we may have the goal of saving more money. Many banking apps now offer a feature that will “round up” transactions to the nearest pound or dollar, placing the remainder in a savings account. The initial set-up effort takes seconds, and the probability of success given implementation is certain. You’ll save a modest amount of money, but it’s certainly better than nothing.

I’ve recently attempted to sleep better. My sleep was often disrupted by a bright street light, so I installed better black-out curtains. This took less than an hour of DIY (easy to implement) and I draw the curtains each night anyway (default behaviour). It’s already paying dividends.

As we all face another stressful, draining year in a global pandemic, I think it’s high time we abandon over-ambitious resolutions: let’s find small, easy nudges that may actually improve our lives.


  1. Or in 2020-21, on Zoom.↩︎

  2. The other “classic” example is that adding stickers of a fly to urinals improves aim; there are even companies selling stickers for this purpose.↩︎

London, Christmas 2020

Regent Street
Regent Street
Regent's Park
Regent’s Park
The Mall
The Mall
Piccadilly Circus
Piccadilly Circus

For a long time I’ve had walking around and photographing a desserted central London on Christmas Day on my bucket list. Ordinarily the city would be bustling with tourists, workers, and shoppers every day of the year, but inevitably this year was an exception. Instead whenever I’ve gone for walks or runs around Westminster I’ve been confronted with vast empty spaces.

Pictures of desserted cities around the world became a theme of the pandemic. At its outset I hoped they wouldn’t. However, on Christmas Day I walked around the West End and took the above. There were a few others with a similar idea, and around Oxford Circus and Trafalgar Square there were still plenty of people — although I suspect like me they were locals, not tourists.

London Warming

London Warming
A view of the City of London from the north-east at Primrose Hill. With clear skies, temperatures reached the mid-thirties for much of the last few days. Made with Nikon D3400, ISO 100, ƒ/5.6, 1/2500s.

Notes on the Ikea Fullfölja

Ikea Fullfölja

I’m always pleasantly surprised when I come across cheap paper that survives fountain pens: you tend to see the nasty effects of feathering and bleeding. However, Ikea’s Fullfölja notebook line — which cost less than $2 — handle the task well.

I saw only a little bleeding (the paper is only 80gsm) but no feathering. For a such a low cost notebook I can’t complain, although I wouldn’t choose to write in this full time. The cover is reportedly “durable card” although I found it took little effort to scratch it.

Paper has long been one of Sweden’s primary exports, so Ikea’s success here is perhaps inevitable, although this notebook is made in China.

The Fullfölja is available on Ikea’s website (UK; US) or in store in their Marketplace.

The French Economist Thomas Piketty

Thomas Piketty’s work on income inequality is much cited and discussed; he is considered one of the most influential living economists. I’ve seen his name crop up a lot recently, especially in articles about the economy after coronavirus. However, there’s just one problem: journalists can’t seem to resist mentioning that he’s the “French economist Thomas Piketty”.

The fact that Piketty is French doesn’t particularly matter to most articles that introduce him this way: granted some of his work focused on the French economy and most of his books and articles were published in French before English translations, but this rarely affects the context.

Even Piketty's own publisher couldn't resist the phrase in a review on the back cover of Capital in the Twenty-First Century.
Even Piketty’s own publisher couldn’t resist the phrase in a review in a review on the back cover of Capital in the Twenty First-Century.

For a while I had a hunch that Piketty was introduced more frequently by his nationality than other economists, so I collected data on the matter. Using a list of the “15 most influential living economists” from The Economist in 2014, I used Google search result counts for the exact phrase “Nationality economist Person” to determine overall ratios.1 I have also included Adam Smith, Keynes, and Marx for reference.

Economist Nationality Total With Nationality Ratio
Robert Shiller American 567,000 12,300 2.17%
Thomas Piketty French 2,080,000 37,500 1.80%
John Maynard Keynes British 2,470,000 43,400 1.76%
Jeffrey Sachs American 1,040,000 8,420 0.81%
Laurence Kotlikoff American 58,400 442 0.76%
Kenneth Rogoff American 552,000 3,170 0.57%
Alan Blinder American 167,000 694 0.42%
Martin Feldstein2 American 370,000 833 0.23%
Joseph Stiglitz American 1,720,000 3,560 0.21%
Paul Krugnman American 3,340,000 4,460 0.13%
Karl Marx3 German 20,500,000 22,980 0.11%
Adam Smith Scottish 17,200,000 15,500 0.09%
Larry Summers American 1,400,000 907 0.06%
Daniel Kahneman4 Israeli-American 3,200,000 879 0.03%
Justin Wolfers American 222,000 4 0.00%
Simon Johnson British-American 592,000 3 0.00%
Jonathan Gruber American 244,000 1 0.00%
Ernst Fehr Austrian-Swiss 148,000 0 0.00%

Shiller, Piketty, and Keynes are clear outliers. The dominance of Americans both in the list and in the field perhaps suggests that economists are considered American by default by most journalists (and perhaps readers too). Nevertheless, the bottom half of the list comprises those of dual and other nationality. The inclusion of a more international pool of economists might reveal a different trend, although we would expect significantly fewer references to them.

Next, I restricted my search to references to these economists on The Economist’s own website. This ought to reduce false positives in the data too, as references to these names are more likely to be to the economists rather than other individuals of the same name. I suspected that The Economist was particularly prone to this trend.

Economist Nationality Total Economist mentions With Nationality Ratio
Thomas Piketty French 2,530 125 4.94%
John Maynard Keynes British 2,970 3 0.10%
Adam Smith Scottish 5,200 4 0.08%
Paul Krugnman American 3,900 1 0.03%
Karl Marx German 4,050 1 0.02%
Larry Summers American 2,580 0 0.00%
Robert Shiller American 1,430 0 0.00%
Daniel Kahneman Israeli-American 1,150 0 0.00%
Joseph Stiglitz American 1,030 0 0.00%
Jeffrey Sachs American 892 0 0.00%
Kenneth Rogoff American 888 0 0.00%
Simon Johnson British-American 859 0 0.00%
Martin Feldstein American 764 0 0.00%
Alan Blinder American 585 0 0.00%
Justin Wolfers American 567 0 0.00%
Jonathan Gruber American 209 0 0.00%
Laurence Kotlikoff American 95 0 0.00%
Ernst Fehr Austrian-Swiss 4 0 0.00%

Amongst Economist articles Piketty is an even more extreme outlier. I’ve found no evidence in The Economist Style Guide that the publication requires the use of nationality or profession when introducing individuals, and the data show this is true of other economists. In conclusion, I’ve absolutely no idea why the newspaper so frequently introduces him as the “French economist Thomas Piketty”, but they certainly refer to his nationality and occupation a great deal more than they do of his peers.


  1. This list was criticised on publication (not least by The Economist itself a few days later) for including no women and being overly academic.↩︎

  2. Died after the list was written.↩︎

  3. Totals include the professions economist and philosopher.↩︎

  4. Totals include the professions economist and psychologist.↩︎

MUJI Stationery

MUJI, the minimalist “no-brand” Japanese retail store, sells an excellent collection of stationery. Usually after removing any stickers or packaging from their products there is no branding left. However, I’d argue that their products are branded in the sense that they are distinctly recognisable, particularly by their quality. MUJI stationery is not the cheap, prototypical “no-brand” stationery that you might purchase from a supermarket, for example.

MUJI fountain pen and notebook
MUJI fountain pen and notebook

I don’t have too much to say about the MUJI fountain pen. Unusually for a sub-$20/£20 pen it has an all-aluminium body. The design is simple, but looks a lot better than similarly priced pens. The nib is a Schmidt fine, and its fine. It writes fine. It flexes fine. It looks fine. I prefer Bock nibs, but I’ve no major complaints about the Schmidt nib. The pen can take an international converter or cartridge, although I only had luck fitting some international converters into mine (I suspect it might have a manufacturing defect as the nib sometimes wobbles a little).

However, my main experience of MUJI pens is not with the fountain pen, but with their gel pens. Today, MUJI sell round polycarbonate gel pens in a wide variety of colours and point sizes. Conveniently, you can buy them in bulk and purchase refills too. For an inexpensive gel pen, they write smoothly and you can buy them with very thin line widths.

MUJI hexagonal gel pen
MUJI hexagonal gel pen

My favourite MUJI pen is no longer sold as far as I can tell. At least as recently as 2018, MUJI sold hexagonal polycarbonate gel pens. I’ve owned dozens of them, and they were popular amongst my friends and family: to solve a lifetime of pen purchases, one friend even bought all the refills in stock in a San Franciscan MUJI.

By the summer of 2019 I couldn’t find them anywhere: I checked MUJI stores across cities and continents. They’re absent from MUJI’s website (although a picture on the fountain pen page clearly still shows one).

MUJI hexagonal gel pen

Although the current round pens carry a similar refill and write just as well, I’m still a little sentimental for the hexagonal pens. I alternated between fountain pens and these MUJI pens for most of the mathematics I wrote at university: their narrower line width was useful for drawing out intricate symbols next to prose.

For the time being I’ve got plenty of the pens and their refills kicking around, but I’d love to know the story of their disappearance.

Westminster Bridge

Westminster Bridge

Lamy 2000

Lamy 2000

Alongside most of the world I am working from home amidst the Covid-19 crisis. The UK will review its lockdown tomorrow, but it will be a long time before life returns to normal. The extra time afforded by my significantly shorter commute has given me the opportunity to cook, watch movies, and enjoy my fountain pen collection.1

I bought a Lamy 2000 after completing my undergraduate degree, but used it little through my master’s. It had long been my grail pen but I had no need to write Verilog by hand, so it remained largely unused.2 Prior to the 2000 I owned the Lamy Studio, Vista, and Safari. All of these are great pens and exploration inevitably lead me to the 2000.

My immediate reaction to the 2000 was that it looked so much cooler than all my other Lamy pens. The Studio certainly has a distinctive shape and clip whilst the Safari/Vista design is purely functional and almost authoritarian: the triangular grip dictates how you must hold the pen.

On the other hand, the 2000 is ingenious in its simplicity. Ignoring the cap, you’d be forgiven for thinking the pen is a single part. The joins separating the body from the grip and the body from the twist mechanism are deliberately obscured. Unlike most fountain pens, disassembly is rarely required as the pen can be refilled just by dipping it in ink and rotating the end cap. This unibody design predates the MacBook by forty years.

Lamy 2000

Although enamoured with the pen’s appearance, I didn’t initially enjoy writing with it as much as I expected. I initially had a faulty pen that leaked and ink didn’t flow well through the second nearly as well as some of my TWSBI or Pilot pens. However, over time I adjusted to the pen, and found I preferred the “fine” thickness to my other, thicker nibs. The rhodium-plated gold nib is also the smoothest nib I’ve ever used, and surprisingly forgiving on poor quality paper. Today I have no complaints whatsoever about the functionality of the pen, and I’ve never had difficulties caring for or cleaning it.

Expensive fountain pens tend to be heavier than their cheaper counterparts, especially north of $200. In part this is due to the use of metal parts over plastic, but I suspect it mostly plays into the psychology of heavier objects feeling more substantial and therefore more valuable. The 2000 eschews this, and is instead finished in Makrolon (polycarbonate) so that it weighs in at just 25g, little more than the 17g Lamy Safari, even though it costs an order of magnitude more. I’d argue that this gives the 2000 a significant advantage over other pens in its price category: I can hold it and write with it for much longer than a Pilot Vanishing Point, for example.

Like the Lamy Studio — but unlike the Safari — the 2000 gives you flexibility in the way you hold it. The grip isn’t entirely symmetrical: it cuts off to form a straight edge with the nib. When viewed from below the symmetry returns: the outline of the nib mirrors flat area around the breather hole.

Lamy 2000

The 2000 features a narrow window near the section to indicate remaining ink. Windows are a common feature of Lamy pens, but unlike the Safari the slits only give you a vague sense of how much you’ve got left. Although windows are certainly useful, I don’t particularly like it as it edges away from the design’s uniformity. The window doesn’t feature on the “metal” finish of the pen, but inevitably I own the pen in black. The pen is light enough that the filled and unfilled weights are noticeably different.

A disadvantage of the uniformity is that the pen loses modularity: there is no choice over nib or ink refill mechanism. This is not entirely a bad thing: I’m a great lover of bold designs that are unafraid to make choices for you.3 In any case, I can’t imagine there are many people installing a $200 gold nib in a $20 Safari.

Lamy 2000

The 2000 is by far my favourite pen. I’m certainly not alone in my love for this pen and my affection is perhaps even clichéd. However, I believe represents the best of what fountain pens can be: comfortable to write with, easy to hold, and a hell of a great design. It is to this pen I point when I need to justify my view that fountain pens are the best writing instruments we have. In times such as these, we should celebrate that which represents the very best of what we can be, if only to bring a little more cheer into the world.


  1. My most recent experiment was fresh pasta: using only a rolling pin to roll and fold the pasta probably burned more calories than I actually consumed.↩︎

  2. I didn’t enjoy typing the Verilog too much either, but I was at least happy with the final processor that I designed for my thesis.↩︎

  3. I have a fantasy of a “zero-decision” restaurant: you would walk in, be seated and served a single starter, then main, and finally dessert. Each course would be partnered by a single appropriate wine. Perhaps finish with coffee. Then leave, paying a bill that includes the tip and taxes, rounded to a suitable pleasing amount. No choice whatsoever: the only decision you can make is to walk through the door. My libertarian side does not advocate that all restaurants should be like this, but I’d love to experience one.↩︎