The Start of a Pattern Match
Welcome to the Lapidary Lemur Mailing List! A recurring Ruby rundown from the mind of Brandon Weaver (@keystonelemur) about what he's been working on, reading, thinking about, and shipping.
Recent Content
What I've written or shipped lately
Ruby Galaxy - Pattern Matching Applied - Poker
A recent conference talk over a recent article on Pattern Matching with a lot of detailed dives into pattern matching, set up, and how I'd reasoned about solving the problem.
If this was of interest you might also appreciate the other recent article on solving Tic Tac Toe.
Pattern Matching Interfaces in Ruby
Ruby 2.7 and 3.0 introduced Pattern Matching, but very few core classes and gems implement the specification to use it. This document outlines best practices, necessary interfaces, testing strategies, and other concerns involved in bringing Pattern Matching to a wider audience.
Matchable - Class-level Pattern Matching Macros Explained
A deep dive into using eval to dynamically compile static conditions, unfold loops, and apply all of it to creating a fast and pristine class level Pattern Matching interface for Ruby using Matchable.
Taking - Elixir-like method level Pattern Matching experiment
I've been thinking on a way to utilize ...
for more interesting purposes, and Taking
is a fun step in that direction:
Point = Struct.new(:x, :y)
def handle_responses(...) = case Taking.from(...)
in Point[x, 10 => y]
Point[x, y + 1]
in 1, 2, 3
:numbers
in 'a', 'b'
:strings
in :a, :b
:symbols
in x: 0, y: 0
:origin
in x: 0, y: (10..)
:north
else
false
end
Tales of the Autistic Developer - The Expert
The most recent of my personal stories about being an autistic developer, this one on the concept of expertise. There's also a corresponding RubyConf talk from last year. It's an exploration on the nature of expertise, how I've failed to achieve it, how I may have in some cases. There are dangers in seeking it, and this talk explores those.
The Reading List
Books, articles, tutorials, and other content I've been reading lately
Fantas Eel and Specification
By Tom Harding
Every now and then I give this series another read to see how much more of it clicks with me this week. Eventually I want to rewrite this in Ruby (with permission from the author) and turn this content into a conference talk.
Eloquent Ruby
By Russ Olsen
Back in 2020 I taught a few Ruby courses from this book, and I'm working to remake those courses and update the content. Perhaps one day I may even release that content publicly.
Ractor Web Server
By Kir Shatrov
Been meaning to read more into Ractor lately, and this is certainly an interesting usecase. Definitely want to see more in this direction, as well as some of the DryRB folks tie in as well.
The Thinking Corner
Musings, what I'm planning next, and what's to come
RailsConf CFP
RailsConf's CFP is open, and I'll be on the program committee this year. I'd love to read all of your submissions!
Pattern Matching
Of course the one topic I've been on for quite a while now. I'm thinking about writing a number of new articles diving through "Pattern Matching Interfaces in Ruby" and trying to make it more digestible. 22+ pages isn't exactly a quick read. I've also been reading a fair amount into Elixir and other languages to try and get ideas for more examples and articles in the future.
If you haven't seen the latest articles I've been writing, and seeing as this is the first news letter, here's a catch-up list of recent ones:
Advent of Ruby 3.0
I've been meaning to finish up this series. I have the solution for part 7 done, and most of part 8, I just need to write articles for them. You can view the current parts of the series here.