168 days ago · 8 min read1677 words · Tech · hide · Fediverse post

Introduction Over the course of this series I ended up writing the same toy async message queue server five times: in Python, JavaScript, C++, Rust and Go. Each one is under 500 lines of code, each speaks the exact same line-based JSON protocol over TCP, and — this is the part I was proud of — each one passes the exact same suite of 34 unit tests. The whole point of the test suite was to enforce wire-compatibility across languages. So here is the uncomfortable question I eventually asked myself: does passing the same tests actually mean the five servers behave the same? Or does it just mean they agree on the 34 things I happened to write tests for? I went looking, at the byte level, and the answer is clearly the latter. Below are at least six ways the five implementations disagree — and every single one of them passes the suite. The code for all five is on Github. How I looked: a byte-level probe Before the findings, the method, because the method is the whole trick. The unit test…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town