We’ve been playing a lot of Astro’s Playroom. I already thought it was great but another week of play has made me love it even more. Friends of mine will be unsurprised to learn I’ve really enjoyed replaying the levels to discover every last artefact and puzzle piece. The music is unbelievably catchy too — the GPU Jungle song in particular has wedged itself deep in my brain. What a great game.
Community: Contemporary Impressionists. Britta is becoming a more annoying person for no obvious reason. I wish they hadn’t made Dean Pelton part of the main cast for season 3 because he’s an unfunny one-note character. Pierce is currently being slightly less awful than before.
The general approach is to write an abstract syntax tree interpreter with Truffle and then use the GraalVM compiler to turn it into a just-in-time virtual machine or (via Native Image) an ahead-of-time compiler. This is cool because AST interpreters are easy to write but usually slow, so it’s almost too good to be true that you can get a fast language implementation without having to write difficult code.
This is possible because the GraalVM compiler has special knowledge of the Truffle AST and does a lot of aggressive optimisation. What’s particularly interesting to me is that the compiler can turn a Truffle interpreter into native code by partially evaluating it with respect to a given AST — the first Futamura projection — which is a technique I gave a talk about in 2013 and am excited to be using for real almost exactly seven years later.
I’m enjoying this work a lot which I suppose means I’m already doing more of the good parts.
One task I picked up was to implement
Module#in TruffleRuby to get it closer to full Ruby 2.7 compatibility. This turned out to be fiddly because, despite a bug fix earlier in the year,
#const_source_locationstill doesn’t work right for autoloaded constants and I wasn’t keen to spend time matching wonky behaviour. I’ve filed a bug in MRI and am hoping they’ll agree that the wonkiness should be fixed or at least documented.
Sorry it’s a dull one this week. I’ll try to think of something funny for next time.