Blog
Notes on languages, tools, and the things I build.
-
PHP, on a Whim #3: Who Is Allowed to Implement This?
Whim lets classes and interfaces list the types allowed to inherit from them using a `for` clause. This post looks at what sealed families actually restrict, why direct children matter, how Whim enforces and reflects the relationship across runtime-loaded files, where Hack influenced the design, and what changed after a similar PHP RFC I co-authored was rejected, including why Whim chose the syntax that received exactly zero votes.
Read articleSeries: PHP, on a Whim
-
PHP, on a Whim #2: Stop Calling Everything an Array
PHP uses one runtime type for lists, dictionaries, tuples, records, and occasionally fake sets, then asks functions like json_encode() to guess which one you meant. This post looks at how Hack changed the way I think about collections, why Whim has distinct vec, dict, and tuple values, how runtime-enforced shapes and array connect them, what the VM does to keep those checks practical, and whether PHP could ever stop calling everything an array.
Read articleSeries: PHP, on a Whim
-
PHP, on a Whim #1: What If Files Had Attributes?
Whim recently gained file-level attributes, mostly because I wanted a clean way to configure lint rules for an entire source file. That small feature first required making files visible through reflection, then unexpectedly opened the door to things like discovering every symbol defined by a file and grouping function-based routes under shared metadata. This post looks at how it works, what it took to implement, where the design gets awkward, and whether something similar could make sense in PHP.
Read articleSeries: PHP, on a Whim
-
PHP, on a Whim #0: A Language for PHP’s “What Ifs”
Whim started as a weekend implementation of Lox, accidentally became interpreted Rust, and eventually turned into a PHP-shaped playground for language ideas. This first post tells that story, explains what Whim is actually for, why I do not trust it with serious production work, and why adding a feature to Whim in a day says absolutely nothing about how quickly it could or should land in PHP.
Read articleSeries: PHP, on a Whim