Marcus Buffett, a programmer and chess player, writes about Rust, chess tooling, compression experiments, and personal projects.
HN commenters point to his chess move compression posts, including the follow-up reaching 3.7 bits per move, and his Bevy snake tutorial.
> Cannot make a type in a foreign package implement an interface
I would only push back on this point, and this point alone. Sure, it would be very convenient for me, an author to be able to just extend the implementation of anything that I import. However, when I am not an author and am instead a reader of code, doing this is the number-one way to causally make code totally unreadable. By allowing anyone to extend a type anywhere, it makes it impossible to just read the code. If the package that declares a type is the sole controller of that type, then reading code is easier.
"Where is the definition of this method?" Answer: It's next to everything else for that type, in the package where that type is defined. However, if anyone can extend any other type, figuring out what methods even exist for a type becomes so difficult that you are forced to use a language-server (with all related dependencies installed) in order to use "go-to-definition". If someone wants to understand the code, requiring them to have a full-fledged IDE and/or development environment is pretty awful and quite onerous, and makes codebases tough to get into.
For example, take this line[0] from a tutorial[1] on creating a simple snake game using the Bevvy engine in Rust. The main() function wires up loads of entities, including a `snake_eating()` function. But it also calls a mysterious `.after()` method of the snake_eating() function. If you do a ctrl-f on the file, you won't find an .after() method…
Oh, related in this space: https://mbuffett.com/posts/structured-editing-syntax/
I thought this blog post had an interesting idea too. Basically that a structural editor which truly knew the underlying AST could then alter the visual representation of the code entirely. Eg changing it to look like Python, or whatever insane thing.
Not advocating for that of course, but the idea that the editor could be effectively transpiling the code in real time is an interesting area to explore too. I imagine not for the purpose of "Write Python that becomes Rust" or w/e, but just in general customizing the experience. Perhaps reducing clutter, /shrug
The Tacit Dimension, Michael Polanyi, 1966
https://press.uchicago.edu/ucp/books/book/chicago/T/bo6035368.html
Programming and Tacit Knowledge
https://mbuffett.com/posts/all-tacit-knowledge/
Tacit Knowledge blogpost series, Commoncog
https://commoncog.com/the-tacit-knowledge-series/
Acquiring and Sharing Tacit Knowledge in Software Development, 2013
https://www.researchgate.net/publication/264125152_Acquiring_and_Sharing_Tacit_Knowledge_in_Software_Development_Teams_An_Empirical_Study
huh, I originally thought this would create unusually long URLs, but if it's just the sequence of moves it could stay pretty small.
might more fun too, representing each state of play instead of just the board position.
Also easily compressible if size is an issue: https://mbuffett.com/posts/compressing-chess-moves
Would also mean all rules can be represented, and you'd be able to do cool things like highlight the previous move that was made.
Nice, ok, might try and add this.
That's exactly what the author seems to have done and describes in their subsequent post: https://mbuffett.com/posts/compressing-chess-moves-even-further/ (published yesterday)
You might be interested in the author's follow up post where they reach 3.7 bits/move after compression. https://mbuffett.com/posts/compressing-chess-moves-even-further/